From: andrew thomas Date: Tue, 26 Jun 2018 11:28:07 -0700 Subject: [U-Boot] [PATCH 1/1] dwc2 USB controller hangs with lan78xx In-Reply-To: <8ef56121-ca35-2362-baab-100bd2f69322@suse.de> References: <1529348166-130059-1-git-send-email-andrew.thomas@oracle.com> <1529348166-130059-2-git-send-email-andrew.thomas@oracle.com> <8ef56121-ca35-2362-baab-100bd2f69322@suse.de> Message-ID: <870c4df1-b108-ebb1-325b-6af2a4bcbe5f@oracle.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/26/2018 04:36 AM, Alexander Graf wrote: > On 06/18/2018 08:56 PM, Andrew Thomas wrote: >> This bug is the combination of dwc2 USB controller and lan78xx >> USB ethernet controller, which is the combination in use on >> the Raspberry Pi Model 3 B+. >> >> When the host attempts to receive a packet, but a packet has not >> arrived, the lan78xx controller responds by setting BIR >> (Bulk-In Empty Response) to NAK. Unfortunately, this hangs >> the USB controller and requires the USB controller to >> be reset. >> >> The fix proposed is to have the lan78xx controller respond >> by setting BIR to ZLP. >> >> Signed-off-by: Andrew Thomas > > So why does this work for Linux? I can see that Linux also sets the > BIR flag, so why don't we see the hang there? Although I proposed a fix to the lan78xx controller, I didn't mean to identify it as the culprit :-) I don't understand the interaction of the dwc2 and lan78xx controller. Maybe BIR works for linux, because the dwc2 controller sets up the USB host interface "differently"? It's just a guess... Maybe we can coax the lan78xx driver writer into looking into this issue? [CCing Yuiko Oshino.] Andrew > > > Alex > >> --- >> drivers/usb/eth/lan78xx.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/usb/eth/lan78xx.c b/drivers/usb/eth/lan78xx.c >> index c5ff379..e8ee665 100644 >> --- a/drivers/usb/eth/lan78xx.c >> +++ b/drivers/usb/eth/lan78xx.c >> @@ -296,7 +296,7 @@ static int lan78xx_basic_reset(struct usb_device >> *udev, >> ret = lan7x_read_reg(udev, LAN78XX_USB_CFG0, &val); >> if (ret) >> return ret; >> - val |= LAN78XX_USB_CFG0_BIR; >> + val &= ~LAN78XX_USB_CFG0_BIR; >> return lan7x_write_reg(udev, LAN78XX_USB_CFG0, val); >> } > >