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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-phy-mxl-gpy-broken-interrupt-fixes'

Michael Walle says:

====================
net: phy: mxl-gpy: broken interrupt fixes

The GPY215 has a broken interrupt pin. This patch series tries to
workaround that and because in general that is not possible, disables the
interrupts by default and falls back to polling mode. There is an opt-in
via the devicetree.

====================

Link: https://lore.kernel.org/r/20230109123013.3094144-1-michael@walle.cc
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+64
+47
Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/net/maxlinear,gpy2xx.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MaxLinear GPY2xx PHY 8 + 9 + maintainers: 10 + - Andrew Lunn <andrew@lunn.ch> 11 + - Michael Walle <michael@walle.cc> 12 + 13 + allOf: 14 + - $ref: ethernet-phy.yaml# 15 + 16 + properties: 17 + maxlinear,use-broken-interrupts: 18 + description: | 19 + Interrupts are broken on some GPY2xx PHYs in that they keep the 20 + interrupt line asserted even after the interrupt status register is 21 + cleared. Thus it is blocking the interrupt line which is usually bad 22 + for shared lines. By default interrupts are disabled for this PHY and 23 + polling mode is used. If one can live with the consequences, this 24 + property can be used to enable interrupt handling. 25 + 26 + Affected PHYs (as far as known) are GPY215B and GPY215C. 27 + type: boolean 28 + 29 + dependencies: 30 + maxlinear,use-broken-interrupts: [ interrupts ] 31 + 32 + unevaluatedProperties: false 33 + 34 + examples: 35 + - | 36 + ethernet { 37 + #address-cells = <1>; 38 + #size-cells = <0>; 39 + 40 + ethernet-phy@0 { 41 + reg = <0>; 42 + interrupts-extended = <&intc 0>; 43 + maxlinear,use-broken-interrupts; 44 + }; 45 + }; 46 + 47 + ...
+2
Documentation/devicetree/bindings/vendor-prefixes.yaml
··· 775 775 description: MaxBotix Inc. 776 776 "^maxim,.*": 777 777 description: Maxim Integrated Products 778 + "^maxlinear,.*": 779 + description: MaxLinear Inc. 778 780 "^mbvl,.*": 779 781 description: Mobiveil Inc. 780 782 "^mcube,.*":
+5
drivers/net/phy/mxl-gpy.c
··· 12 12 #include <linux/mutex.h> 13 13 #include <linux/phy.h> 14 14 #include <linux/polynomial.h> 15 + #include <linux/property.h> 15 16 #include <linux/netdevice.h> 16 17 17 18 /* PHY ID */ ··· 292 291 return -ENOMEM; 293 292 phydev->priv = priv; 294 293 mutex_init(&priv->mbox_lock); 294 + 295 + if (gpy_has_broken_mdint(phydev) && 296 + !device_property_present(dev, "maxlinear,use-broken-interrupts")) 297 + phydev->dev_flags |= PHY_F_NO_IRQ; 295 298 296 299 fw_version = phy_read(phydev, PHY_FWV); 297 300 if (fw_version < 0)
+7
drivers/net/phy/phy_device.c
··· 1487 1487 1488 1488 phydev->interrupts = PHY_INTERRUPT_DISABLED; 1489 1489 1490 + /* PHYs can request to use poll mode even though they have an 1491 + * associated interrupt line. This could be the case if they 1492 + * detect a broken interrupt handling. 1493 + */ 1494 + if (phydev->dev_flags & PHY_F_NO_IRQ) 1495 + phydev->irq = PHY_POLL; 1496 + 1490 1497 /* Port is set to PORT_TP by default and the actual PHY driver will set 1491 1498 * it to different value depending on the PHY configuration. If we have 1492 1499 * the generic PHY driver we can't figure it out, thus set the old
+3
include/linux/phy.h
··· 739 739 #endif 740 740 }; 741 741 742 + /* Generic phy_device::dev_flags */ 743 + #define PHY_F_NO_IRQ 0x80000000 744 + 742 745 static inline struct phy_device *to_phy_device(const struct device *dev) 743 746 { 744 747 return container_of(to_mdio_device(dev), struct phy_device, mdio);