drivers: net: davinci_mdio: remove busy loop on wait user access
Subsystems (3)
PATCH v2 1/2 drivers: net: davinci_mdio: remove busy loop on wait user access
Polling 14 mdio devices on single mdio bus eats 30% of 1Ghz cpu time due to busy loop in wait(). Add small delay to relax cpu.
---
v2: fix spelling in commit description.
drivers/net/ethernet/ti/davinci_mdio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/ti/davinci_mdio.c +3 -1
@@ -198,8 +198,10 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)return 0 ; reg =__raw_readl (®s->control); -if ((reg &CONTROL_IDLE ) ==0 ) +if ((reg &CONTROL_IDLE ) ==0 ) { +usleep_range (100 ,200 );continue ; + }/* * An emac soft_reset may have clobbered the mdio controller's
Signature · 1 line
2.5.0
PATCH v2 2/2 drivers: net: davinci_mdio: print bus frequency
Frequency can be adjusted in DT it make sense to
print current used value on driver init.
--- drivers/net/ethernet/ti/davinci_mdio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/davinci_mdio.c +4 -2
@@ -159,8 +159,10 @@ static int davinci_mdio_reset(struct mii_bus *bus)/* dump hardware version info */ ver =__raw_readl (&data->regs->version); -dev_info (data->dev,"davinci mdio revision %d.%d\n" , - (ver >>8 ) &0xff , ver &0xff ); +dev_info (data->dev, +"davinci mdio revision %d.%d, bus freq %ld\n" , + (ver >>8 ) &0xff , ver &0xff , + data->pdata.bus_freq);if (data->skip_scan) goto done;
Signature · 1 line
2.5.0
Re: [PATCHv2 2/2] drivers: net: davinci_mdio: print bus frequency
Quoted 4 lines · Max Uvarov
Frequency can be adjusted in DT it make sense to
print current used value on driver init.Signed-off-by Max Uvarov <[email protected]>
Quoted 22 lines
--- drivers/net/ethernet/ti/davinci_mdio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/ethernet/ti/davinci_mdio.c +4
-2@@ -159,8 +159,10 @@ static int davinci_mdio_reset(struct mii_bus *bus)/* dump hardware version info */ ver =__raw_readl (&data->regs->version); -dev_info (data->dev,"davinci mdio revision %d.%d\n" , - (ver >>8 ) &0xff , ver &0xff ); +dev_info (data->dev, +"davinci mdio revision %d.%d, bus freq %ld\n" , + (ver >>8 ) &0xff , ver &0xff , + data->pdata.bus_freq);if (data->skip_scan) goto done;
Signature · 2 lines
regards, -grygorii
Re: [PATCHv2 2/2] drivers: net: davinci_mdio: print bus frequency
In reply to Max UvarovFrom: Max Uvarov <[email protected]>
Date: Thu, 10 Aug 2017 10:47:47 +0300
Quoted 4 lines
Frequency can be adjusted in DT it make sense to
print current used value on driver init.Signed-off-by Max Uvarov <[email protected]>
Applied to net-next.
Quoted 2 lines · Max Uvarov
Polling 14 mdio devices on single mdio bus eats 30% of 1Ghz cpu time due to busy loop in
wait(). Add small delay to relax cpu.
Hi Max
Please include a cover note when you have multiple patches in a series.
With 14 devices, it makes sense to swap to using PHY interrupts if you can. That should prevent the PHY state machine polling the PHYs every second.
Andrew
Quoted 4 lines · Max Uvarov
Polling 14 mdio devices on single mdio bus eats 30% of 1Ghz cpu time due to busy loop in
wait(). Add small delay to relax cpu.Signed-off-by Max Uvarov <[email protected]>
yep. cover letter is good to have.
Quoted 23 lines
---
v2: fix spelling in commit description.drivers/net/ethernet/ti/davinci_mdio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/ethernet/ti/davinci_mdio.c +3
-1@@ -198,8 +198,10 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)return 0 ; reg =__raw_readl (®s->control); -if ((reg &CONTROL_IDLE ) ==0 ) +if ((reg &CONTROL_IDLE ) ==0 ) { +usleep_range (100 ,200 );continue ; + }/* * An emac soft_reset may have clobbered the mdio controller's
Signature · 2 lines
regards, -grygorii
From: Max Uvarov <[email protected]>
Date: Thu, 10 Aug 2017 10:47:46 +0300
Quoted 4 lines
Polling 14 mdio devices on single mdio bus eats 30% of 1Ghz cpu time due to busy loop in
wait(). Add small delay to relax cpu.Signed-off-by Max Uvarov <[email protected]>
Applied to net-next.