All of lore.kernel.org
 help / color / mirror / Atom feed
From: huang ying <huang.ying.caritas@gmail.com>
To: Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Sarah Sharp <sarah.a.sharp@linux.intel.com>
Subject: Re: [PATCH] PCI / ACPI: Always resume devices on ACPI wakeup notifications
Date: Fri, 29 Mar 2013 15:41:23 +0800	[thread overview]
Message-ID: <CAC=cRTPOOmnkZvM+3Kw4FU79paEhyh-M9vXU4cGoEkN7niH7Eg@mail.gmail.com> (raw)
In-Reply-To: <2990024.LMTIBUbM3d@vostro.rjw.lan>

[-- Attachment #1: Type: text/plain, Size: 2631 bytes --]

On Fri, Mar 29, 2013 at 5:27 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Thursday, March 28, 2013 07:31:58 PM Martin Mokrejs wrote:
>> Hi Bjorn,
>>
>> Bjorn Helgaas wrote:
>> > On Thu, Mar 28, 2013 at 11:26 AM, Martin Mokrejs
>> > <mmokrejs@fold.natur.cuni.cz> wrote:
>> >>
>> >>
>> >> Rafael J. Wysocki wrote:
>> >>> On Thursday, March 28, 2013 10:46:10 AM Bjorn Helgaas wrote:
>> >>>> On Thu, Mar 28, 2013 at 10:41 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> >>>>> On Thursday, March 28, 2013 10:21:30 AM Bjorn Helgaas wrote:
>> >>>>>> On Thu, Mar 28, 2013 at 6:57 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> >>>>>>> Hi Bjorn,
>> >>>>>>>
>> >>>>>>> I wonder what you think about the patch below?
>> >>>>>>
>> >>>>>> Seems fine to me (I'm trusting your and Matthew's judgment here since
>> >>>>>> I don't know much about it).  Why don't you resend it with Matthew's
>> >>>>>> ack and the appropriate stable tags, and I'll put it in.
>> >>>>>
>> >>>>> I will, thanks!
>> >>>>>
>> >>>>>> If you have
>> >>>>>> a URL for a bugzilla or mailing list report of the original problem,
>> >>>>>> that would be good, too.  It'd be nice if users and distros could
>> >>>>>> match problem reports with this solution, but I can't tell what the
>> >>>>>> user-visible issue was.  I assume that Sarah tested this (or somebody
>> >>>>>> else reproduced the problem and tested the fix)?
>> >>>>>
>> >>>>> Sarah reported it to me privately and I'm afraid I don't have any pointers
>> >>>>> to publicly available mailing list archives etc.
>> >>>>
>> >>>> Do you at least have a description of how a user could determine
>> >>>> whether he is seeing the problem fixed by this patch?
>> >>>
>> >>> Yeah.  For example, when the problem is visible on a USB controller and that
>> >>> controller is runtime-suspended, then plugging a new USB device into one
>> >>> of the controller's ports won't wake the controller up without the patch.
>> >>
>> >> Hi,
>> >>  I am wondering for a week or two why nobody answered any of my bug reports,
>> >> not even Sarah who asked for more details. I am think the fix is about my report
>> >> under thread "Re: 3.8.2: xhci port is dead until pcieport PME# goes to disabled"
>> >> and I really wonder why I wasn't Cc:ed and listed as a reporter provided it is
>> >> about my report. But I should better wait what Sarah says. ;-)

Hi, Martin,

Sorry for late.  Just found your bug report.  That seems related with
PCIe port runtime PM support.

Can you try the debug patch attached?  And send me back the dmesg?

Sorry I use gmail web client, so I can only send patch as attachment.

Best Regards,
Huang Ying

[-- Attachment #2: port_wake_dbg.patch --]
[-- Type: application/octet-stream, Size: 1707 bytes --]

diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index dee5ddd..8d0b909 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -43,10 +43,16 @@ static void pci_acpi_wake_bus(acpi_handle handle, u32 event, void *context)
 static void pci_acpi_wake_dev(acpi_handle handle, u32 event, void *context)
 {
 	struct pci_dev *pci_dev = context;
+	struct acpi_device *adev;
 
 	if (event != ACPI_NOTIFY_DEVICE_WAKE || !pci_dev)
 		return;
 
+	if (!acpi_bus_get_device(handle, &adev)) {
+		adev->wakeup.flags.run_wake_works = true;
+		dev_info(&pci_dev->dev, "run wake works!\n");
+	}
+
 	if (pci_dev->current_state == PCI_D3cold) {
 		pci_wakeup_event(pci_dev);
 		pm_runtime_resume(&pci_dev->dev);
@@ -146,6 +152,15 @@ phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle)
 static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev)
 {
 	int acpi_state, d_max;
+	acpi_handle handle = DEVICE_ACPI_HANDLE(&pdev->dev);
+	struct acpi_device *adev;
+
+	if (pci_is_bridge(pdev) && !acpi_bus_get_device(handle, &adev)) {
+		if (!adev->wakeup.flags.run_wake_works) {
+			dev_info(&pdev->dev, "choose state, run_wake not verified\n");
+			return PCI_D0;
+		}
+	}
 
 	if (pdev->no_d3cold)
 		d_max = ACPI_STATE_D3_HOT;
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 22ba56e..bc88419 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -245,6 +245,7 @@ struct acpi_device_perf {
 struct acpi_device_wakeup_flags {
 	u8 valid:1;		/* Can successfully enable wakeup? */
 	u8 run_wake:1;		/* Run-Wake GPE devices */
+	u8 run_wake_works:1;	/* Run-Wake works for the device */
 	u8 notifier_present:1;  /* Wake-up notify handler has been installed */
 };
 

  reply	other threads:[~2013-03-29  7:41 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 14:33 [PATCH] PCI / ACPI: Always resume devices on ACPI wakeup notifications Rafael J. Wysocki
2013-03-23 16:22 ` Matthew Garrett
2013-03-25 16:45 ` Sarah Sharp
2013-03-25 22:34   ` Rafael J. Wysocki
2013-03-28 12:57 ` Rafael J. Wysocki
2013-03-28 16:21   ` Bjorn Helgaas
2013-03-28 16:41     ` Rafael J. Wysocki
2013-03-28 16:46       ` Bjorn Helgaas
2013-03-28 16:59         ` Rafael J. Wysocki
2013-03-28 17:26           ` Martin Mokrejs
2013-03-28 17:49             ` Bjorn Helgaas
2013-03-28 18:23               ` Sarah Sharp
2013-03-28 19:12                 ` Bjorn Helgaas
2013-03-28 19:42                   ` Martin Mokrejs
2013-03-28 18:31               ` Martin Mokrejs
2013-03-28 21:27                 ` Rafael J. Wysocki
2013-03-29  7:41                   ` huang ying [this message]
2013-03-31  2:29                     ` Martin Mokrejs
2013-03-30  2:03                   ` Martin Mokrejs
2013-04-02  5:25                     ` huang ying
2013-04-02 15:02                       ` Martin Mokrejs
2013-04-02 16:08                         ` huang ying
2013-04-02 16:53                           ` Martin Mokrejs
2013-04-02 16:30                         ` Bjorn Helgaas
     [not found]                           ` <515B17D9.6030805@fold.natur.cuni.cz>
2013-04-02 20:55                             ` Martin Mokrejs
2013-04-02 22:16                               ` Sarah Sharp
2013-04-03 10:35                                 ` Martin Mokrejs
2013-04-03  2:34                               ` huang ying
2013-04-03 10:39                                 ` Martin Mokrejs
2013-04-03 12:16                               ` Martin Mokrejs
2013-04-04 11:30                                 ` Huang Ying
2013-04-04 19:19                                   ` Sarah Sharp
2013-04-05 12:30                                     ` Martin Mokrejs
2013-04-05 12:40                                   ` Martin Mokrejs
2013-04-19 23:49                                     ` Martin Mokrejs
2013-04-30 20:47                                       ` Martin Mokrejs
2013-04-02 22:49                           ` Rafael J. Wysocki
2013-04-02 23:58                             ` Bjorn Helgaas
2013-04-03 11:00                               ` Rafael J. Wysocki
2013-04-03  2:04                           ` huang ying
2013-04-03 17:29                             ` Bjorn Helgaas
2013-03-30 22:38                   ` [Update][PATCH] PCI / PM: Disable runtime PM of PCIe ports Rafael J. Wysocki
2013-04-01 17:34                     ` Bjorn Helgaas
2013-04-01 20:51                       ` Rafael J. Wysocki
2013-04-01 20:53                         ` Bjorn Helgaas
2013-04-01 21:24                           ` Rafael J. Wysocki
2013-04-01 23:20                             ` Rafael J. Wysocki
2013-04-01 21:48                           ` Martin Mokrejs
2013-04-02  5:34                           ` huang ying
2013-04-02  5:28                         ` huang ying
2013-04-02  5:31                           ` huang ying
2013-04-03 22:34                     ` Bjorn Helgaas
2013-03-28 17:10 ` [Resend][PATCH] PCI / ACPI: Always resume devices on ACPI wakeup notifications Rafael J. Wysocki
2013-03-28 21:07   ` [Update][PATCH] " Rafael J. Wysocki
2013-03-29 15:05     ` Martin Mokrejs
2013-03-29 16:05       ` Sarah Sharp
2013-03-29 17:11         ` Martin Mokrejs
2013-03-29 18:16           ` Martin Mokrejs
2013-03-29 21:37         ` Rafael J. Wysocki
2013-03-29 21:34       ` Rafael J. Wysocki
2013-04-03 22:38     ` 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='CAC=cRTPOOmnkZvM+3Kw4FU79paEhyh-M9vXU4cGoEkN7niH7Eg@mail.gmail.com' \
    --to=huang.ying.caritas@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=mmokrejs@fold.natur.cuni.cz \
    --cc=rjw@sisk.pl \
    --cc=sarah.a.sharp@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.