lkml.org 
[lkml]   [2019]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] igb: add parameter to ignore nvm checksum validation
    Date
    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
    \
     
     \ /
      Last update: 2019-05-09 01:22    [W:2.545 / U:0.328 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site