From: Stas Sergeev <stsp@list.ru>
To: Florian Fainelli <f.fainelli@gmail.com>,
madalin.bucur@freescale.com, netdev@vger.kernel.org,
grant.likely@linaro.org, robh+dt@kernel.org
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Igal.Liberman@freescale.com,
Stas Sergeev <stsp@users.sourceforge.net>
Subject: Re: [PATCH 0/2] of: fsl/fman: reuse the fixed node parsing code
Date: Tue, 11 Aug 2015 19:00:20 +0300 [thread overview]
Message-ID: <55CA1C14.3000202@list.ru> (raw)
In-Reply-To: <55C63D3B.5020005@gmail.com>
08.08.2015 20:32, Florian Fainelli пишет:
> CC'ing Stas,
Hi.
> Le 08/05/15 07:42, Madalin Bucur a écrit :
>> The FMan MAC configuration code needs the speed and duplex information
>> for fixed-link interfaces that is parsed now by the of function
>> of_phy_register_fixed_link(). This parses the fixed-link parameters but
>> does not expose to the caller neither the phy_device pointer nor the
>> status struct where it loads the fixed-link params.
I have only barely touched that code, but IMO both things
are by design. There are some API deficiencies, and so, many
drivers still use of_phy_find_device() to circumvent the encapsulation
and get the phy_device pointer, but this is unlikely a good thing
to do. I even proposed some API extensions, but there was no
interest.
>> By extracting the
>> fixed-link parsing code from of_phy_register_fixed_link() into a
>> separate function the parsed values are made available without changing
>> the existing API. This change also removes a small redundancy in the
>> previous code calling fixed_phy_register().
Today, the fixed_link is not always fixed.
See for example this patch (already mainlined):
https://lkml.org/lkml/2015/7/20/711
of_phy_is_fixed_link() returns 'true' if you have
managed="in-band-status", and so the SGMII in-band status
can update fixed-link params.
So my question is: why do you even need to know whether
the link is fixed or not? IIRC you can check the phy_device
pointer in the adjust_link callback of of_phy_connect() to get
the current link status values. Why is this not enough for your
task? Maybe the patch description should be updated to include
why the current technique is bad, what is actually fixed by the
change.
I think using the fixed-link DT values directly is not something
to be done. The encapsulation is there for a reason, so maybe
instead we can see what API additions do we need to avoid the
current limitations that force people to use of_phy_find_device()
and other work-arounds.
next prev parent reply other threads:[~2015-08-11 16:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 14:42 [PATCH 0/2] of: fsl/fman: reuse the fixed node parsing code Madalin Bucur
2015-08-05 14:42 ` [PATCH RFC 2/2] fsl_fman: use fixed_phy_status for MEMAC Madalin Bucur
[not found] ` <1438785745-15517-1-git-send-email-madalin.bucur-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-08-05 14:42 ` [PATCH RFC 1/2] of: separate fixed link parsing from registration Madalin Bucur
2015-08-08 17:32 ` [PATCH 0/2] of: fsl/fman: reuse the fixed node parsing code Florian Fainelli
2015-08-11 16:00 ` Stas Sergeev [this message]
2015-08-11 16:33 ` Madalin-Cristian Bucur
2015-08-11 16:58 ` Stas Sergeev
2015-08-12 13:26 ` Madalin-Cristian Bucur
2015-08-12 13:58 ` Stas Sergeev
2015-08-12 14:43 ` Madalin-Cristian Bucur
2015-08-12 15:09 ` Stas Sergeev
2015-08-12 15:27 ` Madalin-Cristian Bucur
[not found] ` <BL2PR03MB545A213D584384018CCB30CE67E0-AZ66ij2kwaa1tTsckATbNOO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2015-08-12 16:03 ` 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=55CA1C14.3000202@list.ru \
--to=stsp@list.ru \
--cc=Igal.Liberman@freescale.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=grant.likely@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=madalin.bucur@freescale.com \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=stsp@users.sourceforge.net \
/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).