From: Lukas Wunner <lukas@wunner.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
Mathias Nyman <mathias.nyman@linux.intel.com>,
Pierre de Villemereuil <flyos@mailoo.org>,
Oliver Neukum <oneukum@suse.com>,
USB list <linux-usb@vger.kernel.org>,
linux-pci@vger.kernel.org,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: USB hot-plug not working (ASUS TP301UA-C4028T)
Date: Thu, 20 Oct 2016 12:01:46 +0200 [thread overview]
Message-ID: <20161020100146.GA3319@wunner.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1610111117040.1827-100000@iolanthe.rowland.org>
On Tue, Oct 11, 2016 at 11:18:28AM -0400, Alan Stern wrote:
> On Sat, 8 Oct 2016, Lukas Wunner wrote:
> > The PCI core already calls pm_runtime_get_sync() before invoking the
> > ->probe hook of a driver (see local_pci_probe()). Drivers need to
> > explicitly release a runtime ref to allow their device to suspend.
> > For xhci-pci, this seems to happen in usb_hcd_pci_probe():
> >
> > if (pci_dev_run_wake(dev))
> > pm_runtime_put_noidle(&dev->dev);
> >
> > So you could either modify the if-condition if you want to change the
> > behaviour for XHCI devices only, or if you want to change it in general,
> > add something like this to pci_dev_run_wake():
> >
> > /* PME capable in principle, but not from the intended sleep state */
> > if (dev->pme_support && !pci_pme_capable(dev, pci_target_state(dev)))
> > return false;
> >
> > I've briefly looked over the callers of pci_dev_run_wake() and the above
> > seems safe but you should double-check them.
>
> That seems like a good suggestion. The patch is below; Pierre, can you
> test it? This should remove the need to set the USB autosuspend module
> parameter to -1.
Alan, how do we proceed with this? Are you going to submit a patch
(with commit message, tags and all) to linux-pci@ or would you prefer
me to do that? I just went over the callers of pci_dev_run_wake()
once more and the patch still looks safe to me.
Thanks,
Lukas
>
> Index: usb-4.x/drivers/pci/pci.c
> ===================================================================
> --- usb-4.x.orig/drivers/pci/pci.c
> +++ usb-4.x/drivers/pci/pci.c
> @@ -2064,6 +2064,10 @@ bool pci_dev_run_wake(struct pci_dev *de
> if (!dev->pme_support)
> return false;
>
> + /* PME-capable in principle, but not from the intended sleep state */
> + if (!pci_pme_capable(dev, pci_target_state(dev)))
> + return false;
> +
> while (bus->parent) {
> struct pci_dev *bridge = bus->self;
>
next prev parent reply other threads:[~2016-10-20 10:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <57F4B9C5.60600@linux.intel.com>
2016-10-05 14:45 ` USB hot-plug not working (ASUS TP301UA-C4028T) Alan Stern
2016-10-05 18:54 ` Bjorn Helgaas
2016-10-05 20:41 ` Lukas Wunner
2016-10-06 7:24 ` Oliver Neukum
2016-10-06 14:42 ` Alan Stern
2016-10-08 10:31 ` Lukas Wunner
2016-10-10 21:06 ` Pierre de Villemereuil
2016-10-11 15:18 ` Alan Stern
2016-10-11 20:27 ` Pierre de Villemereuil
2016-10-12 18:23 ` Alan Stern
2016-10-13 20:58 ` Pierre de Villemereuil
2016-10-13 21:11 ` Alan Stern
2016-10-14 21:46 ` Pierre de Villemereuil
2016-10-20 10:01 ` Lukas Wunner [this message]
2016-10-20 13:57 ` Alan Stern
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=20161020100146.GA3319@wunner.de \
--to=lukas@wunner.de \
--cc=flyos@mailoo.org \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=oneukum@suse.com \
--cc=rafael.j.wysocki@intel.com \
--cc=stern@rowland.harvard.edu \
/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;
as well as URLs for NNTP newsgroup(s).