From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Kishon Vijay Abraham I <kishon@ti.com>,
Antoine Tenart <antoine.tenart@free-electrons.com>,
Quentin Schulz <quentin.schulz@bootlin.com>,
Russell King - ARM Linux <linux@armlinux.org.uk>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
netdev@vger.kernel.org, Sekhar Nori <nsekhar@ti.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Tony Lindgren <tony@atomide.com>,
linux-amlogic@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Vivek Gautam <vivek.gautam@codeaurora.org>,
Chen-Yu Tsai <wens@csie.org>, Carlo Caione <carlo@caione.org>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Manu Gautam <mgautam@codeaurora.org>
Subject: Re: [PATCH v3 0/5] phy: core: rework phy_set_mode to accept phy mode and submode
Date: Mon, 17 Dec 2018 15:06:23 +0100 [thread overview]
Message-ID: <20181217140623.2zze2kfclup7wjti@flea> (raw)
In-Reply-To: <20181120012424.11802-1-grygorii.strashko@ti.com>
[-- Attachment #1: Type: text/plain, Size: 3253 bytes --]
Hi Grygorii, Kishon,
On Mon, Nov 19, 2018 at 07:24:19PM -0600, Grygorii Strashko wrote:
> Thank you for your review.
> I've not added "Tested-by"/"Acked-by" tags due to code changes in v3.
>
> As was discussed in [1] I'm posting series which introduces rework of
> phy_set_mode to accept phy mode and submode. I've dropped TI specific patches as
> this change is pretty big by itself.
>
> Patch 1 is cumulative change which refactors PHY framework code to
> support dual level PHYs mode configuration - PHY mode and PHY submode. It
> extends .set_mode() callback to support additional parameter "int submode"
> and converts all corresponding PHY drivers to support new .set_mode()
> callback declaration.
> The new extended PHY API
> int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode)
> is introduced to support dual level PHYs mode configuration and existing
> phy_set_mode() API is converted to macros, so PHY framework consumers do
> not need to be changed (~21 matches).
>
> Patches 2-4: Add new PHY's mode to be used by Ethernet PHY interface drivers or
> multipurpose PHYs like serdes and convert ocelot-serdes and mvebu-cp110-comphy
> PHY drivers to use recently introduced PHY_MODE_ETHERNET and phy_set_mode_ext().
>
> Patch 5 - removes unused, ethernet specific phy modes from enum phy_mode.
>
> Testing:
> - series tested on TI am335x/am437x/am5(dra7) paltforms.
> - other driver build tested.
I realise I'm a bit late to the party, but while working on the D-PHY
support, I noticed a few things that could be improved.
I guess the main issue is that the sub-mode is completely opaque to
the generic phy framework now. This might not be a big issue, and I
assume that it has been done that way because the net framework
already has a define for the submode it wants.
However, this creates a bunch of drawbacks at the phy framework level:
- phy_set_mode will now pass a submode of 0, all the time. This means
that the behaviour is undefined for all the modes not using the
submodes at the moment, and phy_interface_t seems to have the value
PHY_INTERFACE_MODE_NA matching 0, but I guess this could change in
the future (or the guarantee is not documented anywhere).
- on a similar note, there's no documentation for which value to pass
to phy_set_mode_ext when used with something else than a
PHY_MODE_ETHERNET.
- at the provider level, if you're supporting a phy that isn't using
the submodes, you have no way to filter out or reject any subnode,
since you have no idea what the "no submode" value is.
I guess this can be addressed by:
A) defining a generic phy framework wide unused / invalid phy submode,
that wouldn't collide with the subnode values (such as -1?), and
making phy_set_mode_ext use that.
B) moving the phy submodes definition to the generic phy headers. This
would allow to have a documented, obvious link between a mode and its
subnodes, for all the actors involved (consumer, provider, and
framework) without prior knowledge.
C) Document what the submodes expectations are
What do you think?
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2018-12-17 14:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-20 1:24 [PATCH v3 0/5] phy: core: rework phy_set_mode to accept phy mode and submode Grygorii Strashko
2018-11-20 1:24 ` [PATCH v3 1/5] " Grygorii Strashko
2018-11-20 1:24 ` [PATCH v3 2/5] phy: core: add PHY_MODE_ETHERNET Grygorii Strashko
2018-11-20 1:24 ` [PATCH v3 3/5] phy: ocelot-serdes: convert to use eth phy mode and submode Grygorii Strashko
2018-11-20 9:18 ` Quentin Schulz
2018-11-20 1:24 ` [PATCH v3 4/5] phy: mvebu-cp110-comphy: " Grygorii Strashko
2018-11-21 7:38 ` Kishon Vijay Abraham I
2018-11-21 7:52 ` Quentin Schulz
2018-11-21 7:58 ` Antoine Tenart
2018-11-21 8:02 ` Antoine Tenart
2018-11-20 1:24 ` [PATCH v3 5/5] phy: core: clean up unused ethernet specific phy modes Grygorii Strashko
2018-11-21 8:55 ` [PATCH v3 0/5] phy: core: rework phy_set_mode to accept phy mode and submode Kishon Vijay Abraham I
2018-11-21 18:23 ` Grygorii Strashko
2018-12-17 14:06 ` Maxime Ripard [this message]
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=20181217140623.2zze2kfclup7wjti@flea \
--to=maxime.ripard@bootlin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=antoine.tenart@free-electrons.com \
--cc=carlo@caione.org \
--cc=chunfeng.yun@mediatek.com \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=kishon@ti.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mgautam@codeaurora.org \
--cc=netdev@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=quentin.schulz@bootlin.com \
--cc=tony@atomide.com \
--cc=vivek.gautam@codeaurora.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).