Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: rename PHY_IGNORE_INTERRUPT to PHY_MAC_INTERRUPT

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>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Heiner Kallweit and committed by
David S. Miller
93e8990c 63477a5d

+16 -16
+1 -1
Documentation/networking/phy.rst
··· 216 216 Lastly, once the controller is ready to handle network traffic, you call 217 217 phy_start(phydev). This tells the PAL that you are ready, and configures the 218 218 PHY to connect to the network. If the MAC interrupt of your network driver 219 - also handles PHY status changes, just set phydev->irq to PHY_IGNORE_INTERRUPT 219 + also handles PHY status changes, just set phydev->irq to PHY_MAC_INTERRUPT 220 220 before you call phy_start and use phy_mac_interrupt() from the network 221 221 driver. If you don't want to use interrupts, set phydev->irq to PHY_POLL. 222 222 phy_start() enables the PHY interrupts (if applicable) and starts the
+1 -1
drivers/net/ethernet/broadcom/genet/bcmmii.c
··· 359 359 * those versions of GENET. 360 360 */ 361 361 if (priv->internal_phy && !GENET_IS_V5(priv)) 362 - dev->phydev->irq = PHY_IGNORE_INTERRUPT; 362 + dev->phydev->irq = PHY_MAC_INTERRUPT; 363 363 364 364 return 0; 365 365 }
+1 -1
drivers/net/ethernet/realtek/r8169_main.c
··· 5056 5056 new_bus->name = "r8169"; 5057 5057 new_bus->priv = tp; 5058 5058 new_bus->parent = &pdev->dev; 5059 - new_bus->irq[0] = PHY_IGNORE_INTERRUPT; 5059 + new_bus->irq[0] = PHY_MAC_INTERRUPT; 5060 5060 snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x", pci_dev_id(pdev)); 5061 5061 5062 5062 new_bus->read = r8169_mdio_read_reg;
+2 -2
drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.c
··· 203 203 case PHY_POLL: 204 204 irq_str = "POLL"; 205 205 break; 206 - case PHY_IGNORE_INTERRUPT: 207 - irq_str = "IGNORE"; 206 + case PHY_MAC_INTERRUPT: 207 + irq_str = "MAC"; 208 208 break; 209 209 default: 210 210 sprintf(irq_num, "%d", phy->irq);
+2 -2
drivers/net/mdio/mdio-moxart.c
··· 125 125 snprintf(bus->id, MII_BUS_ID_SIZE, "%s-%d-mii", pdev->name, pdev->id); 126 126 bus->parent = &pdev->dev; 127 127 128 - /* Setting PHY_IGNORE_INTERRUPT here even if it has no effect, 128 + /* Setting PHY_MAC_INTERRUPT here even if it has no effect, 129 129 * of_mdiobus_register() sets these PHY_POLL. 130 130 * Ideally, the interrupt from MAC controller could be used to 131 131 * detect link state changes, not polling, i.e. if there was ··· 133 133 * interrupt handled in ethernet drivercode. 134 134 */ 135 135 for (i = 0; i < PHY_MAX_ADDR; i++) 136 - bus->irq[i] = PHY_IGNORE_INTERRUPT; 136 + bus->irq[i] = PHY_MAC_INTERRUPT; 137 137 138 138 data = bus->priv; 139 139 data->base = devm_platform_ioremap_resource(pdev, 0);
+1 -1
drivers/net/phy/icplus.c
··· 188 188 genphy_read_status(phydev); 189 189 else 190 190 /* Don't need to read status for switch ports */ 191 - phydev->irq = PHY_IGNORE_INTERRUPT; 191 + phydev->irq = PHY_MAC_INTERRUPT; 192 192 193 193 return 0; 194 194 }
+1 -1
drivers/net/phy/phy.c
··· 1145 1145 } 1146 1146 1147 1147 /* Only re-schedule a PHY state machine change if we are polling the 1148 - * PHY, if PHY_IGNORE_INTERRUPT is set, then we will be moving 1148 + * PHY, if PHY_MAC_INTERRUPT is set, then we will be moving 1149 1149 * between states from phy_mac_interrupt(). 1150 1150 * 1151 1151 * In state PHY_HALTED the PHY gets suspended, so rescheduling the
+2 -2
drivers/net/phy/phy_device.c
··· 1167 1167 case PHY_POLL: 1168 1168 irq_str = "POLL"; 1169 1169 break; 1170 - case PHY_IGNORE_INTERRUPT: 1171 - irq_str = "IGNORE"; 1170 + case PHY_MAC_INTERRUPT: 1171 + irq_str = "MAC"; 1172 1172 break; 1173 1173 default: 1174 1174 snprintf(irq_num, sizeof(irq_num), "%d", phydev->irq);
+5 -5
include/linux/phy.h
··· 71 71 72 72 /* 73 73 * Set phydev->irq to PHY_POLL if interrupts are not supported, 74 - * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if 75 - * the attached driver handles the interrupt 74 + * or not desired for this PHY. Set to PHY_MAC_INTERRUPT if 75 + * the attached MAC driver handles the interrupt 76 76 */ 77 77 #define PHY_POLL -1 78 - #define PHY_IGNORE_INTERRUPT -2 78 + #define PHY_MAC_INTERRUPT -2 79 79 80 80 #define PHY_IS_INTERNAL 0x00000001 81 81 #define PHY_RST_AFTER_CLK_EN 0x00000002 ··· 1202 1202 * @phydev: the phy_device struct 1203 1203 * 1204 1204 * NOTE: must be kept in sync with addition/removal of PHY_POLL and 1205 - * PHY_IGNORE_INTERRUPT 1205 + * PHY_MAC_INTERRUPT 1206 1206 */ 1207 1207 static inline bool phy_interrupt_is_valid(struct phy_device *phydev) 1208 1208 { 1209 - return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT; 1209 + return phydev->irq != PHY_POLL && phydev->irq != PHY_MAC_INTERRUPT; 1210 1210 } 1211 1211 1212 1212 /**