linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Claudiu.Beznea@microchip.com>
To: <f.fainelli@gmail.com>, <andrew@lunn.ch>
Cc: <hkallweit1@gmail.com>, <linux@armlinux.org.uk>,
	<robh+dt@kernel.org>, <frowand.list@gmail.com>,
	<netdev@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] of: of_mdio: count number of regitered phys
Date: Wed, 1 Jul 2020 08:47:58 +0000	[thread overview]
Message-ID: <bf1f950d-9e2b-f898-d46c-4d9ff14632eb@microchip.com> (raw)
In-Reply-To: <6b022bcc-a670-da1d-5f5a-bdf4af667652@gmail.com>

Hi Andrew, Florian,

On 30.06.2020 06:35, Florian Fainelli wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 6/29/2020 5:45 PM, Andrew Lunn wrote:
>> On Mon, Jun 29, 2020 at 10:26:36AM +0300, Claudiu Beznea wrote:
>>> In case of_mdiobus_register_phy()/of_mdiobus_register_device()
>>> returns -ENODEV for all PHYs in device tree or for all scanned
>>> PHYs there is a chance that of_mdiobus_register() to
>>> return success code although no PHY devices were registered.
>>> Add a counter that increments every time a PHY was registered
>>> to avoid the above scenario.
>>
>> Hi Claudiu
>>
>> There is a danger here this will break something. Without this patch,
>> an empty bus is O.K. But with this patch, a bus without a PHY is a
>> problem.
>>
>> Take for example FEC. It often comes in pairs. Each has an MDIO
>> bus. But to save pins, there are some designs which place two PHYs on
>> one bus, leaving the other empty. The driver unconditionally calls
>> of_mdiobus_register() and if it returns an error, it will error out
>> the probe. So i would not be too surprised if you get reports of
>> missing interfaces with this patch.
> 
> Agreed, the potential for breakage here is too high especially given
> this is fixing a hypothetical problem rather an an actual one. Even if
> we were taking this from the angle of power management, runtime PM
> should ensure that a MDIO bus with no slave, or no activity gets runtime
> suspended.

I understand your points. Thank you for taking time on reviewing this.

Claudiu Beznea

> --
> Florian
> 

      reply	other threads:[~2020-07-01  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  7:26 [PATCH] of: of_mdio: count number of regitered phys Claudiu Beznea
2020-06-30  0:45 ` Andrew Lunn
2020-06-30  3:35   ` Florian Fainelli
2020-07-01  8:47     ` Claudiu.Beznea [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=bf1f950d-9e2b-f898-d46c-4d9ff14632eb@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).