From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 484EEFA372B for ; Wed, 16 Oct 2019 21:59:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1706221D7D for ; Wed, 16 Oct 2019 21:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263165; bh=XQSP0d+cbgWEu8Jx9rYaVw4A5+/5RIOTGWGS4iAatEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UkKTFc/GpHXJeEf06GZ/tFLaFHiyiSolQTJh4G5CVWxt7Bz9abORDoBWZBBg7XiP/ MHg3qbVpn5YOPLI+DcMohEV4XZCosRuHsykqOmzYh5RA64YVTto1RbBOSLB3pEV3Fd mVtvFbm3ZgXacFcxTV/i0uoDODfBgN+qZdEegAZk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438490AbfJPV7X (ORCPT ); Wed, 16 Oct 2019 17:59:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:52004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406726AbfJPV60 (ORCPT ); Wed, 16 Oct 2019 17:58:26 -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 26F88218DE; Wed, 16 Oct 2019 21:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263105; bh=XQSP0d+cbgWEu8Jx9rYaVw4A5+/5RIOTGWGS4iAatEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PndhJpHft/ou8Dcg4kJAzz4D5Q5oyv6JHmx9NxjmFvLu/aGgi5XYMrpJ9CD2aspXy 6Nx4tcAPGm27EHFde+im6RbWLGQfeifNGBcemRVZNPpLQmLMI7wXxu2F16Crd4JJ+V D5iOVPAd3KosFkSC1RRsPLn2saO5OPZsbwRZuHww= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Schmidt , Philipp Zabel , Mathias Nyman Subject: [PATCH 5.3 009/112] xhci: Check all endpoints for LPM timeout Date: Wed, 16 Oct 2019 14:50:01 -0700 Message-Id: <20191016214846.317651595@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@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: Jan Schmidt commit d500c63f80f2ea08ee300e57da5f2af1c13875f5 upstream. If an endpoint is encountered that returns USB3_LPM_DEVICE_INITIATED, keep checking further endpoints, as there might be periodic endpoints later that return USB3_LPM_DISABLED due to shorter service intervals. Without this, the code can set too high a maximum-exit-latency and prevent the use of multiple USB3 cameras that should be able to work. Cc: Signed-off-by: Jan Schmidt Tested-by: Philipp Zabel Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/1570190373-30684-4-git-send-email-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4673,12 +4673,12 @@ static int xhci_update_timeout_for_endpo alt_timeout = xhci_call_host_update_timeout_for_endpoint(xhci, udev, desc, state, timeout); - /* If we found we can't enable hub-initiated LPM, or + /* If we found we can't enable hub-initiated LPM, and * the U1 or U2 exit latency was too high to allow - * device-initiated LPM as well, just stop searching. + * device-initiated LPM as well, then we will disable LPM + * for this device, so stop searching any further. */ - if (alt_timeout == USB3_LPM_DISABLED || - alt_timeout == USB3_LPM_DEVICE_INITIATED) { + if (alt_timeout == USB3_LPM_DISABLED) { *timeout = alt_timeout; return -E2BIG; }