From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: "Ramón Nordin Rodriguez" <ramon.nordin.rodriguez@ferroamp.se>
Cc: andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
parthiban.veerasooran@microchip.com
Subject: Re: [PATCH 1/1] net: phy: microchip_t1s: enable lan865x revb1
Date: Fri, 24 May 2024 16:11:51 +0100 [thread overview]
Message-ID: <ZlCuNxe65D3QPeA1@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240524140706.359537-2-ramon.nordin.rodriguez@ferroamp.se>
On Fri, May 24, 2024 at 04:07:06PM +0200, Ramón Nordin Rodriguez wrote:
> +/* this func is copy pasted from Parthibans ongoing work with oa_tc6
> + * see https://lore.kernel.org/netdev/20240418125648.372526-7-Parthiban.Veerasooran@microchip.com/
> + */
Oh dear...
> +static int lan865x_phy_read_mmd(struct phy_device *phydev, int devnum,
> + u16 regnum)
> +{
> + struct mii_bus *bus = phydev->mdio.bus;
> + int addr = phydev->mdio.addr;
> +
> + return bus->read_c45(bus, addr, devnum, regnum);
> +}
> +
> +/* this func is copy pasted from Parthibans ongoing work with oa_tc6
> + * see https://lore.kernel.org/netdev/20240418125648.372526-7-Parthiban.Veerasooran@microchip.com/
> + */
> +static int lan865x_phy_write_mmd(struct phy_device *phydev, int devnum,
> + u16 regnum, u16 val)
> +{
> + struct mii_bus *bus = phydev->mdio.bus;
> + int addr = phydev->mdio.addr;
> +
> + return bus->write_c45(bus, addr, devnum, regnum, val);
> +}
So you need both of these to (dangerously) read and write the C45
address using a devnum with bit 31 set. Please at the very least
take the MDIO bus lock so the locking of these operations remains
consistent.
I'm not sure that abusing the interface by setting bit 31 in the
device address, which is supposed to be between 0 and 31 is
something we're prepared to entertain.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2024-05-24 15:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-24 14:07 [PATCH net 0/1] phy: microchip_t1s: lan865x rev.b1 support Ramón Nordin Rodriguez
2024-05-24 14:07 ` [PATCH 1/1] net: phy: microchip_t1s: enable lan865x revb1 Ramón Nordin Rodriguez
2024-05-24 15:11 ` Russell King (Oracle) [this message]
2024-05-27 5:37 ` [EXTERNAL] " Sai Krishna Gajula
2024-05-24 14:50 ` [PATCH net 0/1] phy: microchip_t1s: lan865x rev.b1 support Andrew Lunn
2024-05-27 9:48 ` Parthiban.Veerasooran
2024-05-24 15:30 ` Russell King (Oracle)
2024-05-27 9:54 ` Parthiban.Veerasooran
2024-05-27 8:21 ` Parthiban.Veerasooran
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=ZlCuNxe65D3QPeA1@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parthiban.veerasooran@microchip.com \
--cc=ramon.nordin.rodriguez@ferroamp.se \
/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).