lkml.org 
[lkml]   [2020]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH net-next 1/3] net: phy: add concept of shared storage for PHYs
On Tue, Apr 21, 2020 at 01:26:22AM +0200, 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.

Hi Michael

Please provide a patch 0/3 cover note. DaveM will uses it for the
merge commit, etc.

> +void phy_package_leave(struct phy_device *phydev)
> +{
> + struct mii_bus *bus = phydev->mdio.bus;
> + struct phy_package_shared *shared = phydev->shared;

Reverse Christmas tree.

> +static inline bool phy_package_init_once(struct phy_device *phydev)
> +{
> + struct phy_package_shared *shared = phydev->shared;
> +
> + if (!shared)
> + return false;
> +
> + return !test_and_set_bit(PHY_SHARED_F_INIT_DONE, &shared->flags);
> +}

I need to look at how you actually use this, but i wonder if this is
sufficient. Can two PHYs probe at the same time? Could we have one PHY
be busy setting up the global init, and the other thinks the global
setup is complete? Do we want a comment like: 'Returns true when the
global package initialization is either under way or complete'?

Andrew

\
 
 \ /
  Last update: 2020-04-21 16:35    [W:0.121 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site