All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add PHY IRQ support to the 'sh_eth' driver
@ 2013-12-19 22:38 ` Sergei Shtylyov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 21:38 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

Hello.

   This patchset adds support for passing PHY's IRQ to the 'sh_eth' driver from
the platform code and removes now useless code that hinders the PHY IRQ handing
by philib.

[1/2] sh_eth: add PHY IRQ to platform data
[2/2] sh_eth: do not reset PHY needlessly

WBR, Sergei

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] sh_eth: add PHY IRQ to platform data
  2013-12-19 22:38 ` Sergei Shtylyov
@ 2013-12-19 22:39   ` Sergei Shtylyov
  -1 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 21:39 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

Allow the platform code to pass PHY's IRQ to the driver.  Print this IRQ along
with the other PHY datails in sh_eth_phy_init().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/net/ethernet/renesas/sh_eth.c |    6 ++++--
 include/linux/sh_eth.h                |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
=================================--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -1685,8 +1685,8 @@ static int sh_eth_phy_init(struct net_de
 		return PTR_ERR(phydev);
 	}
 
-	dev_info(&ndev->dev, "attached phy %i to driver %s\n",
-		phydev->addr, phydev->drv->name);
+	dev_info(&ndev->dev, "attached PHY %d (IRQ %d) to driver %s\n",
+		 phydev->addr, phydev->irq, phydev->drv->name);
 
 	mdp->phydev = phydev;
 
@@ -2544,6 +2544,8 @@ static int sh_mdio_init(struct net_devic
 
 	for (i = 0; i < PHY_MAX_ADDR; i++)
 		mdp->mii_bus->irq[i] = PHY_POLL;
+	if (pd->phy_irq > 0)
+		mdp->mii_bus->irq[pd->phy] = pd->phy_irq;
 
 	/* register mdio bus */
 	ret = mdiobus_register(mdp->mii_bus);
Index: net-next/include/linux/sh_eth.h
=================================--- net-next.orig/include/linux/sh_eth.h
+++ net-next/include/linux/sh_eth.h
@@ -8,6 +8,7 @@ enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_END
 
 struct sh_eth_plat_data {
 	int phy;
+	int phy_irq;
 	int edmac_endian;
 	phy_interface_t phy_interface;
 	void (*set_mdio_gate)(void *addr);

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] sh_eth: do not reset PHY needlessly
  2013-12-19 22:38 ` Sergei Shtylyov
@ 2013-12-19 22:41   ` Sergei Shtylyov
  -1 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 21:41 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

There's no need anymore to call phy_init_hw() to reset/resume the PHY from the
driver, as the call chain in phylib already has reached it, and so reset/resumed
the PHY (even resuming it twice). This duplicate reset is not only  needless, it
e.g. clears the PHY's interrupt enables just setup by phylib and so prevents the
expected IRQs from the PHY.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/net/ethernet/renesas/sh_eth.c |    5 -----
 1 file changed, 5 deletions(-)

Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
=================================--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -1703,11 +1703,6 @@ static int sh_eth_phy_start(struct net_d
 	if (ret)
 		return ret;
 
-	/* reset phy - this also wakes it from PDOWN */
-	ret = phy_init_hw(mdp->phydev);
-	if (ret)
-		return ret;
-
 	phy_start(mdp->phydev);
 
 	return 0;

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] Add PHY IRQ support to the 'sh_eth' driver
  2013-12-19 22:38 ` Sergei Shtylyov
@ 2013-12-19 22:43   ` Sergei Shtylyov
  -1 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 21:43 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

On 12/20/2013 01:38 AM, Sergei Shtylyov wrote:

>     This patchset adds support for passing PHY's IRQ to the 'sh_eth' driver from
> the platform code and removes now useless code that hinders the PHY IRQ handing
> by philib.

    Ugh, forgot to mention it's against DaveM's 'net-next.git' repo.

> [1/2] sh_eth: add PHY IRQ to platform data
> [2/2] sh_eth: do not reset PHY needlessly

WBR, Sergei


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 0/2] Add PHY IRQ support to the 'sh_eth' driver
@ 2013-12-19 22:38 ` Sergei Shtylyov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 22:38 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

Hello.

   This patchset adds support for passing PHY's IRQ to the 'sh_eth' driver from
the platform code and removes now useless code that hinders the PHY IRQ handing
by philib.

[1/2] sh_eth: add PHY IRQ to platform data
[2/2] sh_eth: do not reset PHY needlessly

WBR, Sergei

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] sh_eth: add PHY IRQ to platform data
@ 2013-12-19 22:39   ` Sergei Shtylyov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 22:39 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

Allow the platform code to pass PHY's IRQ to the driver.  Print this IRQ along
with the other PHY datails in sh_eth_phy_init().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/net/ethernet/renesas/sh_eth.c |    6 ++++--
 include/linux/sh_eth.h                |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -1685,8 +1685,8 @@ static int sh_eth_phy_init(struct net_de
 		return PTR_ERR(phydev);
 	}
 
-	dev_info(&ndev->dev, "attached phy %i to driver %s\n",
-		phydev->addr, phydev->drv->name);
+	dev_info(&ndev->dev, "attached PHY %d (IRQ %d) to driver %s\n",
+		 phydev->addr, phydev->irq, phydev->drv->name);
 
 	mdp->phydev = phydev;
 
@@ -2544,6 +2544,8 @@ static int sh_mdio_init(struct net_devic
 
 	for (i = 0; i < PHY_MAX_ADDR; i++)
 		mdp->mii_bus->irq[i] = PHY_POLL;
+	if (pd->phy_irq > 0)
+		mdp->mii_bus->irq[pd->phy] = pd->phy_irq;
 
 	/* register mdio bus */
 	ret = mdiobus_register(mdp->mii_bus);
Index: net-next/include/linux/sh_eth.h
===================================================================
--- net-next.orig/include/linux/sh_eth.h
+++ net-next/include/linux/sh_eth.h
@@ -8,6 +8,7 @@ enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_END
 
 struct sh_eth_plat_data {
 	int phy;
+	int phy_irq;
 	int edmac_endian;
 	phy_interface_t phy_interface;
 	void (*set_mdio_gate)(void *addr);

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] sh_eth: do not reset PHY needlessly
@ 2013-12-19 22:41   ` Sergei Shtylyov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 22:41 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

There's no need anymore to call phy_init_hw() to reset/resume the PHY from the
driver, as the call chain in phylib already has reached it, and so reset/resumed
the PHY (even resuming it twice). This duplicate reset is not only  needless, it
e.g. clears the PHY's interrupt enables just setup by phylib and so prevents the
expected IRQs from the PHY.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/net/ethernet/renesas/sh_eth.c |    5 -----
 1 file changed, 5 deletions(-)

Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -1703,11 +1703,6 @@ static int sh_eth_phy_start(struct net_d
 	if (ret)
 		return ret;
 
-	/* reset phy - this also wakes it from PDOWN */
-	ret = phy_init_hw(mdp->phydev);
-	if (ret)
-		return ret;
-
 	phy_start(mdp->phydev);
 
 	return 0;

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] Add PHY IRQ support to the 'sh_eth' driver
@ 2013-12-19 22:43   ` Sergei Shtylyov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 22:43 UTC (permalink / raw)
  To: netdev; +Cc: linux-sh

On 12/20/2013 01:38 AM, Sergei Shtylyov wrote:

>     This patchset adds support for passing PHY's IRQ to the 'sh_eth' driver from
> the platform code and removes now useless code that hinders the PHY IRQ handing
> by philib.

    Ugh, forgot to mention it's against DaveM's 'net-next.git' repo.

> [1/2] sh_eth: add PHY IRQ to platform data
> [2/2] sh_eth: do not reset PHY needlessly

WBR, Sergei

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] Add PHY IRQ support to the 'sh_eth' driver
  2013-12-19 22:43   ` Sergei Shtylyov
@ 2013-12-20  0:11     ` David Miller
  -1 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2013-12-20  0:11 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, linux-sh

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 20 Dec 2013 01:43:16 +0300

> On 12/20/2013 01:38 AM, Sergei Shtylyov wrote:
> 
>>     This patchset adds support for passing PHY's IRQ to the 'sh_eth'
>>     driver from
>> the platform code and removes now useless code that hinders the PHY
>> IRQ handing
>> by philib.
> 
>    Ugh, forgot to mention it's against DaveM's 'net-next.git' repo.

No need, series applied, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/2] Add PHY IRQ support to the 'sh_eth' driver
@ 2013-12-20  0:11     ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2013-12-20  0:11 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, linux-sh

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 20 Dec 2013 01:43:16 +0300

> On 12/20/2013 01:38 AM, Sergei Shtylyov wrote:
> 
>>     This patchset adds support for passing PHY's IRQ to the 'sh_eth'
>>     driver from
>> the platform code and removes now useless code that hinders the PHY
>> IRQ handing
>> by philib.
> 
>    Ugh, forgot to mention it's against DaveM's 'net-next.git' repo.

No need, series applied, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-12-20  0:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 21:38 [PATCH 0/2] Add PHY IRQ support to the 'sh_eth' driver Sergei Shtylyov
2013-12-19 22:38 ` Sergei Shtylyov
2013-12-19 21:39 ` [PATCH 1/2] sh_eth: add PHY IRQ to platform data Sergei Shtylyov
2013-12-19 22:39   ` Sergei Shtylyov
2013-12-19 21:41 ` [PATCH 2/2] sh_eth: do not reset PHY needlessly Sergei Shtylyov
2013-12-19 22:41   ` Sergei Shtylyov
2013-12-19 21:43 ` [PATCH 0/2] Add PHY IRQ support to the 'sh_eth' driver Sergei Shtylyov
2013-12-19 22:43   ` Sergei Shtylyov
2013-12-20  0:11   ` David Miller
2013-12-20  0:11     ` 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.