From patchwork Mon Oct 13 13:49:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 38655 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9682A2039B for ; Mon, 13 Oct 2014 13:51:55 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf4245925lab.2 for ; Mon, 13 Oct 2014 06:51:54 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=f+auru0HBImBUjeqvK06wNlf1FBU187aKdd/Awbmeg4=; b=D5y3rzA5aILXSCwzLyhWYo/xCbaPN37HmeEPsK/b4W4fdbM4s5XYWG/py/wiQCobeV lf31rhKf2ubyTV7hej4RmRKg6Sd1YI7pKD1c3wQ8ucn9HNVDjKzBa5lCW2npFG//LJTN KFjvN/Li40JK3XD7n+6hmoDvm5488ihzxBiPeRFy6KBM3NQrj9t/bV9cKdKONr8NICJL BCnWPp2cUwEDrRAmbmOa+eqrro1RBF78q6EOb8yCactYBo9h471GZSMCVbiPzRBAJpUS 5jo7P1sJEK9gbMCm3q04vee17NsZH0+d7U1TMktrDG8pLseGeUAtrokijw3q/Zb07bff adfQ== X-Gm-Message-State: ALoCoQkcVpvatVnPxKSOfVL1xcHgitwQXTZ4LYDWpQxl9tLyFvNfgDCj0YXBoD9vK3tvHCFs3Yag X-Received: by 10.152.6.9 with SMTP id w9mr110299law.7.1413208314490; Mon, 13 Oct 2014 06:51:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.74 with SMTP id le10ls473689lac.1.gmail; Mon, 13 Oct 2014 06:51:54 -0700 (PDT) X-Received: by 10.112.218.6 with SMTP id pc6mr24371026lbc.35.1413208314376; Mon, 13 Oct 2014 06:51:54 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx.google.com with ESMTPS id 2si22267581lay.98.2014.10.13.06.51.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Oct 2014 06:51:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id gm9so6542212lab.41 for ; Mon, 13 Oct 2014 06:51:54 -0700 (PDT) X-Received: by 10.112.52.165 with SMTP id u5mr3736347lbo.80.1413208314296; Mon, 13 Oct 2014 06:51:54 -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 c5csp217812lbz; Mon, 13 Oct 2014 06:51:53 -0700 (PDT) X-Received: by 10.70.130.228 with SMTP id oh4mr24545588pdb.54.1413208267839; Mon, 13 Oct 2014 06:51:07 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si10368565pat.185.2014.10.13.06.51.07 for ; Mon, 13 Oct 2014 06:51:07 -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 S1753840AbaJMNvD (ORCPT + 1 other); Mon, 13 Oct 2014 09:51:03 -0400 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:57302 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754802AbaJMNuK (ORCPT ); Mon, 13 Oct 2014 09:50:10 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.83) (envelope-from ) id 1Xdg0g-0003t1-9E; Mon, 13 Oct 2014 15:50:02 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Felipe Balbi , "Alexis R. Cortes" , Jiri Slaby Subject: [patch added to the 3.12 stable tree] usb: host: xhci: fix compliance mode workaround Date: Mon, 13 Oct 2014 15:49:19 +0200 Message-Id: <1413208201-14602-48-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1413208201-14602-1-git-send-email-jslaby@suse.cz> References: <1413208201-14602-1-git-send-email-jslaby@suse.cz> 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.215.54 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 This patch has been added to the 3.12 stable tree. If you have any objections, please let us 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.