netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@linux.dev>
To: Simon Horman <horms@kernel.org>
Cc: Daniel Golle <daniel@makrotopia.org>,
	netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Russell King <linux@armlinux.org.uk>,
	Vineeth Karumanchi <vineeth.karumanchi@amd.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	linux-kernel@vger.kernel.org,
	Kory Maincent <kory.maincent@bootlin.com>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Lei Wei <quic_leiwei@quicinc.com>,
	Michal Simek <michal.simek@amd.com>,
	Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	Robert Hancock <robert.hancock@calian.com>,
	John Crispin <john@phrozen.org>, Felix Fietkau <nbd@nbd.name>,
	Robert Marko <robimarko@gmail.com>
Subject: Re: [RFC] comparing the propesed implementation for standalone PCS drivers
Date: Thu, 10 Jul 2025 19:58:52 -0400	[thread overview]
Message-ID: <2ce3b809-28c4-487a-85d2-c62bce7260b0@linux.dev> (raw)
In-Reply-To: <c84518eb-15da-4356-ac6a-b2fcb807d92f@linux.dev>

On 7/10/25 18:50, Sean Anderson wrote:
> /* In mac_probe() or whatever */
> scoped_guard(mutex)(&pcs_remove_lock) {
> 	/* Just imagine some terrible contortions for compatibility here */
> 	struct phylink_pcs *pcs = pcs_get(dev, "my_pcs");
> 	if (IS_ERR(pcs))
> 		return PTR_ERR(pcs);
> 
> 	list_add(pcs->list, &config.pcs_list);

One thing we could do would be to add a mac_priv field to the PCS that the
MAC could stick some kind of identifier in. I could live with that.

But I still don't like how you'd need to hold a lock across pcs_get/
phylink_create. It feels like an unwieldy API.

> 	ret = phylink_create(config, dev->fwnode, interface,
> 			     &mac_phylink_ops);
> 	if (ret)
> 		return ret;
> }
> /* At this point the PCS could have already been removed */

--Sean

  reply	other threads:[~2025-07-10 23:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 12:55 [RFC] comparing the propesed implementation for standalone PCS drivers Daniel Golle
2025-06-13 16:06 ` Sean Anderson
2025-07-09 13:52   ` Simon Horman
2025-07-10 22:50     ` Sean Anderson
2025-07-10 23:58       ` Sean Anderson [this message]
2025-07-10 23:44     ` Christian Marangi (Ansuel)

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=2ce3b809-28c4-487a-85d2-c62bce7260b0@linux.dev \
    --to=sean.anderson@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=john@phrozen.org \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=michal.simek@amd.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quic_leiwei@quicinc.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=robert.hancock@calian.com \
    --cc=robimarko@gmail.com \
    --cc=vineeth.karumanchi@amd.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;
as well as URLs for NNTP newsgroup(s).