Re: [PATCH net-next 06/11] net: dsa: rzn1-a5psw: Add support for optional timestamp clock

From: Lad, Prabhakar

Date: Wed Nov 26 2025 - 12:44:18 EST


Hi Geert,

Thank you for the review.

On Mon, Nov 24, 2025 at 12:45 PM Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> wrote:
>
> Hi Prabhakar,
>
> On Fri, 21 Nov 2025 at 12:36, Prabhakar <prabhakar.csengg@xxxxxxxxx> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
> >
> > Add support for an optional "ts" (timestamp) clock to the RZN1 A5PSW
> > driver. Some SoC variants provide a dedicated clock source for
> > timestamping or time synchronization features within the Ethernet
> > switch IP.
> >
> > Request and enable this clock during probe if defined in the device tree.
> > If the clock is not present, the driver continues to operate normally.
> >
> > This change prepares the driver for Renesas RZ/T2H and RZ/N2H SoCs, where
> > the Ethernet switch includes a timestamp clock input.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
>
> Thanks for your patch!
>
>
> > --- a/drivers/net/dsa/rzn1_a5psw.c
> > +++ b/drivers/net/dsa/rzn1_a5psw.c
> > @@ -1243,6 +1243,13 @@ static int a5psw_probe(struct platform_device *pdev)
> > goto free_pcs;
> > }
> >
> > + a5psw->ts = devm_clk_get_optional_enabled(dev, "ts");
> > + if (IS_ERR(a5psw->ts)) {
> > + dev_err(dev, "failed get ts clock\n");
>
> I think the error can be -EPROBE_DEFER, so this should use
> dev_err_probe() instead. Same for the existing calls.
>
Agreed. For the existing calls I'll create a separate patch.

> > + ret = PTR_ERR(a5psw->ts);
> > + goto free_pcs;
> > + }
> > +
> > reset = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
> > if (IS_ERR(reset)) {
> > ret = PTR_ERR(reset);
>
> > --- a/drivers/net/dsa/rzn1_a5psw.h
> > +++ b/drivers/net/dsa/rzn1_a5psw.h
> > @@ -236,6 +236,7 @@ union lk_data {
> > * @base: Base address of the switch
> > * @hclk: hclk_switch clock
> > * @clk: clk_switch clock
> > + * @ts: Timestamp clock
> > * @dev: Device associated to the switch
> > * @mii_bus: MDIO bus struct
> > * @mdio_freq: MDIO bus frequency requested
> > @@ -251,6 +252,7 @@ struct a5psw {
> > void __iomem *base;
> > struct clk *hclk;
> > struct clk *clk;
> > + struct clk *ts;
>
> "ts" is only used inside a5psw_probe(), so it can be a local variable.
>
Agreed, I will create a local variable.

Cheers,
Prabhakar

> > struct device *dev;
> > struct mii_bus *mii_bus;
> > struct phylink_pcs *pcs[A5PSW_PORTS_NUM - 1];
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds