mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Buday Csaba <Buday.Csaba@prolan.hu>
To: "Leonardo Mörlein" <leo.moerlein@proton.me>,
	"Andrew Lunn" <andrew@lunn.ch>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Hauke Mehrtens <hauke@hauke-m.de>,
	Russell King <linux@armlinux.org.uk>,
	Paolo Abeni <pabeni@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: phy: mdio_device: leave PHY reset deasserted on unregister
Date: Thu, 21 May 2026 08:47:55 +0000	[thread overview]
Message-ID: <07bd7806-4bc3-4c61-8cc3-4d534010bf65@prolan.hu> (raw)
In-Reply-To: <hRNIpXMBtfUH-OrabbMVvOWAZ5J4O1XNTvx0lMYIDdSLqFL9hhZKdb3CzPo7VgUrwKi6MD3qlj2li6eHybgzFBB_Wfqu5Lc4dABXt9mpL2s=@proton.me>

>> I'm wondering if we are fixing the wrong thing here.
> 
> In general, I see two options to fix this. Either we fix the
> tear down or we fix the setup of the device.

I have been fighting a different problem with a similar cause.

- you should not rely on the bootloader setting anything up. The kernel
   should be able to perform the initialization without any assumptions
   about bootloader OR previous state behavior.
- from this follows, that the correct way to handle resets is always
   during the initialization, not leaving it in a known state.
- mdio_unregister_device() should reverse mdiobus_register_device().
   The reset was in an unknown state before mdiobus_register_device(),
   so both can be argued:
	a) you can leave it in either state, since it was not determined
	   before
	b) you should leave it asserted, to save power

If I understand correctly, your resets are asserted by default (when the 
GPIOs are inputs).

I have sent patches that would have taken control of resets before
the device is established, but there were problems with that.
It would have served a different purpose (PHY ID autodetection), but I 
think if implemented correctly, it would also help your situation.
Russell King replied with a constructive letter, but I lacked the time 
since to do anything on that thread.

See:
https://lore.kernel.org/all/5701a9faafd1769b650b79c2d0c72cc10b5bdbc8.1764337894.git.buday.csaba@prolan.hu/#t

Please also check out this letter by Andrew about the PHY ID autodetection:

https://lore.kernel.org/netdev/23c1bed1-3f95-48b9-8ff0-71696bdcd62b@lunn.ch/

Perhaps specifying the PHY ID would help? It did help me.

Regards,
Csaba

      parent reply	other threads:[~2026-05-21  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 15:13 leo.moerlein
2026-05-20 15:55 ` Andrew Lunn
2026-05-20 22:53   ` Leonardo Mörlein
2026-05-20 23:39     ` Andrew Lunn
2026-06-06 12:03       ` Leonardo Mörlein
2026-05-21  8:47     ` Buday Csaba [this message]

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=07bd7806-4bc3-4c61-8cc3-4d534010bf65@prolan.hu \
    --to=buday.csaba@prolan.hu \
    --cc=andrew@lunn.ch \
    --cc=hauke@hauke-m.de \
    --cc=leo.moerlein@proton.me \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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®