[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3649566c-1424-133f-fed0-b920874fb36b@gmail.com>
Date: Mon, 4 May 2020 10:45:14 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Michael Walle <michael@...le.cc>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S . Miller" <davem@...emloft.net>,
Vladimir Oltean <vladimir.oltean@....com>,
Antoine Tenart <antoine.tenart@...tlin.com>
Subject: Re: [PATCH net-next 1/3] net: phy: add concept of shared storage for
PHYs
On 5/4/2020 9:38 AM, Michael Walle wrote:
> There are packages which contain multiple PHY devices, eg. a quad PHY
> transceiver. Provide functions to allocate and free shared storage.
>
> Usually, a quad PHY contains global registers, which don't belong to any
> PHY. Provide convenience functions to access these registers.
>
> Signed-off-by: Michael Walle <michael@...le.cc>
This looks pretty good, just a few comments below.
[snip]
> +
> +/**
> + * devm_phy_package_join - resource managed phy_package_join()
> + * @dev: device that is registering this GPIO device
You mean device registering this PHY package here?
[snip]
Might be worth a comment that this is a used as a bit number.
> +
> +#define PHY_SHARED_F_INIT_DONE 0
> +
> /*
> * The Bus class for PHYs. Devices which provide access to
> * PHYs should register using this structure
> @@ -278,6 +301,12 @@ struct mii_bus {
> int reset_delay_us;
> /* RESET GPIO descriptor pointer */
> struct gpio_desc *reset_gpiod;
> +
> + /* protect access to the shared element */
> + struct mutex shared_lock;
> +
> + /* shared state across different PHYs */
> + struct phy_package_shared *shared[PHY_MAX_ADDR];
> };
> #define to_mii_bus(d) container_of(d, struct mii_bus, dev)
>
> @@ -478,6 +507,10 @@ struct phy_device {
> /* For use by PHYs to maintain extra state */
> void *priv;
>
> + /* shared data pointer */
> + /* For use by PHYs inside the same package and needs a shared state. */
s/and needs/that need/
--
Florian
Powered by blists - more mailing lists