[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mtiiga35.fsf@bang-olufsen.dk>
Date: Tue, 22 Feb 2022 16:06:06 +0000
From: Alvin Šipraga <ALSI@...g-olufsen.dk>
To: Linus Walleij <linus.walleij@...aro.org>
CC: Alvin Šipraga <alvin@...s.dk>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Michael Rasmussen <MIR@...g-olufsen.dk>,
Luiz Angelo Daros de Luca <luizluca@...il.com>,
Arınç ÜNAL <arinc.unal@...nc9.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 net-next 2/2] net: dsa: realtek: rtl8365mb: serialize
indirect PHY register access
Linus Walleij <linus.walleij@...aro.org> writes:
> On Tue, Feb 22, 2022 at 1:19 AM Alvin Šipraga <ALSI@...g-olufsen.dk> wrote:
>> > On Mon, Feb 21, 2022 at 7:46 PM Alvin Šipraga <alvin@...s.dk> wrote:
>
>> > What I worry about is whether we need to do a similar patch to
>> > rtl8366rb_phy_read() and rtl8366rb_phy_write() in
>> > rtl8366rb.c?
>>
>> Unfortunately I do not have the hardware to test rtl8366rb.c, so I can
>> only speculate. But I gave some hints in the commit message which might
>> help in checking whether or not it is an issue on that hardware as
>> well. The code for rtl8366rb_phy_read() looks similar, but since this is
>> a quirk of the hardware design, it could be that it is not
>> necessary. The only way is to test.
>
> I can test it.
Great! I have attached a test patch to insert these stray register
accesses inside the PHY read/write functions:
0001-TEST-net-dsa-realtek-rtl8366rb-provoke-stray-reg-acc.patch
Set the module parameter stray_access to 1 in order to enable stray
register access. I did this in case you don't build it as a module but
still want to do A/B testing - just remove it if I goofed.
>
>> If you or somebody else can confirm that it is an issue for RTL8366RB as
>> well, I will happily send a patch to the list for testing. You can for
>> example try spamming PHY register reads with phytool while also reading
>> off switch registers via regmap debugfs. See also the discussion in [1].
>>
>> [1] https://lore.kernel.org/netdev/878rukib4f.fsf@bang-olufsen.dk/
>
> If you have time to write a patch I'd love testing it!
Attached also a patch with a proposed fix - if indeed it is an issue -
along the same lines as the second patch in this series. You'll also
need the first patch from this series (attached for convenience):
0001-net-dsa-realtek-allow-subdrivers-to-externally-lock-.patch
0002-TEST-net-dsa-realtek-rtl8366rb-serialize-indirect-PH.patch
All patches are against net-next and build-tested only, so you might
want to double check if the results are unexpected.
Kind regards,
Alvin
>
> Yours,
> Linus Walleij
View attachment "0001-TEST-net-dsa-realtek-rtl8366rb-provoke-stray-reg-acc.patch" of type "text/x-patch" (2843 bytes)
View attachment "0001-net-dsa-realtek-allow-subdrivers-to-externally-lock-.patch" of type "text/x-patch" (8156 bytes)
View attachment "0002-TEST-net-dsa-realtek-rtl8366rb-serialize-indirect-PH.patch" of type "text/x-patch" (2866 bytes)
Powered by blists - more mailing lists