From patchwork Tue Dec 11 21:45:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris J Arges X-Patchwork-Id: 205307 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id F00542C008E for ; Wed, 12 Dec 2012 08:45:20 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TiXdT-0005kW-Vk; Tue, 11 Dec 2012 21:45:08 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TiXdR-0005kO-IK for kernel-team@lists.ubuntu.com; Tue, 11 Dec 2012 21:45:05 +0000 Received: from cpe-70-124-70-187.austin.res.rr.com ([70.124.70.187] helo=[192.168.1.155]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1TiXdR-0003rm-Cj for kernel-team@lists.ubuntu.com; Tue, 11 Dec 2012 21:45:05 +0000 Message-ID: <50C7A95F.9050300@canonical.com> Date: Tue, 11 Dec 2012 15:45:03 -0600 From: Chris J Arges User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Ubuntu Kernel Team Subject: [raring][PATCH] UBUNTU: SAUCE: add eeprom_bad_csum_allow module parameter X-Enigmail-Version: 1.4.6 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.ubuntu.com/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 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. From 780d715a1f4c39bfafd2402b3cd1a7bc396d3acf Mon Sep 17 00:00:00 2001 From: Chris J Arges Date: Fri, 30 Nov 2012 13:29:01 -0600 Subject: [PATCH] UBUNTU: SAUCE: add eeprom_bad_csum_allow module parameter BugLink: http://bugs.ubuntu.com/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 Signed-off-by: Chris J Arges --- 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 222bfaf..0add694 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); @@ -1104,8 +1108,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 f444eb0..bda6e29 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[] = { @@ -6277,8 +6281,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.8.0