[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <01ee01db0da1$2196ac60$64c40520$@trustnetic.com>
Date: Mon, 23 Sep 2024 18:12:44 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: "'Russell King \(Oracle\)'" <linux@...linux.org.uk>
Cc: <netdev@...r.kernel.org>
Subject: RE: Bug? xpcs-wx: read-modify-write to different registers?
> -----Original Message-----
> From: Russell King (Oracle) <linux@...linux.org.uk>
> Sent: Monday, September 23, 2024 5:18 PM
> To: Jiawen Wu <jiawenwu@...stnetic.com>
> Cc: netdev@...r.kernel.org
> Subject: Bug? xpcs-wx: read-modify-write to different registers?
>
> Hi,
>
> While making some cleanups to the XPCS driver, I spotted the following
> in pcs-xpcs-wx.c:
>
> val = txgbe_read_pma(xpcs, TXGBE_RX_GEN_CTL3);
> val = u16_replace_bits(val, 0x4, TXGBE_RX_GEN_CTL3_LOS_TRSHLD0);
> txgbe_write_pma(xpcs, TXGBE_RX_EQ_ATTN_CTL, val);
>
> This reads from the TXGBE_RX_GEN_CTL3 register, changes a value in a
> field, and then writes it back to a different register,
> TXGBE_RX_EQ_ATTN_CTL. This doesn't look correct.
>
> Please check whether this code is correct, if not please submit a fix.
>
> Thanks.
OMG, it's a real bug. Register TXGBE_RX_GEN_CTL3 should be written back.
Thanks Russell, I'll send a patch to fix it.
Powered by blists - more mailing lists