From: Johan Hovold <johan@kernel.org>
To: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Cc: mathias.nyman@intel.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org,
Mario Limonciello <mario.limonciello@amd.com>
Subject: Re: [PATCH] xhci: Change pm_runtime_forbid to pm_runtime_disable
Date: Mon, 30 Sep 2024 14:57:04 +0200 [thread overview]
Message-ID: <ZvqgINVgkYf_r6hY@hovoldconsulting.com> (raw)
In-Reply-To: <20240925161520.2736895-1-Basavaraj.Natikar@amd.com>
On Wed, Sep 25, 2024 at 09:45:20PM +0530, Basavaraj Natikar wrote:
> Change pm_runtime_forbid to pm_runtime_disable to disable RPM on
> platforms that don't support runtime D3, as re-enabling it through sysfs
> auto power control may cause the controller to malfunction. This can lead
> to issues such as hotplug devices not being detected due to failed
> interrupt generation.
>
> Fixes: a5d6264b638e ("xhci: Enable RPM on controllers that support low-power states")
> Suggested-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
> ---
> drivers/usb/host/xhci-pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index dc1e345ab67e..39ab32fed3f4 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -635,7 +635,7 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
> pm_runtime_put_noidle(&dev->dev);
>
> if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0)
> - pm_runtime_forbid(&dev->dev);
> + pm_runtime_disable(&dev->dev);
This looks broken. Runtime PM enable/disable should always be balanced,
and unlike forbid(), disable() doesn't make sure that the device is
actually active.
If you want to prevent the device from runtime suspending you can just
increment the usage counter here in probe() and drop it in remove().
> else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
> pm_runtime_allow(&dev->dev);
NAK.
Johan
next prev parent reply other threads:[~2024-09-30 12:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 16:15 [PATCH] xhci: Change pm_runtime_forbid to pm_runtime_disable Basavaraj Natikar
2024-09-30 8:25 ` Mathias Nyman
2024-09-30 12:57 ` Johan Hovold [this message]
2024-09-30 22:30 ` Mathias Nyman
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=ZvqgINVgkYf_r6hY@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=Basavaraj.Natikar@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mathias.nyman@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox