[PATCH rtems-libbsd 1/3] dev/mii: Handle PHY read timeouts

Chris Johns chrisj at rtems.org
Fri Jul 9 05:32:42 UTC 2021


On 9/7/21 3:28 pm, Sebastian Huber wrote:
> On 09/07/2021 03:14, Kinsey Moore wrote:
>> PHY read timeouts return 0xffffffff and bypass the current bad/no PHY
>> checks. This adds a check specifically for that read timeout to avoid
>> probing PHYs that don't exist.
>> ---
>>   freebsd/sys/dev/mii/mii.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/freebsd/sys/dev/mii/mii.c b/freebsd/sys/dev/mii/mii.c
>> index d0428f24..8f087cab 100644
>> --- a/freebsd/sys/dev/mii/mii.c
>> +++ b/freebsd/sys/dev/mii/mii.c
>> @@ -474,6 +474,7 @@ mii_attach(device_t dev, device_t *miibus, if_t ifp,
>>            */
>>           bmsr = MIIBUS_READREG(dev, ma.mii_phyno, MII_BMSR);
>>           if (bmsr == 0 || bmsr == 0xffff ||
>> +            bmsr == 0xffffffff ||
> 
> Could you please fix the driver so that it returns 0 or 0xffff in case of
> timeouts? This is the general MII module of FreeBSD. If you think there is a bug
> in this code, then please report it to FreeBSD first.

We should resolve the issue in the probe and not the attach call. Attach errors
are real errors, probe errors or failures are niche to the specifics of the
hardware.

Chris


More information about the devel mailing list