Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1482647

Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family

From Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family
Date 2016-09-13 19:20 +0200
Message-ID <sgZxf-4RT-3@gated-at.bofh.it> (permalink)
References <sguWt-OS-3@gated-at.bofh.it> <sguWu-OS-33@gated-at.bofh.it> <sgKHT-35L-1@gated-at.bofh.it> <sgSvM-8uI-9@gated-at.bofh.it> <sgVMZ-2qI-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Andrew,

Andrew Lunn <andrew@lunn.ch> writes:

>> ok, i will simply substract 1 from the phy_addr inside the mdio
>> callbacks. this would make the code more readable and make the DT
>> binding compliant with the ePAPR spec.
>
> It does however need well commenting. It is setting a trap for anybody
> who puts an external PHY on port 6. If they access that PHY via these
> functions, the address is off by one.
>
> This is the first silicon vendor who made their MDIO addresses for
> PHYs illogical. So i'm thinking we maybe should add a new function to
> dsa_switch_ops.
>
> 	/* Return the MDIO address for the PHY for this port. */
>         int     (*phy_port_map(struct dsa_switch *ds, int port);
>
> This should return the MDIO address for integrated PHYs only, or
> -ENODEV if the port does not have an integrated PHY. For an external
> PHY, a phy-handle should be used. This phy_port_map() is used in
> dsa_slave_phy_setup(). But dsa_slave_phy_setup() is already too
> complex, so it needs doing with care.

Note that some switch drivers *have to* register their slave MDIO bus
themselves (e.g. bcm_sf2). This becomes confusing with the DSA
phy_{read,write} ops.

Since the former alternative is prefered, we may want to remove the
latter soon from DSA. If this phy_port_map is needed for that case, it'd
be preferable not to add it.

Thanks,

        Vivien

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] net-next: dsa: add QCA8K support John Crispin <john@phrozen.org> - 2016-09-12 10:40 +0200
  [PATCH 2/3] net-next: dsa: add Qualcomm tag RX/TX handler John Crispin <john@phrozen.org> - 2016-09-12 10:40 +0200
    Re: [PATCH 2/3] net-next: dsa: add Qualcomm tag RX/TX handler Andrew Lunn <andrew@lunn.ch> - 2016-09-12 14:30 +0200
  [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family John Crispin <john@phrozen.org> - 2016-09-12 10:40 +0200
    Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Andrew Lunn <andrew@lunn.ch> - 2016-09-12 15:20 +0200
    Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Andrew Lunn <andrew@lunn.ch> - 2016-09-13 01:00 +0200
    Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Andrew Lunn <andrew@lunn.ch> - 2016-09-13 02:50 +0200
      Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family John Crispin <john@phrozen.org> - 2016-09-13 10:10 +0200
        Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Andrew Lunn <andrew@lunn.ch> - 2016-09-13 18:00 +0200
          Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Florian Fainelli <f.fainelli@gmail.com> - 2016-09-13 19:20 +0200
            Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family John Crispin <john@phrozen.org> - 2016-09-13 20:10 +0200
              Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Florian Fainelli <f.fainelli@gmail.com> - 2016-09-13 20:20 +0200
    Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Andrew Lunn <andrew@lunn.ch> - 2016-09-13 03:30 +0200
      Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family John Crispin <john@phrozen.org> - 2016-09-13 11:50 +0200
        Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Andrew Lunn <andrew@lunn.ch> - 2016-09-13 15:20 +0200
          Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-09-13 19:20 +0200
            Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family Andrew Lunn <andrew@lunn.ch> - 2016-09-13 21:10 +0200
              Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family John Crispin <john@phrozen.org> - 2016-09-13 21:20 +0200

csiph-web