linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] igb: add parameter to ignore nvm checksum validation
@ 2019-05-08 23:14 Nikunj Kela
  2019-05-16 19:35 ` Jeff Kirsher
  0 siblings, 1 reply; 12+ messages in thread
From: Nikunj Kela @ 2019-05-08 23:14 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: xe-linux-external, David S. Miller, intel-wired-lan, netdev,
	linux-kernel

Some of the broken NICs don't have EEPROM programmed correctly. It results
in probe to fail. This change adds a module parameter that can be used to
ignore nvm checksum validation.

Cc: xe-linux-external@cisco.com
Signed-off-by: Nikunj Kela <nkela@cisco.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 39f33af..0ae1324 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -247,6 +247,11 @@ static int debug = -1;
 module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
 
+static bool ignore_nvm_checksum;
+module_param(ignore_nvm_checksum, bool, 0);
+MODULE_PARM_DESC(ignore_nvm_checksum,
+		"Set to ignore nvm checksum validation (defaults N)");
+
 struct igb_reg_info {
 	u32 ofs;
 	char *name;
@@ -3191,18 +3196,29 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	case e1000_i211:
 		if (igb_get_flash_presence_i210(hw)) {
 			if (hw->nvm.ops.validate(hw) < 0) {
-				dev_err(&pdev->dev,
+				if (ignore_nvm_checksum) {
+					dev_warn(&pdev->dev,
 					"The NVM Checksum Is Not Valid\n");
-				err = -EIO;
-				goto err_eeprom;
+				} else {
+					dev_err(&pdev->dev,
+					"The NVM Checksum Is Not Valid\n");
+					err = -EIO;
+					goto err_eeprom;
+				}
 			}
 		}
 		break;
 	default:
 		if (hw->nvm.ops.validate(hw) < 0) {
-			dev_err(&pdev->dev, "The NVM Checksum Is Not Valid\n");
-			err = -EIO;
-			goto err_eeprom;
+			if (ignore_nvm_checksum) {
+				dev_warn(&pdev->dev,
+					"The NVM Checksum Is Not Valid\n");
+			} else {
+				dev_err(&pdev->dev,
+					"The NVM Checksum Is Not Valid\n");
+				err = -EIO;
+				goto err_eeprom;
+			}
 		}
 		break;
 	}
-- 
2.5.0


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

end of thread, other threads:[~2019-05-17 18:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08 23:14 [PATCH] igb: add parameter to ignore nvm checksum validation Nikunj Kela
2019-05-16 19:35 ` Jeff Kirsher
2019-05-16 19:55   ` Nikunj Kela (nkela)
2019-05-16 22:02     ` Florian Fainelli
2019-05-16 22:33       ` Nikunj Kela (nkela)
2019-05-17  1:03       ` Daniel Walker
2019-05-17  1:48         ` Florian Fainelli
2019-05-17 15:16           ` [Intel-wired-lan] " Alexander Duyck
2019-05-17 16:36             ` Daniel Walker
2019-05-17 16:47               ` Florian Fainelli
2019-05-17 16:58               ` Alexander Duyck
2019-05-17 18:09                 ` Daniel Walker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).