From: Heiner Kallweit <hkallweit1@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] net: phy: at803x: use PHY_ID_MATCH_EXACT for IDs
Date: Tue, 1 Oct 2019 20:37:50 +0200 [thread overview]
Message-ID: <4fc4c81f-8fe7-a641-c906-df0af2a63749@gmail.com> (raw)
In-Reply-To: <20191001060811.24291-2-o.rempel@pengutronix.de>
On 01.10.2019 08:08, Oleksij Rempel wrote:
> Use exact match for all IDs. We have no sanity checks, so we can peek
> a device with no exact ID and different register layout.
>
I think it would be better to use PHY_ID_MATCH_EXACT for the newly
added AR9331 only. The mask 0xffffffef for the other Atheros PHY's
may be there for a reason. In this case other PHY's matching the
mask would be silently switched to the genphy driver and may
misbehave.
> Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> drivers/net/phy/at803x.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index 6ad8b1c63c34..7895dbe600ac 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -364,9 +364,8 @@ static int at803x_aneg_done(struct phy_device *phydev)
> static struct phy_driver at803x_driver[] = {
> {
> /* ATHEROS 8035 */
> - .phy_id = ATH8035_PHY_ID,
> + PHY_ID_MATCH_EXACT(ATH8035_PHY_ID),
> .name = "Atheros 8035 ethernet",
> - .phy_id_mask = AT803X_PHY_ID_MASK,
> .probe = at803x_probe,
> .config_init = at803x_config_init,
> .set_wol = at803x_set_wol,
> @@ -378,9 +377,8 @@ static struct phy_driver at803x_driver[] = {
> .config_intr = at803x_config_intr,
> }, {
> /* ATHEROS 8030 */
> - .phy_id = ATH8030_PHY_ID,
> + PHY_ID_MATCH_EXACT(ATH8030_PHY_ID),
> .name = "Atheros 8030 ethernet",
> - .phy_id_mask = AT803X_PHY_ID_MASK,
> .probe = at803x_probe,
> .config_init = at803x_config_init,
> .link_change_notify = at803x_link_change_notify,
> @@ -393,9 +391,8 @@ static struct phy_driver at803x_driver[] = {
> .config_intr = at803x_config_intr,
> }, {
> /* ATHEROS 8031 */
> - .phy_id = ATH8031_PHY_ID,
> + PHY_ID_MATCH_EXACT(ATH8031_PHY_ID),
> .name = "Atheros 8031 ethernet",
> - .phy_id_mask = AT803X_PHY_ID_MASK,
> .probe = at803x_probe,
> .config_init = at803x_config_init,
> .set_wol = at803x_set_wol,
> @@ -411,9 +408,7 @@ 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 },
> - { ATH8035_PHY_ID, AT803X_PHY_ID_MASK },
> + { PHY_ID_MATCH_VENDOR(ATH8030_PHY_ID) },
> { }
> };
>
>
next prev parent reply other threads:[~2019-10-01 18:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-01 6:08 [PATCH v2 0/3] net: phy: at803x: add ar9331 support Oleksij Rempel
2019-10-01 6:08 ` [PATCH v2 1/3] net: phy: at803x: use PHY_ID_MATCH_EXACT for IDs Oleksij Rempel
2019-10-01 18:37 ` Heiner Kallweit [this message]
2019-10-01 6:08 ` [PATCH v2 2/3] net: phy: at803x: add ar9331 support Oleksij Rempel
2019-10-01 18:40 ` Heiner Kallweit
2019-10-01 6:08 ` [PATCH v2 3/3] net: phy: at803x: remove probe and struct at803x_priv Oleksij Rempel
2019-10-01 18:40 ` Heiner Kallweit
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=4fc4c81f-8fe7-a641-c906-df0af2a63749@gmail.com \
--to=hkallweit1@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
/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).