From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH RFC 3/4] net: phy: add unlocked accessors Date: Sat, 9 Dec 2017 10:22:14 -0800 Message-ID: <58260f24-a49c-fb1d-b774-fe457141a2d9@gmail.com> References: <20171208154756.GF10595@n2100.armlinux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Russell King , Andrew Lunn Return-path: Received: from mail-ot0-f194.google.com ([74.125.82.194]:39284 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750954AbdLISWR (ORCPT ); Sat, 9 Dec 2017 13:22:17 -0500 Received: by mail-ot0-f194.google.com with SMTP id v21so11686989oth.6 for ; Sat, 09 Dec 2017 10:22:17 -0800 (PST) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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 Reviewed-by: Florian Fainelli > --- > 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