From patchwork Thu Mar 28 17:10:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 2358541 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4FF97400E6 for ; Thu, 28 Mar 2013 17:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757158Ab3C1RDJ (ORCPT ); Thu, 28 Mar 2013 13:03:09 -0400 Received: from hydra.sisk.pl ([212.160.235.94]:45730 "EHLO hydra.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757144Ab3C1RDG (ORCPT ); Thu, 28 Mar 2013 13:03:06 -0400 Received: from vostro.rjw.lan (afdh131.neoplus.adsl.tpnet.pl [95.49.85.131]) by hydra.sisk.pl (Postfix) with ESMTPSA id B31D9E5359; Thu, 28 Mar 2013 18:01:47 +0100 (CET) From: "Rafael J. Wysocki" To: Bjorn Helgaas Cc: ACPI Devel Maling List , LKML , Linux PM list , Len Brown , Matthew Garrett , Sarah Sharp , "Accardi, Kristen C" , "Huang, Ying" , linux-pci@vger.kernel.org Subject: [Resend][PATCH] PCI / ACPI: Always resume devices on ACPI wakeup notifications Date: Thu, 28 Mar 2013 18:10:34 +0100 Message-ID: <1396732.fV788D0xgr@vostro.rjw.lan> User-Agent: KMail/4.9.5 (Linux/3.9.0-rc4+; KDE/4.9.5; x86_64; ; ) In-Reply-To: <2282655.IicBMMa6jN@vostro.rjw.lan> References: <2282655.IicBMMa6jN@vostro.rjw.lan> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Rafael J. Wysocki It turns out that the _Lxx control methods provided by some BIOSes clear the PME Status bit of PCI devices they handle, which means that pci_acpi_wake_dev() cannot really use that bit to check whether or not the device has signalled wakeup. The symptom of the problem is, for example, that when a PCI USB controller is affected, then plugging in a new USB device into one of the controller's ports will not wake up the controller, which should happen. For this reason, make pci_acpi_wake_dev() always attempt to resume the device it is called for regardless of the device's PME Status bit value (that bit still has to be cleared if set at this point, though). Reported-and-tested-by: Sarah Sharp Signed-off-by: Rafael J. Wysocki Acked-by: Matthew Garrett Cc: 3.7+ --- drivers/pci/pci-acpi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-pm/drivers/pci/pci-acpi.c =================================================================== --- linux-pm.orig/drivers/pci/pci-acpi.c +++ linux-pm/drivers/pci/pci-acpi.c @@ -53,14 +53,15 @@ static void pci_acpi_wake_dev(acpi_handl return; } - if (!pci_dev->pm_cap || !pci_dev->pme_support - || pci_check_pme_status(pci_dev)) { - if (pci_dev->pme_poll) - pci_dev->pme_poll = false; + /* Clear PME Status if set. */ + if (pci_dev->pme_support) + pci_check_pme_status(pci_dev); - pci_wakeup_event(pci_dev); - pm_runtime_resume(&pci_dev->dev); - } + if (pci_dev->pme_poll) + pci_dev->pme_poll = false; + + pci_wakeup_event(pci_dev); + pm_runtime_resume(&pci_dev->dev); if (pci_dev->subordinate) pci_pme_wakeup_bus(pci_dev->subordinate);