Skip to content

Commit

Permalink
net: dsa: qca8k: Fix inconsistent use of jiffies vs milliseconds
Browse files Browse the repository at this point in the history
wait_for_complete_timeout() expects a timeout in jiffies. With the
driver, some call sites converted QCA8K_ETHERNET_TIMEOUT to jiffies,
others did not. Make the code consistent by changes the #define to
include a call to msecs_to_jiffies, and remove all other calls to
msecs_to_jiffies.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: from Christian would be very welcome.
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
lunn authored and davem330 committed Dec 18, 2024
1 parent 2b9da35 commit 5a49ede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/net/dsa/qca/qca8k-8xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static int qca8k_read_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len)
dev_queue_xmit(skb);

ret = wait_for_completion_timeout(&mgmt_eth_data->rw_done,
msecs_to_jiffies(QCA8K_ETHERNET_TIMEOUT));
QCA8K_ETHERNET_TIMEOUT);

*val = mgmt_eth_data->data[0];
if (len > QCA_HDR_MGMT_DATA1_LEN)
Expand Down Expand Up @@ -394,7 +394,7 @@ static int qca8k_write_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len)
dev_queue_xmit(skb);

ret = wait_for_completion_timeout(&mgmt_eth_data->rw_done,
msecs_to_jiffies(QCA8K_ETHERNET_TIMEOUT));
QCA8K_ETHERNET_TIMEOUT);

ack = mgmt_eth_data->ack;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/dsa/qca/qca8k.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#define QCA8K_ETHERNET_MDIO_PRIORITY 7
#define QCA8K_ETHERNET_PHY_PRIORITY 6
#define QCA8K_ETHERNET_TIMEOUT 5
#define QCA8K_ETHERNET_TIMEOUT msecs_to_jiffies(5)

#define QCA8K_NUM_PORTS 7
#define QCA8K_NUM_CPU_PORTS 2
Expand Down

0 comments on commit 5a49ede

Please sign in to comment.