[PATCH 1/1][SRU][T] UBUNTU: SAUCE: e1000/e1000e: add eeprom_bad_csum_allow module parameter

You-Sheng Yang vicamo.yang at canonical.com
Mon Mar 24 18:24:50 UTC 2025


From: Chris J Arges <chris.j.arges at canonical.com>

BugLink: http://bugs.launchpad.net/bugs/2102113

This patch adds the eeprom_bad_csum_allow module parameter for the
e1000 and e1000e drivers. This allows users of affected hardware
to bypass EEPROM/NVM checksum validation.
Based on a patch by Ben Collins <bcollins at ubuntu.com>

Signed-off-by: Chris J Arges <chris.j.arges at canonical.com>
Signed-off-by: You-Sheng Yang <vicamo.yang at canonical.com>
---
 drivers/net/ethernet/intel/e1000/e1000_main.c |  8 ++++++--
 drivers/net/ethernet/intel/e1000e/netdev.c    | 14 ++++++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index b655fe4f4c2e7..8d9b34838debd 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -194,6 +194,10 @@ module_param(copybreak, uint, 0644);
 MODULE_PARM_DESC(copybreak,
 	"Maximum size of packet that is copied to a new buffer on receive");
 
+static int eeprom_bad_csum_allow __read_mostly = 0;
+module_param(eeprom_bad_csum_allow, int, 0);
+MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad EEPROM checksums");
+
 static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
                      pci_channel_state_t state);
 static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev);
@@ -1096,8 +1100,8 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	e1000_reset_hw(hw);
 
-	/* make sure the EEPROM is good */
-	if (e1000_validate_eeprom_checksum(hw) < 0) {
+	/* make sure the EEPROM is good, skip if eeprom_bad_csum_allow is 1 */
+	if ((e1000_validate_eeprom_checksum(hw) < 0) && (!eeprom_bad_csum_allow)) {
 		e_err(probe, "The EEPROM Checksum Is Not Valid\n");
 		e1000_dump_eeprom(adapter);
 		/* set MAC address to all zeroes to invalidate and temporary
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index a205f8dd85fe5..35052425f5ed0 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -64,6 +64,10 @@ static int debug = -1;
 module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
 
+static int eeprom_bad_csum_allow __read_mostly = 0;
+module_param(eeprom_bad_csum_allow, int, 0);
+MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad EEPROM checksums");
+
 static const struct e1000_info *e1000_info_tbl[] = {
 	[board_82571]		= &e1000_82571_info,
 	[board_82572]		= &e1000_82572_info,
@@ -6725,8 +6729,14 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			break;
 		if (i == 2) {
 			dev_err(&pdev->dev, "The NVM Checksum Is Not Valid\n");
-			err = -EIO;
-			goto err_eeprom;
+
+			/* if we allow bad checksums, just break */
+			if (eeprom_bad_csum_allow) {
+				break;
+			} else {
+				err = -EIO;
+				goto err_eeprom;
+			}
 		}
 	}
 
-- 
2.48.1




More information about the kernel-team mailing list