Re: [PATCH v1 1/2] driver core: fw_devlink: Add support for FWNODE_FLAG_BROKEN_PARENT

From: Andrew Lunn
Date: Thu Sep 30 2021 - 16:22:52 EST


> I don't think this is going to scale, we have dozens and dozens of
> drivers that connect to the PHY during ndo_open(). It is not realistic
> to audit them all, just like the opposite case where the drivers do
> probe MDIO/PHY during their .probe() call is not realistic either.

I was wondering if Coccinelle could help use here. But a quick scan of
the documents don't suggest it can follow call stacks. Ideally we
would what something to goes and finds the struct net_device_ops, and
gets the function used for .ndo_open. Then look into that function,
and all functions it calls within the driver, and see if any of them
connect the PHY to the MAC. We could then add an additional parameter
to indicate we are in ndo_open context.

But it looks like that is wishful thinking.

Andrew