* [patch net 0/2] mlxsw: couple of fixes
@ 2018-01-10 10:42 Jiri Pirko
2018-01-10 10:42 ` [patch net 1/2] mlxsw: pci: Wait after reset before accessing HW Jiri Pirko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jiri Pirko @ 2018-01-10 10:42 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, yuvalm, mlxsw
From: Jiri Pirko <jiri@mellanox.com>
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(-)
--
2.14.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch net 1/2] mlxsw: pci: Wait after reset before accessing HW
2018-01-10 10:42 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
@ 2018-01-10 10:42 ` Jiri Pirko
2018-01-10 10:42 ` [patch net 2/2] mlxsw: spectrum_qdisc: Don't use variable array in mlxsw_sp_tclass_congestion_enable Jiri Pirko
2018-01-10 20:58 ` [patch net 0/2] mlxsw: couple of fixes David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2018-01-10 10:42 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, yuvalm, mlxsw
From: Yuval Mintz <yuvalm@mellanox.com>
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.
Fixes: 233fa44bd67a ("mlxsw: pci: Implement reset done check")
Signed-off-by: Yuval Mintz <yuvalm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/pci.c | 7 ++++++-
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
index 23f7d828cf67..6ef20e5cc77d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
@@ -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);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci_hw.h b/drivers/net/ethernet/mellanox/mlxsw/pci_hw.h
index a6441208e9d9..fb082ad21b00 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/pci_hw.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/pci_hw.h
@@ -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
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [patch net 2/2] mlxsw: spectrum_qdisc: Don't use variable array in mlxsw_sp_tclass_congestion_enable
2018-01-10 10:42 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2018-01-10 10:42 ` [patch net 1/2] mlxsw: pci: Wait after reset before accessing HW Jiri Pirko
@ 2018-01-10 10:42 ` Jiri Pirko
2018-01-10 20:58 ` [patch net 0/2] mlxsw: couple of fixes David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2018-01-10 10:42 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, yuvalm, mlxsw
From: Jiri Pirko <jiri@mellanox.com>
Resolve the sparse warning:
"sparse: Variable length array is used."
Use 2 arrays for 2 PRM register accesses.
Fixes: 96f17e0776c2 ("mlxsw: spectrum: Support RED qdisc offload")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Yuval Mintz <yuvalm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
index c33beac5def0..b5397da94d7f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
@@ -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
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch net 0/2] mlxsw: couple of fixes
2018-01-10 10:42 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2018-01-10 10:42 ` [patch net 1/2] mlxsw: pci: Wait after reset before accessing HW Jiri Pirko
2018-01-10 10:42 ` [patch net 2/2] mlxsw: spectrum_qdisc: Don't use variable array in mlxsw_sp_tclass_congestion_enable Jiri Pirko
@ 2018-01-10 20:58 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-01-10 20:58 UTC (permalink / raw)
To: jiri; +Cc: netdev, idosch, yuvalm, mlxsw
From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 10 Jan 2018 11:42:42 +0100
> From: Jiri Pirko <jiri@mellanox.com>
>
> Couple of small fixes for mlxsw driver.
Series applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-10 20:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10 10:42 [patch net 0/2] mlxsw: couple of fixes Jiri Pirko
2018-01-10 10:42 ` [patch net 1/2] mlxsw: pci: Wait after reset before accessing HW Jiri Pirko
2018-01-10 10:42 ` [patch net 2/2] mlxsw: spectrum_qdisc: Don't use variable array in mlxsw_sp_tclass_congestion_enable Jiri Pirko
2018-01-10 20:58 ` [patch net 0/2] mlxsw: couple of fixes David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).