Re: [PATCH] Add eeprom_bad_csum_allow module option to e1000.

From: Kok, Auke
Date: Tue Oct 23 2007 - 12:19:20 EST


Adam Jackson wrote:
> When the EEPROM gets corrupted, you can fix it with ethtool, but only if
> the module loads and creates a network device. But, without this option,
> if the EEPROM is corrupted, the driver will not create a network device.
>
> Signed-off-by: Adam Jackson <ajax@xxxxxxxxxx>


NAK

wrong list, not sent to me, and while for e100 I was OK with this patch, for e1000
it really does not make sense to 'just allow' a bad checksum - if your eeprom is
randomly messed up then you cannot just fix it like this anyway.

Auke



> ---
> drivers/net/e1000/e1000_main.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
> index f1ce348..b308c32 100644
> --- a/drivers/net/e1000/e1000_main.c
> +++ b/drivers/net/e1000/e1000_main.c
> @@ -255,6 +255,10 @@ static int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE;
> module_param(debug, int, 0);
> MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
>
> +static int eeprom_bad_csum_allow = 0;
> +module_param(eeprom_bad_csum_allow, int, 0);
> +MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad eeprom checksums");
> +
> /**
> * e1000_init_module - Driver Registration Routine
> *
> @@ -1012,7 +1016,8 @@ e1000_probe(struct pci_dev *pdev,
>
> if (e1000_validate_eeprom_checksum(&adapter->hw) < 0) {
> DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n");
> - goto err_eeprom;
> + if (!eeprom_bad_csum_allow)
> + goto err_eeprom;
> }
>
> /* copy the MAC address out of the EEPROM */
> @@ -1024,7 +1029,8 @@ e1000_probe(struct pci_dev *pdev,
>
> if (!is_valid_ether_addr(netdev->perm_addr)) {
> DPRINTK(PROBE, ERR, "Invalid MAC Address\n");
> - goto err_eeprom;
> + if (!eeprom_bad_csum_allow)
> + goto err_eeprom;
> }
>
> e1000_get_bus_info(&adapter->hw);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/