From: Vivien Didelot <vivien.didelot@savoirfairelinux•com>
To: Andrew Lunn <andrew@lunn•ch>, John Crispin <john@phrozen•org>
Cc: "David S. Miller" <davem@davemloft•net>,
Florian Fainelli <f.fainelli@gmail•com>,
netdev@vger•kernel.org, linux-kernel@vger•kernel.org,
qsdk-review@qca•qualcomm.com
Subject: Re: [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family
Date: Tue, 13 Sep 2016 13:11:56 -0400 [thread overview]
Message-ID: <87twdjafmr.fsf@ketchup.mtl.sfl> (raw)
In-Reply-To: <20160913131408.GE15332@lunn.ch>
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
next prev parent reply other threads:[~2016-09-13 17:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 8:35 [PATCH 0/3] net-next: dsa: add QCA8K support John Crispin
2016-09-12 8:35 ` [PATCH 1/3] Documentation: devicetree: add qca8k binding John Crispin
2016-09-12 11:53 ` Sergei Shtylyov
2016-09-12 8:35 ` [PATCH 2/3] net-next: dsa: add Qualcomm tag RX/TX handler John Crispin
2016-09-12 12:26 ` Andrew Lunn
2016-09-12 8:35 ` [PATCH 3/3] net-next: dsa: add new driver for qca8xxx family John Crispin
2016-09-12 13:16 ` Andrew Lunn
2016-09-12 22:52 ` Andrew Lunn
2016-09-13 0:40 ` Andrew Lunn
2016-09-13 8:04 ` John Crispin
2016-09-13 15:59 ` Andrew Lunn
2016-09-13 17:09 ` Florian Fainelli
2016-09-13 18:07 ` John Crispin
2016-09-13 18:11 ` Florian Fainelli
2016-09-13 1:23 ` Andrew Lunn
2016-09-13 9:40 ` John Crispin
2016-09-13 13:14 ` Andrew Lunn
2016-09-13 17:11 ` Vivien Didelot [this message]
2016-09-13 19:07 ` Andrew Lunn
2016-09-13 19:10 ` John Crispin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87twdjafmr.fsf@ketchup.mtl.sfl \
--to=vivien.didelot@savoirfairelinux$(echo .)com \
--cc=andrew@lunn$(echo .)ch \
--cc=davem@davemloft$(echo .)net \
--cc=f.fainelli@gmail$(echo .)com \
--cc=john@phrozen$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=qsdk-review@qca$(echo .)qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox