All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Stefan Eichenberger <eichest@gmail.com>
Cc: hongxing.zhu@nxp.com, l.stach@pengutronix.de,
	lpieralisi@kernel.org, kw@linux.com,
	manivannan.sadhasivam@linaro.org, robh@kernel.org,
	bhelgaas@google.com, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	francesco.dolcini@toradex.com, Frank.li@nxp.com,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	imx@lists.linux.dev, linux-kernel@vger.kernel.org,
	Stefan Eichenberger <stefan.eichenberger@toradex.com>
Subject: Re: [PATCH v3] PCI: imx6: Add suspend/resume support for i.MX6QDL
Date: Wed, 23 Oct 2024 15:12:21 -0500	[thread overview]
Message-ID: <20241023201221.GA926319@bhelgaas> (raw)
In-Reply-To: <Zxi6f3S5p8Pnto-S@eichest-laptop>

On Wed, Oct 23, 2024 at 10:57:35AM +0200, Stefan Eichenberger wrote:
> On Tue, Oct 22, 2024 at 10:53:49AM -0500, Bjorn Helgaas wrote:
> > On Mon, Oct 21, 2024 at 02:49:13PM +0200, Stefan Eichenberger wrote:
> > > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > > 
> > > The suspend/resume support is broken on the i.MX6QDL platform. This
> > > patch resets the link upon resuming to recover functionality. It shares
> > > most of the sequences with other i.MX devices but does not touch the
> > > critical registers, which might break PCIe. This patch addresses the
> > > same issue as the following downstream commit:
> > > https://github.com/nxp-imx/linux-imx/commit/4e92355e1f79d225ea842511fcfd42b343b32995
> > > In comparison this patch will also reset the device if possible because
> > > the downstream patch alone would still make the ath10k driver crash.
> > > Without this patch suspend/resume will not work if a PCIe device is
> > > connected. The kernel will hang on resume and print an error:
> > > ath10k_pci 0000:01:00.0: Unable to change power state from D3hot to D0, device inaccessible
> ...

> > The downstream commit log ("WARNING: this is not the official
> > workaround; user should take own risk to use it") doesn't exactly
> > inspire confidence.
> > 
> > It sounds like this resets *endpoints*?  That sounds scary and
> > unexpected in suspend/resume.
> 
> Yes, I completely agree with you, but NXP has never come up with an
> "official" workaround. Our problem is that with the current
> implementation, suspend/resume is completely broken when a PCIe device
> is connected. With this proposed patch we at least have a working device
> after resume. Even for the other i.MX devices, the driver resets the
> endpoints in the resume function (imx_pcie_resume_noir ->
> imx_pcie_host_init -> imx_pcie_assert_core_reset), we just do that now
> for the i.MX6QDL as well. If it is more appropriate to call
> imx_pcie_assert_core_reset in resume as we do for the other devices,
> that would be fine with me as well. I was thinking that if we need to
> reset the device anyway, we could put it into reset on suspend, as this
> might save some extra power.

OK, I have to admit I don't know enough about suspend/resume.  Since
we already do that for other i.MX platforms, maybe an endpoint reset
is normal for suspend.  I really don't know.  In any case, if we do it
for other i.MX platforms, I'm OK doing it for this one too.

Bjorn

      reply	other threads:[~2024-10-23 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21 12:49 [PATCH v3] PCI: imx6: Add suspend/resume support for i.MX6QDL Stefan Eichenberger
2024-10-22  5:34 ` kernel test robot
2024-10-22 15:53 ` Bjorn Helgaas
2024-10-23  8:57   ` Stefan Eichenberger
2024-10-23 20:12     ` Bjorn Helgaas [this message]

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=20241023201221.GA926319@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=Frank.li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=eichest@gmail.com \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=hongxing.zhu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=kw@linux.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stefan.eichenberger@toradex.com \
    /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.