Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "SkyLake Huang (黃啟澤)" <SkyLake.Huang@mediatek.com>
To: "linux@armlinux.org.uk" <linux@armlinux.org.uk>
Cc: "andrew@lunn.ch" <andrew@lunn.ch>,
	"dqfext@gmail.com" <dqfext@gmail.com>,
	"Steven Liu (劉人豪)" <steven.liu@mediatek.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"daniel@makrotopia.org" <daniel@makrotopia.org>,
	"horms@kernel.org" <horms@kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Subject: Re: [PATCH net-next v2 3/3] net: phy: mediatek: add driver for built-in 2.5G ethernet PHY on MT7988
Date: Tue, 13 May 2025 11:13:04 +0000	[thread overview]
Message-ID: <23205135c80c77b99fe32ef7bbe4ee421ac80bb4.camel@mediatek.com> (raw)
In-Reply-To: <Z77kcqzmCqdT6lE0@shell.armlinux.org.uk>

On Wed, 2025-02-26 at 09:52 +0000, Russell King (Oracle) wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Wed, Feb 26, 2025 at 06:48:34AM +0000, SkyLake Huang (黃啟澤) wrote:
> > On Wed, 2025-02-19 at 09:33 +0000, Russell King (Oracle) wrote:
> > > 
> > > External email : Please do not click links or open attachments
> > > until
> > > you have verified the sender or the content.
> > > 
> > > 
> > > On Wed, Feb 19, 2025 at 04:39:10PM +0800, Sky Huang wrote:
> > > > +static int mt798x_2p5ge_phy_config_init(struct phy_device
> > > > *phydev)
> > > > +{
> > > > +     struct pinctrl *pinctrl;
> > > > +     int ret;
> > > > +
> > > > +     /* Check if PHY interface type is compatible */
> > > > +     if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL)
> > > > +             return -ENODEV;
> > > > +
> > > > +     ret = mt798x_2p5ge_phy_load_fw(phydev);
> > > > +     if (ret < 0)
> > > > +             return ret;
> > > 
> > > Firmware should not be loaded in the .config_init method. The
> > > above
> > > call will block while holding the RTNL which will prevent all
> > > other
> > > network configuration until the firmware has been loaded or the
> > > load
> > > fails.
> > > 
> > > Thanks.
> > > 
> > > --
> > > RMK's Patch system:
> > > https://urldefense.com/v3/__https://www.armlinux.org.uk/developer/patches/__;!!CTRNKA9wMg0ARbw!iV-1ViPFsUV-lLj7aIycan8nery6sQO3t6mkpdlb_GW8hswhxc4ejJozxqkU3s2WzxSizs4kfdC77yr7HGGRIuU$
> > > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
> > Hi Russell,
> > mt798x_p5ge_phy_load_fw() will only load firmware once after driver
> > is
> > probed through priv->fw_loaded. And actually, firmware loading
> > procedure only takes about 11ms. This was discussed earlier in:
> > https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20240520113456.21675-6-SkyLake.Huang@mediatek.com/*25856462__;Iw!!CTRNKA9wMg0ARbw!lQ7b7kgD0JGOHR_CLeHtF5SF-knx3hZcm2u_tYbzgBnX91a7muRwqGhDUaP3XorHlu9qQozNX_pXDMIxO1DyVIY$
> > https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20240520113456.21675-6-SkyLake.Huang@mediatek.com/*25857174__;Iw!!CTRNKA9wMg0ARbw!lQ7b7kgD0JGOHR_CLeHtF5SF-knx3hZcm2u_tYbzgBnX91a7muRwqGhDUaP3XorHlu9qQozNX_pXDMIxHDm1IuQ$
> 
> 1. Wouldn't it be a good idea to include the loading time in the
> patch
>    description or a comment in the patch?
> 
Sure. I'll include this in v3's commit message.

> 2. What about the time it takes for request_firmware() uses the sysfs
>    fallback, which essentially passes the firmware request to
> userspace
>    to deal with? That can block for an indeterminate amount of time.
> 
I'm not really sure how to achieve this. As far as I know, I can
provide fw via /sys/class/firmware/<device-name>/ after I boot into
Linux shell. But at that moment, we need to insmod phy driver again.
Users will also need to load fw file manually. This will add a lot of
complexity. Is this what upstream style expects?

> --
> RMK's Patch system:
> https://urldefense.com/v3/__https://www.armlinux.org.uk/developer/patches/__;!!CTRNKA9wMg0ARbw!lQ7b7kgD0JGOHR_CLeHtF5SF-knx3hZcm2u_tYbzgBnX91a7muRwqGhDUaP3XorHlu9qQozNX_pXDMIxE9f2xWs$
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

BRs,
Sky

  reply	other threads:[~2025-05-13 11:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-19  8:39 [PATCH net-next v2 0/2] Add 2.5G ethernet phy support on MT7988 Sky Huang
2025-02-19  8:39 ` [PATCH net-next v2 1/3] net: phy: mediatek: Add 2.5Gphy firmware dt-bindings and dts node Sky Huang
2025-02-19 12:26   ` Krzysztof Kozlowski
2025-02-19 15:26   ` Andrew Lunn
2025-02-19 15:30     ` Daniel Golle
2025-02-25 10:59       ` SkyLake Huang (黃啟澤)
2025-02-25 13:51         ` Andrew Lunn
2025-02-26  4:14           ` SkyLake Huang (黃啟澤)
2025-02-26 13:26             ` Andrew Lunn
2025-05-13  9:45               ` SkyLake Huang (黃啟澤)
2025-02-19  8:39 ` [PATCH net-next v2 2/3] dts: mt7988a: Add built-in ethernet phy firmware node Sky Huang
2025-02-19 12:28   ` Krzysztof Kozlowski
2025-02-19  8:39 ` [PATCH net-next v2 3/3] net: phy: mediatek: add driver for built-in 2.5G ethernet PHY on MT7988 Sky Huang
2025-02-19  9:33   ` Russell King (Oracle)
2025-02-19 15:16     ` Andrew Lunn
2025-02-26  6:48     ` SkyLake Huang (黃啟澤)
2025-02-26  9:52       ` Russell King (Oracle)
2025-05-13 11:13         ` SkyLake Huang (黃啟澤) [this message]
2025-02-26 13:32       ` Andrew Lunn
2025-05-13 11:15         ` SkyLake Huang (黃啟澤)
2025-05-13 10:12     ` SkyLake Huang (黃啟澤)
2025-05-13 11:01       ` SkyLake Huang (黃啟澤)
2025-05-13 12:32       ` Andrew Lunn
2025-02-19 15:47   ` Andrew Lunn
2025-05-13 10:55     ` SkyLake Huang (黃啟澤)

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=23205135c80c77b99fe32ef7bbe4ee421ac80bb4.camel@mediatek.com \
    --to=skylake.huang@mediatek.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=steven.liu@mediatek.com \
    /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