All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Russell King <rmk+kernel@armlinux.org.uk>, Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH RFC 3/4] net: phy: add unlocked accessors
Date: Sat, 9 Dec 2017 10:22:14 -0800	[thread overview]
Message-ID: <58260f24-a49c-fb1d-b774-fe457141a2d9@gmail.com> (raw)
In-Reply-To: <E1eNKtR-0007nR-AH@rmk-PC.armlinux.org.uk>



On 12/08/2017 07:48 AM, Russell King wrote:
> Add unlocked versions of the bus accessors, which allows access to the
> bus with all the tracing. These accessors validate that the bus mutex
> is held, which is a basic requirement for all mii bus accesses.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
>  include/linux/phy.h | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 71d777fe6c3d..964803bd7324 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -716,6 +716,18 @@ static inline int phy_read(struct phy_device *phydev, u32 regnum)
>  }
>  
>  /**
> + * __phy_read - convenience function for reading a given PHY register
> + * @phydev: the phy_device struct
> + * @regnum: register number to read
> + *
> + * The caller must have taken the MDIO bus lock.
> + */
> +static inline int __phy_read(struct phy_device *phydev, u32 regnum)

Do you know if we could have sparse validate that the caller of these
functions holds the mutex? I remember reading somewhere that sparse does
not do that yet, but can't get my hands on it.
-- 
Florian

  reply	other threads:[~2017-12-09 18:22 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 [this message]
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
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=58260f24-a49c-fb1d-b774-fe457141a2d9@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    /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.