From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755025AbdJIQER (ORCPT ); Mon, 9 Oct 2017 12:04:17 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:41881 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754293AbdJIQEP (ORCPT ); Mon, 9 Oct 2017 12:04:15 -0400 Date: Mon, 9 Oct 2017 11:03:43 -0500 From: Bin Liu To: Jonathan Liu CC: Greg Kroah-Hartman , Maxime Ripard , Chen-Yu Tsai , , , , Subject: Re: [PATCH] usb: musb: Check for host-mode using is_host_active() on reset interrupt Message-ID: <20171009160343.GC32614@uda0271908> Mail-Followup-To: Bin Liu , Jonathan Liu , Greg Kroah-Hartman , Maxime Ripard , Chen-Yu Tsai , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com References: <20170927103522.30202-1-net147@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170927103522.30202-1-net147@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Sep 27, 2017 at 08:35:22PM +1000, Jonathan Liu wrote: > The sunxi musb has a bug where sometimes it will generate a babble > error on device disconnect instead of a disconnect IRQ. When this > happens the musb controller switches from host mode to device mode > (it clears MUSB_DEVCTL_HM/MUSB_DEVCTL_SESSION and sets > MUSB_DEVCTL_BDEVICE) and gets stuck in this state. > > The babble error is misdetected as a bus reset because MUSB_DEVCTL_HM > was cleared. > > To fix this, use is_host_active() rather than (devctl & MUSB_DEVCTL_HM) > to detect babble error so that sunxi musb babble recovery can handle it > by restoring the mode. This information is provided by the driver logic > and does not rely on register contents. > > Cc: stable@vger.kernel.org # v4.1+ > Signed-off-by: Jonathan Liu Applied. Thanks. -Bin.