From: Michael Walle <michael@walle.cc>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrew Lunn <andrew@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register
Date: Wed, 10 Feb 2021 12:14:35 +0100 [thread overview]
Message-ID: <3a9716ffafc632d2963d3eee673fb0b1@walle.cc> (raw)
In-Reply-To: <20210210104900.GS1463@shell.armlinux.org.uk>
Am 2021-02-10 11:49, schrieb Russell King - ARM Linux admin:
> On Wed, Feb 10, 2021 at 11:38:18AM +0100, Michael Walle wrote:
>> Am 2021-02-10 11:30, schrieb Russell King - ARM Linux admin:
>> > On Wed, Feb 10, 2021 at 08:03:07AM +0100, Heiner Kallweit wrote:
>> > > On 09.02.2021 17:40, Michael Walle wrote:
>> > > > +out:
>> > > > + return phy_restore_page(phydev, oldpage, err);
>> > >
>> > > If a random page was set before entering config_init, do we actually
>> > > want
>> > > to restore it? Or wouldn't it be better to set the default page as
>> > > part
>> > > of initialization?
>> >
>> > I think you've missed asking one key question: does the paging on this
>> > PHY affect the standardised registers at 0..15 inclusive, or does it
>> > only affect registers 16..31?
>>
>> For this PHY it affects only registers >=16. But that doesn't
>> invaldiate
>> the point that for other PHYs this might affect all regsisters. Eg.
>> ones
>> where you could select between fiber and copper pages, right?
>
> You are modifying the code using ip101a_g_* functions, which is only
> used for the IP101A and IP101G PHYs. Do these devices support fiber
> in a way that change the first 16 registers?
The PHY doesn't support fiber and register 0..15 are always available
regardless of the selected page for the IP101G.
genphy_() stuff will work, but the IP101G PHY driver specific functions,
like interrupt and mdix will break if someone is messing with the page
register from userspace.
So Heiner's point was, that there are other PHY drivers which
also break when a user changes registers from userspace and no one
seemed to cared about that for now.
I guess it boils down to: how hard should we try to get the driver
behave correctly if the user is changing registers. Or can we
just make the assumption that if the PHY driver sets the page
selection to its default, all the other callbacks will work
on this page.
-michael
next prev parent reply other threads:[~2021-02-10 11:17 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-09 16:40 [PATCH net-next 0/9] net: phy: icplus: cleanups and new features Michael Walle
2021-02-09 16:40 ` [PATCH net-next 1/9] net: phy: icplus: use PHY_ID_MATCH_MODEL() macro Michael Walle
2021-02-10 1:55 ` Andrew Lunn
2021-02-09 16:40 ` [PATCH net-next 2/9] net: phy: icplus: use PHY_ID_MATCH_EXACT() for IP101A/G Michael Walle
2021-02-10 1:57 ` Andrew Lunn
2021-02-09 16:40 ` [PATCH net-next 3/9] net: phy: icplus: drop address operator for functions Michael Walle
2021-02-10 1:57 ` Andrew Lunn
2021-02-09 16:40 ` [PATCH net-next 4/9] net: phy: icplus: use the .soft_reset() of the phy-core Michael Walle
2021-02-10 2:02 ` Andrew Lunn
2021-02-09 16:40 ` [PATCH net-next 5/9] net: phy: icplus: add IP101A/IP101G model detection Michael Walle
2021-02-09 20:03 ` Heiner Kallweit
2021-02-09 16:40 ` [PATCH net-next 6/9] net: phy: icplus: don't set APS_EN bit on IP101G Michael Walle
2021-02-10 2:04 ` Andrew Lunn
2021-02-09 16:40 ` [PATCH net-next 7/9] net: phy: icplus: select page before writing control register Michael Walle
2021-02-10 2:07 ` Andrew Lunn
2021-02-10 7:03 ` Heiner Kallweit
2021-02-10 8:25 ` Michael Walle
2021-02-10 9:03 ` Heiner Kallweit
2021-02-10 9:14 ` Michael Walle
2021-02-10 10:30 ` Russell King - ARM Linux admin
2021-02-10 10:38 ` Michael Walle
2021-02-10 10:49 ` Russell King - ARM Linux admin
2021-02-10 11:14 ` Michael Walle [this message]
2021-02-10 11:48 ` Russell King - ARM Linux admin
2021-02-10 12:17 ` Michael Walle
2021-02-10 12:26 ` Heiner Kallweit
2021-02-10 20:27 ` Andrew Lunn
2021-02-09 16:40 ` [PATCH net-next 8/9] net: phy: icplus: add PHY counter for IP101G Michael Walle
2021-02-10 2:10 ` Andrew Lunn
2021-02-09 16:40 ` [PATCH net-next 9/9] net: phy: icplus: add MDI/MDIX support for IP101A/G Michael Walle
2021-02-10 2:12 ` Andrew Lunn
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=3a9716ffafc632d2963d3eee673fb0b1@walle.cc \
--to=michael@walle.cc \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.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).