aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/sfc/ethtool.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index eab3e5c61c7b..3aaece6b12cc 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -568,10 +568,13 @@ static int efx_ethtool_get_eeprom(struct net_device *net_dev,
568 size_t len; 568 size_t len;
569 int rc; 569 int rc;
570 570
571 mutex_lock(&efx->spi_lock); 571 rc = mutex_lock_interruptible(&efx->spi_lock);
572 if (rc)
573 return rc;
572 rc = falcon_spi_read(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START, 574 rc = falcon_spi_read(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
573 eeprom->len, &len, buf); 575 eeprom->len, &len, buf);
574 mutex_unlock(&efx->spi_lock); 576 mutex_unlock(&efx->spi_lock);
577
575 eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC; 578 eeprom->magic = EFX_ETHTOOL_EEPROM_MAGIC;
576 eeprom->len = len; 579 eeprom->len = len;
577 return rc; 580 return rc;
@@ -588,10 +591,13 @@ static int efx_ethtool_set_eeprom(struct net_device *net_dev,
588 if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC) 591 if (eeprom->magic != EFX_ETHTOOL_EEPROM_MAGIC)
589 return -EINVAL; 592 return -EINVAL;
590 593
591 mutex_lock(&efx->spi_lock); 594 rc = mutex_lock_interruptible(&efx->spi_lock);
595 if (rc)
596 return rc;
592 rc = falcon_spi_write(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START, 597 rc = falcon_spi_write(spi, eeprom->offset + EFX_EEPROM_BOOTCONFIG_START,
593 eeprom->len, &len, buf); 598 eeprom->len, &len, buf);
594 mutex_unlock(&efx->spi_lock); 599 mutex_unlock(&efx->spi_lock);
600
595 eeprom->len = len; 601 eeprom->len = len;
596 return rc; 602 return rc;
597} 603}