Netdev List
 help / color / mirror / Atom feed
From: Javen <javen_xu@realsil.com.cn>
To: Nicolai Buchwitz <nb@tipi-net.de>
Cc: "andrew@lunn.ch" <andrew@lunn.ch>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	顾晓军 <freddy_gu@realsil.com.cn>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"daniel@makrotopia.org" <daniel@makrotopia.org>,
	"vladimir.oltean@nxp.com" <vladimir.oltean@nxp.com>
Subject: RE: [PATCH net-next v3 4/4] net: phy: realtek: load firmware for RTL8261C_CG
Date: Fri, 5 Jun 2026 09:58:27 +0000	[thread overview]
Message-ID: <2ef7327934824882a33e43eaca58d923@realsil.com.cn> (raw)
In-Reply-To: <b2b2d485db137d26e3838116560f6d59@tipi-net.de>

>Hi Javen
>
>On 5.6.2026 09:43, javen wrote:
>> From: Javen Xu <javen_xu@realsil.com.cn>
>>
>> This patch adds support for loading firmware. Download some parameters
>> for RTL8261C_CG.
>>
>> Signed-off-by: Javen Xu <javen_xu@realsil.com.cn>
>> ---
>> Changes in v2:
>>  - remove __pack, struct rtl8261x_fw_header and rtl8261x_fw_entry will
>> not pad
>>  - reverse xmas tree for some definition
>>  - add explanation on rtl_phy_write_mmd_bits()
>>
>> Changes in v3:
>>  - add struct rtl8261x_priv
>> ---
>
>> [...]
>
>> +static int rtl8261x_config_init(struct phy_device *phydev) {
>> +     struct rtl8261x_priv *priv = phydev->priv;
>> +     int ret = 0;
>> +
>> +     if (priv->fw_name && !priv->fw_loaded) {
>> +             ret = rtl8261x_fw_load(phydev);
>> +             if (ret) {
>> +                     phydev_err(phydev, "Firmware loading failed: %d\n", ret);
>> +                     return ret;
>> +             }
>> +     }
>
>fw_loaded loads once per lifetime, phy_init_hw() does soft_reset before
>config_init.
>So after a reset (e.g. resume), aren't the patches gone and never re-applied?
>en8811h for example re-runs every config_init - but just guessing as I don't
>know the internals of your fw.
>
>> [...]
>
>Thanks,
>Nicolai

Hi, Nicolai

For RTL8261C_CG, the patches will not be lost after resume or soft_reset. They only need to be downloaded again after a power cycle or a hardware reset.
So the fw_loaded flag is intended to avoid reloading the same parameters multiple times during the PHY device lifetime.

Thanks,
BRs,
Javen

  reply	other threads:[~2026-06-05  9:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05  7:43 [PATCH net-next v3 0/4] Add support for RTL8261C_CG javen
2026-06-05  7:43 ` [PATCH net-next v3 1/4] net: phy: c45: add genphy_c45_soft_reset() javen
2026-06-05  8:59   ` Nicolai Buchwitz
2026-06-05  7:43 ` [PATCH net-next v3 2/4] net: phy: c45: add genphy_c45_an_setup_master_slave() javen
2026-06-05  9:00   ` Nicolai Buchwitz
2026-06-05  7:43 ` [PATCH net-next v3 3/4] net: phy: realtek: add support for RTL8261C_CG javen
2026-06-05  9:00   ` Nicolai Buchwitz
2026-06-05  7:43 ` [PATCH net-next v3 4/4] net: phy: realtek: load firmware " javen
2026-06-05  9:11   ` Nicolai Buchwitz
2026-06-05  9:58     ` Javen [this message]
2026-06-05 10:08       ` Nicolai Buchwitz

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=2ef7327934824882a33e43eaca58d923@realsil.com.cn \
    --to=javen_xu@realsil.com.cn \
    --cc=andrew@lunn.ch \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=freddy_gu@realsil.com.cn \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nb@tipi-net.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vladimir.oltean@nxp.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