From: Bjorn Helgaas <helgaas@kernel.org>
To: Richard Zhu <hongxing.zhu@nxp.com>
Cc: kwilczynski@kernel.org, bhelgaas@google.com,
lorenzo.pieralisi@arm.com, frank.li@nxp.com, mani@kernel.org,
linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kernel@pengutronix.de,
imx@lists.linux.dev
Subject: Re: [PATCH v2] PCI: dwc: Fix resume failure if no EP is connected at some platforms
Date: Tue, 5 Nov 2024 17:35:13 -0600 [thread overview]
Message-ID: <20241105233513.GA1495684@bhelgaas> (raw)
In-Reply-To: <1721628913-1449-1-git-send-email-hongxing.zhu@nxp.com>
On Mon, Jul 22, 2024 at 02:15:13PM +0800, Richard Zhu wrote:
> The dw_pcie_suspend_noirq() function currently returns success directly
> if no endpoint (EP) device is connected. However, on some platforms, power
> loss occurs during suspend, causing dw_resume() to do nothing in this case.
> This results in a system halt because the DWC controller is not initialized
> after power-on during resume.
>
> Change call to deinit() in suspend and init() at resume regardless of
> whether there are EP device connections or not. It is not harmful to
> perform deinit() and init() again for the no power-off case, and it keeps
> the code simple and consistent in logic.
> ...
> - ret = read_poll_timeout(dw_pcie_get_ltssm, val, val == DW_PCIE_LTSSM_L2_IDLE,
> - PCIE_PME_TO_L2_TIMEOUT_US/10,
> - PCIE_PME_TO_L2_TIMEOUT_US, false, pci);
> - if (ret) {
> - dev_err(pci->dev, "Timeout waiting for L2 entry! LTSSM: 0x%x\n", val);
> - return ret;
> + ret = read_poll_timeout(dw_pcie_get_ltssm, val, val == DW_PCIE_LTSSM_L2_IDLE,
> + PCIE_PME_TO_L2_TIMEOUT_US/10,
> + PCIE_PME_TO_L2_TIMEOUT_US, false, pci);
> + if (ret) {
> + dev_err(pci->dev, "Timeout waiting for L2 entry! LTSSM: 0x%x\n", val);
> + return ret;
> + }
Not related to this patch, but what's the reason for waiting for the
link to enter L2? There are a few other drivers that do this, but
most don't. Is there something else the driver needs to do after the
link is in L2?
> }
>
> if (pci->pp.ops->deinit)
> --
> 2.37.1
>
next prev parent reply other threads:[~2024-11-05 23:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-22 6:15 [PATCH v2] PCI: dwc: Fix resume failure if no EP is connected at some platforms Richard Zhu
2024-11-03 20:56 ` Krzysztof Wilczyński
2024-11-06 6:18 ` Hongxing Zhu
2024-11-06 15:07 ` Krzysztof Wilczy��ski
2024-11-07 1:51 ` Hongxing Zhu
2024-11-05 23:27 ` Bjorn Helgaas
2024-11-06 1:59 ` Hongxing Zhu
2024-11-06 22:29 ` Bjorn Helgaas
2024-11-07 6:16 ` Hongxing Zhu
2024-11-07 7:20 ` Krzysztof Wilczyński
2024-11-07 8:40 ` Hongxing Zhu
2024-11-07 8:47 ` Hongxing Zhu
2024-11-07 16:30 ` Krzysztof Wilczy��ski
2024-11-07 16:57 ` Frank Li
2024-11-07 19:16 ` Krzysztof Wilczy��ski
2024-11-05 23:35 ` Bjorn Helgaas [this message]
2024-11-06 2:06 ` Hongxing Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241105233513.GA1495684@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=frank.li@nxp.com \
--cc=hongxing.zhu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mani@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.