[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230406190208.7918c71e@kernel.org>
Date: Thu, 6 Apr 2023 19:02:08 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: linux@...linux.org.uk
Cc: Ivan Bornyakov <i.bornyakov@...rotek.ru>, netdev@...r.kernel.org,
andrew@...n.ch, hkallweit1@...il.com, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com,
linux-kernel@...r.kernel.org, system@...rotek.ru,
stable@...r.kernel.org
Subject: Re: [PATCH net] net: sfp: initialize sfp->i2c_block_size at sfp
allocation
On Wed, 5 Apr 2023 18:39:00 +0300 Ivan Bornyakov wrote:
> sfp->i2c_block_size is initialized at SFP module insertion in
> sfp_sm_mod_probe(). Because of that, if SFP module was not inserted
> since boot, ethtool -m leads to zero-length I2C read attempt.
>
> # ethtool -m xge0
> i2c i2c-3: adapter quirk: no zero length (addr 0x0050, size 0, read)
> Cannot get Module EEPROM data: Operation not supported
>
> If SFP module was plugged then removed at least once,
> sfp->i2c_block_size will be initialized and ethtool -m will fail with
> different error
>
> # ethtool -m xge0
> Cannot get Module EEPROM data: Remote I/O error
>
> Fix this by initializing sfp->i2_block_size at struct sfp allocation
> stage so ethtool -m with SFP module removed will fail the same way, i.e.
> -EREMOTEIO, in both cases and without errors from I2C adapter.
Hi Russell - yes / no / come back when both patches are ready?
Powered by blists - more mailing lists