mlxsw: couple of fixes
Subsystems (3)
cover mlxsw: couple of fixes
From: Jiri Pirko <[email protected]>
Couple of small fixes for mlxsw driver.
Jiri Pirko (1):
mlxsw: spectrum_qdisc: Don't use variable array in
mlxsw_sp_tclass_congestion_enable
Yuval Mintz (1):
mlxsw: pci: Wait after reset before accessing HW
drivers/net/ethernet/mellanox/mlxsw/pci.c | 7 ++++++- drivers/net/ethernet/mellanox/mlxsw/pci_hw.h | 1 + drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c | 7 ++++--- 3 files changed, 11 insertions(+), 4 deletions(-)
Signature · 1 line
2.14.3
PATCH 1/2 mlxsw: pci: Wait after reset before accessing HW
From: Yuval Mintz <[email protected]>
After performing reset driver polls on HW indication until learning that the reset is done, but immediately after reset the device becomes unresponsive which might lead to completion timeout on the first read.
Wait for 100ms before starting the polling.
--- drivers/net/ethernet/mellanox/mlxsw/pci.c | 7 ++++++- drivers/net/ethernet/mellanox/mlxsw/pci_hw.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/pci.c +6 -1
@@ -1643,7 +1643,12 @@ static int mlxsw_pci_sw_reset(struct mlxsw_pci *mlxsw_pci,return 0 ; } -wmb ();/* reset needs to be written before we read control register */ +/* Reset needs to be written before we read control register, and +* we must wait for the HW to become responsive once again +*/ +wmb (); +msleep (MLXSW_PCI_SW_RESET_WAIT_MSECS ); + end = jiffies +msecs_to_jiffies (MLXSW_PCI_SW_RESET_TIMEOUT_MSECS ); do { u32 val = mlxsw_pci_read32(mlxsw_pci, FW_READY);
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h +1 -0
@@ -59,6 +59,7 @@#define MLXSW_PCI_SW_RESET 0xF0010#define MLXSW_PCI_SW_RESET_RST_BIT BIT(0)#define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS 5000 +#define MLXSW_PCI_SW_RESET_WAIT_MSECS 100#define MLXSW_PCI_FW_READY 0xA1844#define MLXSW_PCI_FW_READY_MASK 0xFFFF#define MLXSW_PCI_FW_READY_MAGIC 0x5E
Signature · 1 line
2.14.3
PATCH 2/2 mlxsw: spectrum_qdisc: Don't use variable array in mlxsw_sp_tclass_congestion_enable
In reply to Jiri PirkoFrom: Jiri Pirko <[email protected]>
Resolve the sparse warning:
"sparse: Variable length array is used."
Use 2 arrays for 2 PRM register accesses.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c +4 -3
@@ -46,7 +46,8 @@ mlxsw_sp_tclass_congestion_enable(struct mlxsw_sp_port *mlxsw_sp_port, int tclass_num, u32 min, u32 max, u32 probability, bool is_ecn) { - char cwtp_cmd[max_t(u8, MLXSW_REG_CWTP_LEN, MLXSW_REG_CWTPM_LEN)]; + char cwtpm_cmd[MLXSW_REG_CWTPM_LEN]; +char cwtp_cmd[MLXSW_REG_CWTP_LEN ];struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;int err;
@@ -60,10 +61,10 @@ mlxsw_sp_tclass_congestion_enable(struct mlxsw_sp_port *mlxsw_sp_port,if (err)return err; -mlxsw_reg_cwtpm_pack (cwtp_cmd, mlxsw_sp_port->local_port, tclass_num, +mlxsw_reg_cwtpm_pack (cwtpm_cmd, mlxsw_sp_port->local_port, tclass_num,MLXSW_REG_CWTP_DEFAULT_PROFILE , true, is_ecn); -return mlxsw_reg_write (mlxsw_sp->core,MLXSW_REG (cwtpm), cwtp_cmd); +return mlxsw_reg_write (mlxsw_sp->core,MLXSW_REG (cwtpm), cwtpm_cmd); } static int
Signature · 1 line
2.14.3
David Miller
maintainerFrom: Jiri Pirko <[email protected]>
Date: Wed, 10 Jan 2018 11:42:42 +0100
Quoted 3 lines
From: Jiri Pirko <[email protected]>
Couple of small fixes for mlxsw driver.
Series applied, thanks.