Re: [PATCH v5 3/4] PCI: qcom-ep: Update the D-state log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 8/3/2023 11:28 PM, Bjorn Helgaas wrote:
In subject:

   PCI: qcom-ep: Print D-state name to distinguish D3hot/D3cold

("Update" doesn't give any hint about what the change does.)
I will update it as suggested.
On Wed, Aug 02, 2023 at 09:21:20AM +0530, Krishna chaitanya chundru wrote:
Now that the state event is stored as pci_power_t, let's use the PCI helper
pci_power_name() to print the state event.
s/let's use/use/

The main change is this, right?

   D3 -> D3hot
   D4 -> D3cold
Yes this is the main change.
Signed-off-by: Krishna chaitanya chundru <quic_krichai@xxxxxxxxxxx>
---
  drivers/pci/controller/dwc/pcie-qcom-ep.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index 22545ff..0c69a61 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -583,7 +583,6 @@ static irqreturn_t qcom_pcie_ep_global_irq_thread(int irq, void *data)
  	} else if (FIELD_GET(PARF_INT_ALL_DSTATE_CHANGE, status)) {
  		dstate = dw_pcie_readl_dbi(pci, DBI_CON_STATUS) &
  					   DBI_CON_STATUS_POWER_STATE_MASK;
-		dev_dbg(dev, "Received D%d state event\n", dstate);
  		state = dstate;
  		if (dstate == 3) {
Can this check for "state == PCI_D3hot" to be clearer?
I will modify this.

  			val = readl_relaxed(pcie_ep->parf + PARF_PM_CTRL);
@@ -594,6 +593,7 @@ static irqreturn_t qcom_pcie_ep_global_irq_thread(int irq, void *data)
  			if (gpiod_get_value(pcie_ep->reset))
  				state = PCI_D3cold;
  		}
+		dev_dbg(dev, "Received %s event\n", pci_power_name(state));
Not really sure why this needs to be moved (the diff would be clearer
if it stayed in the same spot), but it doesn't look like it really
matters.

As we know if the link is in D3hot or D3cold moving the log here so that we can log correct Dstate.

- KC

  		pci_epc_dstate_notify(pci->ep.epc, state);
  	} else if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
  		dev_dbg(dev, "Received Linkup event. Enumeration complete!\n");
--
2.7.4




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux