[PATCH 2/2] Fix phy_attach - forward dev_flags for phy_attach
Florian Fainelli
florian at openwrt.org
Thu Jan 10 12:12:53 EST 2013
Le 01/10/13 16:57, Kosta Zertsekel a écrit :
>> By the way, most, if not all of the phy_connect() users in drivers/net/ethernet/ also do not ensure they pass the phy device flags, so you might
> want to fix this globally and not just for Marvell driver.
> Indeed, phy_connect() mostly just pass zero intead of phy_dev->dev_flags.
> But, I think, the guy that calls phy_connect() in its driver should know what he does, and,
> probably, we should rely on him knowing his stuff.
> The only evidence of the bug is when phy_dev->dev_flags was actually changed by PHY fixup callback
> (see dns323-setup.c for example) and was *not* propagated to phy_connect() or phy_attach() as in pxa168_eth.c phy_init().
> The code conforming to the former should be fixed IMHO.
Actually, I wonder if we should not rather remove entirely the flags
argument, let the phy_connect() or phy_attach() callers modify the phy
device dev_flags like it does today (e.g: tg3) and modify phy_connect()
and phy_attach() to pass phy->dev_flags to phy_attach_direct().
--
Florian
More information about the linux-arm-kernel
mailing list