[PATCH v1] net: phy: fix motorcomm module automatic loading

Peter Geis pgwipeout at gmail.com
Mon Feb 28 16:44:43 PST 2022


On Mon, Feb 28, 2022 at 7:14 PM Russell King (Oracle)
<linux at armlinux.org.uk> wrote:
>
> On Mon, Feb 28, 2022 at 06:30:57PM -0500, Peter Geis wrote:
> > The sentinel compatible entry whitespace causes automatic module loading
> > to fail with certain userspace utilities. Fix this by removing the
> > whitespace and sentinel comment, which is unnecessary.
>
> Umm. How does it fail?

It simply does not auto load the module by device id match.
Manually loading the module after the fact works fine.

>
> >  static const struct mdio_device_id __maybe_unused motorcomm_tbl[] = {
> >       { PHY_ID_MATCH_EXACT(PHY_ID_YT8511) },
> > -     { /* sentinal */ }
> > +     {}
>
> These two should be 100% identical in terms of the object code produced,
> and thus should have no bearing on the ability for the module to be
> loaded.
>
> Have you investigated the differences in the produced object code?

Yes, you are correct, I just compared the produced files and they are identical.
This patch can get dropped then.
I'm curious now why it seemed to make a difference.

I am not familiar enough with how the various userspace elements
decide to match the modules to determine exactly why this is failing.
It seems to be hit or miss if userspace decides to auto load this, for
instance Ubuntu 20.04 was happy to load my kernel module built with
the arm64 official toolchain, but Manjaro will not load their self
built kernel module.
I originally suspected it was due to the manufacturer id being all zeros.
Unless there's some weird compiler optimization that I'm not seeing in
my configuration.

Any ideas would be appreciated.
Thanks!

> If not, please do so, and describe what they were. Thanks.
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!



More information about the Linux-rockchip mailing list