From patchwork Fri Dec 21 09:24:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1902561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 5C8353FC64 for ; Fri, 21 Dec 2012 09:27:18 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tlyq5-0004c6-0s; Fri, 21 Dec 2012 09:24:21 +0000 Received: from mail-oa0-f44.google.com ([209.85.219.44]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tlyq0-0004bn-Sx for linux-arm-kernel@lists.infradead.org; Fri, 21 Dec 2012 09:24:17 +0000 Received: by mail-oa0-f44.google.com with SMTP id n5so4435281oag.17 for ; Fri, 21 Dec 2012 01:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zzSmxdJTfcePzZhNuoj2s2OqTwWOvgBTxqGnhCaXNP4=; b=M9PRimTXKsv/OpneV2lyevZWkD+t1boJP214lgvwK0sbMrcSmSM5EaJ0yz7nAHBYm5 2nTdA6WCIoArbGrYjwiWj1UDWKbL7TlYIYKZ/nrjOkDEESPwxpORspEOzoFODG6XNHOV YbqNG4Rg0rCfg7B9NMLWgc33zByu9n/P4kvEAP2i7KosaXHBvFlDUGY0mNoMsVwOgAsg lCnq0eFnVZQVSvp6SIIF/CYtbFnrbvxuSmo+34Bd2N1hPGkueG2aEHbFJjgDKhK+PiZi IRIzdZNoRtfbwCfdapUZEAA8OcqIm7vDtfrsfa2p9UOYA2QaO2ID3wljT/eCpY6xGwzY nFaA== MIME-Version: 1.0 Received: by 10.182.185.12 with SMTP id ey12mr10646695obc.7.1356081854782; Fri, 21 Dec 2012 01:24:14 -0800 (PST) Received: by 10.76.33.34 with HTTP; Fri, 21 Dec 2012 01:24:14 -0800 (PST) In-Reply-To: <20121221022249.GA16251@nchen-desktop> References: <20121218024353.GA17118@kroah.com> <20121220043943.GA992@nchen-desktop> <20121221022249.GA16251@nchen-desktop> Date: Fri, 21 Dec 2012 07:24:14 -0200 Message-ID: Subject: Re: 3.7 kernel hangs when doing scp From: Fabio Estevam To: Peter Chen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121221_042417_037801_EF08FDEF X-CRM114-Status: GOOD ( 16.14 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.219.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Li Frank-B20596 , alexander.shishkin@linux.intel.com, Greg KH , USB list , sebastian@breakpoint.cc, Sascha Hauer , Chen Peter-B29397 , Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi Peter, On Fri, Dec 21, 2012 at 12:22 AM, Peter Chen wrote: > Current chipidea driver only considers disable stream mode at device > mode, in fact, it may be related to below chipidea bug, and needs > to consider all usb modes. > > STAR 9000378958 > Title: Non-Double Word Aligned Buffer Address Sometimes Causes Host to Hang on OUT Retry > www.synopsys.com/dw/star.php?c=dwc_usb2_hs_otg_controller&fixedIn=2.20a > > To fix this, we need to add CI13XXX_DISABLE_STREAMING after role->start/init. Yes, setting CI13XXX_DISABLE_STREAMING inside ci_role_start does work. If you think the patch below is fine I can properly submit it. --- drivers/usb/chipidea/ci.h | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) enum ci_role role = ci->role; @@ -307,6 +293,27 @@ static inline u32 hw_test_and_write(struct ci13xxx *ci, enum ci13xxx_regs reg, return (val & mask) >> ffs_nr(mask); } + +static inline int ci_role_start(struct ci13xxx *ci, enum ci_role role) +{ + int ret; + + if (role >= CI_ROLE_END) + return -EINVAL; + + if (!ci->roles[role]) + return -ENXIO; + + ret = ci->roles[role]->start(ci); + if (!ret) + ci->role = role; + + if (ci->platdata->flags & CI13XXX_DISABLE_STREAMING) + hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); + + return ret; +} + int hw_device_reset(struct ci13xxx *ci, u32 mode); int hw_port_test_set(struct ci13xxx *ci, u8 mode); -- diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index e25d126..7fe652a 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -18,6 +18,8 @@ #include #include +#define USBMODE_CI_SDIS BIT(4) + /****************************************************************************** * DEFINE *****************************************************************************/ @@ -173,22 +175,6 @@ static inline struct ci_role_driver *ci_role(struct ci13xxx *ci) return ci->roles[ci->role]; } -static inline int ci_role_start(struct ci13xxx *ci, enum ci_role role) -{ - int ret; - - if (role >= CI_ROLE_END) - return -EINVAL; - - if (!ci->roles[role]) - return -ENXIO; - - ret = ci->roles[role]->start(ci); - if (!ret) - ci->role = role; - return ret; -} - static inline void ci_role_stop(struct ci13xxx *ci) {