Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752909AbcD1OhV (ORCPT ); Thu, 28 Apr 2016 10:37:21 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:39011 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759AbcD1OhR (ORCPT ); Thu, 28 Apr 2016 10:37:17 -0400 Date: Thu, 28 Apr 2016 09:37:14 -0500 From: Bin Liu To: Maxim Uvarov CC: , , Greg KH , Subject: Re: [PATCHv2] musb_host: fix lockup on rxcsr_h_error Message-ID: <20160428143714.GA7222@uda0271908> Mail-Followup-To: Bin Liu , Maxim Uvarov , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Greg KH , sergei.shtylyov@cogentembedded.com References: <1461739918-9583-1-git-send-email-muvarov@gmail.com> <20160427154620.GB5604@uda0271908> <20160427191356.GA16821@uda0271908> <20160427212823.GA14645@uda0271908> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1886 Lines: 63 Hi, On Thu, Apr 28, 2016 at 09:51:37AM +0300, Maxim Uvarov wrote: [snip] > Hello Bin, > > yes, it also works with that reset and go to finish: > > diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c > index c3d5fc9..8cd98e7 100644 > --- a/drivers/usb/musb/musb_host.c > +++ b/drivers/usb/musb/musb_host.c > @@ -1599,6 +1599,10 @@ void musb_host_rx(struct musb *musb, u8 epnum) > status = -EPROTO; > musb_writeb(epio, MUSB_RXINTERVAL, 0); > > + rx_csr &= ~MUSB_RXCSR_H_ERROR; > + musb_writew(epio, MUSB_RXCSR, rx_csr); > + > + goto finish; > } else if (rx_csr & MUSB_RXCSR_DATAERROR) { > > if (USB_ENDPOINT_XFER_ISOC != qh->type) { > Thanks for testing it. > > That I think a key thing, which is done in other error. If that change > is good for you than I'm also happy with it. We need to understand why the controller keeps generating the same interrupt to come out a proper fix. I will take a look. But I can only use my spare time on this, so be patient. > > I also not sure if musb_writeb(epio, MUSB_RXINTERVAL, 0); is needed. > In my case it's the same result with it and without it. > In other scenarios might be reasonable... It disables NAK timeout. > > > > First of all, I don't like the idea of merging the two branches, it > > makes the code ugly. > > Yes, I don't like that function at all, it's too long and difficult to > read if you first look on it first time. It will be good to split it > on 3 small functions for each big if. This particular function is not that hard to understand, but the driver in general is messy. But I am not sure if anyone in the community can refactory this driver. The community had some effort in the past to clean up this driver, but it always broke usecases on different platforms. Regards, -Bin.