lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Sep 2021 16:56:42 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Jonathan Lemon <jonathan.lemon@...il.com>
Cc:     davem@...emloft.net, richardcochran@...il.com,
        netdev@...r.kernel.org, kernel-team@...com, abyagowi@...com
Subject: Re: [PATCH net-next 08/11] ptp: ocp: Add sysfs attribute
 utc_tai_offset

On Mon, 30 Aug 2021 16:52:33 -0700 Jonathan Lemon wrote:
> +static ssize_t
> +utc_tai_offset_show(struct device *dev,
> +		    struct device_attribute *attr, char *buf)
> +{
> +	struct ptp_ocp *bp = dev_get_drvdata(dev);
> +
> +	return sysfs_emit(buf, "%d\n", bp->utc_tai_offset);
> +}
> +
> +static ssize_t
> +utc_tai_offset_store(struct device *dev,
> +		     struct device_attribute *attr,
> +		     const char *buf, size_t count)
> +{
> +	struct ptp_ocp *bp = dev_get_drvdata(dev);
> +	unsigned long flags;
> +	int err;
> +	s32 val;
> +
> +	err = kstrtos32(buf, 0, &val);
> +	if (err)
> +		return err;
> +
> +	bp->utc_tai_offset = val;

This line should probably be under the lock.

> +	spin_lock_irqsave(&bp->lock, flags);
> +	iowrite32(val, &bp->irig_out->adj_sec);
> +	iowrite32(val, &bp->dcf_out->adj_sec);
> +	spin_unlock_irqrestore(&bp->lock, flags);
> +
> +	return count;
> +}
> +static DEVICE_ATTR_RW(utc_tai_offset);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ