devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Stas Sergeev <stsp@list.ru>
Cc: netdev <netdev@vger.kernel.org>,
	Linux kernel <linux-kernel@vger.kernel.org>,
	Stas Sergeev <stsp@users.sourceforge.net>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH 4/6] of: add API for changing parameters of fixed link
Date: Fri, 27 Mar 2015 10:15:54 -0700	[thread overview]
Message-ID: <5515904A.1060600@gmail.com> (raw)
In-Reply-To: <551587D1.5070408@list.ru>

On 27/03/15 09:39, Stas Sergeev wrote:
> 27.03.2015 19:21, Florian Fainelli пишет:
>>> Do you want mvneta to register a similar callback in of_mdio, instead
>>> of adding an explicit state-updating functions? Something like
>>> of_phy_fixed_link_set_update_callback()?
>> You don't need an of_phy_fixed_link_set_update callback, you just need
>> to provide a fixed_link_update callback in mvneta, that you register,
> That approach I in fact considered initially, as the simplest one,
> and even had a patch. But I disliked the fact that then mvneta will
> exploit the knowledge of the fact that of_phy_register_fixed_link()
> uses a fixed_phy driver. What if the implementation will later change?

There is no reason why it should change later, that's the entire purpose
of why we can tell whether it is a fixed PHY or a regular MDIO-managed
PHY, and drivers rely on that for their operations.

> Also what makes me uncomfortable is that since of_phy_register_fixed_link()
> doesn't even return the struct phy_device pointer, mvneta will have
> to get around that and use for example of_phy_find_device(), or register
> the callback later, after of_phy_connect()

Ok, you could either make of_phy_register_fixed_link() return a
phy_device, or as you suggest resolve the phy_device from the
device_node later, your call.

. dsa/slave.c does of_phy_connect()
> initially, together with fixed link registration, so it gets around the
> problem. But mvneta registers the fixed_link in .probe callback, and
> does of_phy_connect() in .open callback.
> This all made me to drop that idea despite the simplicity.

Yet that's still the cleanest/less invasive approach imho.

> 
>>> This will remove a few changes indeed, but perhaps not too much.
>>> Please confirm if this is exactly what you want, and then I try.
>> Let me know if this is clearer now, if not, I can certainly cook a
>> patch which does what I am suggesting. Thanks!
> I can do that too, because I already did.
> Let me know if the above concerns are not important, and I'll
> restore my initial patch.
> 

I think your concerns are valid, but I don't think there is going to be
any problem with the approach I suggested because there is a contract
that the fixed PHYs and regular PHYs need to
-- 
Florian

  reply	other threads:[~2015-03-27 17:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <55155AFC.4050800@list.ru>
2015-03-27 13:35 ` [PATCH 3/6] of_mdio: restructure of_phy_register_fixed_link() for further modifications Stas Sergeev
2015-03-27 13:37 ` [PATCH 4/6] of: add API for changing parameters of fixed link Stas Sergeev
     [not found]   ` <55155D35.1070703-cmBhpYW9OiY@public.gmane.org>
2015-03-27 15:41     ` Florian Fainelli
2015-03-27 16:07       ` Stas Sergeev
2015-03-27 16:21         ` Florian Fainelli
     [not found]           ` <CAGVrzcaLfQcTAx8OR=sE=7FLrp0gGvfX8_YfxK_CU+x26JHymw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-27 16:39             ` Stas Sergeev
2015-03-27 17:15               ` Florian Fainelli [this message]
2015-03-27 17:31                 ` Stas Sergeev
2015-03-30 14:39                 ` Stas Sergeev
2015-03-30 16:06                   ` Florian Fainelli
2015-03-30 17:04                     ` Stas Sergeev
2015-03-31 17:11                     ` Stas Sergeev

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=5515904A.1060600@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=stsp@list.ru \
    --cc=stsp@users.sourceforge.net \
    --cc=thomas.petazzoni@free-electrons.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;
as well as URLs for NNTP newsgroup(s).