From: <Claudiu.Beznea@microchip.com>
To: <michael@walle.cc>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<Nicolas.Ferre@microchip.com>, <davem@davemloft.net>
Subject: Re: [PATCH] net: macb: ignore tx_clk if MII is used
Date: Fri, 22 Jan 2021 09:10:58 +0000 [thread overview]
Message-ID: <1bde9969-8769-726b-02cb-a1fcded0cd74@microchip.com> (raw)
In-Reply-To: <bd029c647db42e05bf1a54d43d601861@walle.cc>
On 21.01.2021 11:41, Michael Walle wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
>
> Hi Claudiu,
>
> Am 2021-01-21 10:19, schrieb Claudiu.Beznea@microchip.com:
>> On 20.01.2021 21:43, Michael Walle wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know
>>> the content is safe
>>>
>>> If the MII interface is used, the PHY is the clock master, thus don't
>>> set the clock rate. On Zynq-7000, this will prevent the following
>>> warning:
>>> macb e000b000.ethernet eth0: unable to generate target frequency:
>>> 25000000 Hz
>>>
>>
>> Since in this case the PHY provides the TX clock and it provides the
>> proper
>> rate based on link speed, the MACB driver should not handle the
>> bp->tx_clk
>> at all (MACB driver uses this clock only for setting the proper rate on
>> it
>> based on link speed). So, I believe the proper fix would be to not pass
>> the
>> tx_clk at all in device tree. This clock is optional for MACB driver.
>
> Thanks for looking into this.
>
> I had the same thought. But shouldn't the driver handle this case
> gracefully?
> I mean it does know that the clock isn't needed at all.
Currently it may knows that by checking the bp->tx_clk. Moreover the clock
could be provided by PHY not only for MII interface.
Moreover the IP has the bit "refclk" of register at offset 0xc (userio)
that tells it to use the clock provided by PHY or to use one internal to
the SoC. If a SoC generated clock would be used the IP logic may have the
option to do the proper division based on link speed (if IP has this option
enabled then this should be selected in driver with capability
MACB_CAPS_CLK_HW_CHG).
If the clock provided by the PHY is the one to be used then this is
selected with capability MACB_CAPS_USRIO_HAS_CLKEN. So, if the change you
proposed in this patch is still imperative then checking for this
capability would be the best as the clock could be provided by PHY not only
for MII interface.
> Ususually that
> clock
> is defined in a device tree include. So you'd have to redefine that node
> in
> an actual board file which means duplicating the other clocks.
>
> -michael
next prev parent reply other threads:[~2021-01-22 9:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 19:43 Michael Walle
2021-01-20 20:29 ` Andrew Lunn
2021-01-21 9:19 ` Claudiu.Beznea
2021-01-21 9:41 ` Michael Walle
2021-01-22 9:10 ` Claudiu.Beznea [this message]
2021-01-22 11:20 ` Michael Walle
2021-01-22 11:38 ` Claudiu.Beznea
2021-01-22 12:32 ` Michael Walle
2021-01-22 4:00 ` patchwork-bot+netdevbpf
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=1bde9969-8769-726b-02cb-a1fcded0cd74@microchip.com \
--to=claudiu.beznea@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
--cc=netdev@vger.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
Powered by JetHome