* [PATCH net-next] net: phy: at803x: fix PHY ID masks
@ 2020-05-22 9:53 Michael Walle
2020-05-23 23:26 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Michael Walle @ 2020-05-22 9:53 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, Russell King,
David S . Miller, Jakub Kicinski, Michael Walle, Matus Ujhelyi
Ever since its first commit 0ca7111a38f05 ("phy: add AT803x driver") the
PHY ID mask was set to 0xffffffef. It is unclear to me why this mask was
chosen in the first place. Both the AR8031/AR8033 and the AR8035
datasheets mention it is always the given value:
- for AR8031/AR8033 its 0x004d/0xd074
- for AR8035 its 0x004d/0xd072
Unfortunately, I don't have a datasheet for the AR8030. Therefore, we
leave its PHY ID mask untouched. For the PHYs mentioned before use the
handy PHY_ID_MATCH_EXACT() macro.
I've tried to contact the author of the initial commit, but received no
answer so far.
Cc: Matus Ujhelyi <ujhelyi.m@gmail.com>
Signed-off-by: Michael Walle <michael@walle.cc>
---
drivers/net/phy/at803x.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index acd51b29a476..822b3acf6be7 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -126,7 +126,7 @@
#define ATH8031_PHY_ID 0x004dd074
#define ATH8032_PHY_ID 0x004dd023
#define ATH8035_PHY_ID 0x004dd072
-#define AT803X_PHY_ID_MASK 0xffffffef
+#define AT8030_PHY_ID_MASK 0xffffffef
MODULE_DESCRIPTION("Qualcomm Atheros AR803x PHY driver");
MODULE_AUTHOR("Matus Ujhelyi");
@@ -967,9 +967,8 @@ static int at803x_cable_test_start(struct phy_device *phydev)
static struct phy_driver at803x_driver[] = {
{
/* Qualcomm Atheros AR8035 */
- .phy_id = ATH8035_PHY_ID,
+ PHY_ID_MATCH_EXACT(ATH8035_PHY_ID),
.name = "Qualcomm Atheros AR8035",
- .phy_id_mask = AT803X_PHY_ID_MASK,
.flags = PHY_POLL_CABLE_TEST,
.probe = at803x_probe,
.remove = at803x_remove,
@@ -991,7 +990,7 @@ static struct phy_driver at803x_driver[] = {
/* Qualcomm Atheros AR8030 */
.phy_id = ATH8030_PHY_ID,
.name = "Qualcomm Atheros AR8030",
- .phy_id_mask = AT803X_PHY_ID_MASK,
+ .phy_id_mask = AT8030_PHY_ID_MASK,
.probe = at803x_probe,
.remove = at803x_remove,
.config_init = at803x_config_init,
@@ -1005,9 +1004,8 @@ static struct phy_driver at803x_driver[] = {
.config_intr = at803x_config_intr,
}, {
/* Qualcomm Atheros AR8031/AR8033 */
- .phy_id = ATH8031_PHY_ID,
+ PHY_ID_MATCH_EXACT(ATH8031_PHY_ID),
.name = "Qualcomm Atheros AR8031/AR8033",
- .phy_id_mask = AT803X_PHY_ID_MASK,
.flags = PHY_POLL_CABLE_TEST,
.probe = at803x_probe,
.remove = at803x_remove,
@@ -1055,10 +1053,10 @@ static struct phy_driver at803x_driver[] = {
module_phy_driver(at803x_driver);
static struct mdio_device_id __maybe_unused atheros_tbl[] = {
- { ATH8030_PHY_ID, AT803X_PHY_ID_MASK },
- { ATH8031_PHY_ID, AT803X_PHY_ID_MASK },
+ { ATH8030_PHY_ID, AT8030_PHY_ID_MASK },
+ { PHY_ID_MATCH_EXACT(ATH8031_PHY_ID) },
{ PHY_ID_MATCH_EXACT(ATH8032_PHY_ID) },
- { ATH8035_PHY_ID, AT803X_PHY_ID_MASK },
+ { PHY_ID_MATCH_EXACT(ATH8035_PHY_ID) },
{ PHY_ID_MATCH_EXACT(ATH9331_PHY_ID) },
{ }
};
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: phy: at803x: fix PHY ID masks
2020-05-22 9:53 [PATCH net-next] net: phy: at803x: fix PHY ID masks Michael Walle
@ 2020-05-23 23:26 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-23 23:26 UTC (permalink / raw)
To: michael
Cc: netdev, linux-kernel, andrew, f.fainelli, hkallweit1, linux,
kuba, ujhelyi.m
From: Michael Walle <michael@walle.cc>
Date: Fri, 22 May 2020 11:53:31 +0200
> Ever since its first commit 0ca7111a38f05 ("phy: add AT803x driver") the
> PHY ID mask was set to 0xffffffef. It is unclear to me why this mask was
> chosen in the first place. Both the AR8031/AR8033 and the AR8035
> datasheets mention it is always the given value:
> - for AR8031/AR8033 its 0x004d/0xd074
> - for AR8035 its 0x004d/0xd072
>
> Unfortunately, I don't have a datasheet for the AR8030. Therefore, we
> leave its PHY ID mask untouched. For the PHYs mentioned before use the
> handy PHY_ID_MATCH_EXACT() macro.
>
> I've tried to contact the author of the initial commit, but received no
> answer so far.
>
> Cc: Matus Ujhelyi <ujhelyi.m@gmail.com>
> Signed-off-by: Michael Walle <michael@walle.cc>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-23 23:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 9:53 [PATCH net-next] net: phy: at803x: fix PHY ID masks Michael Walle
2020-05-23 23:26 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.