From: Dan Murphy <dmurphy@ti.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>, <hkallweit1@gmail.com>,
<davem@davemloft.net>, <robh@kernel.org>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<devicetree@vger.kernel.org>
Subject: Re: [PATCH net-next v2 4/4] net: dp83869: Add RGMII internal delay configuration
Date: Sat, 23 May 2020 16:40:22 -0500 [thread overview]
Message-ID: <a59412a5-7cc6-dc70-b851-c7d65c1635b7@ti.com> (raw)
In-Reply-To: <20200523150951.GK610998@lunn.ch>
Andrew
On 5/23/20 10:09 AM, Andrew Lunn wrote:
>>>> + dp83869->tx_id_delay = DP83869_RGMII_CLK_DELAY_INV;
>>>> + ret = of_property_read_u32(of_node, "tx-internal-delay-ps",
>>>> + &dp83869->tx_id_delay);
>>>> + if (!ret && dp83869->tx_id_delay > dp83869_internal_delay[delay_size]) {
>>>> + phydev_err(phydev,
>>>> + "tx-internal-delay value of %u out of range\n",
>>>> + dp83869->tx_id_delay);
>>>> + return -EINVAL;
>>>> + }
>>> This is the kind of validation that I would be expecting from the PHY
>>> library to do, in fact, since you use Device Tree standard property, I
>>> would expect you only need to pass the maximum delay value and some
>>> storage for your array of delays.
>> Actually the PHY library will return either the 0th index if the value is to
>> small or the max index if the value is to large
>>
>> based on the array passed in so maybe this check is unnecessary.
> Hi Dan
>
> I'm not sure the helper is implementing the best behaviour. Rounded to
> the nearest when within the supported range is O.K. But if the request
> is outside the range, i would report an error.
Hope this email does not bounce.
> Any why is your PHY special, in that is does care about out of range
> delays, when others using new the new core helper don't?
We are not rounding to nearest here. Basically the helper works to find
the best match
If the delay passed in is less than or equal to the smallest delay then
return the smallest delay index
If the delay passed in is greater then the largest delay then return the
max delay index
Not sure what you mean about this PHY being special. This helper is not
PHY specific.
After I think about this more I am thinking a helper may be over kill
here and the delay to setting should be done within the PHY driver itself
Dan
> Andrew
next prev parent reply other threads:[~2020-05-23 21:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-22 12:25 [PATCH net-next v2 0/4] RGMII Internal delay common property Dan Murphy
2020-05-22 12:25 ` [PATCH net-next v2 1/4] dt-bindings: net: Add tx and rx internal delays Dan Murphy
2020-05-23 15:13 ` Andrew Lunn
2020-05-22 12:25 ` [PATCH net-next v2 2/4] net: phy: Add a helper to return the index for of the internal delay Dan Murphy
2020-05-22 16:11 ` Florian Fainelli
2020-05-22 18:27 ` Dan Murphy
2020-05-22 12:25 ` [PATCH net-next v2 3/4] dt-bindings: net: Add RGMII internal delay for DP83869 Dan Murphy
2020-05-22 12:25 ` [PATCH net-next v2 4/4] net: dp83869: Add RGMII internal delay configuration Dan Murphy
2020-05-22 16:13 ` Florian Fainelli
2020-05-22 18:50 ` Dan Murphy
2020-05-23 15:09 ` Andrew Lunn
2020-05-23 21:40 ` Dan Murphy [this message]
2020-05-23 22:07 ` Andrew Lunn
2020-05-26 17:48 ` Dan Murphy
-- strict thread matches above, loose matches on Subject: below --
2020-05-20 12:18 [PATCH net-next v2 0/4] DP83869 Enhancements Dan Murphy
2020-05-20 12:18 ` [PATCH net-next v2 4/4] net: dp83869: Add RGMII internal delay configuration Dan Murphy
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=a59412a5-7cc6-dc70-b851-c7d65c1635b7@ti.com \
--to=dmurphy@ti.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=robh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.