From patchwork Fri Apr 12 11:04:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 16084 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-gh0-f198.google.com (mail-gh0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8594726EB0 for ; Fri, 12 Apr 2013 11:07:38 +0000 (UTC) Received: by mail-gh0-f198.google.com with SMTP id r11sf3610375ghr.5 for ; Fri, 12 Apr 2013 04:07:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-auditid:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-brightmail-tracker:x-brightmail-tracker :dlp-filter:x-mtr:x-cfilter-loop:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe; bh=nmk7PTzzA4XQMVbM/UTsFg4gGWD0pELx9kjrmyNAoEk=; b=pUj8tiIrpOUE/3pHy0ehh/CjQI0nCoT+FGWjC9LeWgPa8AzPOlmSnD7GG6l5qwskjg jRemU8qsy7THKmWMs+AE38YWa6dnwx1Uf+y01/QHyvumU9/xlxTF4Dztacjs87n7Oj+g 86cClBfmcOrsUreUuO0m1bk4oimmCRlK/euOo0QEHluHrUVy2R+0tc53zs7OWx6XgwZT WmcW+TR8nRIgk5sNNFQpR2iyVawy5GWVUmOLgsYpIAJXgsGRQLKk8dWjcsrGmD0IJ8jf 0E4UzHY3sZ0vt4VUzNdc1MGmEonNRaqRB6I88yGJ3yECyQMwISu2T4jnl/AGWRllZoIc gumQ== X-Received: by 10.224.178.205 with SMTP id bn13mr2284911qab.3.1365764835107; Fri, 12 Apr 2013 04:07:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.212 with SMTP id 20ls1235175qeg.12.gmail; Fri, 12 Apr 2013 04:07:14 -0700 (PDT) X-Received: by 10.220.107.210 with SMTP id c18mr8189834vcp.5.1365764834915; Fri, 12 Apr 2013 04:07:14 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id j3si6172755vcx.65.2013.04.12.04.07.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 04:07:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id d10so2267734vea.14 for ; Fri, 12 Apr 2013 04:07:14 -0700 (PDT) X-Received: by 10.52.34.168 with SMTP id a8mr6823359vdj.75.1365764834606; Fri, 12 Apr 2013 04:07:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp60894veb; Fri, 12 Apr 2013 04:07:14 -0700 (PDT) X-Received: by 10.66.160.106 with SMTP id xj10mr14469243pab.139.1365764833415; Fri, 12 Apr 2013 04:07:13 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id nb4si8318541pbc.354.2013.04.12.04.07.12; Fri, 12 Apr 2013 04:07:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of gautam.vivek@samsung.com designates 203.254.224.25 as permitted sender) client-ip=203.254.224.25; Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ML5003GL2VZ7ST0@mailout2.samsung.com> for patches@linaro.org; Fri, 12 Apr 2013 20:07:12 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.124]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id C9.ED.02019.FDAE7615; Fri, 12 Apr 2013 20:07:11 +0900 (KST) X-AuditID: cbfee690-b7f656d0000007e3-9f-5167eadf49ca Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 65.54.17838.FDAE7615; Fri, 12 Apr 2013 20:07:11 +0900 (KST) Received: from vivekkumarg-linuxpc.sisodomain.com ([107.108.214.169]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0ML500IF52UIWD90@mmp2.samsung.com>; Fri, 12 Apr 2013 20:07:11 +0900 (KST) From: Vivek Gautam To: u-boot@lists.denx.de Cc: u-boot-review@google.com, patches@linaro.org, marex@denx.de, rajeshwari.s@samsung.com, sjg@chromium.org, vikas.sajjan@samsung.com, amarendra.xt@samsung.com, vipin.kumar@st.com, gautam.vivek@samsung.com Subject: [PATCH v3 7/8] usb: hub: Reset only usb 2.0 ports Date: Fri, 12 Apr 2013 16:34:39 +0530 Message-id: <1365764680-10917-8-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1365764680-10917-1-git-send-email-gautam.vivek@samsung.com> References: <1365764680-10917-1-git-send-email-gautam.vivek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42JZI2JSo3v/VXqgwdarZhZfFnSyW7RdOchu 8aatkdFiyuEvLBYtaw+wWnzbso3RYvnrjewWb/cCldx8tp3J4t+la6wOXB6zGy6yeMybdYLF Y8GmUo871/aweZy9s4PRo2/LKkaPpz/2MgewR3HZpKTmZJalFunbJXBlvF7kXfBZoGLXuteM DYz7ebsYOT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eApcX7pW3YQWwioZmX/bpYJjLwLGBlW MYqmFiQXFCel5xrqFSfmFpfmpesl5+duYgTH3TOpHYwrGywOMQpwMCrx8L4QTg8UYk0sK67M PcQowcGsJMIbszctUIg3JbGyKrUoP76oNCe1+BBjMtBVE5mlRJPzgSkhryTe0NjE3NTY1NLE wsTMkjRhJXHeA63WgUIC6YklqdmpqQWpRTBbmDg4pRoY16fdOMl6k3VJAMsky/n8JuLs7Bra 6pO/f5of18mhGNUpmhalmu0jlzqv2ad5z/kl6x95sAS/El5h9v+VzNeUxVMfvOzRsvl2U3FR d3zKGc3N7vHdnZUKh443WfG/O3av9Iu0idfe5/sUsybMWdXW8dqhrsJ1tU8s7yYpB8W+ZwbP v8kJ8axRYinOSDTUYi4qTgQAzkvK9v8CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQlWsdEHL9KV54J6YH01T4uMSXbxrsO0WEKLstRz+UnYo8wVUXTu2m/l072u4oHwDn9zKbdg X-Original-Sender: gautam.vivek@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , As per XHCI specifications USB 3.0 protocol ports attempt to advance to 'Enabled' state; however USB 2.0 protocol ports require software reset to advance them to 'Enabled' state. Thereby, inferring that software need to reset USB 2.0 protocol ports invariably (as per EHCI spec or xHCI spec). Signed-off-by: Vivek Gautam --- This patch added in V3(current-version) of this patch-series. common/usb_hub.c | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/common/usb_hub.c b/common/usb_hub.c index 1e225e6..eedbcf2 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -233,6 +233,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port) struct usb_device *usb; ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1); unsigned short portstatus; + uint32_t do_port_reset = 1; /* Check status */ if (usb_get_port_status(dev, port + 1, portsts) < 0) { @@ -246,6 +247,9 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port) le16_to_cpu(portsts->wPortChange), portspeed(portstatus)); + if (portstatus & (1 << USB_PORT_FEAT_SUPERSPEED)) + do_port_reset = 0; + /* Clear the connection change status */ usb_clear_port_feature(dev, port + 1, USB_PORT_FEAT_C_CONNECTION); @@ -259,10 +263,21 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port) } mdelay(200); - /* Reset the port */ - if (hub_port_reset(dev, port, &portstatus) < 0) { - printf("cannot reset port %i!?\n", port + 1); - return; + /* + * Reset the port: + * As per xHCI protocol, USB 3.0 devices do not require + * a port reset, however USB 2.0 device do require the same + * to let ports proceed to 'enabled' state + * + * XXX: Will this break EHCI ?? + * probably not, above condition for 'do_port_reset' checks for + * speed, and for EHCI it can't reach Super speed anyways. + */ + if (do_port_reset) { + if (hub_port_reset(dev, port, &portstatus) < 0) { + printf("cannot reset port %i!?\n", port + 1); + return; + } } mdelay(200);