Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: dsa: qca8k: Fix inconsistent use of jiffies vs milliseconds

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>

authored by

Andrew Lunn and committed by
David S. Miller
5a49edec 2b9da35f

+3 -3
+2 -2
drivers/net/dsa/qca/qca8k-8xxx.c
··· 342 342 dev_queue_xmit(skb); 343 343 344 344 ret = wait_for_completion_timeout(&mgmt_eth_data->rw_done, 345 - msecs_to_jiffies(QCA8K_ETHERNET_TIMEOUT)); 345 + QCA8K_ETHERNET_TIMEOUT); 346 346 347 347 *val = mgmt_eth_data->data[0]; 348 348 if (len > QCA_HDR_MGMT_DATA1_LEN) ··· 394 394 dev_queue_xmit(skb); 395 395 396 396 ret = wait_for_completion_timeout(&mgmt_eth_data->rw_done, 397 - msecs_to_jiffies(QCA8K_ETHERNET_TIMEOUT)); 397 + QCA8K_ETHERNET_TIMEOUT); 398 398 399 399 ack = mgmt_eth_data->ack; 400 400
+1 -1
drivers/net/dsa/qca/qca8k.h
··· 16 16 17 17 #define QCA8K_ETHERNET_MDIO_PRIORITY 7 18 18 #define QCA8K_ETHERNET_PHY_PRIORITY 6 19 - #define QCA8K_ETHERNET_TIMEOUT 5 19 + #define QCA8K_ETHERNET_TIMEOUT msecs_to_jiffies(5) 20 20 21 21 #define QCA8K_NUM_PORTS 7 22 22 #define QCA8K_NUM_CPU_PORTS 2