From: Florian Fainelli <f.fainelli@gmail.com>
To: Michael Walle <michael@walle.cc>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Antoine Tenart <antoine.tenart@bootlin.com>
Subject: Re: [PATCH net-next 1/3] net: phy: add concept of shared storage for PHYs
Date: Mon, 4 May 2020 10:45:14 -0700 [thread overview]
Message-ID: <3649566c-1424-133f-fed0-b920874fb36b@gmail.com> (raw)
In-Reply-To: <20200504163859.10763-2-michael@walle.cc>
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@walle.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
next prev parent reply other threads:[~2020-05-04 17:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 16:38 [PATCH net-next 0/3] add phy shared storage Michael Walle
2020-05-04 16:38 ` [PATCH net-next 1/3] net: phy: add concept of shared storage for PHYs Michael Walle
2020-05-04 17:45 ` Florian Fainelli [this message]
2020-05-04 16:38 ` [PATCH net-next 2/3] net: phy: bcm54140: use phy_package_shared Michael Walle
2020-05-04 16:38 ` [PATCH net-next 3/3] net: phy: mscc: " Michael Walle
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=3649566c-1424-133f-fed0-b920874fb36b@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@bootlin.com \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=michael@walle.cc \
--cc=netdev@vger.kernel.org \
--cc=vladimir.oltean@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®