Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1393952ybp; Thu, 17 Oct 2019 12:07:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmwDgQZH/uHq8lA9xmKwGRD4hyE5P4pyg1nTj9ePVxlniFOAnhh0nvqwmO1DEkGW8PcnWy X-Received: by 2002:a17:906:fcd4:: with SMTP id qx20mr5095764ejb.257.1571339277223; Thu, 17 Oct 2019 12:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571339277; cv=none; d=google.com; s=arc-20160816; b=DNI8mOojqaP7SSzMkEtTSTWlIQEX35dAYv9lKKQxYsoKD4vBaCvXfl9a+NYAsjVKgd ngFmFQio1yoeDeVh8dqeTLEKw04xvXovVCxNbhzBwvBTChT2ySjN6XTv/86pub5UXgjq DB5SRwta2I1vfFdbakt2JQBZ6KXPEqfdBwooDjLv7fs/KR/gMDHgILCtylczB0R961oD 3R1fJW5M8QWinvyKvr2aAqPT6IMkCdKVbRmpLRZzOtmdnz2ZqmMmLkeHrZYE1fiuXdsk cE9HiOpn3Y72chf+/z0fICHh+iuHqP0pZ7pBjGS4qPzenXQq7RDGpGVdiC5uvWLNjbET f5XA== 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=WC16gt8wwBAtQ4z2IAC2Uy4MCF1dkTZ9PFPs3qeY89k=; b=OfT2Ke7kV9UIGF2s6Wfoe9GJzd/gNJF9U5JAwkRD4YoM+xLOvjmZ4m7gjw/jNItPku HNcD5lsLw6Q7P5E+EdyIfV8xl9uQatu9pAM5ttTrYD4/e8hcYW5ZVVnsvTAqDr/h7Cxy XRpYAU1jZAhEW6pOY11aTJxnUNQNavq3QRvPIdiqKTIpbkL9b7L9Jka/3WvDtbYHfQfB rAl83DZORoh/4qAv84mZbFmIerbSCuzdCLVuwiSKoy9sMDVDn7cNIGw72XloNCpeYm5z NewuuLic4x6F8nvI9UmQyfDsniCEB94Jq+Hz7C+Av5+3x3udGtxHLW3vH8g3fbTXkGYs y54w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QbVIiNRz; 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 y10si1988664ejw.76.2019.10.17.12.07.33; Thu, 17 Oct 2019 12:07:57 -0700 (PDT) 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=QbVIiNRz; 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 S2407353AbfJPWMj (ORCPT + 99 others); Wed, 16 Oct 2019 18:12:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:47682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406590AbfJPV4O (ORCPT ); Wed, 16 Oct 2019 17:56:14 -0400 Received: from localhost (unknown [192.55.54.58]) (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 2081C218DE; Wed, 16 Oct 2019 21:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571262974; bh=JffcVU2maBe0QjGzq/y3BwaF0f+wHP+HIvIN//M6Jio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QbVIiNRz8uZy1iiU1CcQr5CYl4eX1+Jtc7vuQsJNiP5OAg//zlpMN7DCLhAvpFXHc U/6Uiw0W9eOKkAdD3FdYl66pN74x69ps5apFt4+Tv9/rIjCxqNr7TnDB/KtBhHt7Qo hZG/BjirbgctSTAv7fk2pK+ZG/w+GtR5O1R7rv+Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Schmidt , Mathias Nyman Subject: [PATCH 4.14 09/65] xhci: Prevent device initiated U1/U2 link pm if exit latency is too long Date: Wed, 16 Oct 2019 14:50:23 -0700 Message-Id: <20191016214803.862322042@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214756.457746573@linuxfoundation.org> References: <20191016214756.457746573@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 cd9d9491e835a845c1a98b8471f88d26285e0bb9 upstream. If host/hub initiated link pm is prevented by a driver flag we still must ensure that periodic endpoints have longer service intervals than link pm exit latency before allowing device initiated link pm. Fix this by continue walking and checking endpoint service interval if xhci_get_timeout_no_hub_lpm() returns anything else than USB3_LPM_DISABLED While at it fix the split line error message Tested-by: Jan Schmidt Cc: Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/1570190373-30684-3-git-send-email-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4607,10 +4607,12 @@ static u16 xhci_calculate_lpm_timeout(st if (intf->dev.driver) { driver = to_usb_driver(intf->dev.driver); if (driver && driver->disable_hub_initiated_lpm) { - dev_dbg(&udev->dev, "Hub-initiated %s disabled " - "at request of driver %s\n", - state_name, driver->name); - return xhci_get_timeout_no_hub_lpm(udev, state); + dev_dbg(&udev->dev, "Hub-initiated %s disabled at request of driver %s\n", + state_name, driver->name); + timeout = xhci_get_timeout_no_hub_lpm(udev, + state); + if (timeout == USB3_LPM_DISABLED) + return timeout; } }