On Wed, 21 Jul 2021 08:40:34 +0200
Marcus Glocker <mar...@nazgul.ch> wrote:

> On Tue, 20 Jul 2021 22:21:11 +0100
> Stuart Henderson <s...@spacehopper.org> wrote:
> 
> > On 2021/07/20 11:03, adrian...@fortix.com.ar wrote:  
> > > >Description:    
> > >   The ure driver with the RTL8152 adapter does not respond
> > > if the device is UP before having ethernet link. The dmesg command
> > > displays the following lines when the error occurs:    
> > 
> > Oh I hit that the other day, forgot the silly thinkpad donlge and
> > tried a ure instead, but I didn't figure out that there was a way to
> > get it to work. RTL8153B in my case.
> > 
> > ure0: RTL8153B (0x6010), address 00:e0:4c:38:2b:0f
> > rgephy0 at ure0 phy 0: RTL8251 PHY, rev. 0
> > ure0: usb error on tx: IOERROR
> > ure0: usb error on tx: IN_PROGRESS
> > usb_insert_transfer: xfer=0xfffffd847bccd000 not free
> > ure0: usb error on tx: IOERROR
> > ure0: usb error on tx: IN_PROGRESS
> > usb_insert_transfer: xfer=0xfffffd847bccd230 not free
> > 
> > On 2021/07/20 21:44, Marcus Glocker wrote:  
> > > I don't have such a device here.  But one reason could be that
> > > ure(4) isn't reading the link status correctly.  Following a debug
> > > diff.  If you could run it with the cable disconnected and then
> > > connected and send back the output please.    
> > 
> > It's not triggered, that function is only called if
> > (sc->ure_flags & URE_FLAG_8156).  
> 
> Oh right, I missed that.
> 
> Then I guess the thing to be checked first is still;  Is something
> setting 'sc->ure_flags |= URE_FLAG_LINK', and by that the the driver
> is queuing up packets in ure_start() while there is no link?

Does this diff fix the issue?


Index: if_ure.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/if_ure.c,v
retrieving revision 1.24
diff -u -p -u -p -r1.24 if_ure.c
--- if_ure.c    15 Apr 2021 02:23:17 -0000      1.24
+++ if_ure.c    21 Jul 2021 14:15:10 -0000
@@ -435,6 +435,9 @@ ure_miibus_statchg(struct device *dev)
        /* Lost link, do nothing. */
        if ((sc->ure_flags & URE_FLAG_LINK) == 0)
                return;
+
+       /* Enable transmit and receive. */
+       URE_SETBIT_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA, URE_CR_RE | URE_CR_TE);
 }
 
 int


Reply via email to