From: eajames@linux.vnet.ibm.com
To: openbmc@lists.ozlabs.org
Cc: joel@jms.id.au, alistair@popple.id.au, benh@kernel.crashing.org,
Christopher Bostic <cbostic@linux.vnet.ibm.com>,
Eddie James <eajames@us.ibm.com>
Subject: [PATCH v2 3/3] drivers/fsi: Add sysfs file to adjust i-poll period
Date: Thu, 2 Feb 2017 17:26:04 -0600 [thread overview]
Message-ID: <1486077964-11346-9-git-send-email-eajames@linux.vnet.ibm.com> (raw)
In-Reply-To: <1486077964-11346-1-git-send-email-eajames@linux.vnet.ibm.com>
From: Christopher Bostic <cbostic@linux.vnet.ibm.com>
Create a sysfs file that can read and modify the period for
interrupt polling of connected CFAMs.
Signed-off-by: Eddie James <eajames@us.ibm.com>
Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
---
drivers/fsi/fsi-core.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 2f6fde9..1e9c5a2 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -569,6 +569,30 @@ done:
return 0;
}
+static ssize_t fsi_ipoll_period_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE - 1, "%u\n", fsi_ipoll_period_ms);
+}
+
+static ssize_t fsi_ipoll_period_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ int rc;
+ unsigned long val = 0;
+
+ rc = kstrtoul(buf, 0, &val);
+
+ if (val > 1 && val < 10000)
+ fsi_ipoll_period_ms = val;
+
+ return count;
+}
+
+DEVICE_ATTR(fsi_ipoll_period, S_IRUGO | S_IWUSR, fsi_ipoll_period_show,
+ fsi_ipoll_period_store);
+
int fsi_master_register(struct fsi_master *master)
{
if (!master || !master->dev)
@@ -578,12 +602,14 @@ int fsi_master_register(struct fsi_master *master)
master->slave_list = false;
get_device(master->dev);
fsi_master_scan(master);
+ device_create_file(master->dev, &dev_attr_fsi_ipoll_period);
return 0;
}
EXPORT_SYMBOL_GPL(fsi_master_register);
void fsi_master_unregister(struct fsi_master *master)
{
+ device_remove_file(master->dev, &dev_attr_fsi_ipoll_period);
fsi_master_unscan(master);
put_device(master->dev);
if (master_ipoll) {
--
1.8.2.2
next prev parent reply other threads:[~2017-02-02 23:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 23:25 [PATCH linux v1 0/8] drivers: fsi: interrupt polling, i2c client eajames
2017-02-02 23:25 ` [PATCH linux v1 4/8] drivers: fsi: Add i2c client driver eajames
2017-02-03 0:56 ` Alistair Popple
2017-02-03 0:58 ` Joel Stanley
2017-02-02 23:25 ` [PATCH linux v1 5/8] drivers: fsi: i2c: Add engine access wrappers eajames
2017-02-02 23:25 ` [PATCH linux v1 6/8] drivers: fsi: i2c: probe fsi device for i2c client eajames
2017-02-02 23:26 ` [PATCH linux v1 7/8] drivers: fsi: i2c: add driver file operations and bus locking eajames
2017-02-02 23:26 ` [PATCH linux v1 8/8] drivers: fsi: i2c: boe engine eajames
2017-02-02 23:26 ` [PATCH v2 1/3] drivers/fsi: Add slave interrupt polling eajames
2017-02-03 1:11 ` Alistair Popple
2017-02-03 16:18 ` eajames
2017-02-03 20:33 ` Benjamin Herrenschmidt
2017-02-02 23:26 ` [PATCH v2 2/3] drivers/fsi: Add Client IRQ Enable / Disable eajames
2017-02-02 23:26 ` eajames [this message]
2017-02-03 0:55 ` [PATCH linux v1 0/8] drivers: fsi: interrupt polling, i2c client Joel Stanley
2017-02-03 16:36 ` eajames
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=1486077964-11346-9-git-send-email-eajames@linux.vnet.ibm.com \
--to=eajames@linux.vnet.ibm.com \
--cc=alistair@popple.id.au \
--cc=benh@kernel.crashing.org \
--cc=cbostic@linux.vnet.ibm.com \
--cc=eajames@us.ibm.com \
--cc=joel@jms.id.au \
--cc=openbmc@lists.ozlabs.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.