Re: [RFC] comparing the propesed implementation for standalone PCS drivers
From: Sean Anderson <sean.anderson@linux.dev>
Date: 2025-07-10 23:58:59
Also in:
lkml
From: Sean Anderson <sean.anderson@linux.dev>
Date: 2025-07-10 23:58:59
Also in:
lkml
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