From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: zhuyinbo <zhuyinbo@loongson.cn>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kbuild@vger.kernel.org, davem@davemloft.net,
kuba@kernel.org, masahiroy@kernel.org, michal.lkml@markovi.net,
ndesaulniers@google.com
Subject: Re: [PATCH v1 1/2] modpost: file2alias: fixup mdio alias garbled code in modules.alias
Date: Fri, 26 Nov 2021 10:27:55 +0000 [thread overview]
Message-ID: <YaC2qyfGhOnT3Nve@shell.armlinux.org.uk> (raw)
In-Reply-To: <92c667be-7d33-7742-5fb9-7e5670024911@loongson.cn>
On Fri, Nov 26, 2021 at 05:34:36PM +0800, zhuyinbo wrote:
> Hi Andrew,
>
>
> I don't get udev log, but I can find that phy module wether be load by
> lsmod ways, and you can try
>
> it in any a phy deice and in any arch platform. in addition, I will
> send v2 version patch that need consider
>
> some phy device doesn't follow IEEE802.3 protocol strictly and doesn't
> read phy id from phy register successfully,
I'm not sure I understand what you've said above correctly.
You seem to be saying that the module has been loaded (it appears in
lsmod) but it doesn't get bound to the PHY device? If that is correct,
there isn't a problem with the modalias, but there's something wrong
in the driver matching.
The last sentence seems to point at a completely different problem -
one concerning an inability to correctly read the PHY ID from the PHY
itself. If that's the case, then that isn't a problem with modalias,
it's a problem with reading the PHY ID.
The existing modalias scheme doesn't care about the format of the ID.
Normally the least significant four bits are the PHY revision, but that
doesn't always hold. Let's take a couple of examples:
The PHY ID for a Marvell PHY is 0x01410dd1. This will expand to:
mdio:00000001010000010000110111010001
The kernel modalias tables will be generated from an ID of 0x01410dd0
with a mask of 0xfffffff0. The mask means "ignore the bottom four bits".
So, we end up with this in the module's alias table:
mdio:0000000101000001000011011101????
udev knows that "?" is a wildcard. Consequently the above matches.
On an Atheros PHY, this has an ID value of 0x004dd072. The driver also
has a value of 0x004dd072 and a mask of 0xffffffef, meaning bit 4 is
ignored:
mdio:00000000010011011101000001110010 <= PHY ID
mdio:000000000100110111010000011?0010 <= module alias table
This will also match a PHY with id 0x004dd062.
mdio:00000000010011011101000001100010 <= PHY ID
The current modalias approach is flexible. Publishing the raw hex ID
and having an exact match is too inflexible for phylib and will lead to
users reporting regressions.
Please show us:
1) the contents of the phy_id file for the PHY you are having problems
with. This can be found in /sys/bus/mdio_bus/devices/.../phy_id
2) which driver in the kernel is a problem.
Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
prev parent reply other threads:[~2021-11-26 10:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 12:14 [PATCH v1 1/2] modpost: file2alias: fixup mdio alias garbled code in modules.alias Yinbo Zhu
2021-11-22 12:14 ` [PATCH v1 2/2] net: mdio: fixup ethernet phy module auto-load function Yinbo Zhu
2021-11-22 14:54 ` Russell King (Oracle)
2021-11-22 14:07 ` [PATCH v1 1/2] modpost: file2alias: fixup mdio alias garbled code in modules.alias Andrew Lunn
2021-11-23 2:21 ` zhuyinbo
[not found] ` <5b561d5f-d7ac-4d90-e69e-5a80a73929e0@loongson.cn>
2021-11-23 4:12 ` Andrew Lunn
2021-11-23 4:58 ` zhuyinbo
2021-11-23 13:54 ` Andrew Lunn
2021-11-26 9:34 ` zhuyinbo
2021-11-26 10:27 ` Russell King (Oracle) [this message]
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=YaC2qyfGhOnT3Nve@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=zhuyinbo@loongson.cn \
/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).