From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754293AbcEENjM (ORCPT ); Thu, 5 May 2016 09:39:12 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:36441 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751890AbcEENjK (ORCPT ); Thu, 5 May 2016 09:39:10 -0400 Subject: Re: [PATCHv2] musb_host: fix lockup on rxcsr_h_error To: Bin Liu , Yegor Yefremov , Maxim Uvarov , kernel list , linux-usb , Greg KH References: <20160428143714.GA7222@uda0271908> <20160503134813.GA690@uda0271908> <20160503143547.GB690@uda0271908> <20160504185638.GB4327@uda0271908> <572A4738.10407@cogentembedded.com> <20160504191715.GA6727@uda0271908> <20160505133113.GA22575@uda0271908> From: Sergei Shtylyov Message-ID: <046fc425-f559-0212-d2b5-27e2a4b24c7c@cogentembedded.com> Date: Thu, 5 May 2016 16:39:06 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160505133113.GA22575@uda0271908> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/5/2016 4:31 PM, Bin Liu wrote: >>>>>>>>>>>> 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. >>>>>>>>>> >>>>>>>>>> Have tested your patch and now both FT4232 and Huawei don't freeze on removal. >>>>>>>>>> >>>>>>>>>> Bin, Max thanks for fixing this issue. >>>>>>>>>> >>>>>>>>>> Tested-by: Yegor Yefremov >>>>>>>>> >>>>>>>>> Thanks for testing. >>>>>>>>> >>>>>>>>> Can you please test the patch [1] instead? I'd like to use it as the >>>>>>>>> fix. >>>>>>>>> >>>>>>>>> [1] http://marc.info/?l=linux-usb&m=146222355213935&w=2 >>>>>>>> >>>>>>>> The patch behaves the same as the previous one. >>>>>>>> >>>>>>>> Kernel: 4.6-rc6 >>>>>>> >>>>>>> Thanks for testing. I will add your Tested-by. >>>>>> >>>>>> If you'll resend this patch, it would be good to add it to stable >>>>>> kernels. I've tested 3.18.32 and it fixes the error too. >>>> >>>>> Thanks for testing. >>>>> >>>>> My plan is to not rush it into stable, but let it sit in v4.7 for a >>>>> while first. >>>> >>>> Are you serious? Fixing interrupt storm due to not cleared >>>> interrupt bit will only be done in 4.7? >>> >>> Well, I am new to maintianer's role, and thought there is only one week >>> away to v4.7 merge window, there is no big difference to let this patch >>> get into v4.7-rc1. If getting the fix into upstream as soon as possible >>> is important, I will send it for 4.6-rc7. >>> >>> BTY, the issue is not because of not clearing interrupt bit, but the hub >>> has no chance to report the disconnect event, which causes the >>> controller keeps generating the interrupt for every new rx urb. >> >> Sorry, looking at the Mentor manuals, I got the impression that >> whenever the RXCSR.Error is set, there's interrupt. Probably they > > This is my understanding of the manual too. > >> meant that the interrupt is generated only on transition from 0 to >> 1.... > > What transition? the RXCSR bit? Of course. > 'set' means from 0 to 1, 'clear' means 1 -> 0, right? Well, in my understanding "set" means 1 and "clear" means 0. > I don't see you have any misunderstanding. >>> Regards, >>> -Bin. MBR, Sergei