diff mbox

[U-Boot] smsc95xx: Use zero length packets when RX fifo is empty

Message ID 14106325-d7b0-4bcf-ada1-3733d65f285f@HUB2.rwth-ad.de
State Accepted
Delegated to: Joe Hershberger
Headers show

Commit Message

Stefan Brüns Sept. 8, 2015, 3:12 a.m. UTC
Using NAKs on empty RX fifo for bulk in transfers is the right choice
for a interrupt driven model, but U-Boot uses polling and expects an
immediate answer if there is no incoming packet. Using ZLP Bulk In Response
(BIR) mode avoids unexpected timeouts in the host controller driver.

As ZLP mode is reset default, there is no need to set it.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
The current setting results in timeouts in the dwc2 hc driver, if an expected
network response is lost. This is often hidden by incoming broadcast packets,
as these trigger the completion of the bulk in transfer as well.

 drivers/usb/eth/smsc95xx.c | 16 ----------------
 1 file changed, 16 deletions(-)

Comments

Joe Hershberger Sept. 8, 2015, 1:56 p.m. UTC | #1
On Mon, Sep 7, 2015 at 10:12 PM, Stefan Brüns
<stefan.bruens@rwth-aachen.de> wrote:
> Using NAKs on empty RX fifo for bulk in transfers is the right choice
> for a interrupt driven model, but U-Boot uses polling and expects an
> immediate answer if there is no incoming packet. Using ZLP Bulk In Response
> (BIR) mode avoids unexpected timeouts in the host controller driver.
>
> As ZLP mode is reset default, there is no need to set it.
>
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

LGTM.

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Stefan Brüns Sept. 13, 2015, 4:45 p.m. UTC | #2
On Tuesday 08 September 2015 08:56:12 Joe Hershberger wrote:
> On Mon, Sep 7, 2015 at 10:12 PM, Stefan Brüns
> 
> <stefan.bruens@rwth-aachen.de> wrote:
> > Using NAKs on empty RX fifo for bulk in transfers is the right choice
> > for a interrupt driven model, but U-Boot uses polling and expects an
> > immediate answer if there is no incoming packet. Using ZLP Bulk In
> > Response
> > (BIR) mode avoids unexpected timeouts in the host controller driver.
> > 
> > As ZLP mode is reset default, there is no need to set it.
> > 
> > Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> 
> LGTM.
> 
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Anything I need to do to get this patch and the other ones I sent recently 
included into U-boot?

All pending patches were ACKed.

Kind regards,

Stefan
Joe Hershberger Sept. 14, 2015, 9:37 p.m. UTC | #3
Hi Stefan,

On Sun, Sep 13, 2015 at 11:45 AM, Stefan Bruens
<stefan.bruens@rwth-aachen.de> wrote:
> On Tuesday 08 September 2015 08:56:12 Joe Hershberger wrote:
>> On Mon, Sep 7, 2015 at 10:12 PM, Stefan Brüns
>>
>> <stefan.bruens@rwth-aachen.de> wrote:
>> > Using NAKs on empty RX fifo for bulk in transfers is the right choice
>> > for a interrupt driven model, but U-Boot uses polling and expects an
>> > immediate answer if there is no incoming packet. Using ZLP Bulk In
>> > Response
>> > (BIR) mode avoids unexpected timeouts in the host controller driver.
>> >
>> > As ZLP mode is reset default, there is no need to set it.
>> >
>> > Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
>>
>> LGTM.
>>
>> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
>
> Anything I need to do to get this patch and the other ones I sent recently
> included into U-boot?
>
> All pending patches were ACKed.

Any that are bugs that affect existing devices will be considered. All
enhancements will wait until next time the merge window opens.

See http://www.denx.de/wiki/U-Boot/ReleaseCycle

Cheers,
-Joe
Joe Hershberger Oct. 29, 2015, 7:28 p.m. UTC | #4
On Mon, Sep 7, 2015 at 10:12 PM, Stefan Brüns
<stefan.bruens@rwth-aachen.de> wrote:
> Using NAKs on empty RX fifo for bulk in transfers is the right choice
> for a interrupt driven model, but U-Boot uses polling and expects an
> immediate answer if there is no incoming packet. Using ZLP Bulk In Response
> (BIR) mode avoids unexpected timeouts in the host controller driver.
>
> As ZLP mode is reset default, there is no need to set it.
>
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

Applied to u-boot-net/master, thanks!
-Joe
diff mbox

Patch

diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c
index 6e80184..ae8bc18 100644
--- a/drivers/usb/eth/smsc95xx.c
+++ b/drivers/usb/eth/smsc95xx.c
@@ -531,22 +531,6 @@  static int smsc95xx_init_common(struct usb_device *udev, struct ueth_data *dev,
 	if (ret < 0)
 		return ret;
 
-	ret = smsc95xx_read_reg(udev, HW_CFG, &read_buf);
-	if (ret < 0)
-		return ret;
-	debug("Read Value from HW_CFG : 0x%08x\n", read_buf);
-
-	read_buf |= HW_CFG_BIR_;
-	ret = smsc95xx_write_reg(udev, HW_CFG, read_buf);
-	if (ret < 0)
-		return ret;
-
-	ret = smsc95xx_read_reg(udev, HW_CFG, &read_buf);
-	if (ret < 0)
-		return ret;
-	debug("Read Value from HW_CFG after writing "
-		"HW_CFG_BIR_: 0x%08x\n", read_buf);
-
 #ifdef TURBO_MODE
 	if (dev->pusb_dev->speed == USB_SPEED_HIGH) {
 		burst_cap = DEFAULT_HS_BURST_CAP_SIZE / HS_USB_PKT_SIZE;