* [PATCH] net: qcom/emac: Reduce timeout for mdio read/write
@ 2017-12-15 14:35 Hemanth Puranik
2017-12-15 15:20 ` Timur Tabi
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Hemanth Puranik @ 2017-12-15 14:35 UTC (permalink / raw
To: netdev, linux-kernel; +Cc: Timur Tabi, Hemanth Puranik
Currently mdio read/write takes around ~115us as the timeout
between status check is set to 100us.
By reducing the timeout to 1us mdio read/write takes ~15us to
complete. This improves the link up event response.
Signed-off-by: Hemanth Puranik <hpuranik@codeaurora.org>
---
drivers/net/ethernet/qualcomm/emac/emac-phy.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-phy.c b/drivers/net/ethernet/qualcomm/emac/emac-phy.c
index 18461fc..53dbf1e 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-phy.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-phy.c
@@ -47,6 +47,7 @@
#define MDIO_CLK_25_28 7
#define MDIO_WAIT_TIMES 1000
+#define MDIO_STATUS_DELAY_TIME 1
static int emac_mdio_read(struct mii_bus *bus, int addr, int regnum)
{
@@ -65,7 +66,7 @@ static int emac_mdio_read(struct mii_bus *bus, int addr, int regnum)
if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg,
!(reg & (MDIO_START | MDIO_BUSY)),
- 100, MDIO_WAIT_TIMES * 100))
+ MDIO_STATUS_DELAY_TIME, MDIO_WAIT_TIMES * 100))
return -EIO;
return (reg >> MDIO_DATA_SHFT) & MDIO_DATA_BMSK;
@@ -88,8 +89,8 @@ static int emac_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
writel(reg, adpt->base + EMAC_MDIO_CTRL);
if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg,
- !(reg & (MDIO_START | MDIO_BUSY)), 100,
- MDIO_WAIT_TIMES * 100))
+ !(reg & (MDIO_START | MDIO_BUSY)),
+ MDIO_STATUS_DELAY_TIME, MDIO_WAIT_TIMES * 100))
return -EIO;
return 0;
--
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: qcom/emac: Reduce timeout for mdio read/write
2017-12-15 14:35 [PATCH] net: qcom/emac: Reduce timeout for mdio read/write Hemanth Puranik
@ 2017-12-15 15:20 ` Timur Tabi
2017-12-15 15:47 ` Andrew Lunn
2017-12-15 20:46 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Timur Tabi @ 2017-12-15 15:20 UTC (permalink / raw
To: Hemanth Puranik, netdev, linux-kernel
On 12/15/2017 08:35 AM, Hemanth Puranik wrote:
> Currently mdio read/write takes around ~115us as the timeout
> between status check is set to 100us.
> By reducing the timeout to 1us mdio read/write takes ~15us to
> complete. This improves the link up event response.
>
> Signed-off-by: Hemanth Puranik<hpuranik@codeaurora.org>
Acked-by: Timur Tabi <timur@codeaurora.org>
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: qcom/emac: Reduce timeout for mdio read/write
2017-12-15 14:35 [PATCH] net: qcom/emac: Reduce timeout for mdio read/write Hemanth Puranik
2017-12-15 15:20 ` Timur Tabi
@ 2017-12-15 15:47 ` Andrew Lunn
2017-12-15 20:46 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2017-12-15 15:47 UTC (permalink / raw
To: Hemanth Puranik; +Cc: netdev, linux-kernel, Timur Tabi
On Fri, Dec 15, 2017 at 08:05:58PM +0530, Hemanth Puranik wrote:
> Currently mdio read/write takes around ~115us as the timeout
> between status check is set to 100us.
> By reducing the timeout to 1us mdio read/write takes ~15us to
> complete. This improves the link up event response.
>
> Signed-off-by: Hemanth Puranik <hpuranik@codeaurora.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: qcom/emac: Reduce timeout for mdio read/write
2017-12-15 14:35 [PATCH] net: qcom/emac: Reduce timeout for mdio read/write Hemanth Puranik
2017-12-15 15:20 ` Timur Tabi
2017-12-15 15:47 ` Andrew Lunn
@ 2017-12-15 20:46 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-12-15 20:46 UTC (permalink / raw
To: hpuranik; +Cc: netdev, linux-kernel, timur
From: Hemanth Puranik <hpuranik@codeaurora.org>
Date: Fri, 15 Dec 2017 20:05:58 +0530
> Currently mdio read/write takes around ~115us as the timeout
> between status check is set to 100us.
> By reducing the timeout to 1us mdio read/write takes ~15us to
> complete. This improves the link up event response.
>
> Signed-off-by: Hemanth Puranik <hpuranik@codeaurora.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-15 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-15 14:35 [PATCH] net: qcom/emac: Reduce timeout for mdio read/write Hemanth Puranik
2017-12-15 15:20 ` Timur Tabi
2017-12-15 15:47 ` Andrew Lunn
2017-12-15 20:46 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.