diff mbox

[v1,1/6] net: mv643xx_eth: properly start/stop phy device

Message ID 1386513631-11284-2-git-send-email-sebastian.hesselbarth@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sebastian Hesselbarth Dec. 8, 2013, 2:40 p.m. UTC
When using phydev, it should be phy_start/phy_stop'ed properly. This
driver doesn't do that, so add the corresponding calls to port_start/
stop respectively.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
Cc: David Miller <davem@davemloft.net>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

David Miller Dec. 11, 2013, 2:52 a.m. UTC | #1
This series looks good, applied to net-next, thanks.
David Miller Dec. 11, 2013, 2:56 a.m. UTC | #2
From: David Miller <davem@davemloft.net>

Date: Tue, 10 Dec 2013 21:52:53 -0500 (EST)

> 

> This series looks good, applied to net-next, thanks.


Actually, I had to revert.

You cannot use late_initcall_sync() from code that is potentially
built modular, this caused my build to fail at the mdio_bus code.

drivers/net/phy/mdio_bus.c:344:1: warning: data definition has no type or storage class [enabled by default]
drivers/net/phy/mdio_bus.c:344:1: error: type defaults to ‘int’ in declaration of ‘late_initcall_sync’ [-Werror=implicit-int]
drivers/net/phy/mdio_bus.c:344:1: warning: parameter names (without types) in function declaration [enabled by default]
drivers/net/phy/mdio_bus.c:339:12: warning: ‘mdio_bus_class_suspend_unused’ defined but not used [-Wunused-function]
Sebastian Hesselbarth Dec. 11, 2013, 7:06 a.m. UTC | #3
On 12/11/2013 03:56 AM, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Tue, 10 Dec 2013 21:52:53 -0500 (EST)
>
>>
>> This series looks good, applied to net-next, thanks.
>
> Actually, I had to revert.
>
> You cannot use late_initcall_sync() from code that is potentially
> built modular, this caused my build to fail at the mdio_bus code.
>
> drivers/net/phy/mdio_bus.c:344:1: warning: data definition has no type or storage class [enabled by default]
> drivers/net/phy/mdio_bus.c:344:1: error: type defaults to ‘int’ in declaration of ‘late_initcall_sync’ [-Werror=implicit-int]
> drivers/net/phy/mdio_bus.c:344:1: warning: parameter names (without types) in function declaration [enabled by default]
> drivers/net/phy/mdio_bus.c:339:12: warning: ‘mdio_bus_class_suspend_unused’ defined but not used [-Wunused-function]
>

Hmm, I see. What about you drop patch 5 ("net: phy: suspend unused PHYs
on mdio_bus in late_initcall"), take the rest, and I'll have look at
suspending unused PHYs later?

Sebastian
David Miller Dec. 11, 2013, 5:28 p.m. UTC | #4
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>

Date: Wed, 11 Dec 2013 08:06:36 +0100

> On 12/11/2013 03:56 AM, David Miller wrote:

>> From: David Miller <davem@davemloft.net>

>> Date: Tue, 10 Dec 2013 21:52:53 -0500 (EST)

>>

>>>

>>> This series looks good, applied to net-next, thanks.

>>

>> Actually, I had to revert.

>>

>> You cannot use late_initcall_sync() from code that is potentially

>> built modular, this caused my build to fail at the mdio_bus code.

>>

>> drivers/net/phy/mdio_bus.c:344:1: warning: data definition has no type

>> or storage class [enabled by default]

>> drivers/net/phy/mdio_bus.c:344:1: error: type defaults to ‘int’ in

>> declaration of ‘late_initcall_sync’ [-Werror=implicit-int]

>> drivers/net/phy/mdio_bus.c:344:1: warning: parameter names (without

>> types) in function declaration [enabled by default]

>> drivers/net/phy/mdio_bus.c:339:12: warning:

>> ‘mdio_bus_class_suspend_unused’ defined but not used

>> [-Wunused-function]

>>

> 

> Hmm, I see. What about you drop patch 5 ("net: phy: suspend unused

> PHYs

> on mdio_bus in late_initcall"), take the rest, and I'll have look at

> suspending unused PHYs later?


What about you resubmit the series that you want me to apply?

Thanks.
diff mbox

Patch

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 61088a6..3aa706f 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2098,6 +2098,7 @@  static void port_start(struct mv643xx_eth_private *mp)
 		mv643xx_eth_get_settings(mp->dev, &cmd);
 		phy_reset(mp);
 		mv643xx_eth_set_settings(mp->dev, &cmd);
+		phy_start(mp->phy);
 	}
 
 	/*
@@ -2293,7 +2294,8 @@  static int mv643xx_eth_stop(struct net_device *dev)
 	del_timer_sync(&mp->rx_oom);
 
 	netif_carrier_off(dev);
-
+	if (mp->phy)
+		phy_stop(mp->phy);
 	free_irq(dev->irq, dev);
 
 	port_reset(mp);