From patchwork Sat May 11 02:49:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 243107 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 08DC52C00D7 for ; Sat, 11 May 2013 12:49:31 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 60B504A178; Sat, 11 May 2013 04:49:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j4V0EQyta-Z2; Sat, 11 May 2013 04:49:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4D1394A17A; Sat, 11 May 2013 04:49:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E53804A178 for ; Sat, 11 May 2013 04:49:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NxRNi3t2axEZ for ; Sat, 11 May 2013 04:49:14 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=SKIP(-1.5) (only DNSBL check requested) Received: from mail-vb0-f73.google.com (mail-vb0-f73.google.com [209.85.212.73]) by theia.denx.de (Postfix) with ESMTPS id 676D84A177 for ; Sat, 11 May 2013 04:49:13 +0200 (CEST) Received: by mail-vb0-f73.google.com with SMTP id e13so455957vbg.0 for ; Fri, 10 May 2013 19:49:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=8Z2MIeBW4LyvFzWU4hwx7SwviIvq6NTACH9Xu+nBbDQ=; b=Bocn1Yn1AW3deR/Lih8g5a4UEVDcnjb8j/XHlvU78Pl3x7hDlrpRYnu5oV/qjwfej/ laIcSlJ4YUDvBaGnFycVnMmWZMgrfA/yIk4XFymgncSwecqjtGRf0pLeEd5jF0YyEPxl wgCviOoyIRguz/AsuWbtfbeTgJcOLawb+YLOa68jh7ljF2P+Dq8TIJlT8NH2PymXcjaf S4qi4ppHHlFIL74iVz/qsEN6o2Q1jgwdyuZPTMgmbF7H3uSuDX5HEI1AgHIEP3VaZU6I 7xkZZv2G3lxQIGt3nGaClAY5nT9GtIh8gck0mUZdj20LS2UUYvhUyzTZr9/o/YBx9OFa K5TA== X-Received: by 10.236.142.11 with SMTP id h11mr1632610yhj.55.1368240550817; Fri, 10 May 2013 19:49:10 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id n23si267826yhi.7.2013.05.10.19.49.10 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Fri, 10 May 2013 19:49:10 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id A631C5A415D; Fri, 10 May 2013 19:49:10 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 57152160AC6; Fri, 10 May 2013 19:49:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 10 May 2013 19:49:00 -0700 Message-Id: <1368240540-11741-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1368240540-11741-1-git-send-email-sjg@chromium.org> References: <1368240540-11741-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQnj/AV6ojRu2f4Wnx7abW3ksNJWmXRwVdeoHCEQVNr5zjDZ1L7TYAZO2usQ+M/+jl2BSGMl4iaoNRNiEmNcen9ZDF2mr9Mz0YwQ6JoDAzEIzcC69EnTa1XlAW+rOKJi6RVdvZhR3Vzin8z6tbiXMZ5HWfOc+7535+HtML9XnD9fmVi8gE6PFwASnyMBrtIfrvj+tNZ6 Cc: Julius Werner , u-boot-review@google.com Subject: [U-Boot] [PATCH 3/3] usb: Correct CLEAR_FEATURE code in ehci-hcd X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This commit broke USB2 on link (Chromebook Pixel): 020bbcb usb: hub: Power-cycle on root-hub ports However the root cause seems to be a missing mask and missing 'break' in ehci-hcd.c. This patch fixes both. On link, 'usb start' with a USB keyboard and memory stick inserted now finds both. The keyboard works as expected. Also ext2ls shows a directory listing from the memory stick. Signed-off-by: Simon Glass Acked-by: Julius Werner --- drivers/usb/host/ehci-hcd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index e0f3e4b..445759b 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -809,21 +809,23 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, break; case USB_REQ_CLEAR_FEATURE | ((USB_DIR_OUT | USB_RT_PORT) << 8): reg = ehci_readl(status_reg); + reg &= ~EHCI_PS_CLEAR; switch (le16_to_cpu(req->value)) { case USB_PORT_FEAT_ENABLE: reg &= ~EHCI_PS_PE; break; case USB_PORT_FEAT_C_ENABLE: - reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_PE; + reg |= EHCI_PS_PE; break; case USB_PORT_FEAT_POWER: if (HCS_PPC(ehci_readl(&ctrl->hccr->cr_hcsparams))) - reg = reg & ~(EHCI_PS_CLEAR | EHCI_PS_PP); + reg &= ~EHCI_PS_PP; + break; case USB_PORT_FEAT_C_CONNECTION: - reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_CSC; + reg |= EHCI_PS_CSC; break; case USB_PORT_FEAT_OVER_CURRENT: - reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_OCC; + reg |= EHCI_PS_OCC; break; case USB_PORT_FEAT_C_RESET: ctrl->portreset &= ~(1 << port);