From: Thomas Gleixner <tglx@linutronix.de>
To: lakshmi.sowjanya.d@intel.com, giometti@enneenne.com,
corbet@lwn.net, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org
Cc: gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com,
eddie.dong@intel.com, christopher.s.hall@intel.com,
pandith.n@intel.com, subramanian.mohan@intel.com,
thejesh.reddy.t.r@intel.com, lakshmi.sowjanya.d@intel.com
Subject: Re: [PATCH v9 1/3] pps: generators: Add PPS Generator TIO Driver
Date: Wed, 05 Jun 2024 23:34:28 +0200 [thread overview]
Message-ID: <871q5b3wgr.ffs@tglx> (raw)
In-Reply-To: <20240605153554.11584-2-lakshmi.sowjanya.d@intel.com>
On Wed, Jun 05 2024 at 21:05, lakshmi.sowjanya.d@intel.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
next prev parent reply other threads:[~2024-06-05 21:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 15:35 [PATCH v9 0/3] Add support for Intel PPS Generator lakshmi.sowjanya.d
2024-06-05 15:35 ` [PATCH v9 1/3] pps: generators: Add PPS Generator TIO Driver lakshmi.sowjanya.d
2024-06-05 21:34 ` Thomas Gleixner [this message]
2024-06-05 15:35 ` [PATCH v9 2/3] Documentation: driver-api: pps: Add Intel Timed I/O PPS generator lakshmi.sowjanya.d
2024-06-07 10:19 ` Bagas Sanjaya
2024-06-05 15:35 ` [PATCH v9 3/3] ABI: pps: Add ABI documentation for Intel TIO lakshmi.sowjanya.d
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871q5b3wgr.ffs@tglx \
--to=tglx@linutronix.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=christopher.s.hall@intel.com \
--cc=corbet@lwn.net \
--cc=eddie.dong@intel.com \
--cc=giometti@enneenne.com \
--cc=gregkh@linuxfoundation.org \
--cc=lakshmi.sowjanya.d@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pandith.n@intel.com \
--cc=subramanian.mohan@intel.com \
--cc=thejesh.reddy.t.r@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).