public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: sfp: return the number of written bytes for smbus single byte access
@ 2026-01-05 15:18 Maxime Chevallier
  2026-01-05 15:40 ` Andrew Lunn
  2026-01-07  1:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Maxime Chevallier @ 2026-01-05 15:18 UTC (permalink / raw)
  To: davem, Andrew Lunn, Jakub Kicinski, Eric Dumazet, Paolo Abeni,
	Russell King, Jonas Jelonek, Heiner Kallweit
  Cc: Maxime Chevallier, netdev, linux-kernel, thomas.petazzoni,
	Florian Fainelli, Köry Maincent, Simon Horman,
	Romain Gantois, Marek Behún

We expect the SFP write accessors to return the number of written bytes.
We fail to do so for single-byte smbus accesses, which may cause errors
when setting a module's high-power state and for some cotsworks modules.

Let's return the amount of written bytes, as expected.

Fixes: 7662abf4db94 ("net: phy: sfp: Add support for SMBus module access")
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/phy/sfp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 6166e9196364..84bef5099dda 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -765,7 +765,7 @@ static int sfp_smbus_byte_write(struct sfp *sfp, bool a2, u8 dev_addr,
 		dev_addr++;
 	}
 
-	return 0;
+	return data - (u8 *)buf;
 }
 
 static int sfp_i2c_configure(struct sfp *sfp, struct i2c_adapter *i2c)
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: sfp: return the number of written bytes for smbus single byte access
  2026-01-05 15:18 [PATCH net] net: sfp: return the number of written bytes for smbus single byte access Maxime Chevallier
@ 2026-01-05 15:40 ` Andrew Lunn
  2026-01-07  1:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2026-01-05 15:40 UTC (permalink / raw)
  To: Maxime Chevallier
  Cc: davem, Jakub Kicinski, Eric Dumazet, Paolo Abeni, Russell King,
	Jonas Jelonek, Heiner Kallweit, netdev, linux-kernel,
	thomas.petazzoni, Florian Fainelli, Köry Maincent,
	Simon Horman, Romain Gantois, Marek Behún

On Mon, Jan 05, 2026 at 04:18:39PM +0100, Maxime Chevallier wrote:
> We expect the SFP write accessors to return the number of written bytes.
> We fail to do so for single-byte smbus accesses, which may cause errors
> when setting a module's high-power state and for some cotsworks modules.
> 
> Let's return the amount of written bytes, as expected.
> 
> Fixes: 7662abf4db94 ("net: phy: sfp: Add support for SMBus module access")
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: sfp: return the number of written bytes for smbus single byte access
  2026-01-05 15:18 [PATCH net] net: sfp: return the number of written bytes for smbus single byte access Maxime Chevallier
  2026-01-05 15:40 ` Andrew Lunn
@ 2026-01-07  1:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-07  1:20 UTC (permalink / raw)
  To: Maxime Chevallier
  Cc: davem, andrew, kuba, edumazet, pabeni, linux, jelonek.jonas,
	hkallweit1, netdev, linux-kernel, thomas.petazzoni, f.fainelli,
	kory.maincent, horms, romain.gantois, kabel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  5 Jan 2026 16:18:39 +0100 you wrote:
> We expect the SFP write accessors to return the number of written bytes.
> We fail to do so for single-byte smbus accesses, which may cause errors
> when setting a module's high-power state and for some cotsworks modules.
> 
> Let's return the amount of written bytes, as expected.
> 
> Fixes: 7662abf4db94 ("net: phy: sfp: Add support for SMBus module access")
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> 
> [...]

Here is the summary with links:
  - [net] net: sfp: return the number of written bytes for smbus single byte access
    https://git.kernel.org/netdev/net/c/13ff3e724207

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-07  1:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 15:18 [PATCH net] net: sfp: return the number of written bytes for smbus single byte access Maxime Chevallier
2026-01-05 15:40 ` Andrew Lunn
2026-01-07  1:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox