From: Heiner Kallweit <hkallweit1@gmail.com>
To: Zhiyuan Wan <kmlinuxm@gmail.com>
Cc: linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, willy.liu@realtek.com,
Yuki Lee <febrieac@outlook.com>,
andrew@lunn.ch
Subject: Re: [PATCH net-next 1/2] net: phy: realtek: disable broadcast address feature of rtl8211f
Date: Tue, 3 Dec 2024 10:52:05 +0100 [thread overview]
Message-ID: <af9e7960-ae36-43f9-bf54-0b6b5588b340@gmail.com> (raw)
In-Reply-To: <e707044d-a1d3-40c4-aeef-fad68c6a1785@gmail.com>
On 03.12.2024 09:35, Zhiyuan Wan wrote:
> On 2024/12/3 15:38, Heiner Kallweit wrote:
>>
>> Take care to remove the Rb tag if you make changes to the patch.
>>
> Roger that.
>>
>> This still uses the _changed version even if not needed.
>>
> I'm not sure is it okay to directly write PHYCR1 register, because not
> only it controls ALDPS and broadcast PHY address, but also controls
> MDI mode/Jabber detection.
>
This was not my point. Just use phy_modify_paged().
> I'm afraid that maybe it causes problem if I don't use RMW to clear
> the PHYAD_EN bit. Because the following code in `rtl8211f_config_init`
> also utilizes `phy_modify_paged_changed` to change ALDPS setting
> without touching anything else.
>
> But if you insist, I can modify code to this if you like:
>
>
> ret = phy_read_paged(phydev, 0xa43, RTL8211F_PHYCR1);
> if (ret < 0)
> return ret;
>
> dev_dbg(dev, "disabling MDIO address 0 for this phy");
> priv->phycr1 = ret & (u16)~RTL8211F_PHYAD0_EN;
> ret = phy_write_paged(phydev, 0xa43, RTL8211F_PHYCR1,
> priv->phycr1);
> if (ret < 0) {
> return dev_err_probe(dev, ret,
> "disabling MDIO address 0 failed\n");
> }
> /* Don't allow using broadcast address as PHY address */
> if (phydev->mdio.addr == 0)
> return -ENODEV;
>
> priv->phycr1 &= (RTL8211F_ALDPS_PLL_OFF | RTL8211F_ALDPS_ENABLE | RTL8211F_ALDPS_XTAL_OFF);
> ...
>
>
>
>>> + if (ret < 0) {
>>> + dev_err(dev, "disabling MDIO address 0 failed: %pe\n",
>>> + ERR_PTR(ret));
>>
>> You may want to use dev_err_probe() here. And is it by intent that
>> the error is ignored and you go on?
>>
>
> I'm sorry that I made a mistake.
>
>>
>> And one more formal issue:
>> You annotated the patch as 1/2, but submit it as single patch.
>>
> I have another patch to enable support optical/copper combo support
> of RTL8211FS PHY in this mail thread, but since Andrew said that patch
> (migrated from Rockchip SDK) is low quality and I'm too busy with my
> job, don't have much time to read and improve it, so I decided to
> suspend that patch's submission and I'll resume to submit that patch
> when I'm free. Could you please give me some advice or recommends on it?
>
The patch here seems to be independent and should be properly submitted
as single patch. Regarding the other patch I have nothing to add to what
Andrew stated already.
> Sincerely,
>
> Zhiyuan Wan
next prev parent reply other threads:[~2024-12-03 9:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 19:50 [PATCH 1/2] net: phy: realtek: add combo mode support for RTL8211FS Zhiyuan Wan
2024-12-02 19:50 ` [PATCH 2/2] net: phy: realtek: add dt property to disable broadcast PHY address Zhiyuan Wan
2024-12-03 0:04 ` Andrew Lunn
2024-12-03 3:46 ` [PATCH v2 1/2] net: phy: realtek: disable broadcast address feature of rtl8211f Zhiyuan Wan
2024-12-03 3:58 ` Andrew Lunn
2024-12-03 4:26 ` [PATCH v3 " Zhiyuan Wan
2024-12-03 6:50 ` Heiner Kallweit
2024-12-03 7:18 ` [PATCH net-next " Zhiyuan Wan
2024-12-03 7:38 ` Heiner Kallweit
2024-12-03 8:35 ` Zhiyuan Wan
2024-12-03 9:52 ` Heiner Kallweit [this message]
2024-12-02 23:52 ` [PATCH 1/2] net: phy: realtek: add combo mode support for RTL8211FS Andrew Lunn
2024-12-03 3:08 ` 万致远
2024-12-03 3:53 ` Andrew Lunn
2024-12-03 4:42 ` 万致远
2024-12-03 4:44 ` 万致远
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=af9e7960-ae36-43f9-bf54-0b6b5588b340@gmail.com \
--to=hkallweit1@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=febrieac@outlook.com \
--cc=kmlinuxm@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willy.liu@realtek.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
all inboxes | Powered by JetHome®