From patchwork Fri Oct 17 08:09:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38843 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DEA5D20C5D for ; Fri, 17 Oct 2014 08:14:07 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf178726lam.4 for ; Fri, 17 Oct 2014 01:14:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=PIIx7PNnLknWvEa0eFhyRqeudkS2IMXDS7oixhyRq4A=; b=G37PLg5ydIdnqs+f/x7R1id7S/r4xHgs2AGbMnG6HMdHcTjahe4xYqJTL58HkXEVjG 5akmkO7LJe6gWcioRhACaEbUxE5hq+26zJFuMAJfZRvEjlQJcAUW7YTr8JWTd66VoINj TzAJqvdOVOQUdeNBho/XTQbiJvmJ5YbwjqENGoYLjZK+91arXtDPMZtg1cGr8r/Sm74p QgNscRcLvcrxAHHT/sF+PRahmJyfY+Qwt2l/+d2AGg8NM/pB01U5o6gw9eyueXnZWc/K d4vkgP4P8KbW775VM5162hLvQYt/mKRSQrwgh/UslaOvXLsRiNY10DF0ZehzAfqqhUkK 17ww== X-Gm-Message-State: ALoCoQkrsvykEvzKh94a2prcG7QeCZd3jQUap3SBY8uGKguI7AWTgulhaiMZFnVf75auyL/qSjUS X-Received: by 10.112.141.230 with SMTP id rr6mr1116240lbb.4.1413533646722; Fri, 17 Oct 2014 01:14:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.193 with SMTP id x1ls250456lae.53.gmail; Fri, 17 Oct 2014 01:14:06 -0700 (PDT) X-Received: by 10.112.157.225 with SMTP id wp1mr6937481lbb.55.1413533646615; Fri, 17 Oct 2014 01:14:06 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id m8si844656lam.108.2014.10.17.01.14.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 01:14:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id z12so264625lbi.2 for ; Fri, 17 Oct 2014 01:14:06 -0700 (PDT) X-Received: by 10.112.173.134 with SMTP id bk6mr6987397lbc.66.1413533646537; Fri, 17 Oct 2014 01:14:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp184294lbz; Fri, 17 Oct 2014 01:14:05 -0700 (PDT) X-Received: by 10.66.150.102 with SMTP id uh6mr850486pab.141.1413533613357; Fri, 17 Oct 2014 01:13:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si482018pdp.169.2014.10.17.01.13.32 for ; Fri, 17 Oct 2014 01:13:33 -0700 (PDT) Received-SPF: none (google.com: stable-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753699AbaJQINa (ORCPT + 1 other); Fri, 17 Oct 2014 04:13:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36364 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753607AbaJQIMk (ORCPT ); Fri, 17 Oct 2014 04:12:40 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4CE4AADBE; Fri, 17 Oct 2014 08:11:56 +0000 (UTC) Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1Xf2df-0000Bb-3E; Fri, 17 Oct 2014 10:11:55 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Felipe Balbi , "Alexis R. Cortes" , Jiri Slaby Subject: [PATCH 3.12 057/197] usb: host: xhci: fix compliance mode workaround Date: Fri, 17 Oct 2014 10:09:33 +0200 Message-Id: X-Mailer: git-send-email 2.1.1 In-Reply-To: <7d97f39bc813aa9f11fe03d602885f81de07007c.1413533329.git.jslaby@suse.cz> References: <7d97f39bc813aa9f11fe03d602885f81de07007c.1413533329.git.jslaby@suse.cz> In-Reply-To: References: Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Felipe Balbi 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit 96908589a8b2584b1185f834d365f5cc360e8226 upstream. Commit 71c731a (usb: host: xhci: Fix Compliance Mode on SN65LVP3502CP Hardware) implemented a workaround for a known issue with Texas Instruments' USB 3.0 redriver IC but it left a condition where any xHCI host would be taken out of reset if port was placed in compliance mode and there was no device connected to the port. That condition would trigger a fake connection to a non-existent device so that usbcore would trigger a warm reset of the port, thus taking the link out of reset. This has the side-effect of preventing any xHCI host connected to a Linux machine from starting and running the USB 3.0 Electrical Compliance Suite because the port will mysteriously taken out of compliance mode and, thus, xHCI won't step through the necessary compliance patterns for link validation. This patch fixes the issue by just adding a missing check for XHCI_COMP_MODE_QUIRK inside xhci_hub_report_usb3_link_state() when PORT_CAS isn't set. This patch should be backported to all kernels containing commit 71c731a. Fixes: 71c731a (usb: host: xhci: Fix Compliance Mode on SN65LVP3502CP Hardware) Cc: Alexis R. Cortes Signed-off-by: Felipe Balbi Acked-by: Mathias Nyman Signed-off-by: Jiri Slaby --- drivers/usb/host/xhci-hub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index e8b4c56dcf62..cd478409cad3 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -470,7 +470,8 @@ static void xhci_hub_report_usb2_link_state(u32 *status, u32 status_reg) } /* Updates Link Status for super Speed port */ -static void xhci_hub_report_usb3_link_state(u32 *status, u32 status_reg) +static void xhci_hub_report_usb3_link_state(struct xhci_hcd *xhci, + u32 *status, u32 status_reg) { u32 pls = status_reg & PORT_PLS_MASK; @@ -509,7 +510,8 @@ static void xhci_hub_report_usb3_link_state(u32 *status, u32 status_reg) * in which sometimes the port enters compliance mode * caused by a delay on the host-device negotiation. */ - if (pls == USB_SS_PORT_LS_COMP_MOD) + if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && + (pls == USB_SS_PORT_LS_COMP_MOD)) pls |= USB_PORT_STAT_CONNECTION; } @@ -668,7 +670,7 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, } /* Update Port Link State */ if (hcd->speed == HCD_USB3) { - xhci_hub_report_usb3_link_state(&status, raw_port_status); + xhci_hub_report_usb3_link_state(xhci, &status, raw_port_status); /* * Verify if all USB3 Ports Have entered U0 already. * Delete Compliance Mode Timer if so.