Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1184222ybf; Thu, 27 Feb 2020 06:28:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyojBrDszCHsZH+9je+ogtfDWoVMbI+m5p9Tv2qXtVw39uqysWvx1TDgv0UtER9wnQr/Liw X-Received: by 2002:aca:1012:: with SMTP id 18mr3366365oiq.151.1582813716944; Thu, 27 Feb 2020 06:28:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582813716; cv=none; d=google.com; s=arc-20160816; b=KJdP7VAPS3hUKPRjCFsOyBHIWposQ6bkjPInVmSQIn7/s8VSw/uQyyG4mX5cPNtzbG iARG1pd5jJYgt5EalYMobDL68S7x3qpY9ZArBJOnKI0VyaowgN/Wvlh5L09mykjz6ND0 ZaCHr6bY7kmAfjj2XByvs1YLaYszawn/T+jJujltaVNzlDU30X5SlKHe6JraeUb7ISa9 dgExcZJ+ACdCNfq5Aq6JZ39RSmUZDAKotM0KQRnUbehwCe46L9O177bQcV4KQ0hGBa7I ogjz7xqKaDd6Kac/7yvsLTTWyF+aEJO6dN82HepFFeMKw4QhHGBiR5ZAGorGB2CxOMUK 1zmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7NFNAjbw1RB4ArhQF7ZK1lFDHJqfuBYrGoEzP4jfUwk=; b=wzJzxuo1IKT1z247CuuKcPzQOEyACp4eQIPevlX07smP50KNHwOeEkAH5714CCIymT R6IlX+YUii6L/Hzt6MXzwZfZKtuX70ddvNcN7wLPzsNcsYX/8H6cHi+zrvoElIBmchas 7uWrQlF+jvDYIEQnqLojT2UuN/V1URdtw5TJ9VdH6VB1uWoay+LRxn69re3IjJQktc36 REQkBnORxqmChyJlbiTBIndFKuAde6NfLFEa+zjnCnh7QT5V3rk8RaqhSS3xX1fzkMv4 GrTF8QvGL5penFOAQ3efdLgjXQgcoEjgbFRruIvfOTIB1uaLPOZcYquxq3tt34oFTJe+ MagA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dWla4Yr8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u63si1391183oif.88.2020.02.27.06.28.25; Thu, 27 Feb 2020 06:28:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dWla4Yr8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388887AbgB0O1I (ORCPT + 99 others); Thu, 27 Feb 2020 09:27:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:47114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388359AbgB0OJM (ORCPT ); Thu, 27 Feb 2020 09:09:12 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 473F724656; Thu, 27 Feb 2020 14:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812551; bh=ZY1iDZKCiMk23xFTVQl9UMqSJynqVb1zbUgUTPGQCV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dWla4Yr81OO+kOZpJxUdlEKRQg+YOr3uIPi9RqdJD7YbpP14PEA4Qkbq0pBU+H9Rf ewicUkWKaMursYRsLPYqtoJJqrjbIUrMtHjNOhSJyLHv3iCla2h7krFm0rE+G1UjTO LCcQY3zwFnFi3wD3Sh6A37eGFKX9HHAXiUNr1wIo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 5.4 024/135] xhci: fix runtime pm enabling for quirky Intel hosts Date: Thu, 27 Feb 2020 14:36:04 +0100 Message-Id: <20200227132232.836031603@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132228.710492098@linuxfoundation.org> References: <20200227132228.710492098@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathias Nyman commit 024d411e9c5d49eb96c825af52a3ce2682895676 upstream. Intel hosts that need the XHCI_PME_STUCK_QUIRK flag should enable runtime pm by calling xhci_pme_acpi_rtd3_enable() before usb_hcd_pci_probe() calls pci_dev_run_wake(). Otherwise usage count for the device won't be decreased, and runtime suspend is prevented. usb_hcd_pci_probe() only decreases the usage count if device can generate run-time wake-up events, i.e. when pci_dev_run_wake() returns true. This issue was exposed by pci_dev_run_wake() change in commit 8feaec33b986 ("PCI / PM: Always check PME wakeup capability for runtime wakeup support") and should be backported to kernels with that change Cc: # 4.13+ Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20200210134553.9144-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -302,6 +302,9 @@ static int xhci_pci_setup(struct usb_hcd if (!usb_hcd_is_primary_hcd(hcd)) return 0; + if (xhci->quirks & XHCI_PME_STUCK_QUIRK) + xhci_pme_acpi_rtd3_enable(pdev); + xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn); /* Find any debug ports */ @@ -359,9 +362,6 @@ static int xhci_pci_probe(struct pci_dev HCC_MAX_PSA(xhci->hcc_params) >= 4) xhci->shared_hcd->can_do_streams = 1; - if (xhci->quirks & XHCI_PME_STUCK_QUIRK) - xhci_pme_acpi_rtd3_enable(dev); - /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ pm_runtime_put_noidle(&dev->dev);