sfc: Bug fixes and cleanup
Subsystems (2)
The following changes since commit c20ec76157747434652e721cdd4dccd8654ad370:
forcedeth: Use netdev_dbg for printk(KERN_DEBUG (2010-11-29 11:44:56 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next-2.6.git for-davem
Various bug fixes and cleanup. I'll post them all as replies to this message. Please pull.
Ben.
Ben Hutchings (15):
sfc: Reduce log level for MCDI error response in efx_mcdi_rpc()
sfc: Fix condition for no-op in set_phy_flash_cfg()
sfc: Distinguish critical and non-critical over-temperature conditions
sfc: Read-to-clear LM87 alarm/interrupt status at start of day
sfc: Clear RXIN_SEL when soft-resetting QT2025C
sfc: Remove broken automatic fallback for invalid Falcon chip/board config
sfc: Expose Falcon BootROM config through MTD, not ethtool
sfc: Remove unnecessary inclusion of various private header files
sfc: Move SPI state to struct falcon_nic_data
sfc: Move mdio_lock to struct falcon_nic_data
sfc: Move Falcon global event handling to falcon.c
sfc: Move xmac_poll_required into struct falcon_nic_data
sfc: Update kernel-doc to match earlier move of Toeplitz hash key
sfc: Use current MAC address, not NVRAM MAC address, for WoL filter
sfc: Store MAC address from NVRAM in net_device::perm_addr
Steve Hodgson (2):
sfc: Fix event based MCDI completion and MC REBOOT/CMDDONE ordering issue
sfc: When waking a stopped tx_queue, only lock that tx_queue
drivers/net/sfc/efx.c | 14 +-- drivers/net/sfc/ethtool.c | 60 ------------- drivers/net/sfc/falcon.c | 183 +++++++++++++++++++++----------------- drivers/net/sfc/falcon_boards.c | 120 ++++++++++++++++++------- drivers/net/sfc/falcon_xmac.c | 14 ++- drivers/net/sfc/mcdi.c | 3 +- drivers/net/sfc/mcdi_phy.c | 1 - drivers/net/sfc/mdio_10g.c | 1 - drivers/net/sfc/mtd.c | 98 ++++++++++++++------- drivers/net/sfc/net_driver.h | 17 +--- drivers/net/sfc/nic.c | 48 +--------- drivers/net/sfc/nic.h | 12 +++- drivers/net/sfc/qt202x_phy.c | 6 ++ drivers/net/sfc/siena.c | 10 +-- drivers/net/sfc/spi.h | 5 + drivers/net/sfc/tenxpress.c | 2 - drivers/net/sfc/tx.c | 8 ++- 17 files changed, 309 insertions(+), 293 deletions(-)
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 1/17 sfc: Reduce log level for MCDI error response in efx_mcdi_rpc()
Some errors are expected, e.g. when sending new commands to an MC running old firmware. Only the caller of efx_mcdi_rpc() can decide what is a real error. Therefore log the error responses with netif_dbg().
--- drivers/net/sfc/mcdi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/sfc/mcdi.c +1 -1
@@ -381,7 +381,7 @@ int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, -rc);efx_schedule_reset (efx,RESET_TYPE_MC_FAILURE ); }else -netif_err (efx, hw, efx->net_dev, +netif_dbg (efx, hw, efx->net_dev,"MC command 0x%x inlen %d failed rc=%d\n" , cmd, (int )inlen, -rc); }
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 01/17] sfc: Reduce log level for MCDI error response in efx_mcdi_rpc()
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:46:09 +0000
Quoted 6 lines
Some errors are expected, e.g. when sending new commands to an MC running old firmware. Only the caller of
efx_mcdi_rpc()can decide what is a real error. Therefore log the error responses withnetif_dbg().Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 2/17 sfc: Fix condition for no-op in set_phy_flash_cfg()
In reply to Ben Hutchings--- drivers/net/sfc/falcon_boards.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/sfc/falcon_boards.c +1 -1
@@ -325,7 +325,7 @@ static ssize_t set_phy_flash_cfg(struct device *dev, new_mode = old_mode & ~PHY_MODE_SPECIAL ; else new_mode =PHY_MODE_SPECIAL ; -if (old_mode == new_mode) { +if (!((old_mode ^ new_mode) &PHY_MODE_SPECIAL )) { err =0 ; }else if (efx->state !=STATE_RUNNING ||netif_running (efx->net_dev)) { err = -EBUSY ;
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 02/17] sfc: Fix condition for no-op in set_phy_flash_cfg()
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:46:14 +0000
Quoted 1 line
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 3/17 sfc: Distinguish critical and non-critical over-temperature conditions
In reply to Ben HutchingsSet both the 'maximum' and critical temperature limits for LM87 hardware monitors on Falcon boards. Do not shut down a port until the critical temperature is reached, but warn as soon as the 'maximum' temperature is reached.
--- drivers/net/sfc/falcon_boards.c | 109 ++++++++++++++++++++++++++++---------- 1 files changed, 80 insertions(+), 29 deletions(-)
drivers/net/sfc/falcon_boards.c +80 -29
@@ -30,17 +30,28 @@#define FALCON_BOARD_SFN4112F 0x52/* Board temperature is about 15°C above ambient when air flow is -* limited. */ +* limited. The maximum acceptable ambient temperature varies +* depending on the PHY specifications but the critical temperature +* above which we should shut down to avoid damage is 80°C. */ #define FALCON_BOARD_TEMP_BIAS 15 +#define FALCON_BOARD_TEMP_CRIT (80 + FALCON_BOARD_TEMP_BIAS)/* SFC4000 datasheet says: 'The maximum permitted junction temperature * is 125°C; the thermal design of the environment for the SFC4000 * should aim to keep this well below 100°C.' */ +#define FALCON_JUNC_TEMP_MIN 0#define FALCON_JUNC_TEMP_MAX 90 +#define FALCON_JUNC_TEMP_CRIT 125/***************************************************************************** * Support for LM87 sensor chip used on several boards */ +#define LM87_REG_TEMP_HW_INT_LOCK 0x13 +#define LM87_REG_TEMP_HW_EXT_LOCK 0x14 +#define LM87_REG_TEMP_HW_INT 0x17 +#define LM87_REG_TEMP_HW_EXT 0x18 +#define LM87_REG_TEMP_EXT1 0x26 +#define LM87_REG_TEMP_INT 0x27#define LM87_REG_ALARMS1 0x41#define LM87_REG_ALARMS2 0x42#define LM87_IN_LIMITS (nr, _min, _max) \
@@ -57,6 +68,27 @@#if defined(CONFIG_SENSORS_LM87 ) || defined(CONFIG_SENSORS_LM87_MODULE ) +static int efx_poke_lm87 (struct i2c_client *client,const u8 *reg_values) +{ +while (*reg_values) { +u8 reg = *reg_values++; +u8 value = *reg_values++; +int rc =i2c_smbus_write_byte_data (client, reg, value); +if (rc) +return rc; + } +return 0 ; +} + +static const u8 falcon_lm87_common_regs[] = { +LM87_REG_TEMP_HW_INT_LOCK ,FALCON_BOARD_TEMP_CRIT , +LM87_REG_TEMP_HW_INT ,FALCON_BOARD_TEMP_CRIT , +LM87_TEMP_EXT1_LIMITS (FALCON_JUNC_TEMP_MIN ,FALCON_JUNC_TEMP_MAX ), +LM87_REG_TEMP_HW_EXT_LOCK ,FALCON_JUNC_TEMP_CRIT , +LM87_REG_TEMP_HW_EXT ,FALCON_JUNC_TEMP_CRIT , +0 +}; +static int efx_init_lm87 (struct efx_nic *efx,struct i2c_board_info *info,const u8 *reg_values) {
@@ -67,13 +99,12 @@ static int efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info,if (!client)return -EIO ; -while (*reg_values) { -u8 reg = *reg_values++; -u8 value = *reg_values++; - rc =i2c_smbus_write_byte_data (client, reg, value); -if (rc) - goto err; - } + rc =efx_poke_lm87 (client, reg_values); +if (rc) + goto err; + rc =efx_poke_lm87 (client, falcon_lm87_common_regs); +if (rc) + goto err; board->hwmon_client = client;return 0 ;
@@ -91,36 +122,56 @@ static void efx_fini_lm87(struct efx_nic *efx)static int efx_check_lm87 (struct efx_nic *efx,unsigned mask) {struct i2c_client *client =falcon_board (efx)->hwmon_client; -s32 alarms1, alarms2; +bool temp_crit, elec_fault, is_failure; +u16 alarms; +s32 reg;/* If link is up then do not monitor temperature */ if (EFX_WORKAROUND_7884 (efx) && efx->link_state.up)return 0 ; - alarms1 =i2c_smbus_read_byte_data (client,LM87_REG_ALARMS1 ); - alarms2 =i2c_smbus_read_byte_data (client,LM87_REG_ALARMS2 ); -if (alarms1 <0 ) -return alarms1; -if (alarms2 <0 ) -return alarms2; - alarms1 &= mask; - alarms2 &= mask >>8 ; -if (alarms1 || alarms2) { + reg =i2c_smbus_read_byte_data (client,LM87_REG_ALARMS1 ); +if (reg <0 ) +return reg; + alarms = reg; + reg =i2c_smbus_read_byte_data (client,LM87_REG_ALARMS2 ); +if (reg <0 ) +return reg; + alarms |= reg <<8 ; + alarms &= mask; + + temp_crit = false; +if (alarms &LM87_ALARM_TEMP_INT ) { + reg =i2c_smbus_read_byte_data (client,LM87_REG_TEMP_INT ); +if (reg <0 ) +return reg; +if (reg >FALCON_BOARD_TEMP_CRIT ) + temp_crit = true; + } +if (alarms &LM87_ALARM_TEMP_EXT1 ) { + reg =i2c_smbus_read_byte_data (client,LM87_REG_TEMP_EXT1 ); +if (reg <0 ) +return reg; +if (reg >FALCON_JUNC_TEMP_CRIT ) + temp_crit = true; + } + elec_fault = alarms & ~(LM87_ALARM_TEMP_INT |LM87_ALARM_TEMP_EXT1 ); + is_failure = temp_crit || elec_fault; + +if (alarms)netif_err (efx, hw, efx->net_dev, -"LM87 detected a hardware failure (status %02x:%02x)" -"%s%s%s\n" , - alarms1, alarms2, - (alarms1 &LM87_ALARM_TEMP_INT ) ? +"LM87 detected a hardware %s (status %02x:%02x)" +"%s%s%s%s\n" , + is_failure ?"failure" :"problem" , + alarms &0xff , alarms >>8 , + (alarms &LM87_ALARM_TEMP_INT ) ?"; board is overheating" :"" , - (alarms1 &LM87_ALARM_TEMP_EXT1 ) ? + (alarms &LM87_ALARM_TEMP_EXT1 ) ?"; controller is overheating" :"" , - (alarms1 & ~(LM87_ALARM_TEMP_INT |LM87_ALARM_TEMP_EXT1 ) - || alarms2) ? -"; electrical fault" :"" ); -return -ERANGE ; - } + temp_crit ?"; reached critical temperature" :"" , + elec_fault ?"; electrical fault" :"" ); -return 0 ; +return is_failure ? -ERANGE :0 ; }#else /* !CONFIG_SENSORS_LM87 */
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 03/17] sfc: Distinguish critical and non-critical over-temperature conditions
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:46:24 +0000
Quoted 6 lines
Set both the 'maximum' and critical temperature limits for LM87 hardware monitors on Falcon boards. Do not shut down a port until the critical temperature is reached, but warn as soon as the 'maximum' temperature is reached.
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 4/17 sfc: Read-to-clear LM87 alarm/interrupt status at start of day
In reply to Ben HutchingsWe do not want to shut down the board based on a fault that has already been cleared.
--- drivers/net/sfc/falcon_boards.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/sfc/falcon_boards.c +4 -0
@@ -99,6 +99,10 @@ static int efx_init_lm87(struct efx_nic *efx, struct i2c_board_info *info,if (!client)return -EIO ; +/* Read-to-clear alarm/interrupt status */ +i2c_smbus_read_byte_data (client,LM87_REG_ALARMS1 ); +i2c_smbus_read_byte_data (client,LM87_REG_ALARMS2 ); + rc =efx_poke_lm87 (client, reg_values);if (rc) goto err;
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 04/17] sfc: Read-to-clear LM87 alarm/interrupt status at start of day
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:46:31 +0000
Quoted 4 lines
We do not want to shut down the board based on a fault that has already been cleared.
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 5/17 sfc: Clear RXIN_SEL when soft-resetting QT2025C
In reply to Ben HutchingsWhen we enable PMA/PMD loopback this automatically sets RXIN_SEL (inverse polarity for RXIN). We need to clear that bit during the soft-reset sequence, as it is not done automatically.
--- drivers/net/sfc/qt202x_phy.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/sfc/qt202x_phy.c +6 -0
@@ -41,6 +41,8 @@#define PCS_UC_STATUS_LBN 0#define PCS_UC_STATUS_WIDTH 8#define PCS_UC_STATUS_FW_SAVE 0x20 +#define PMA_PMD_MODE_REG 0xc301 +#define PMA_PMD_RXIN_SEL_LBN 6#define PMA_PMD_FTX_CTRL2_REG 0xc309#define PMA_PMD_FTX_STATIC_LBN 13#define PMA_PMD_VEND1_REG 0xc001
@@ -282,6 +284,10 @@ static int qt2025c_select_phy_mode(struct efx_nic *efx)* slow) reload of the firmware image (the microcontroller's code * memory is not affected by the microcontroller reset). */ efx_mdio_write (efx,1 ,0xc317 ,0x00ff ); +/* PMA/PMD loopback sets RXIN to inverse polarity and the firmware +* restart doesn't reset it. We need to do that ourselves. */ +efx_mdio_set_flag (efx,1 ,PMA_PMD_MODE_REG , +1 <<PMA_PMD_RXIN_SEL_LBN , false);efx_mdio_write (efx,1 ,0xc300 ,0x0002 );msleep (20 );
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 05/17] sfc: Clear RXIN_SEL when soft-resetting QT2025C
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:46:37 +0000
Quoted 5 lines
When we enable PMA/PMD loopback this automatically sets
RXIN_SEL(inverse polarity for RXIN). We need to clear that bit during the soft-reset sequence, as it is not done automatically.Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 6/17 sfc: Fix event based MCDI completion and MC REBOOT/CMDDONE ordering issue
In reply to Ben HutchingsFrom: Steve Hodgson <[email protected]>
The mcfw *never* sends CMDDONE when rebooting. Changing this so that it always sends CMDDONE *before* REBOOT is easy on Siena, but it's not obvious that we could guarantee to be able to implement this on future hardware.
Given this, I'm less convinced that the protocol should be changed.
To reiterate the failure mode: The driver sees this:
issue command
receive REBOOT event
Was that reboot event sent before the command was issued, or in response to the command? If the former then there will be a subsequent CMDDONE event, if the latter, then there will be no CMDDONE event.
Options to resolve this are:
1. REBOOT always completes an outstanding mcdi request, and we set the credits count to ignore a subsequent CMDDONE event with mismatching seqno.
2. REBOOT never completes an outstanding mcdi request. If there is no CMDDONE event then we rely on the mcdi timeout code to complete the outstanding request, incurring a 10s delay.
I'd argue that (2) is tidier, but that incurring a 10s delay is a little needless. Let's go with (1).
--- drivers/net/sfc/mcdi.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/sfc/mcdi.c +1 -0
@@ -463,6 +463,7 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc)if (mcdi->mode ==MCDI_MODE_EVENTS ) { mcdi->resprc = rc; mcdi->resplen =0 ; + ++mcdi->credits; } }else /* Nobody was waiting for an MCDI request, so trigger a reset */
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 06/17] sfc: Fix event based MCDI completion and MC REBOOT/CMDDONE ordering issue
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:46:55 +0000
Quoted 23 lines
From: Steve Hodgson <[email protected]>
The mcfw *never* sends CMDDONE when rebooting. Changing this so that it always sends CMDDONE *before* REBOOT is easy on Siena, but it's not obvious that we could guarantee to be able to implement this on future hardware.
Given this, I'm less convinced that the protocol should be changed.
To reiterate the failure mode: The driver sees this:
issue command
receive REBOOT eventWas that reboot event sent before the command was issued, or in response to the command? If the former then there will be a subsequent CMDDONE event, if the latter, then there will be no CMDDONE event.
Options to resolve this are:
1. REBOOT always completes an outstanding mcdi request, and we set the credits count to ignore a subsequent CMDDONE event with mismatching seqno.
Quoted 8 lines
2. REBOOT never completes an outstanding mcdi request. If there is no CMDDONE event then we rely on the mcdi timeout code to complete the outstanding request, incurring a 10s delay.
I'd argue that (2) is tidier, but that incurring a 10s delay is a little needless. Let's go with (1).
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 7/17 sfc: Remove broken automatic fallback for invalid Falcon chip/board config
In reply to Ben HutchingsIf the Falcon board config is invalid, we cannot proceed - we do not have a valid board type to pass to falcon_probe_board(), and if we kluge that to work with an unknown board then other initialisation code will crash.
--- drivers/net/sfc/falcon.c | 57 +++++++++++++++++++-------------------------- 1 files changed, 24 insertions(+), 33 deletions(-)
drivers/net/sfc/falcon.c +24 -33
@@ -1235,7 +1235,6 @@ static void falcon_remove_spi_devices(struct efx_nic *efx)static int falcon_probe_nvconfig (struct efx_nic *efx) {struct falcon_nvconfig *nvconfig; -int board_rev;int rc; nvconfig =kmalloc (sizeof (*nvconfig),GFP_KERNEL );
@@ -1243,37 +1242,25 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)return -ENOMEM ; rc =falcon_read_nvram (efx, nvconfig); -if (rc == -EINVAL ) { -netif_err (efx, probe, efx->net_dev, -"NVRAM is invalid therefore using defaults\n" ); - efx->phy_type =PHY_TYPE_NONE ; - efx->mdio.prtad =MDIO_PRTAD_NONE ; - board_rev =0 ; - rc =0 ; - }else if (rc) { +if (rc) goto fail1; - }else { -struct falcon_nvconfig_board_v2 *v2 = &nvconfig->board_v2; -struct falcon_nvconfig_board_v3 *v3 = &nvconfig->board_v3; - - efx->phy_type = v2->port0_phy_type; - efx->mdio.prtad = v2->port0_phy_addr; - board_rev =le16_to_cpu (v2->board_revision); - -if (le16_to_cpu (nvconfig->board_struct_ver) >=3 ) { - rc =falcon_spi_device_init ( - efx, &efx->spi_flash,FFE_AB_SPI_DEVICE_FLASH , -le32_to_cpu (v3->spi_device_type - [FFE_AB_SPI_DEVICE_FLASH ])); -if (rc) - goto fail2; - rc =falcon_spi_device_init ( - efx, &efx->spi_eeprom,FFE_AB_SPI_DEVICE_EEPROM , -le32_to_cpu (v3->spi_device_type - [FFE_AB_SPI_DEVICE_EEPROM ])); -if (rc) - goto fail2; - } + + efx->phy_type = nvconfig->board_v2.port0_phy_type; + efx->mdio.prtad = nvconfig->board_v2.port0_phy_addr; + +if (le16_to_cpu (nvconfig->board_struct_ver) >=3 ) { + rc =falcon_spi_device_init ( + efx, &efx->spi_flash,FFE_AB_SPI_DEVICE_FLASH , +le32_to_cpu (nvconfig->board_v3 + .spi_device_type[FFE_AB_SPI_DEVICE_FLASH ])); +if (rc) + goto fail2; + rc =falcon_spi_device_init ( + efx, &efx->spi_eeprom,FFE_AB_SPI_DEVICE_EEPROM , +le32_to_cpu (nvconfig->board_v3 + .spi_device_type[FFE_AB_SPI_DEVICE_EEPROM ])); +if (rc) + goto fail2; }/* Read the MAC addresses */
@@ -1282,7 +1269,8 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)netif_dbg (efx, probe, efx->net_dev,"PHY is %d phy_id %d\n" , efx->phy_type, efx->mdio.prtad); - rc =falcon_probe_board (efx, board_rev); + rc =falcon_probe_board (efx, +le16_to_cpu (nvconfig->board_v2.board_revision));if (rc) goto fail2;
@@ -1419,8 +1407,11 @@ static int falcon_probe_nic(struct efx_nic *efx)/* Read in the non-volatile configuration */ rc =falcon_probe_nvconfig (efx); -if (rc) +if (rc) { +if (rc == -EINVAL ) +netif_err (efx, probe, efx->net_dev,"NVRAM is invalid\n" ); goto fail5; + }/* Initialise I2C adapter */ board =falcon_board (efx);
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 07/17] sfc: Remove broken automatic fallback for invalid Falcon chip/board config
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:47:01 +0000
Quoted 6 lines
If the Falcon board config is invalid, we cannot proceed - we do not have a valid board type to pass to
falcon_probe_board(), and if we kluge that to work with an unknown board then other initialisation code will crash.Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 8/17 sfc: Expose Falcon BootROM config through MTD, not ethtool
In reply to Ben HutchingsThe ethtool EEPROM interface is really meant for exposing chip configuration, not BootROM configuration.
--- drivers/net/sfc/ethtool.c | 59 ---------------------------------- drivers/net/sfc/mtd.c | 77 +++++++++++++++++++++++++++++++------------- 2 files changed, 54 insertions(+), 82 deletions(-)
drivers/net/sfc/ethtool.c +0 -59
@@ -17,7 +17,6 @@#include "efx.h" #include "filter.h" #include "nic.h" -#include "spi.h" #include "mdio_10g.h" struct ethtool_string {
@@ -629,61 +628,6 @@ static u32 efx_ethtool_get_link(struct net_device *net_dev)return efx->link_state.up; } -static int efx_ethtool_get_eeprom_len (struct net_device *net_dev) -{ -struct efx_nic *efx =netdev_priv (net_dev); -struct efx_spi_device *spi = efx->spi_eeprom; - -if (!spi) -return 0 ; -return min (spi->size,EFX_EEPROM_BOOTCONFIG_END ) - -min (spi->size,EFX_EEPROM_BOOTCONFIG_START ); -} - -static int efx_ethtool_get_eeprom (struct net_device *net_dev, -struct ethtool_eeprom *eeprom,u8 *buf) -{ -struct efx_nic *efx =netdev_priv (net_dev); -struct efx_spi_device *spi = efx->spi_eeprom; -size_t len; -int rc; - - rc =mutex_lock_interruptible (&efx->spi_lock); -if (rc) -return rc; - rc =falcon_spi_read (efx, spi, - eeprom->offset +EFX_EEPROM_BOOTCONFIG_START , - eeprom->len, &len, buf); -mutex_unlock (&efx->spi_lock); - - eeprom->magic =EFX_ETHTOOL_EEPROM_MAGIC ; - eeprom->len = len; -return rc; -} - -static int efx_ethtool_set_eeprom (struct net_device *net_dev, -struct ethtool_eeprom *eeprom,u8 *buf) -{ -struct efx_nic *efx =netdev_priv (net_dev); -struct efx_spi_device *spi = efx->spi_eeprom; -size_t len; -int rc; - -if (eeprom->magic !=EFX_ETHTOOL_EEPROM_MAGIC ) -return -EINVAL ; - - rc =mutex_lock_interruptible (&efx->spi_lock); -if (rc) -return rc; - rc =falcon_spi_write (efx, spi, - eeprom->offset +EFX_EEPROM_BOOTCONFIG_START , - eeprom->len, &len, buf); -mutex_unlock (&efx->spi_lock); - - eeprom->len = len; -return rc; -} -static int efx_ethtool_get_coalesce (struct net_device *net_dev,struct ethtool_coalesce *coalesce) {
@@ -1116,9 +1060,6 @@ const struct ethtool_ops efx_ethtool_ops = { .set_msglevel = efx_ethtool_set_msglevel, .nway_reset = efx_ethtool_nway_reset, .get_link = efx_ethtool_get_link, - .get_eeprom_len = efx_ethtool_get_eeprom_len, - .get_eeprom = efx_ethtool_get_eeprom, - .set_eeprom = efx_ethtool_set_eeprom, .get_coalesce = efx_ethtool_get_coalesce, .set_coalesce = efx_ethtool_set_coalesce, .get_ringparam = efx_ethtool_get_ringparam,
drivers/net/sfc/mtd.c +54 -23
89 lines not on this page · raw message
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 08/17] sfc: Expose Falcon BootROM config through MTD, not ethtool
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:47:10 +0000
Quoted 4 lines
The ethtool EEPROM interface is really meant for exposing chip configuration, not BootROM configuration.
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 9/17 sfc: Remove unnecessary inclusion of various private header files
In reply to Ben Hutchings--- drivers/net/sfc/efx.c | 1 - drivers/net/sfc/ethtool.c | 1 - drivers/net/sfc/falcon.c | 1 - drivers/net/sfc/falcon_boards.c | 2 -- drivers/net/sfc/falcon_xmac.c | 1 - drivers/net/sfc/mcdi_phy.c | 1 - drivers/net/sfc/mdio_10g.c | 1 - drivers/net/sfc/tenxpress.c | 2 -- 8 files changed, 0 insertions(+), 10 deletions(-)
drivers/net/sfc/efx.c +0 -1
@@ -23,7 +23,6 @@#include <linux/gfp.h> #include "net_driver.h" #include "efx.h" -#include "mdio_10g.h" #include "nic.h" #include "mcdi.h"
drivers/net/sfc/ethtool.c +0 -1
@@ -17,7 +17,6 @@#include "efx.h" #include "filter.h" #include "nic.h" -#include "mdio_10g.h" struct ethtool_string {char name[ETH_GSTRING_LEN ];
drivers/net/sfc/falcon.c +0 -1
@@ -24,7 +24,6 @@#include "nic.h" #include "regs.h" #include "io.h" -#include "mdio_10g.h" #include "phy.h" #include "workarounds.h"
drivers/net/sfc/falcon_boards.c +0 -2
@@ -13,8 +13,6 @@#include "phy.h" #include "efx.h" #include "nic.h" -#include "regs.h" -#include "io.h" #include "workarounds.h" /* Macros for unpacking the board revision */
drivers/net/sfc/falcon_xmac.c +0 -1
@@ -16,7 +16,6 @@#include "io.h" #include "mac.h" #include "mdio_10g.h" -#include "phy.h" #include "workarounds.h" /**************************************************************************
drivers/net/sfc/mcdi_phy.c +0 -1
@@ -16,7 +16,6 @@#include "phy.h" #include "mcdi.h" #include "mcdi_pcol.h" -#include "mdio_10g.h" #include "nic.h" #include "selftest.h"
drivers/net/sfc/mdio_10g.c +0 -1
@@ -15,7 +15,6 @@#include "net_driver.h" #include "mdio_10g.h" #include "workarounds.h" -#include "nic.h" unsigned efx_mdio_id_oui (u32 id) {
drivers/net/sfc/tenxpress.c +0 -2
@@ -15,9 +15,7 @@#include "mdio_10g.h" #include "nic.h" #include "phy.h" -#include "regs.h" #include "workarounds.h" -#include "selftest.h" /* We expect these MMDs to be in the package. */ #define TENXPRESS_REQUIRED_DEVS (MDIO_DEVS_PMAPMD | \
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 09/17] sfc: Remove unnecessary inclusion of various private header files
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:47:17 +0000
Quoted 1 line
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 10/17 sfc: Move SPI state to struct falcon_nic_data
In reply to Ben HutchingsWe only have direct access to SPI on Falcon, so move all this state out of struct efx_nic.
--- drivers/net/sfc/efx.c | 4 -- drivers/net/sfc/falcon.c | 91 ++++++++++++++++++----------------------- drivers/net/sfc/mtd.c | 29 ++++++++------ drivers/net/sfc/net_driver.h | 8 ---- drivers/net/sfc/nic.h | 7 +++ drivers/net/sfc/spi.h | 5 ++ 6 files changed, 69 insertions(+), 75 deletions(-)
drivers/net/sfc/efx.c +0 -4
@@ -1961,7 +1961,6 @@ void efx_reset_down(struct efx_nic *efx, enum reset_type method)efx_stop_all (efx);mutex_lock (&efx->mac_lock); -mutex_lock (&efx->spi_lock);efx_fini_channels (efx);if (efx->port_initialized && method !=RESET_TYPE_INVISIBLE )
@@ -2003,7 +2002,6 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)efx_init_channels (efx);efx_restore_filters (efx); -mutex_unlock (&efx->spi_lock);mutex_unlock (&efx->mac_lock);efx_start_all (efx);
@@ -2013,7 +2011,6 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok) fail: efx->port_initialized = false; -mutex_unlock (&efx->spi_lock);mutex_unlock (&efx->mac_lock);return rc;
@@ -2202,7 +2199,6 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,memset (efx,0 ,sizeof (*efx));spin_lock_init (&efx->biu_lock);mutex_init (&efx->mdio_lock); -mutex_init (&efx->spi_lock);#ifdef CONFIG_SFC_MTD INIT_LIST_HEAD (&efx->mtd_list);#endif
drivers/net/sfc/falcon.c +40 -51
208 lines not on this page · raw message
drivers/net/sfc/mtd.c +17 -12
@@ -321,14 +321,15 @@ static int falcon_mtd_read(struct mtd_info *mtd, loff_t start,struct efx_mtd *efx_mtd = mtd->priv;const struct efx_spi_device *spi = efx_mtd->spi;struct efx_nic *efx = efx_mtd->efx; +struct falcon_nic_data *nic_data = efx->nic_data;int rc; - rc =mutex_lock_interruptible (&efx->spi_lock); + rc =mutex_lock_interruptible (&nic_data->spi_lock);if (rc)return rc; rc =falcon_spi_read (efx, spi, part->offset + start, len, retlen, buffer); -mutex_unlock (&efx->spi_lock); +mutex_unlock (&nic_data->spi_lock);return rc; }
@@ -337,13 +338,14 @@ static int falcon_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len)struct efx_mtd_partition *part =to_efx_mtd_partition (mtd);struct efx_mtd *efx_mtd = mtd->priv;struct efx_nic *efx = efx_mtd->efx; +struct falcon_nic_data *nic_data = efx->nic_data;int rc; - rc =mutex_lock_interruptible (&efx->spi_lock); + rc =mutex_lock_interruptible (&nic_data->spi_lock);if (rc)return rc; rc =efx_spi_erase (part, part->offset + start, len); -mutex_unlock (&efx->spi_lock); +mutex_unlock (&nic_data->spi_lock);return rc; }
@@ -354,14 +356,15 @@ static int falcon_mtd_write(struct mtd_info *mtd, loff_t start,struct efx_mtd *efx_mtd = mtd->priv;const struct efx_spi_device *spi = efx_mtd->spi;struct efx_nic *efx = efx_mtd->efx; +struct falcon_nic_data *nic_data = efx->nic_data;int rc; - rc =mutex_lock_interruptible (&efx->spi_lock); + rc =mutex_lock_interruptible (&nic_data->spi_lock);if (rc)return rc; rc =falcon_spi_write (efx, spi, part->offset + start, len, retlen, buffer); -mutex_unlock (&efx->spi_lock); +mutex_unlock (&nic_data->spi_lock);return rc; }
@@ -370,11 +373,12 @@ static int falcon_mtd_sync(struct mtd_info *mtd)struct efx_mtd_partition *part =to_efx_mtd_partition (mtd);struct efx_mtd *efx_mtd = mtd->priv;struct efx_nic *efx = efx_mtd->efx; +struct falcon_nic_data *nic_data = efx->nic_data;int rc; -mutex_lock (&efx->spi_lock); +mutex_lock (&nic_data->spi_lock); rc =efx_spi_slow_wait (part, true); -mutex_unlock (&efx->spi_lock); +mutex_unlock (&nic_data->spi_lock);return rc; }
@@ -387,14 +391,15 @@ static struct efx_mtd_ops falcon_mtd_ops = {static int falcon_mtd_probe (struct efx_nic *efx) { +struct falcon_nic_data *nic_data = efx->nic_data;struct efx_spi_device *spi;struct efx_mtd *efx_mtd;int rc = -ENODEV ;ASSERT_RTNL (); - spi = efx->spi_flash; -if (spi && spi->size >FALCON_FLASH_BOOTCODE_START ) { + spi = &nic_data->spi_flash; +if (efx_spi_present (spi) && spi->size >FALCON_FLASH_BOOTCODE_START ) { efx_mtd =kzalloc (sizeof (*efx_mtd) +sizeof (efx_mtd->part[0 ]),GFP_KERNEL );if (!efx_mtd)
@@ -419,8 +424,8 @@ static int falcon_mtd_probe(struct efx_nic *efx) } } - spi = efx->spi_eeprom; -if (spi && spi->size >EFX_EEPROM_BOOTCONFIG_START ) { + spi = &nic_data->spi_eeprom; +if (efx_spi_present (spi) && spi->size >EFX_EEPROM_BOOTCONFIG_START ) { efx_mtd =kzalloc (sizeof (*efx_mtd) +sizeof (efx_mtd->part[0 ]),GFP_KERNEL );if (!efx_mtd)
drivers/net/sfc/net_driver.h +0 -8
@@ -657,11 +657,6 @@ struct efx_filter_state;* to verify that an interrupt has occurred. * @irq_zero_count: Number of legacy IRQs seen with queue flags == 0 * @fatal_irq_level: IRQ level (bit number) used for serious errors -* @spi_flash: SPI flash device -* This field will be %NULL if no flash device is present (or for Siena). -* @spi_eeprom: SPI EEPROM device -* This field will be %NULL if no EEPROM device is present (or for Siena). -* @spi_lock: SPI bus lock * @mtd_list: List of MTDs attached to the NIC * @n_rx_nodesc_drop_cnt: RX no descriptor drop count * @nic_data: Hardware dependant state
@@ -746,9 +741,6 @@ struct efx_nic {unsigned irq_zero_count;unsigned fatal_irq_level; -struct efx_spi_device *spi_flash; -struct efx_spi_device *spi_eeprom; -struct mutex spi_lock;#ifdef CONFIG_SFC_MTD struct list_head mtd_list;#endif
drivers/net/sfc/nic.h +7 -0
@@ -15,6 +15,7 @@#include "net_driver.h" #include "efx.h" #include "mcdi.h" +#include "spi.h" /* * Falcon hardware control
@@ -113,6 +114,9 @@ struct falcon_board {* @stats_pending: Is there a pending DMA of MAC statistics. * @stats_timer: A timer for regularly fetching MAC statistics. * @stats_dma_done: Pointer to the flag which indicates DMA completion. +* @spi_flash: SPI flash device +* @spi_eeprom: SPI EEPROM device +* @spi_lock: SPI bus lock */ struct falcon_nic_data {struct pci_dev *pci_dev2;
@@ -121,6 +125,9 @@ struct falcon_nic_data {bool stats_pending;struct timer_list stats_timer;u32 *stats_dma_done; +struct efx_spi_device spi_flash; +struct efx_spi_device spi_eeprom; +struct mutex spi_lock; };static inline struct falcon_board *falcon_board (struct efx_nic *efx)
drivers/net/sfc/spi.h +5 -0
@@ -61,6 +61,11 @@ struct efx_spi_device {unsigned int block_size; }; +static inline bool efx_spi_present (const struct efx_spi_device *spi) +{ +return spi->size !=0 ; +} +int falcon_spi_cmd (struct efx_nic *efx,const struct efx_spi_device *spi,unsigned int command,int address,const void * in,void *out,size_t len);
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 10/17] sfc: Move SPI state to struct falcon_nic_data
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:47:29 +0000
Quoted 4 lines
We only have direct access to SPI on Falcon, so move all this state out of struct
efx_nic.Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 11/17 sfc: Move mdio_lock to struct falcon_nic_data
In reply to Ben HutchingsWe only have direct access to MDIO on Falcon, so move this out of struct efx_nic.
--- drivers/net/sfc/efx.c | 1 - drivers/net/sfc/falcon.c | 11 +++++++---- drivers/net/sfc/net_driver.h | 2 -- drivers/net/sfc/nic.h | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-)
drivers/net/sfc/efx.c +0 -1
@@ -2198,7 +2198,6 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,/* Initialise common structures */ memset (efx,0 ,sizeof (*efx));spin_lock_init (&efx->biu_lock); -mutex_init (&efx->mdio_lock);#ifdef CONFIG_SFC_MTD INIT_LIST_HEAD (&efx->mtd_list);#endif
drivers/net/sfc/falcon.c +7 -4
@@ -717,6 +717,7 @@ static int falcon_mdio_write(struct net_device *net_dev, int prtad, int devad, u16 addr, u16 value) { struct efx_nic *efx = netdev_priv(net_dev); +struct falcon_nic_data *nic_data = efx->nic_data;efx_oword_t reg;int rc;
@@ -724,7 +725,7 @@ static int falcon_mdio_write(struct net_device *net_dev,"writing MDIO %d register %d.%d with 0x%04x\n" , prtad, devad, addr, value); -mutex_lock (&efx->mdio_lock); +mutex_lock (&nic_data->mdio_lock);/* Check MDIO not currently being accessed */ rc =falcon_gmii_wait (efx);
@@ -760,7 +761,7 @@ static int falcon_mdio_write(struct net_device *net_dev, } out: -mutex_unlock (&efx->mdio_lock); +mutex_unlock (&nic_data->mdio_lock);return rc; }
@@ -769,10 +770,11 @@ static int falcon_mdio_read(struct net_device *net_dev, int prtad, int devad, u16 addr) { struct efx_nic *efx = netdev_priv(net_dev); +struct falcon_nic_data *nic_data = efx->nic_data;efx_oword_t reg;int rc; -mutex_lock (&efx->mdio_lock); +mutex_lock (&nic_data->mdio_lock);/* Check MDIO not currently being accessed */ rc =falcon_gmii_wait (efx);
@@ -811,7 +813,7 @@ static int falcon_mdio_read(struct net_device *net_dev, } out: -mutex_unlock (&efx->mdio_lock); +mutex_unlock (&nic_data->mdio_lock);return rc; }
@@ -839,6 +841,7 @@ static int falcon_probe_port(struct efx_nic *efx) }/* Fill out MDIO structure and loopback modes */ +mutex_init (&nic_data->mdio_lock); efx->mdio.mdio_read = falcon_mdio_read; efx->mdio.mdio_write = falcon_mdio_write; rc = efx->phy_op->probe (efx);
drivers/net/sfc/net_driver.h +0 -2
@@ -679,7 +679,6 @@ struct efx_filter_state;* @mac_op: MAC interface * @mac_address: Permanent MAC address * @phy_type: PHY type -* @mdio_lock: MDIO lock * @phy_op: PHY interface * @phy_data: PHY private data (including PHY-specific stats) * @mdio: PHY MDIO interface
@@ -766,7 +765,6 @@ struct efx_nic {unsigned char mac_address[ETH_ALEN ];unsigned int phy_type; -struct mutex mdio_lock;struct efx_phy_operations *phy_op;void *phy_data;struct mdio_if_info mdio;
drivers/net/sfc/nic.h +2 -0
@@ -117,6 +117,7 @@ struct falcon_board {* @spi_flash: SPI flash device * @spi_eeprom: SPI EEPROM device * @spi_lock: SPI bus lock +* @mdio_lock: MDIO bus lock */ struct falcon_nic_data {struct pci_dev *pci_dev2;
@@ -128,6 +129,7 @@ struct falcon_nic_data {struct efx_spi_device spi_flash;struct efx_spi_device spi_eeprom;struct mutex spi_lock; +struct mutex mdio_lock; };static inline struct falcon_board *falcon_board (struct efx_nic *efx)
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 11/17] sfc: Move mdio_lock to struct falcon_nic_data
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:47:35 +0000
Quoted 4 lines
We only have direct access to MDIO on Falcon, so move this out of struct
efx_nic.Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 12/17 sfc: Move Falcon global event handling to falcon.c
In reply to Ben Hutchings--- drivers/net/sfc/falcon.c | 36 +++++++++++++++++++++++++++++++ drivers/net/sfc/net_driver.h | 2 + drivers/net/sfc/nic.c | 48 ++++------------------------------------- 3 files changed, 43 insertions(+), 43 deletions(-)
drivers/net/sfc/falcon.c +36 -0
@@ -881,6 +881,40 @@ static void falcon_remove_port(struct efx_nic *efx)efx_nic_free_buffer (efx, &efx->stats_buffer); } +/* Global events are basically PHY events */ +static bool +falcon_handle_global_event (struct efx_channel *channel,efx_qword_t *event) +{ +struct efx_nic *efx = channel->efx; + +if (EFX_QWORD_FIELD (*event,FSF_AB_GLB_EV_G_PHY0_INTR ) || +EFX_QWORD_FIELD (*event,FSF_AB_GLB_EV_XG_PHY0_INTR ) || +EFX_QWORD_FIELD (*event,FSF_AB_GLB_EV_XFP_PHY0_INTR )) +/* Ignored */ +return true; + +if ((efx_nic_rev (efx) ==EFX_REV_FALCON_B0 ) && +EFX_QWORD_FIELD (*event,FSF_BB_GLB_EV_XG_MGT_INTR )) { + efx->xmac_poll_required = true; +return true; + } + +if (efx_nic_rev (efx) <=EFX_REV_FALCON_A1 ? +EFX_QWORD_FIELD (*event,FSF_AA_GLB_EV_RX_RECOVERY ) : +EFX_QWORD_FIELD (*event,FSF_BB_GLB_EV_RX_RECOVERY )) { +netif_err (efx, rx_err, efx->net_dev, +"channel %d seen global RX_RESET event. Resetting.\n" , + channel->channel); + +atomic_inc (&efx->rx_reset); +efx_schedule_reset (efx,EFX_WORKAROUND_6555 (efx) ? +RESET_TYPE_RX_RECOVERY :RESET_TYPE_DISABLE ); +return true; + } + +return false; +} +/************************************************************************** * * Falcon test code
@@ -1702,6 +1736,7 @@ struct efx_nic_type falcon_a1_nic_type = { .reset = falcon_reset_hw, .probe_port = falcon_probe_port, .remove_port = falcon_remove_port, + .handle_global_event = falcon_handle_global_event, .prepare_flush = falcon_prepare_flush, .update_stats = falcon_update_nic_stats, .start_stats = falcon_start_nic_stats,
@@ -1742,6 +1777,7 @@ struct efx_nic_type falcon_b0_nic_type = { .reset = falcon_reset_hw, .probe_port = falcon_probe_port, .remove_port = falcon_remove_port, + .handle_global_event = falcon_handle_global_event, .prepare_flush = falcon_prepare_flush, .update_stats = falcon_update_nic_stats, .start_stats = falcon_start_nic_stats,
drivers/net/sfc/net_driver.h +2 -0
@@ -819,6 +819,7 @@ static inline unsigned int efx_port_num(struct efx_nic *efx)* be called while the controller is uninitialised. * @probe_port: Probe the MAC and PHY * @remove_port: Free resources allocated by probe_port() +* @handle_global_event: Handle a "global" event (may be %NULL) * @prepare_flush: Prepare the hardware for flushing the DMA queues * @update_stats: Update statistics not provided by event handling * @start_stats: Start the regular fetching of statistics
@@ -863,6 +864,7 @@ struct efx_nic_type {int (*reset)(struct efx_nic *efx,enum reset_type method);int (*probe_port)(struct efx_nic *efx);void (*remove_port)(struct efx_nic *efx); +bool (*handle_global_event)(struct efx_channel *channel,efx_qword_t *);void (*prepare_flush)(struct efx_nic *efx);void (*update_stats)(struct efx_nic *efx);void (*start_stats)(struct efx_nic *efx);
drivers/net/sfc/nic.c +5 -43
66 lines not on this page · raw message
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 12/17] sfc: Move Falcon global event handling to falcon.c
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:47:45 +0000
Quoted 1 line
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 13/17 sfc: Move xmac_poll_required into struct falcon_nic_data
In reply to Ben Hutchings--- drivers/net/sfc/falcon.c | 3 ++- drivers/net/sfc/falcon_boards.c | 3 ++- drivers/net/sfc/falcon_xmac.c | 13 +++++++++---- drivers/net/sfc/net_driver.h | 2 -- drivers/net/sfc/nic.h | 2 ++ 5 files changed, 15 insertions(+), 8 deletions(-)
drivers/net/sfc/falcon.c +2 -1
@@ -886,6 +886,7 @@ static bool falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event) { struct efx_nic *efx = channel->efx; +struct falcon_nic_data *nic_data = efx->nic_data; if (EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_G_PHY0_INTR) || EFX_QWORD_FIELD(*event, FSF_AB_GLB_EV_XG_PHY0_INTR) ||
@@ -895,7 +896,7 @@ falcon_handle_global_event(struct efx_channel *channel, efx_qword_t *event)if ((efx_nic_rev (efx) ==EFX_REV_FALCON_B0 ) &&EFX_QWORD_FIELD (*event,FSF_BB_GLB_EV_XG_MGT_INTR )) { - efx->xmac_poll_required = true; + nic_data->xmac_poll_required = true;return true; }
drivers/net/sfc/falcon_boards.c +2 -1
@@ -415,10 +415,11 @@ static void sfe4001_fini(struct efx_nic *efx)static int sfe4001_check_hw (struct efx_nic *efx) { +struct falcon_nic_data *nic_data = efx->nic_data;s32 status;/* If XAUI link is up then do not monitor */ -if (EFX_WORKAROUND_7884 (efx) && !efx->xmac_poll_required) +if (EFX_WORKAROUND_7884 (efx) && !nic_data->xmac_poll_required)return 0 ;/* Check the powered status of the PHY. Lack of power implies that
drivers/net/sfc/falcon_xmac.c +9 -4
@@ -87,6 +87,7 @@ int falcon_reset_xaui(struct efx_nic *efx)static void falcon_ack_status_intr (struct efx_nic *efx) { +struct falcon_nic_data *nic_data = efx->nic_data;efx_oword_t reg;if ((efx_nic_rev (efx) !=EFX_REV_FALCON_B0 ) ||LOOPBACK_INTERNAL (efx))
@@ -98,7 +99,7 @@ static void falcon_ack_status_intr(struct efx_nic *efx)/* We can only use this interrupt to signal the negative edge of * xaui_align [we have to poll the positive edge]. */ -if (efx->xmac_poll_required) +if (nic_data->xmac_poll_required)return ;efx_reado (efx, ®,FR_AB_XM_MGT_INT_MSK );
@@ -276,12 +277,14 @@ static bool falcon_xmac_check_fault(struct efx_nic *efx)static int falcon_reconfigure_xmac (struct efx_nic *efx) { +struct falcon_nic_data *nic_data = efx->nic_data; +falcon_reconfigure_xgxs_core (efx);falcon_reconfigure_xmac_core (efx);falcon_reconfigure_mac_wrapper (efx); - efx->xmac_poll_required = !falcon_xmac_link_ok_retry (efx,5 ); + nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry (efx,5 );falcon_ack_status_intr (efx);return 0 ;
@@ -349,11 +352,13 @@ static void falcon_update_stats_xmac(struct efx_nic *efx)void falcon_poll_xmac (struct efx_nic *efx) { +struct falcon_nic_data *nic_data = efx->nic_data; +if (!EFX_WORKAROUND_5147 (efx) || !efx->link_state.up || - !efx->xmac_poll_required) + !nic_data->xmac_poll_required)return ; - efx->xmac_poll_required = !falcon_xmac_link_ok_retry (efx,1 ); + nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry (efx,1 );falcon_ack_status_intr (efx); }
drivers/net/sfc/net_driver.h +0 -2
@@ -684,7 +684,6 @@ struct efx_filter_state;* @mdio: PHY MDIO interface * @mdio_bus: PHY MDIO bus ID (only used by Siena) * @phy_mode: PHY operating mode. Serialised by @mac_lock. -* @xmac_poll_required: XMAC link state needs polling * @link_advertising: Autonegotiation advertising flags * @link_state: Current state of the link * @n_link_state_changes: Number of times the link has changed state
@@ -771,7 +770,6 @@ struct efx_nic {unsigned int mdio_bus;enum efx_phy_mode phy_mode; -bool xmac_poll_required;u32 link_advertising;struct efx_link_state link_state;unsigned int n_link_state_changes;
drivers/net/sfc/nic.h +2 -0
@@ -118,6 +118,7 @@ struct falcon_board {* @spi_eeprom: SPI EEPROM device * @spi_lock: SPI bus lock * @mdio_lock: MDIO bus lock +* @xmac_poll_required: XMAC link state needs polling */ struct falcon_nic_data {struct pci_dev *pci_dev2;
@@ -130,6 +131,7 @@ struct falcon_nic_data {struct efx_spi_device spi_eeprom;struct mutex spi_lock;struct mutex mdio_lock; +bool xmac_poll_required; };static inline struct falcon_board *falcon_board (struct efx_nic *efx)
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 13/17] sfc: Move xmac_poll_required into struct falcon_nic_data
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:47:51 +0000
Quoted 1 line
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 14/17 sfc: Update kernel-doc to match earlier move of Toeplitz hash key
In reply to Ben Hutchings--- drivers/net/sfc/net_driver.h | 1 + drivers/net/sfc/nic.h | 1 - 2 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/sfc/net_driver.h +1 -0
@@ -647,6 +647,7 @@ struct efx_filter_state;* @n_tx_channels: Number of channels used for TX * @rx_buffer_len: RX buffer length * @rx_buffer_order: Order (log2) of number of pages for each RX buffer +* @rx_hash_key: Toeplitz hash key for RSS * @rx_indir_table: Indirection table for RSS * @int_error_count: Number of internal errors seen recently * @int_error_expire: Time at which error count will be expired
drivers/net/sfc/nic.h +0 -1
@@ -146,7 +146,6 @@ static inline struct falcon_board *falcon_board(struct efx_nic *efx)* @fw_build: Firmware build number * @mcdi: Management-Controller-to-Driver Interface * @wol_filter_id: Wake-on-LAN packet filter id -* @ipv6_rss_key: Toeplitz hash key for IPv6 RSS */ struct siena_nic_data {u64 fw_version;
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 14/17] sfc: Update kernel-doc to match earlier move of Toeplitz hash key
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:47:56 +0000
Quoted 1 line
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 15/17 sfc: When waking a stopped tx_queue, only lock that tx_queue
In reply to Ben HutchingsFrom: Steve Hodgson <[email protected]>
--- drivers/net/sfc/tx.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/sfc/tx.c +6 -2
@@ -401,6 +401,7 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index) {unsigned fill_level;struct efx_nic *efx = tx_queue->efx; +struct netdev_queue *queue;EFX_BUG_ON_PARANOID (index > tx_queue->ptr_mask);
@@ -417,12 +418,15 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)/* Do this under netif_tx_lock(), to avoid racing * with efx_xmit(). */ -netif_tx_lock (efx->net_dev); + queue =netdev_get_tx_queue ( + efx->net_dev, + tx_queue->queue /EFX_TXQ_TYPES ); +__netif_tx_lock (queue,smp_processor_id ());if (tx_queue->stopped) { tx_queue->stopped =0 ;efx_wake_queue (tx_queue->channel); } -netif_tx_unlock (efx->net_dev); +__netif_tx_unlock (queue); } } }
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 15/17] sfc: When waking a stopped tx_queue, only lock that tx_queue
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:48:14 +0000
Quoted 3 lines
From: Steve Hodgson <[email protected]>
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 16/17 sfc: Use current MAC address, not NVRAM MAC address, for WoL filter
In reply to Ben Hutchings--- drivers/net/sfc/siena.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/sfc/siena.c +1 -1
@@ -562,7 +562,7 @@ static int siena_set_wol(struct efx_nic *efx, u32 type)if (nic_data->wol_filter_id !=-1 )efx_mcdi_wol_filter_remove (efx, nic_data->wol_filter_id); - rc =efx_mcdi_wol_filter_set_magic (efx, efx->mac_address, + rc =efx_mcdi_wol_filter_set_magic (efx, efx->net_dev->dev_addr, &nic_data->wol_filter_id);if (rc) goto fail;
Signature · 8 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 16/17] sfc: Use current MAC address, not NVRAM MAC address, for WoL filter
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:48:20 +0000
Quoted 1 line
Signed-off-by Ben Hutchings <[email protected]>
Applied.
PATCH 17/17 sfc: Store MAC address from NVRAM in net_device::perm_addr
In reply to Ben HutchingsFor some reason we failed to make this change when perm_addr was introduced.
--- drivers/net/sfc/efx.c | 8 +++++--- drivers/net/sfc/falcon.c | 2 +- drivers/net/sfc/net_driver.h | 2 -- drivers/net/sfc/siena.c | 8 +------- 4 files changed, 7 insertions(+), 13 deletions(-)
drivers/net/sfc/efx.c +5 -3
@@ -909,6 +909,7 @@ static void efx_mac_work(struct work_struct *data)static int efx_probe_port (struct efx_nic *efx) { +unsigned char *perm_addr;int rc;netif_dbg (efx, probe, efx->net_dev,"create port\n" );
@@ -922,11 +923,12 @@ static int efx_probe_port(struct efx_nic *efx)return rc;/* Sanity check MAC address */ -if (is_valid_ether_addr (efx->mac_address)) { -memcpy (efx->net_dev->dev_addr, efx->mac_address,ETH_ALEN ); + perm_addr = efx->net_dev->perm_addr; +if (is_valid_ether_addr (perm_addr)) { +memcpy (efx->net_dev->dev_addr, perm_addr,ETH_ALEN ); }else {netif_err (efx, probe, efx->net_dev,"invalid MAC address %pM\n" , - efx->mac_address); + perm_addr);if (!allow_bad_hwaddr) { rc = -EINVAL ; goto err;
drivers/net/sfc/falcon.c +1 -1
@@ -1297,7 +1297,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx) }/* Read the MAC addresses */ -memcpy (efx->mac_address, nvconfig->mac_address[0 ],ETH_ALEN ); +memcpy (efx->net_dev->perm_addr, nvconfig->mac_address[0 ],ETH_ALEN );netif_dbg (efx, probe, efx->net_dev,"PHY is %d phy_id %d\n" , efx->phy_type, efx->mdio.prtad);
drivers/net/sfc/net_driver.h +0 -2
@@ -678,7 +678,6 @@ struct efx_filter_state;* @stats_buffer: DMA buffer for statistics * @stats_lock: Statistics update lock. Serialises statistics fetches * @mac_op: MAC interface -* @mac_address: Permanent MAC address * @phy_type: PHY type * @phy_op: PHY interface * @phy_data: PHY private data (including PHY-specific stats)
@@ -762,7 +761,6 @@ struct efx_nic {spinlock_t stats_lock;struct efx_mac_operations *mac_op; -unsigned char mac_address[ETH_ALEN ];unsigned int phy_type;struct efx_phy_operations *phy_op;
drivers/net/sfc/siena.c +1 -7
@@ -194,13 +194,7 @@ static int siena_reset_hw(struct efx_nic *efx, enum reset_type method)static int siena_probe_nvconfig (struct efx_nic *efx) { -int rc; - - rc =efx_mcdi_get_board_cfg (efx, efx->mac_address,NULL ); -if (rc) -return rc; - -return 0 ; +return efx_mcdi_get_board_cfg (efx, efx->net_dev->perm_addr,NULL ); }static int siena_probe_nic (struct efx_nic *efx)
Signature · 7 lines
1.7.3.2 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 17/17] sfc: Store MAC address from NVRAM in net_device::perm_addr
From: Ben Hutchings <[email protected]>
Date: Thu, 02 Dec 2010 23:48:28 +0000
Quoted 4 lines
For some reason we failed to make this change when
perm_addrwas introduced.Signed-off-by Ben Hutchings <[email protected]>
Applied.