From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 27 Aug 2015 12:45:23 +0200 Subject: [U-Boot] [PATCH] usb: ehci: remember init mode In-Reply-To: <55DB68FE.6020002@wwwdotorg.org> References: <1440113885-24882-1-git-send-email-swarren@wwwdotorg.org> <201508240547.09552.marex@denx.de> <55DB68FE.6020002@wwwdotorg.org> Message-ID: <201508271245.23095.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday, August 24, 2015 at 08:57:02 PM, Stephen Warren wrote: > On 08/23/2015 09:47 PM, Marek Vasut wrote: > > On Friday, August 21, 2015 at 11:58:55 PM, Stephen Warren wrote: > >> On 08/20/2015 11:34 PM, Marek Vasut wrote: > >>> On Friday, August 21, 2015 at 01:38:05 AM, Stephen Warren wrote: > >>>> From: Stephen Warren > >>>> > >>>> When an EHCI device is registered in device mode, the HW isn't > >>>> actually initialized at all, and hence isn't left in a running state. > >>>> Consequently, when the device is deregistered, ehci_shutdown() will > >>>> fail, since the HW bits it expects to see set in response to its > >>>> shutdown requests will not be sent, and the message "EHCI failed to > >>>> shut down host controller." will be printed. > >>>> > >>>> Fix ehci-hcd.c to remember whether the device was registered in host > >>>> or device mode, and only call ehci_shutdown() for host mode > >>>> registrations. > >>> > >>> Hi, > >>> > >>> Shouldn't you instead check if the controller is running or not and > >>> shut it down based on that ? > >> > >> Why would the two states be different? How can the code check if the > >> controller is running; is there some HW bit that should be checked for > >> that? > > > > Hi, > > > > Hrm, I am not aware of any, sorry :-( But the driver can track whether > > the controller was previously inited or not, right ? I mean, this is DM, > > so we should be able to have a private data bit for that, no ? > > I believe that's exactly what this patch is doing. I added a variable to > the driver's data structure indicating whether the last initialization > call was for host mode (-> EHCI is running, and should be shut down in > remove()) or device mode (-> EHCI is not running, so should not be shut > down in remove()). Uh, right, sorry. Applied. Best regards, Marek Vasut