mbox series

[net-next,v3,0/4] net: phy: mxl-gpy: broken interrupt fixes

Message ID 20230109123013.3094144-1-michael@walle.cc
Headers show
Series net: phy: mxl-gpy: broken interrupt fixes | expand

Message

Michael Walle Jan. 9, 2023, 12:30 p.m. UTC
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.

v3:
 - move phy_device::dev_flags after the struct phy_device definition.
   also add a comment. Thanks Russell.
 - add a rationale for the new devicetree property in the commit
   message

v2:
 - new handling of how to disable the interrupts

Michael Walle (4):
  dt-bindings: vendor-prefixes: add MaxLinear
  dt-bindings: net: phy: add MaxLinear GPY2xx bindings
  net: phy: allow a phy to opt-out of interrupt handling
  net: phy: mxl-gpy: disable interrupts on GPY215 by default

 .../bindings/net/maxlinear,gpy2xx.yaml        | 47 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 drivers/net/phy/mxl-gpy.c                     |  5 ++
 drivers/net/phy/phy_device.c                  |  7 +++
 include/linux/phy.h                           |  3 ++
 5 files changed, 64 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/maxlinear,gpy2xx.yaml

Comments

Andrew Lunn Jan. 9, 2023, 1:40 p.m. UTC | #1
On Mon, Jan 09, 2023 at 01:30:12PM +0100, Michael Walle wrote:
> Until now, it is not possible for a PHY driver to disable interrupts
> during runtime. If a driver offers the .config_intr() as well as the
> .handle_interrupt() ops, it is eligible for interrupt handling.
> Introduce a new flag for the dev_flags property of struct phy_device, which
> can be set by PHY driver to skip interrupt setup and fall back to polling
> mode.
> 
> At the moment, this is used for the MaxLinear PHY which has broken
> interrupt handling and there is a need to disable interrupts in some
> cases.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>

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

    Andrew
Andrew Lunn Jan. 9, 2023, 1:41 p.m. UTC | #2
On Mon, Jan 09, 2023 at 01:30:13PM +0100, Michael Walle wrote:
> The interrupts on the GPY215B and GPY215C are broken and the only viable
> fix is to disable them altogether. There is still the possibilty to
> opt-in via the device tree.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>

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

    Andrew
patchwork-bot+netdevbpf@kernel.org Jan. 10, 2023, 1:10 p.m. UTC | #3
Hello:

This series was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Mon,  9 Jan 2023 13:30:09 +0100 you wrote:
> 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.
> 
> v3:
>  - move phy_device::dev_flags after the struct phy_device definition.
>    also add a comment. Thanks Russell.
>  - add a rationale for the new devicetree property in the commit
>    message
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/4] dt-bindings: vendor-prefixes: add MaxLinear
    https://git.kernel.org/netdev/net-next/c/dd1a98a375a6
  - [net-next,v3,2/4] dt-bindings: net: phy: add MaxLinear GPY2xx bindings
    https://git.kernel.org/netdev/net-next/c/90c47eb169ac
  - [net-next,v3,3/4] net: phy: allow a phy to opt-out of interrupt handling
    https://git.kernel.org/netdev/net-next/c/7d885863e716
  - [net-next,v3,4/4] net: phy: mxl-gpy: disable interrupts on GPY215 by default
    https://git.kernel.org/netdev/net-next/c/97a89ed101bb

You are awesome, thank you!