From patchwork Fri Oct 3 15:57:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38339 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6F1532057C for ; Fri, 3 Oct 2014 15:57:29 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf864078wgh.8 for ; Fri, 03 Oct 2014 08:57:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=Y1WnTsKGeqIbnt5r8E8V4tQH4WMeRMhNIFhSOguGxJ4=; b=kyPoNY9kW0CD5pPHQsUV9NmVx3hCg8q5aVWW5jrDB2aK4BQZhwsyfX1fyB/AMA+nU1 mMmfSYOToDPJeFysnkLGCLCbkaPW0fqRJZ+V1BnzhwB18sSY2HGr8eXwlpQBxZR2orWh jVVAvqUoRx5QJ0t+/MsIgscWkJBa9akkBE1CDnknFavvhuALhDOViKaUxP+0mYmHSFSG sb9a9mEWV+agzKJm0eaNk/MwYtpePhF/OJAd9iKfJy4TNZiErzwrFx/ilTIhw/RIBOgO KGXxyFAKaQnHbs8qkWIA+VGpBq+nU7jV7oImKgSUmZ0U2RqBch6JqxcNGlnOhm4qCgT2 qvWA== X-Gm-Message-State: ALoCoQmXG7iS9mmgGrhqxK+xqL1oyh3K/c34fZblF+PK7VxGCZJxP8bsQegYFz2C/4RhJ1OC9QQr X-Received: by 10.152.1.136 with SMTP id 8mr1142373lam.5.1412351848628; Fri, 03 Oct 2014 08:57:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.5 with SMTP id a5ls402977lae.19.gmail; Fri, 03 Oct 2014 08:57:28 -0700 (PDT) X-Received: by 10.152.163.66 with SMTP id yg2mr6925486lab.38.1412351848400; Fri, 03 Oct 2014 08:57:28 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id to5si11797218lbb.93.2014.10.03.08.57.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 08:57:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id f15so1237941lbj.39 for ; Fri, 03 Oct 2014 08:57:27 -0700 (PDT) X-Received: by 10.152.5.168 with SMTP id t8mr6686234lat.67.1412351847786; Fri, 03 Oct 2014 08:57:27 -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.130.169 with SMTP id of9csp254351lbb; Fri, 3 Oct 2014 08:57:27 -0700 (PDT) X-Received: by 10.70.128.40 with SMTP id nl8mr1822147pdb.78.1412351846157; Fri, 03 Oct 2014 08:57:26 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zs4si7576523pbb.69.2014.10.03.08.57.25 for ; Fri, 03 Oct 2014 08:57:26 -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 S1754350AbaJCP5Y (ORCPT + 1 other); Fri, 3 Oct 2014 11:57:24 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:37986 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754161AbaJCP5V (ORCPT ); Fri, 3 Oct 2014 11:57:21 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s93FvKhX029989; Fri, 3 Oct 2014 10:57:20 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93FvKR1023437; Fri, 3 Oct 2014 10:57:20 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 3 Oct 2014 10:57:20 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s93FvJRx006481; Fri, 3 Oct 2014 10:57:19 -0500 From: Felipe Balbi To: Greg KH CC: , Felipe Balbi , "Alexis R. Cortes" Subject: [PATCH v3.10-stable 1/3] usb: host: xhci: fix compliance mode workaround Date: Fri, 3 Oct 2014 10:57:19 -0500 Message-ID: <1412351841-28107-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT MIME-Version: 1.0 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: balbi@ti.com 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.180 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: , 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 Cc: # v3.2+ Signed-off-by: Felipe Balbi Acked-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- 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 7cdcfd0..d939376 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -462,7 +462,8 @@ void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array, } /* Updates Link Status for super Speed port */ -static void xhci_hub_report_link_state(u32 *status, u32 status_reg) +static void xhci_hub_report_link_state(struct xhci_hcd *xhci, + u32 *status, u32 status_reg) { u32 pls = status_reg & PORT_PLS_MASK; @@ -501,7 +502,8 @@ static void xhci_hub_report_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; } @@ -686,7 +688,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, } /* Update Port Link State for super speed ports*/ if (hcd->speed == HCD_USB3) { - xhci_hub_report_link_state(&status, temp); + xhci_hub_report_link_state(xhci, &status, temp); /* * Verify if all USB3 Ports Have entered U0 already. * Delete Compliance Mode Timer if so.