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]
Message-ID: <871q5b3wgr.ffs@tglx>
Date: Wed, 05 Jun 2024 23:34:28 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: lakshmi.sowjanya.d@...el.com, giometti@...eenne.com, corbet@....net,
 linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org
Cc: gregkh@...uxfoundation.org, andriy.shevchenko@...ux.intel.com,
 eddie.dong@...el.com, christopher.s.hall@...el.com, pandith.n@...el.com,
 subramanian.mohan@...el.com, thejesh.reddy.t.r@...el.com,
 lakshmi.sowjanya.d@...el.com
Subject: Re: [PATCH v9 1/3] pps: generators: Add PPS Generator TIO Driver

On Wed, Jun 05 2024 at 21:05, lakshmi.sowjanya.d@...el.com wrote:
> +static ssize_t enable_store(struct device *dev, struct device_attribute *attr, const char *buf,
> +			    size_t count)
> +{
> +	struct pps_tio *tio = dev_get_drvdata(dev);
> +	bool enable;
> +	int err;
> +
> +	if (!timekeeping_clocksource_has_base(CSID_X86_ART)) {
> +		dev_err(dev, "PPS cannot be used as clock is not related to ART");

                dev_err_once() if at all

> +		return -EPERM;

Why -EPERM? This has nothing to do with permissions.

ENODEV or ENOTSUPPORTED perhaps.

> +static ssize_t enable_show(struct device *dev, struct device_attribute *devattr, char *buf)
> +{
> +	struct pps_tio *tio = dev_get_drvdata(dev);
> +	u32 ctrl;
> +
> +	ctrl = pps_tio_read(tio, TIOCTL);
> +	ctrl &= TIOCTL_EN;

Why reading the hardware instead of simply using tio->enabled?

> +
> +	return sysfs_emit(buf, "%u\n", ctrl);
> +}

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ