linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	gregkh@linuxfoundation.org, USB list <linux-usb@vger.kernel.org>,
	linux-pci@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller
Date: Tue, 20 Jun 2017 10:36:59 +0800	[thread overview]
Message-ID: <CAAd53p6Dc2skx1sjDcwG_5VLGOHo_bQK9h3UOJN7o9OuZXDqbA@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1706191415180.1715-100000@iolanthe.rowland.org>

On Tue, Jun 20, 2017 at 2:32 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
>
> It's possible that the test was invalid.  Kai-Heng did not say whether
> /sys/.../power/wakeup was set to "enabled" for both the EHCI controller
> and the USB root hub beneath it, before the test was started.  If
> either of them was set to "disabled" then we would not expect a plug or
> unplug event to wake up the system.

You are right, it's "disabled" on USB root hub.
Changed it to "enabled", the test result remains the same.

>
> In any case, the controller should be set to the lowest power setting
> that is consistent with the desired wakeup behavior.  If wakeup is set
> to "enabled" then the state should be D2 -- if possible.  That's the
> theory, anyway.  If the system supports putting devices only into D3
> during S3 sleep then there's no choice, but if we do have a choice then
> we should take it.
>
> BTW, I just noticed that pci_target_state() uses device_may_wakeup() to
> get the desired wakeup behavior.  That is correct for system sleep, but
> it is wrong for runtime PM.  For runtime PM, wakeup should be enabled
> whenever the hardware allows it, so the test should be
> device_can_wakeup().
>
> This means that pci_target_state() should behave differently depending
> on whether it is called from pci_prepare_to_sleep() or from
> pci_finish_runtime_suspend().  Probably nobody noticed this before
> because it usually doesn't make any difference.
>
> Alan Stern
>

  parent reply	other threads:[~2017-06-20  2:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAAd53p6S9NPBD=qGP419mhBgSgn-s1dc=adued8Y+Y0=GDsHKg@mail.gmail.com>
2017-06-12 14:18 ` [PATCH] usb: host: ehci: workaround PME bug on AMD EHCI controller Alan Stern
2017-06-13  4:21   ` Kai-Heng Feng
2017-06-13 17:28     ` Bjorn Helgaas
2017-06-14 18:55       ` Alan Stern
2017-06-15  7:02         ` Kai-Heng Feng
2017-06-15 13:23           ` Bjorn Helgaas
2017-06-15  6:57       ` Kai-Heng Feng
2017-06-15 14:12         ` Alan Stern
2017-06-16  3:07           ` Kai-Heng Feng
2017-06-16 16:18             ` Kai-Heng Feng
2017-06-16 17:30               ` Alan Stern
2017-06-19  3:30                 ` Kai-Heng Feng
2017-06-19 17:45                   ` Bjorn Helgaas
2017-06-19 18:32                     ` Alan Stern
2017-06-19 22:00                       ` Rafael J. Wysocki
2017-06-20  2:36                       ` Kai-Heng Feng [this message]
2017-06-23  0:48                       ` [PATCH] PCI / PM: Avoid using device_may_wakeup() for runtime PM Rafael J. Wysocki
2017-06-23 12:58                         ` [PATCH v2] " Rafael J. Wysocki
2017-06-29 22:37                           ` Rafael J. Wysocki
2017-06-30  8:44                             ` Mika Westerberg
2017-06-30 16:16                           ` Bjorn Helgaas

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=CAAd53p6Dc2skx1sjDcwG_5VLGOHo_bQK9h3UOJN7o9OuZXDqbA@mail.gmail.com \
    --to=kai.heng.feng@canonical.com \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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).