From: Geoff Steckel Subject: Re: 7.7->7.8 2 regressions: rge0 & amd embedded com0 To: Kevin Lo Cc: tech Date: Sun, 2 Nov 2025 21:37:00 -0500 On 11/2/25 9:11 PM, Kevin Lo wrote: > On Sat, Nov 01, 2025 at 02:30:16AM -0400, Geoff Steckel wrote: >> Just upgraded 7.7 -> 7.8 >> Noticed 2 regressions on devices that worked immediately before the upgrade. >> >> com0 embedded uart worked -almost- ok in 7.7 >> >> Oct 31 17:58:30 eight /bsd: com0: 3 silo overflows, 0 ibuf overflows >> >> now >> >> Nov 1 02:00:59 eight /bsd: com0: 51 silo overflows, 0 ibuf overflows >> >> The embedded uart is a little tricky >> The port is connected to a GPS receiver @9600 baud sending 2 lines once a >> second. >> >> rge0 worked perfectly in 7.7 (and was used to do sysupgrade) >> >> Oct 9 13:25:26 eight /bsd: rge0 at pci3 dev 0 function 0 "Realtek RTL8125" >> rev >> 0x00: msix, address 78:2d:7e:12:5a:d9 >> >> now >> >> Nov 1 01:43:45 eight /bsd: rge0 at pci3 dev 0 function 0 "Realtek RTL8125" >> rev >> 0x00: msixrge0: failed to stop all requests >> >> If anyone suggests a patch or a test I'll gladly try it. >> thanks >> Geoff Steckel > Hi Geoff, > > First of all, I sincerely apologize for breaking the RTL8125 and causing > your network card to stop working. > I probably tested using an RTL8125B card while assuming it was an RTL8125, > which is why I didn't encounter this issue. In other words, I didn't > actually test on an RTL8125 :( > > In revision 1.38 of if_rge.c, I added a check for the RTL8125 to verify > that the chip has finished the request. > Like the RTL8125B and RTL8125D, it doesn't require an additional check. > > The vendor driver for Linux works fine because it doesn't check the return > value of rtl8125_stop_all_request(). If it did, it would also fail. > > The patch below fixes the issue I mentioned. > > Tested: > rge0 at pci4 dev 0 function 0 "Realtek RTL8125" rev 0x00: msix, address 00:13:3b:xx:xx:xx > rge1 at pci6 dev 0 function 0 "Realtek RTL8125" rev 0x04: msix: RTL8125B, address 7c:b5:9b:xx:xx:xx > rge2 at pci7 dev 0 function 0 "Realtek RTL8125" rev 0x0c: msix: RTL8125D, address 34:5a:60:xx:xx:xx > > Index: sys/dev/pci/if_rge.c > =================================================================== > RCS file: /cvs/src/sys/dev/pci/if_rge.c,v > diff -u -p -u -p -r1.39 if_rge.c > --- sys/dev/pci/if_rge.c 27 Oct 2025 03:18:36 -0000 1.39 > +++ sys/dev/pci/if_rge.c 3 Nov 2025 01:06:55 -0000 > @@ -1528,19 +1528,7 @@ rge_reset(struct rge_softc *sc) > RGE_SETBIT_1(sc, RGE_PPSW, 0x08); > > RGE_SETBIT_1(sc, RGE_CMD, RGE_CMD_STOPREQ); > - if (sc->rge_type == MAC_R25) { > - for (i = 0; i < 20; i++) { > - DELAY(10); > - if (!(RGE_READ_1(sc, RGE_CMD) & RGE_CMD_STOPREQ)) > - break; > - } > - if (i == 20) { > - printf("%s: failed to stop all requests\n", > - sc->sc_dev.dv_xname); > - return ETIMEDOUT; > - } > - } else > - DELAY(200); > + DELAY(200); > > for (i = 0; i < 3000; i++) { > DELAY(50); > Hi Kevin,   Thanks very much for looking into this. Realtek doesn't make it easy with their semi-random chip numbering! I'll put the patch in early tomorrow. I expect no problems!   Geoff Steckel