public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 ethtool] cmis: Fix incorrect LSB field used for wavelength tolerance
@ 2026-03-21 15:39 Alok Tiwari
  2026-03-22  8:15 ` Danielle Ratson
  2026-03-23 22:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Alok Tiwari @ 2026-03-21 15:39 UTC (permalink / raw)
  To: danieller, kuba, netdev, mkubecek; +Cc: alok.a.tiwari, alok.a.tiwarilinux

The wavelength tolerance calculation mistakenly uses the nominal
wavelength LSB field (CMIS_NOM_WAVELENGTH_LSB) instead of the correct
tolerance LSB field (CMIS_WAVELENGTH_TOL_LSB). This causes incorrect
values to be reported for the "Laser wavelength tolerance".

Use CMIS_NOM_WAVELENGTH_LSB -> CMIS_WAVELENGTH_TOL_LSB.
correct 0.005 nm LSB scaling for the tolerance field (per CMIS)

Fixes: 3448a2f73e77 ("cmis: Add JSON output handling to --module-info in CMIS modules")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
v1 -> v2
change 0.05 -> 0.005
---
 cmis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmis.c b/cmis.c
index 305814c..996e9eb 100644
--- a/cmis.c
+++ b/cmis.c
@@ -276,7 +276,7 @@ static void cmis_show_mit_compliance(const struct cmis_memory_map *map)
 				       "nm");
 		module_print_any_float("Laser wavelength tolerance",
 				       (((map->page_01h[CMIS_WAVELENGTH_TOL_MSB] << 8) |
-				        map->page_01h[CMIS_NOM_WAVELENGTH_LSB]) * 0.05),
+				        map->page_01h[CMIS_WAVELENGTH_TOL_LSB]) * 0.005),
 				       "nm");
 	}
 }
-- 
2.50.1


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

end of thread, other threads:[~2026-03-23 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-21 15:39 [PATCH v2 ethtool] cmis: Fix incorrect LSB field used for wavelength tolerance Alok Tiwari
2026-03-22  8:15 ` Danielle Ratson
2026-03-23 22: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