[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50530d02-ede9-4e59-bf97-5e3c9c8debe8@savoirfairelinux.com>
Date: Wed, 5 Jun 2024 09:53:56 +0200
From: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@...oirfairelinux.com>
To: Arun.Ramadoss@...rochip.com, netdev@...r.kernel.org
Cc: linux@...linux.org.uk, horms@...nel.org, Tristram.Ha@...rochip.com,
Woojung.Huh@...rochip.com, hkallweit1@...il.com,
UNGLinuxDriver@...rochip.com, andrew@...n.ch
Subject: Re: [PATCH net v5 4/4] net: dsa: microchip: monitor potential faults
in half-duplex mode
Hello,
On 05/06/2024 05:31, Arun.Ramadoss@...rochip.com wrote:
> Hi Enguerrand,
>
>
>>
>> +int ksz9477_errata_monitor(struct ksz_device *dev, int port,
>> + u64 tx_late_col)
>> +{
>> + u32 pmavbc;
>> + u8 status;
>> + u16 pqm;
>> + int ret;
>> +
>> + ret = ksz_pread8(dev, port, REG_PORT_STATUS_0, &status);
>> + if (ret)
>> + return ret;
>
> Blank line after return ret will increase readability.
>
>> + if (!((status & PORT_INTF_SPEED_MASK) ==
>> PORT_INTF_SPEED_MASK) &&
>
> Why this check is needed. Is it to check reserved value 11b.
>
Yes indeed, 11b would means that the port is not connected. So here I'm
isolating ports in half duplex which are properly up.
>
>> + !(status & PORT_INTF_FULL_DUPLEX)) {
>> + dev_warn_once(dev->dev,
>> + "Half-duplex detected on port %d,
>> transmission halt may occur\n",
>> + port);
>>
>>
--
Savoir-faire Linux
Enguerrand de Ribaucourt
Powered by blists - more mailing lists