From: Andrew Lunn <andrew@lunn.ch>
To: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: davem@davemloft.net, f.fainelli@gmail.com,
allan.nielsen@microchip.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, thomas.petazzoni@bootlin.com,
Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Subject: Re: [PATCH net-next 1/5] net: phy: mscc: add ethtool statistics counters
Date: Fri, 14 Sep 2018 15:29:59 +0200 [thread overview]
Message-ID: <20180914132959.GH14865@lunn.ch> (raw)
In-Reply-To: <20180914131645.64k4w4h7ir3u5yuk@qschulz>
> When you change a page, you basically can access only the registers in
> this page so if there are two functions requesting different pages at
> the same time or registers of different pages, it won't work well
> indeed.
>
> > phy_read_page() and phy_write_page() will do the needed locking if
> > this is an issue.
> >
>
> That's awesome! Didn't know it existed. Thanks a ton!
>
> Well, that means I should migrate the whole driver to use
> phy_read/write_paged instead of the phy_read/write that is currently in
> use.
>
> That's impacting performance though as per phy_read/write_paged we read
> the current page, set the desired page, read/write the register, set the
> old page back. That's 4 times more operations.
You can use the lower level locking primatives. See m88e1318_set_wol()
for example.
> Couldn't we use the
> phy_device mutex instead (as it's currently done in the whole driver)?
> Or is it worse/comparable in performance to the suggested solution?
Russell King found a race condition where this breaks. You cannot hold
the phy_device mutex everywhere.
Andrew
next prev parent reply other threads:[~2018-09-14 13:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-14 8:33 [PATCH net-next 0/5] Various improvements to Microsemi PHY driver Quentin Schulz
2018-09-14 8:33 ` [PATCH net-next 1/5] net: phy: mscc: add ethtool statistics counters Quentin Schulz
2018-09-14 13:01 ` Andrew Lunn
2018-09-14 13:16 ` Quentin Schulz
2018-09-14 13:29 ` Andrew Lunn [this message]
2018-10-02 13:51 ` Quentin Schulz
2018-10-04 14:17 ` Quentin Schulz
2018-09-14 8:33 ` [PATCH net-next 2/5] net: phy: mscc: Add EEE init sequence Quentin Schulz
2018-09-15 2:21 ` Florian Fainelli
2018-10-01 8:51 ` Quentin Schulz
2018-10-01 16:27 ` Florian Fainelli
2018-09-14 8:33 ` [PATCH net-next 3/5] net: phy: mscc: remove unneeded parenthesis Quentin Schulz
2018-09-14 13:04 ` Andrew Lunn
2018-09-15 20:52 ` Florian Fainelli
2018-09-14 8:33 ` [PATCH net-next 4/5] net: phy: mscc: shorten `x != 0` condition to `x` Quentin Schulz
2018-09-14 13:05 ` Andrew Lunn
2018-09-15 20:53 ` Florian Fainelli
2018-09-14 8:33 ` [PATCH net-next 5/5] net: phy: mscc: remove unneeded temporary variable Quentin Schulz
2018-09-14 13:06 ` Andrew Lunn
2018-09-15 2:19 ` Florian Fainelli
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=20180914132959.GH14865@lunn.ch \
--to=andrew@lunn.ch \
--cc=Raju.Lakkaraju@microsemi.com \
--cc=allan.nielsen@microchip.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=quentin.schulz@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.