RE: [PATCH v2 6/8] net: ethernet: renesas: rswitch: Add R-Car Gen4 gPTP support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
> > +}




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux