All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT
@ 2021-02-14 14:16 Heiner Kallweit
  2021-02-14 16:32 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Heiner Kallweit @ 2021-02-14 14:16 UTC (permalink / raw)
  To: Jakub Kicinski, David Miller, Realtek linux nic maintainers,
	Andrew Lunn, Russell King - ARM Linux, Jonathan Corbet,
	Doug Berger, Florian Fainelli, Byungho An
  Cc: netdev, linux-doc, bcm-kernel-feedback-list

Some internal PHY's have their events like link change reported by the
MAC interrupt. We have PHY_IGNORE_INTERRUPT to deal with this scenario.
I'm not too happy with this name. We don't ignore interrupts, typically
there is no interrupt exposed at a PHY level. So let's rename it to
PHY_MAC_INTERRUPT. This is in line with phy_mac_interrupt(), which is
called from the MAC interrupt handler to handle PHY events.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 Documentation/networking/phy.rst                |  2 +-
 drivers/net/ethernet/broadcom/genet/bcmmii.c    |  2 +-
 drivers/net/ethernet/realtek/r8169_main.c       |  2 +-
 drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c |  4 ++--
 drivers/net/mdio/mdio-moxart.c                  |  4 ++--
 drivers/net/phy/icplus.c                        |  2 +-
 drivers/net/phy/phy.c                           |  2 +-
 drivers/net/phy/phy_device.c                    |  4 ++--
 include/linux/phy.h                             | 10 +++++-----
 9 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Documentation/networking/phy.rst b/Documentation/networking/phy.rst
index 399f17976..70136cc9e 100644
--- a/Documentation/networking/phy.rst
+++ b/Documentation/networking/phy.rst
@@ -216,7 +216,7 @@ put into an unsupported state.
 Lastly, once the controller is ready to handle network traffic, you call
 phy_start(phydev).  This tells the PAL that you are ready, and configures the
 PHY to connect to the network. If the MAC interrupt of your network driver
-also handles PHY status changes, just set phydev->irq to PHY_IGNORE_INTERRUPT
+also handles PHY status changes, just set phydev->irq to PHY_MAC_INTERRUPT
 before you call phy_start and use phy_mac_interrupt() from the network
 driver. If you don't want to use interrupts, set phydev->irq to PHY_POLL.
 phy_start() enables the PHY interrupts (if applicable) and starts the
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 17f997ef9..5335244e4 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -359,7 +359,7 @@ int bcmgenet_mii_probe(struct net_device *dev)
 	 * those versions of GENET.
 	 */
 	if (priv->internal_phy && !GENET_IS_V5(priv))
-		dev->phydev->irq = PHY_IGNORE_INTERRUPT;
+		dev->phydev->irq = PHY_MAC_INTERRUPT;
 
 	return 0;
 }
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 9197da8e6..c69f87645 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5055,7 +5055,7 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
 	new_bus->name = "r8169";
 	new_bus->priv = tp;
 	new_bus->parent = &pdev->dev;
-	new_bus->irq[0] = PHY_IGNORE_INTERRUPT;
+	new_bus->irq[0] = PHY_MAC_INTERRUPT;
 	snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x", pci_dev_id(pdev));
 
 	new_bus->read = r8169_mdio_read_reg;
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
index b1e7f7ab2..fceb6d637 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
@@ -203,8 +203,8 @@ int sxgbe_mdio_register(struct net_device *ndev)
 			case PHY_POLL:
 				irq_str = "POLL";
 				break;
-			case PHY_IGNORE_INTERRUPT:
-				irq_str = "IGNORE";
+			case PHY_MAC_INTERRUPT:
+				irq_str = "MAC";
 				break;
 			default:
 				sprintf(irq_num, "%d", phy->irq);
diff --git a/drivers/net/mdio/mdio-moxart.c b/drivers/net/mdio/mdio-moxart.c
index b72c6d185..f0cff584e 100644
--- a/drivers/net/mdio/mdio-moxart.c
+++ b/drivers/net/mdio/mdio-moxart.c
@@ -125,7 +125,7 @@ static int moxart_mdio_probe(struct platform_device *pdev)
 	snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%d-mii", pdev->name, pdev->id);
 	bus->parent = &pdev->dev;
 
-	/* Setting PHY_IGNORE_INTERRUPT here even if it has no effect,
+	/* Setting PHY_MAC_INTERRUPT here even if it has no effect,
 	 * of_mdiobus_register() sets these PHY_POLL.
 	 * Ideally, the interrupt from MAC controller could be used to
 	 * detect link state changes, not polling, i.e. if there was
@@ -133,7 +133,7 @@ static int moxart_mdio_probe(struct platform_device *pdev)
 	 * interrupt handled in ethernet drivercode.
 	 */
 	for (i = 0; i < PHY_MAX_ADDR; i++)
-		bus->irq[i] = PHY_IGNORE_INTERRUPT;
+		bus->irq[i] = PHY_MAC_INTERRUPT;
 
 	data = bus->priv;
 	data->base = devm_platform_ioremap_resource(pdev, 0);
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index 4e15d4d02..3e431737c 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -188,7 +188,7 @@ static int ip175c_read_status(struct phy_device *phydev)
 		genphy_read_status(phydev);
 	else
 		/* Don't need to read status for switch ports */
-		phydev->irq = PHY_IGNORE_INTERRUPT;
+		phydev->irq = PHY_MAC_INTERRUPT;
 
 	return 0;
 }
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index fdb914b5b..1be07e45d 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1145,7 +1145,7 @@ void phy_state_machine(struct work_struct *work)
 	}
 
 	/* Only re-schedule a PHY state machine change if we are polling the
-	 * PHY, if PHY_IGNORE_INTERRUPT is set, then we will be moving
+	 * PHY, if PHY_MAC_INTERRUPT is set, then we will be moving
 	 * between states from phy_mac_interrupt().
 	 *
 	 * In state PHY_HALTED the PHY gets suspended, so rescheduling the
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 479e7d117..166853982 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1148,8 +1148,8 @@ char *phy_attached_info_irq(struct phy_device *phydev)
 	case PHY_POLL:
 		irq_str = "POLL";
 		break;
-	case PHY_IGNORE_INTERRUPT:
-		irq_str = "IGNORE";
+	case PHY_MAC_INTERRUPT:
+		irq_str = "MAC";
 		break;
 	default:
 		snprintf(irq_num, sizeof(irq_num), "%d", phydev->irq);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index c13078830..5d7c4084a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -71,11 +71,11 @@ extern const int phy_10gbit_features_array[1];
 
 /*
  * Set phydev->irq to PHY_POLL if interrupts are not supported,
- * or not desired for this PHY.  Set to PHY_IGNORE_INTERRUPT if
- * the attached driver handles the interrupt
+ * or not desired for this PHY.  Set to PHY_MAC_INTERRUPT if
+ * the attached MAC driver handles the interrupt
  */
 #define PHY_POLL		-1
-#define PHY_IGNORE_INTERRUPT	-2
+#define PHY_MAC_INTERRUPT	-2
 
 #define PHY_IS_INTERNAL		0x00000001
 #define PHY_RST_AFTER_CLK_EN	0x00000002
@@ -1202,11 +1202,11 @@ static inline int phy_clear_bits_mmd(struct phy_device *phydev, int devad,
  * @phydev: the phy_device struct
  *
  * NOTE: must be kept in sync with addition/removal of PHY_POLL and
- * PHY_IGNORE_INTERRUPT
+ * PHY_MAC_INTERRUPT
  */
 static inline bool phy_interrupt_is_valid(struct phy_device *phydev)
 {
-	return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT;
+	return phydev->irq != PHY_POLL && phydev->irq != PHY_MAC_INTERRUPT;
 }
 
 /**
-- 
2.30.1


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

* Re: [PATCH net-next] net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT
  2021-02-14 14:16 [PATCH net-next] net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT Heiner Kallweit
@ 2021-02-14 16:32 ` Andrew Lunn
  2021-02-14 16:50 ` Florian Fainelli
  2021-02-14 20:43 ` Russell King - ARM Linux admin
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2021-02-14 16:32 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Jakub Kicinski, David Miller, Realtek linux nic maintainers,
	Russell King - ARM Linux, Jonathan Corbet, Doug Berger,
	Florian Fainelli, Byungho An, netdev, linux-doc,
	bcm-kernel-feedback-list

On Sun, Feb 14, 2021 at 03:16:23PM +0100, Heiner Kallweit wrote:
> Some internal PHY's have their events like link change reported by the
> MAC interrupt. We have PHY_IGNORE_INTERRUPT to deal with this scenario.
> I'm not too happy with this name. We don't ignore interrupts, typically
> there is no interrupt exposed at a PHY level. So let's rename it to
> PHY_MAC_INTERRUPT. This is in line with phy_mac_interrupt(), which is
> called from the MAC interrupt handler to handle PHY events.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next] net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT
  2021-02-14 14:16 [PATCH net-next] net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT Heiner Kallweit
  2021-02-14 16:32 ` Andrew Lunn
@ 2021-02-14 16:50 ` Florian Fainelli
  2021-02-14 20:43 ` Russell King - ARM Linux admin
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-02-14 16:50 UTC (permalink / raw)
  To: Heiner Kallweit, Jakub Kicinski, David Miller,
	Realtek linux nic maintainers, Andrew Lunn,
	Russell King - ARM Linux, Jonathan Corbet, Doug Berger,
	Florian Fainelli, Byungho An
  Cc: netdev, linux-doc, bcm-kernel-feedback-list



On 2/14/2021 6:16 AM, Heiner Kallweit wrote:
> Some internal PHY's have their events like link change reported by the
> MAC interrupt. We have PHY_IGNORE_INTERRUPT to deal with this scenario.
> I'm not too happy with this name. We don't ignore interrupts, typically
> there is no interrupt exposed at a PHY level. So let's rename it to
> PHY_MAC_INTERRUPT. This is in line with phy_mac_interrupt(), which is
> called from the MAC interrupt handler to handle PHY events.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks Heiner!
-- 
Florian

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

* Re: [PATCH net-next] net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT
  2021-02-14 14:16 [PATCH net-next] net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT Heiner Kallweit
  2021-02-14 16:32 ` Andrew Lunn
  2021-02-14 16:50 ` Florian Fainelli
@ 2021-02-14 20:43 ` Russell King - ARM Linux admin
  2 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux admin @ 2021-02-14 20:43 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Jakub Kicinski, David Miller, Realtek linux nic maintainers,
	Andrew Lunn, Jonathan Corbet, Doug Berger, Florian Fainelli,
	Byungho An, netdev, linux-doc, bcm-kernel-feedback-list

On Sun, Feb 14, 2021 at 03:16:23PM +0100, Heiner Kallweit wrote:
> Some internal PHY's have their events like link change reported by the
> MAC interrupt. We have PHY_IGNORE_INTERRUPT to deal with this scenario.
> I'm not too happy with this name. We don't ignore interrupts, typically
> there is no interrupt exposed at a PHY level. So let's rename it to
> PHY_MAC_INTERRUPT. This is in line with phy_mac_interrupt(), which is
> called from the MAC interrupt handler to handle PHY events.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

end of thread, other threads:[~2021-02-14 20:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 14:16 [PATCH net-next] net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT Heiner Kallweit
2021-02-14 16:32 ` Andrew Lunn
2021-02-14 16:50 ` Florian Fainelli
2021-02-14 20:43 ` Russell King - ARM Linux admin

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.