[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFBinCCbtLRomdikKWkS+HOFoek4cGhN4L91FQfQ4rbKTV-xvg@mail.gmail.com>
Date: Fri, 1 May 2020 19:10:06 +0200
From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: robh+dt@...nel.org, f.fainelli@...il.com,
linux-amlogic@...ts.infradead.org, devicetree@...r.kernel.org,
jianxin.pan@...ogic.com, davem@...emloft.net,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH RFC v2 08/11] net: stmmac: dwmac-meson8b: add support for
the RX delay configuration
Hi Andrew,
On Fri, May 1, 2020 at 5:44 PM Andrew Lunn <andrew@...n.ch> wrote:
>
> > + if (rx_dly_config & PRG_ETH0_ADJ_ENABLE) {
> > + /* The timing adjustment logic is driven by a separate clock */
> > + ret = meson8b_devm_clk_prepare_enable(dwmac,
> > + dwmac->timing_adj_clk);
> > + if (ret) {
> > + dev_err(dwmac->dev,
> > + "Failed to enable the timing-adjustment clock\n");
> > + return ret;
> > + }
> > + }
>
> Hi Martin
>
> It is a while since i used the clk API. I thought the get_optional()
> call returned a NULL pointer if the clock does not exist.
> clk_prepare_enable() passed a NULL pointer is a NOP, but it also does
> not return an error. So if the clock does not exist, you won't get
> this error, the code keeps going, configures the hardware, but it does
> not work.
>
> I think you need to check dwmac->timing_adj_clk != NULL here, and
> error out if DT has properties which require it.
Thank you for your excellent code review quality (as always)!
you are right and I will fix that in the next version
Martin
Powered by blists - more mailing lists