Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756140AbdGXXMH (ORCPT ); Mon, 24 Jul 2017 19:12:07 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:41850 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753676AbdGXXL6 (ORCPT ); Mon, 24 Jul 2017 19:11:58 -0400 From: "Rafael J. Wysocki" To: Linux USB Cc: Linux PM , LKML , Alan Stern , Greg Kroah-Hartman , Mathias Nyman , Felipe Balbi Subject: [PATCH] PM / USB: hcd_pci: Skip secondary root hub check for HCD_DEAD() Date: Tue, 25 Jul 2017 01:04:01 +0200 Message-ID: <5273465.xcnvLcBNTW@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.12.0-rc1+; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 852 Lines: 28 From: Rafael J. Wysocki If HCD_DEAD(hcd) is "true" in check_root_hub_suspended(), it is rather pointless to check the secondary root hub, so return early then. This actually fixes occasional suspend failures on one of my test machines. Signed-off-by: Rafael J. Wysocki --- drivers/usb/core/hcd-pci.c | 3 +++ 1 file changed, 3 insertions(+) Index: linux-pm/drivers/usb/core/hcd-pci.c =================================================================== --- linux-pm.orig/drivers/usb/core/hcd-pci.c +++ linux-pm/drivers/usb/core/hcd-pci.c @@ -427,6 +427,9 @@ static int check_root_hub_suspended(stru dev_warn(dev, "Root hub is not suspended\n"); return -EBUSY; } + if (HCD_DEAD(hcd)) + return 0; + if (hcd->shared_hcd) { hcd = hcd->shared_hcd; if (HCD_RH_RUNNING(hcd)) {