Re: [RFC PATCH] xhci: Prevent runtime pm from autosuspending during initialization

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

 



On Fri, Feb 21, 2014 at 5:19 AM, Mathias Nyman
<mathias.nyman@xxxxxxxxxxxxxxx> wrote:
> If autosuspend is set to zero the usb-2 roothub will try to suspend
> the controller before usb-3 parts are initialized.
>
> Prevent this by incrementing the usage counter before usb-2 registers
> its roothub. Decrement the counter when usb-3 roothub is allocated.
>
> Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/host/xhci.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 6fe577d..9301aff 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -4753,6 +4753,8 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
>                  * companion controller.
>                  */
>                 hcd->has_tt = 1;
> +               /* prevent USB2 runtime pm until USB3 parts are initialized */
> +               pm_runtime_get_noresume(hcd->self.controller);
>         } else {
>                 /* xHCI private pointer was set in xhci_pci_probe for the second
>                  * registered roothub.
> @@ -4765,6 +4767,9 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
>                 if (xhci->hci_version < 0x100)
>                         hcd->self.no_sg_constraint = 1;
>
> +               /* USB3 initialized far enough to allow runtime pm suspend */
> +               pm_runtime_put_noidle(hcd->self.controller);
> +

Why the noresume and noidle versions?  Shouldn't these be the _sync versions?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux