Netdev List
 help / color / mirror / Atom feed
From: "Arınç ÜNAL" <arinc.unal@arinc9.com>
To: Vladimir Oltean <olteanv@gmail.com>,
	Daniel Golle <daniel@makrotopia.org>
Cc: Frank Wunderlich <frank-w@public-files.de>,
	netdev <netdev@vger.kernel.org>,
	erkin.bozoglu@xeront.com, Thibaut <hacks@slashdirt.org>
Subject: Re: mt7530: dsa_switch_parse_of() fails, causes probe code to run twice
Date: Sun, 16 Apr 2023 12:38:03 +0300	[thread overview]
Message-ID: <2f3796e3-438c-604f-1e61-ccb2fa118aff@arinc9.com> (raw)
In-Reply-To: <ef677f5f-07a3-2cf7-79d1-ae8980b73701@arinc9.com>

On 15.04.2023 17:57, Arınç ÜNAL wrote:
> On 15.04.2023 17:20, Vladimir Oltean wrote:
>> On Sat, Apr 15, 2023 at 03:02:10PM +0100, Daniel Golle wrote:
>>> As the PHYs are accessed over the MDIO bus which is exposed by the 
>>> mt7530.c
>>> DSA driver the only middle ground would possibly be to introduce a MFD
>>> driver taking care of creating the bus access regmap (MDIO vs. MDIO) and
>>> expose the mt7530-controlled MDIO bus.
>>
>> Which is something I had already mentioned as a possible way forward in
>> the other thread. One would need to take care of ensuring a reasonable
>> migration path in terms of device tree compatibility though.
>>
>>>
>>> Obviously that'd be a bit more work than just moving some things from 
>>> the
>>> switch setup function to the probe function...
>>
>> On the other hand, it would actually work reliably, and would not depend
>> on whomever wanted to reorder things just a little bit differently for
>> his system to probe faster.
> 
> Ok thanks. I will investigate how the switch would be set up with an MFD 
> driver, and how it would affect dt-bindings.
> 
> Looking back at my patch series, currently with this [0], SGMII on 
> MT7531BE's port 6 starts working, and with Daniel's addition [1], the 
> regulator warnings disappear.
> 
> I will submit the patch series as an RFC after addressing Daniel's 
> inline functions suggestion.

I've been giving this some thought. My understanding of probe in this 
context has changed drastically. The probe here is supposed to probe the 
driver, like setting up the pointers, reading from the devicetree, 
filling up the info table, and finally calling dsa_register_switch(). It 
would not necessarily do anything to the switch hardware like resetting 
and reading information from the registers. This is currently how 
mt7530-mdio and mt7530-mmio already operate. So I'm not going to move 
anything from setup to probe.

The duplicate code on mt7530_setup() and mt7531_setup() could rather be 
put on mt753x_setup() instead. But now there's ID_MT7988 also going 
through mt753x_setup, so it's not very feasible to do this anymore, too 
many ID checks there would be.

Moving forward, I will send a separate bugfix patch that makes port 6 on 
MT7531BE work. My patch series will solely be for improving the driver.

Daniel, can you confirm this patch is enough to make port 6 work on 
MT7531BE? I won't touch the PCS creation code here as it'd be an 
improvement rather than a fix, if this works.

https://github.com/arinc9/linux/commit/bb55b97b8f600cf28433e7ff494d296a15191cb3

Arınç

  reply	other threads:[~2023-04-16  9:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 22:41 mt7530: dsa_switch_parse_of() fails, causes probe code to run twice Arınç ÜNAL
2023-04-14 22:48 ` Daniel Golle
2023-04-14 23:23   ` Arınç ÜNAL
2023-04-14 23:53     ` Daniel Golle
2023-04-15  0:28       ` Arınç ÜNAL
2023-04-15  0:52         ` Daniel Golle
2023-04-15  7:53           ` Arınç ÜNAL
2023-04-15  9:43             ` Arınç ÜNAL
2023-04-15 12:43             ` Daniel Golle
2023-04-15 13:19               ` Arınç ÜNAL
2023-04-15 13:38                 ` Vladimir Oltean
2023-04-15 13:40                   ` Arınç ÜNAL
2023-04-15 13:46                     ` Vladimir Oltean
2023-04-15 14:02                       ` Daniel Golle
2023-04-15 14:20                         ` Vladimir Oltean
2023-04-15 14:28                           ` Vladimir Oltean
2023-04-15 14:57                           ` Arınç ÜNAL
2023-04-16  9:38                             ` Arınç ÜNAL [this message]
2023-04-16 11:57                               ` Daniel Golle
2023-04-15 10:12 ` Vladimir Oltean

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=2f3796e3-438c-604f-1e61-ccb2fa118aff@arinc9.com \
    --to=arinc.unal@arinc9.com \
    --cc=daniel@makrotopia.org \
    --cc=erkin.bozoglu@xeront.com \
    --cc=frank-w@public-files.de \
    --cc=hacks@slashdirt.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.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