From: Christian Marangi <ansuelsmth@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Michal Simek <michal.simek@amd.com>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next] net: phy: constify phydev->drv
Date: Sat, 3 Feb 2024 18:04:14 +0100 [thread overview]
Message-ID: <65be7212.050a0220.d2de9.e25c@mx.google.com> (raw)
In-Reply-To: <7f4f7fc2-6bf3-4ecb-9c13-763e2d4f176f@lunn.ch>
On Sat, Feb 03, 2024 at 05:56:19PM +0100, Andrew Lunn wrote:
> On Fri, Feb 02, 2024 at 05:41:45PM +0000, Russell King (Oracle) wrote:
> > Device driver structures are shared between all devices that they
> > match, and thus nothing should never write to the device driver
>
> nothing should never ???
>
> I guess the never should be ever?
>
> > diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
> > index 7fd9fe6a602b..7b1bc5fcef9b 100644
> > --- a/drivers/net/phy/xilinx_gmii2rgmii.c
> > +++ b/drivers/net/phy/xilinx_gmii2rgmii.c
> > @@ -22,7 +22,7 @@
> >
> > struct gmii2rgmii {
> > struct phy_device *phy_dev;
> > - struct phy_driver *phy_drv;
> > + const struct phy_driver *phy_drv;
> > struct phy_driver conv_phy_drv;
> > struct mdio_device *mdio;
> > };
>
> Did you build testing include xilinx_gmii2rgmii.c ? It does funky
> things with phy_driver structures.
>
Looking at the probe function it seems they only swap phy_drv with
conv_phy_drv but it doesn't seems they touch stuff in the phy_dev
struct. Looks like the thing while hackish, seems clean enough to follow
the rule of not touching the OPs and causing side effects.
--
Ansuel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Christian Marangi <ansuelsmth@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Michal Simek <michal.simek@amd.com>,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next] net: phy: constify phydev->drv
Date: Sat, 3 Feb 2024 18:04:14 +0100 [thread overview]
Message-ID: <65be7212.050a0220.d2de9.e25c@mx.google.com> (raw)
In-Reply-To: <7f4f7fc2-6bf3-4ecb-9c13-763e2d4f176f@lunn.ch>
On Sat, Feb 03, 2024 at 05:56:19PM +0100, Andrew Lunn wrote:
> On Fri, Feb 02, 2024 at 05:41:45PM +0000, Russell King (Oracle) wrote:
> > Device driver structures are shared between all devices that they
> > match, and thus nothing should never write to the device driver
>
> nothing should never ???
>
> I guess the never should be ever?
>
> > diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
> > index 7fd9fe6a602b..7b1bc5fcef9b 100644
> > --- a/drivers/net/phy/xilinx_gmii2rgmii.c
> > +++ b/drivers/net/phy/xilinx_gmii2rgmii.c
> > @@ -22,7 +22,7 @@
> >
> > struct gmii2rgmii {
> > struct phy_device *phy_dev;
> > - struct phy_driver *phy_drv;
> > + const struct phy_driver *phy_drv;
> > struct phy_driver conv_phy_drv;
> > struct mdio_device *mdio;
> > };
>
> Did you build testing include xilinx_gmii2rgmii.c ? It does funky
> things with phy_driver structures.
>
Looking at the probe function it seems they only swap phy_drv with
conv_phy_drv but it doesn't seems they touch stuff in the phy_dev
struct. Looks like the thing while hackish, seems clean enough to follow
the rule of not touching the OPs and causing side effects.
--
Ansuel
next prev parent reply other threads:[~2024-02-03 17:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 17:41 [PATCH net-next] net: phy: constify phydev->drv Russell King (Oracle)
2024-02-02 17:41 ` Russell King (Oracle)
2024-02-03 16:56 ` Andrew Lunn
2024-02-03 16:56 ` Andrew Lunn
2024-02-03 17:04 ` Christian Marangi [this message]
2024-02-03 17:04 ` Christian Marangi
2024-02-03 17:23 ` Russell King (Oracle)
2024-02-03 17:23 ` Russell King (Oracle)
2024-02-06 12:10 ` patchwork-bot+netdevbpf
2024-02-06 12:10 ` patchwork-bot+netdevbpf
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=65be7212.050a0220.d2de9.e25c@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=michal.simek@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
/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 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.