All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
	mathias.nyman@intel.com, gregkh@linuxfoundation.org,
	mika.westerberg@linux.intel.com, mario.limonciello@amd.com,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 2/2] xhci: Enable RPM on controllers that support low-power states
Date: Fri, 15 Sep 2023 16:21:54 +0300	[thread overview]
Message-ID: <c00ce19e-efb4-fe82-e46b-5c369fbcc2c9@linux.intel.com> (raw)
In-Reply-To: <20230821065742.2924681-3-Basavaraj.Natikar@amd.com>

On 21.8.2023 9.57, Basavaraj Natikar wrote:
> Use the low-power states of the underlying platform to enable runtime PM.
> If the platform doesn't support runtime D3, then enabling default RPM will
> result in the controller malfunctioning, as in the case of hotplug devices
> not being detected because of a failed interrupt generation.
> 
> Cc: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
> ---
>   drivers/usb/host/xhci-pci.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index c908a80ef436..1bb5b510c5ba 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -693,7 +693,9 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>   	/* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */
>   	pm_runtime_put_noidle(&dev->dev);
>   
> -	if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
> +	if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0)
> +		pm_runtime_forbid(&dev->dev);
> +	else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
>   		pm_runtime_allow(&dev->dev);
>   
>   	dma_set_max_seg_size(&dev->dev, UINT_MAX);

Looks good to me

-Mathias

  reply	other threads:[~2023-09-15 13:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21  6:57 [PATCH 0/2] Handle RPM for xhci-pci Basavaraj Natikar
2023-08-21  6:57 ` [PATCH 1/2] xhci: Loosen RPM as default policy to cover xHC 1.1 as well Basavaraj Natikar
2023-09-15 13:20   ` Mathias Nyman
2023-08-21  6:57 ` [PATCH 2/2] xhci: Enable RPM on controllers that support low-power states Basavaraj Natikar
2023-09-15 13:21   ` Mathias Nyman [this message]
2023-09-15  4:38 ` [PATCH 0/2] Handle RPM for xhci-pci Mario Limonciello
2023-09-15 12:55   ` 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=c00ce19e-efb4-fe82-e46b-5c369fbcc2c9@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --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 \
    --cc=mika.westerberg@linux.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 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.