[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <TYBPR01MB5341298CC6B2DE1A10AC120FD84E9@TYBPR01MB5341.jpnprd01.prod.outlook.com>
Date: Thu, 22 Sep 2022 00:10:27 +0000
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To: Richard Cochran <richardcochran@...il.com>
CC: "kishon@...com" <kishon@...com>,
"vkoul@...nel.org" <vkoul@...nel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"geert+renesas@...der.be" <geert+renesas@...der.be>,
"andrew@...n.ch" <andrew@...n.ch>,
"linux-phy@...ts.infradead.org" <linux-phy@...ts.infradead.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>
Subject: RE: [PATCH v2 6/8] net: ethernet: renesas: rswitch: Add R-Car Gen4
gPTP support
Hi Richard,
Thank you for your review!
> From: Richard Cochran, Sent: Wednesday, September 21, 2022 11:35 PM
>
> On Wed, Sep 21, 2022 at 05:47:43PM +0900, Yoshihiro Shimoda wrote:
>
> > +static int rcar_gen4_ptp_gettime(struct ptp_clock_info *ptp,
> > + struct timespec64 *ts)
> > +{
> > + struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp);
> > +
> > + ts->tv_nsec = ioread32(ptp_priv->addr + ptp_priv->offs->monitor_t0);
> > + ts->tv_sec = ioread32(ptp_priv->addr + ptp_priv->offs->monitor_t1) |
> > + ((s64)ioread32(ptp_priv->addr + ptp_priv->offs->monitor_t2) << 32);
>
> No locking here ...
>
> > + return 0;
> > +}
> > +
> > +static int rcar_gen4_ptp_settime(struct ptp_clock_info *ptp,
> > + const struct timespec64 *ts)
> > +{
> > + struct rcar_gen4_ptp_private *ptp_priv = ptp_to_priv(ptp);
> > +
> > + iowrite32(1, ptp_priv->addr + ptp_priv->offs->disable);
> > + iowrite32(0, ptp_priv->addr + ptp_priv->offs->config_t2);
> > + iowrite32(0, ptp_priv->addr + ptp_priv->offs->config_t1);
> > + iowrite32(0, ptp_priv->addr + ptp_priv->offs->config_t0);
> > + iowrite32(1, ptp_priv->addr + ptp_priv->offs->enable);
> > + iowrite32(ts->tv_sec >> 32, ptp_priv->addr + ptp_priv->offs->config_t2);
> > + iowrite32(ts->tv_sec, ptp_priv->addr + ptp_priv->offs->config_t1);
> > + iowrite32(ts->tv_nsec, ptp_priv->addr + ptp_priv->offs->config_t0);
>
> ... or here?
>
> You need to protect multiple register access against concurrent callers.
I understood it. I'll add such protections.
Best regards,
Yoshihiro Shimoda
> Thanks,
> Richard
>
> > + return 0;
> > +}
Powered by blists - more mailing lists