Patchwork [quantal,sru] UBUNTU: SAUCE: add eeprom_bad_csum_allow module parameter

login
register
mail settings
Submitter Chris J Arges
Date Dec. 12, 2012, 9:12 p.m.
Message ID <50C8F33F.4020309@canonical.com>
Download mbox | patch
Permalink /patch/205662/
State New
Headers show

Comments

Chris J Arges - Dec. 12, 2012, 9:12 p.m.
BugLink: http://bugs.launchpad.net/bugs/1070182

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@ubuntu.com>

This parameter was already present in the e100 driver already, this
SAUCE patch just adds this functionality for the e1000 and e1000e
drivers. This fixes cases where NVM checksum validation fails, yet the
hardware still functions correctly if we skip this. This patch has
already been verified in the bug.
Leann Ogasawara - Dec. 12, 2012, 9:32 p.m.
Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>

On 12/12/2012 01:12 PM, Chris J Arges wrote:
> BugLink: http://bugs.launchpad.net/bugs/1070182
>
> 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@ubuntu.com>
>
> This parameter was already present in the e100 driver already, this
> SAUCE patch just adds this functionality for the e1000 and e1000e
> drivers. This fixes cases where NVM checksum validation fails, yet the
> hardware still functions correctly if we skip this. This patch has
> already been verified in the bug.
>
>
>
>
Brad Figg - Dec. 12, 2012, 9:40 p.m.
On 12/12/2012 01:12 PM, Chris J Arges wrote:
> BugLink: http://bugs.launchpad.net/bugs/1070182
> 
> 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@ubuntu.com>
> 
> This parameter was already present in the e100 driver already, this
> SAUCE patch just adds this functionality for the e1000 and e1000e
> drivers. This fixes cases where NVM checksum validation fails, yet the
> hardware still functions correctly if we skip this. This patch has
> already been verified in the bug.
> 
> 
> 
>
Leann Ogasawara - Dec. 13, 2012, 2:11 p.m.
Applied to Quantal master-next.

Thanks,
Leann

On 12/12/2012 01:12 PM, Chris J Arges wrote:
> BugLink: http://bugs.launchpad.net/bugs/1070182
>
> 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@ubuntu.com>
>
> This parameter was already present in the e100 driver already, this
> SAUCE patch just adds this functionality for the e1000 and e1000e
> drivers. This fixes cases where NVM checksum validation fails, yet the
> hardware still functions correctly if we skip this. This patch has
> already been verified in the bug.
>
>
>
>

Patch

From 8f35240428d4d5a0dc208bfbf95bc18cc7cd55b8 Mon Sep 17 00:00:00 2001
From: Chris J Arges <chris.j.arges@canonical.com>
Date: Wed, 12 Dec 2012 14:16:52 -0600
Subject: [PATCH] UBUNTU: SAUCE: add eeprom_bad_csum_allow module parameter

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

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@ubuntu.com>

Signed-off-by: Chris J Arges <chris.j.arges@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 49406ed..3a81988 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -187,6 +187,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);
@@ -1106,8 +1110,8 @@  static int __devinit e1000_probe(struct pci_dev *pdev,
 
 	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);
 		/*
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 8e89867..21eb0d5 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -65,6 +65,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 void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
 
 static const struct e1000_info *e1000_info_tbl[] = {
@@ -6281,8 +6285,14 @@  static int __devinit e1000_probe(struct pci_dev *pdev,
 			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;
+			}
 		}
 	}
 
-- 
1.7.9.5