From: Florian Fainelli <f.fainelli@gmail.com>
To: Russell King - ARM Linux <linux@armlinux.org.uk>,
Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH RFC 0/4] Fixes for Marvell MII paged register access races
Date: Sat, 9 Dec 2017 10:22:58 -0800 [thread overview]
Message-ID: <a968b765-a9e9-9ff7-9a95-2a98ce0db9fc@gmail.com> (raw)
In-Reply-To: <20171208164446.GH10595@n2100.armlinux.org.uk>
On 12/08/2017 08:44 AM, Russell King - ARM Linux wrote:
> On Fri, Dec 08, 2017 at 05:17:14PM +0100, Andrew Lunn wrote:
>> Hi Russell
>>
>>> There is an open question whether there should be generic helpers for
>>> this. Generic helpers would mean:
>>>
>>> - Additional couple of function pointers in phy_driver to read/write the
>>> paging register. This has the restriction that there must only be one
>>> paging register.
>>
>> I must be missing something. I don't see why there is this
>> restriction. Don't we just need
>>
>> int phy_get_page(phydev);
>> int phy_set_page(phydev, page);
>
> The restriction occurs because a PHY may have several different
> registers, and knowing which of the registers need touching becomes an
> issue. We wouldn't want these accessors to needlessly access several
> registers each and every time we requested an access to the page
> register.
>
> There's also the issue of whether an "int" or whatever type we choose to
> pass the "page" around is enough bits. I haven't surveyed all the PHY
> drivers yet to know the answer to that.
I have not come across a PHY yet that required writing a page across two
16-bit quantities, in general, the page fits within less than 16-bit
actually to fit within one MDIO write. That does not mean it cannot
exist obviously, but having about 32-bit x pages of address space within
a PHY sounds a bit extreme.
--
Florian
next prev parent reply other threads:[~2017-12-09 18:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 15:47 [PATCH RFC 0/4] Fixes for Marvell MII paged register access races Russell King - ARM Linux
2017-12-08 15:48 ` [PATCH RFC 1/4] net: mdiobus: add unlocked accessors Russell King
2017-12-09 18:20 ` Florian Fainelli
2017-12-08 15:48 ` [PATCH RFC 2/4] net: phy: use unlocked accessors for indirect MMD accesses Russell King
2017-12-09 18:21 ` Florian Fainelli
2017-12-08 15:48 ` [PATCH RFC 3/4] net: phy: add unlocked accessors Russell King
2017-12-09 18:22 ` Florian Fainelli
2017-12-09 23:11 ` Russell King - ARM Linux
2017-12-08 15:48 ` [PATCH RFC 4/4] net: phy: marvell: fix paged access races Russell King
2017-12-08 16:17 ` [PATCH RFC 0/4] Fixes for Marvell MII paged register " Andrew Lunn
2017-12-08 16:44 ` Russell King - ARM Linux
2017-12-09 18:22 ` Florian Fainelli [this message]
2017-12-09 23:49 ` Russell King - ARM Linux
2017-12-10 0:19 ` Andrew Lunn
2017-12-09 18:19 ` Florian Fainelli
2017-12-09 19:06 ` 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=a968b765-a9e9-9ff7-9a95-2a98ce0db9fc@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--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).