Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1049582ybp; Thu, 17 Oct 2019 07:21:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1ZGtAFbLyQuQ8gtkeU+WLPDN6l6GOspD5AXUhNEYpaQvKHQa2DpxMSatChbsb+DGJeQj6 X-Received: by 2002:aa7:d756:: with SMTP id a22mr4090339eds.198.1571322063157; Thu, 17 Oct 2019 07:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571322063; cv=none; d=google.com; s=arc-20160816; b=qjuUxaOPvAbEtmM4Braus18lfSirX67TR3Xpz5Cg5AUHYvLbqY1myS4MtAwX8PqA4n z82n5S77r2EYecv2kr8E2XNoCZGdyMJ/AvblVz1jLd37aNnmZjRpOVxAD2BM5PbPf5CB VZt6LT4gEck944EnRgodw8xHc5ZGMc1MLGDyA45EhbSTyjd4r0DUM/Ih0RgvfXrrYsHA pXc+sFLhTIZ8DejlsYi/ZoTl9Xnrbl2riX/vRzX2asRKy9P0L5Ur67yl2+ASG1otYqBY zFMcUzo11AB674mVApPQG05y6X2MENFgkqfjcRM/XEI4k9noEnFoZ3cX2gD2fYhkhUhy nsjw== 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=vx3cwj6BAQjGhRBR4t0mz8jOQwGbWAA5rXLAyr0EvvE=; b=MnYTyybPiejKCXVbJov8qe388D1BTrda1PcYTgCZ4OtyzkzF9XTMCsoo3yG7u6jmYX M7OUIttFHa3Cx4ewnb0yVKTGgOrkr/8rLQp3ekBnhYuYuT5RUbPCf6rzFXj3oDyxNMI3 PZjOk4FwMCy0a0loeXe3sh6WJDe550GRt/cmPFD7lsU3p9Cl4U9Ia2m/sxWIICVSP1Vn uU22GAEdvYsDS08NEdZjisLjgFdPT/wkD7pAcyNMjPoxHJ9+TnCwcoRRMV/ZOJwRiVpq JFj/8QATwG7wDjScU6MKXKD4FCpeLRMfaLN819PvCuAS+os8254ALJKHEc6+CTqH1cvZ tZMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ANHS59wY; 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 c26si1661815edx.353.2019.10.17.07.20.39; Thu, 17 Oct 2019 07:21:03 -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=ANHS59wY; 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 S2395094AbfJPVyz (ORCPT + 99 others); Wed, 16 Oct 2019 17:54:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:44834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395071AbfJPVys (ORCPT ); Wed, 16 Oct 2019 17:54:48 -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 E258A20872; Wed, 16 Oct 2019 21:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571262887; bh=B+56Rk6MOcpvOySkqiVk7g+eKtEtdThp+MfpJwfLYMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ANHS59wYVtyCQk9Fhbv2r1WT/yQvLwjrc9v/m1W8HSc3R+9v8XxRB8qPsBT0ScIjm bNFuw0vFUfX5fmBimoAX7/vJiao6fIjUmQ1xZ17J2gFoLf0buywdB8U+ZVnsjaNRfr oqeOjOcH5O47CPt8cSTC9xUmilB+/G+lh7+Z3kPU= 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 4.9 44/92] xhci: Check all endpoints for LPM timeout Date: Wed, 16 Oct 2019 14:50:17 -0700 Message-Id: <20191016214833.497334248@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214759.600329427@linuxfoundation.org> References: <20191016214759.600329427@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 @@ -4510,12 +4510,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; }