* [PATCH net] lan78xx: changed to use updated phy-ignore-interrupts
@ 2016-01-21 20:15 Woojung.Huh
2016-01-23 3:33 ` Florian Fainelli
0 siblings, 1 reply; 3+ messages in thread
From: Woojung.Huh @ 2016-01-21 20:15 UTC (permalink / raw)
To: davem, f.fainelli; +Cc: netdev
Update lan78xx to use patch of commit 4f2aaf7dd95b
("Merge branch 'fix-phy-ignore-interrupts'")
Signed-off-by: Woojung Huh <woojung.huh@microchip.com>
---
drivers/net/usb/lan78xx.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 2ed5333..85ca7de 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -36,7 +36,7 @@
#define DRIVER_AUTHOR "WOOJUNG HUH <woojung.huh@microchip.com>"
#define DRIVER_DESC "LAN78XX USB 3.0 Gigabit Ethernet Devices"
#define DRIVER_NAME "lan78xx"
-#define DRIVER_VERSION "1.0.1"
+#define DRIVER_VERSION "1.0.2"
#define TX_TIMEOUT_JIFFIES (5 * HZ)
#define THROTTLE_JIFFIES (HZ / 8)
@@ -914,6 +914,8 @@ static int lan78xx_link_reset(struct lan78xx_net *dev)
ret = lan78xx_write_reg(dev, MAC_CR, buf);
if (unlikely(ret < 0))
return -EIO;
+
+ phy_mac_interrupt(phydev, 0);
} else if (phydev->link && !dev->link_on) {
dev->link_on = true;
@@ -954,6 +956,7 @@ static int lan78xx_link_reset(struct lan78xx_net *dev)
ret = lan78xx_update_flowcontrol(dev, ecmd.duplex, ladv, radv);
netif_carrier_on(dev->net);
+ phy_mac_interrupt(phydev, 1);
}
return ret;
@@ -1495,7 +1498,6 @@ done:
static int lan78xx_mdio_init(struct lan78xx_net *dev)
{
int ret;
- int i;
dev->mdiobus = mdiobus_alloc();
if (!dev->mdiobus) {
@@ -1511,10 +1513,6 @@ static int lan78xx_mdio_init(struct lan78xx_net *dev)
snprintf(dev->mdiobus->id, MII_BUS_ID_SIZE, "usb-%03d:%03d",
dev->udev->bus->busnum, dev->udev->devnum);
- /* handle our own interrupt */
- for (i = 0; i < PHY_MAX_ADDR; i++)
- dev->mdiobus->irq[i] = PHY_IGNORE_INTERRUPT;
-
switch (dev->devid & ID_REV_CHIP_ID_MASK_) {
case 0x78000000:
case 0x78500000:
@@ -1558,6 +1556,16 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
return -EIO;
}
+ /* Enable PHY interrupts.
+ * We handle our own interrupt
+ */
+ ret = phy_read(phydev, LAN88XX_INT_STS);
+ ret = phy_write(phydev, LAN88XX_INT_MASK,
+ LAN88XX_INT_MASK_MDINTPIN_EN_ |
+ LAN88XX_INT_MASK_LINK_CHANGE_);
+
+ phydev->irq = PHY_IGNORE_INTERRUPT;
+
ret = phy_connect_direct(dev->net, phydev,
lan78xx_link_status_change,
PHY_INTERFACE_MODE_GMII);
@@ -1580,14 +1588,6 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
SUPPORTED_Pause | SUPPORTED_Asym_Pause);
genphy_config_aneg(phydev);
- /* Workaround to enable PHY interrupt.
- * phy_start_interrupts() is API for requesting and enabling
- * PHY interrupt. However, USB-to-Ethernet device can't use
- * request_irq() called in phy_start_interrupts().
- * Set PHY to PHY_HALTED and call phy_start()
- * to make a call to phy_enable_interrupts()
- */
- phy_stop(phydev);
phy_start(phydev);
netif_dbg(dev, ifup, dev->net, "phy initialised successfully");
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] lan78xx: changed to use updated phy-ignore-interrupts
2016-01-21 20:15 [PATCH net] lan78xx: changed to use updated phy-ignore-interrupts Woojung.Huh
@ 2016-01-23 3:33 ` Florian Fainelli
2016-01-25 16:26 ` Woojung.Huh
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2016-01-23 3:33 UTC (permalink / raw)
To: Woojung.Huh, davem; +Cc: netdev
On 21/01/2016 12:15, Woojung.Huh@microchip.com wrote:
> Update lan78xx to use patch of commit 4f2aaf7dd95b
> ("Merge branch 'fix-phy-ignore-interrupts'")
Looks fine, just one nit below:
>
> Signed-off-by: Woojung Huh <woojung.huh@microchip.com>
> ---
> drivers/net/usb/lan78xx.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index 2ed5333..85ca7de 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -36,7 +36,7 @@
> #define DRIVER_AUTHOR "WOOJUNG HUH <woojung.huh@microchip.com>"
> #define DRIVER_DESC "LAN78XX USB 3.0 Gigabit Ethernet Devices"
> #define DRIVER_NAME "lan78xx"
> -#define DRIVER_VERSION "1.0.1"
> +#define DRIVER_VERSION "1.0.2"
>
> #define TX_TIMEOUT_JIFFIES (5 * HZ)
> #define THROTTLE_JIFFIES (HZ / 8)
> @@ -914,6 +914,8 @@ static int lan78xx_link_reset(struct lan78xx_net *dev)
> ret = lan78xx_write_reg(dev, MAC_CR, buf);
> if (unlikely(ret < 0))
> return -EIO;
> +
> + phy_mac_interrupt(phydev, 0);
> } else if (phydev->link && !dev->link_on) {
> dev->link_on = true;
>
> @@ -954,6 +956,7 @@ static int lan78xx_link_reset(struct lan78xx_net *dev)
>
> ret = lan78xx_update_flowcontrol(dev, ecmd.duplex, ladv, radv);
> netif_carrier_on(dev->net);
Do you need this netif_carrier_on() call here? PHYLIB should set that
already.
> + phy_mac_interrupt(phydev, 1);
> }
>
> return ret;
> @@ -1495,7 +1498,6 @@ done:
> static int lan78xx_mdio_init(struct lan78xx_net *dev)
> {
> int ret;
> - int i;
>
> dev->mdiobus = mdiobus_alloc();
> if (!dev->mdiobus) {
> @@ -1511,10 +1513,6 @@ static int lan78xx_mdio_init(struct lan78xx_net *dev)
> snprintf(dev->mdiobus->id, MII_BUS_ID_SIZE, "usb-%03d:%03d",
> dev->udev->bus->busnum, dev->udev->devnum);
>
> - /* handle our own interrupt */
> - for (i = 0; i < PHY_MAX_ADDR; i++)
> - dev->mdiobus->irq[i] = PHY_IGNORE_INTERRUPT;
> -
> switch (dev->devid & ID_REV_CHIP_ID_MASK_) {
> case 0x78000000:
> case 0x78500000:
> @@ -1558,6 +1556,16 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
> return -EIO;
> }
>
> + /* Enable PHY interrupts.
> + * We handle our own interrupt
> + */
> + ret = phy_read(phydev, LAN88XX_INT_STS);
> + ret = phy_write(phydev, LAN88XX_INT_MASK,
> + LAN88XX_INT_MASK_MDINTPIN_EN_ |
> + LAN88XX_INT_MASK_LINK_CHANGE_);
> +
> + phydev->irq = PHY_IGNORE_INTERRUPT;
> +
> ret = phy_connect_direct(dev->net, phydev,
> lan78xx_link_status_change,
> PHY_INTERFACE_MODE_GMII);
> @@ -1580,14 +1588,6 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
> SUPPORTED_Pause | SUPPORTED_Asym_Pause);
> genphy_config_aneg(phydev);
>
> - /* Workaround to enable PHY interrupt.
> - * phy_start_interrupts() is API for requesting and enabling
> - * PHY interrupt. However, USB-to-Ethernet device can't use
> - * request_irq() called in phy_start_interrupts().
> - * Set PHY to PHY_HALTED and call phy_start()
> - * to make a call to phy_enable_interrupts()
> - */
> - phy_stop(phydev);
> phy_start(phydev);
>
> netif_dbg(dev, ifup, dev->net, "phy initialised successfully");
>
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [PATCH net] lan78xx: changed to use updated phy-ignore-interrupts
2016-01-23 3:33 ` Florian Fainelli
@ 2016-01-25 16:26 ` Woojung.Huh
0 siblings, 0 replies; 3+ messages in thread
From: Woojung.Huh @ 2016-01-25 16:26 UTC (permalink / raw)
To: f.fainelli, davem; +Cc: netdev
Florian,
> Looks fine, just one nit below:
>
> > @@ -954,6 +956,7 @@ static int lan78xx_link_reset(struct lan78xx_net
> *dev)
> >
> > ret = lan78xx_update_flowcontrol(dev, ecmd.duplex, ladv,
> radv);
> > netif_carrier_on(dev->net);
>
> Do you need this netif_carrier_on() call here? PHYLIB should set that
> already.
>
> > + phy_mac_interrupt(phydev, 1);
> > }
Thanks for feedback.
As you pointed, netif_carrier_on() is redundant and also netif_carrier_off() in same routine.
Will post new patch.
Thanks,
Woojung
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-25 16:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 20:15 [PATCH net] lan78xx: changed to use updated phy-ignore-interrupts Woojung.Huh
2016-01-23 3:33 ` Florian Fainelli
2016-01-25 16:26 ` Woojung.Huh
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.