From: Todd Poynor <toddpoynor@gmail.com>
To: Rob Springer <rspringer@google.com>,
John Joseph <jnjoseph@google.com>,
Ben Chan <benchan@chromium.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dmitry Torokhov <dtor@chromium.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Todd Poynor <toddpoynor@google.com>
Subject: [PATCH 6/8] staging: gasket: remove "reset type" param from framework
Date: Thu, 2 Aug 2018 01:42:43 -0700 [thread overview]
Message-ID: <20180802084245.239689-7-toddpoynor@gmail.com> (raw)
In-Reply-To: <20180802084245.239689-1-toddpoynor@gmail.com>
From: Todd Poynor <toddpoynor@google.com>
The "type of reset" parameter to the gasket device reset APIs isn't
required by the only gasket device submitted upstream, apex.
The framework documents the param as private to the device driver and a
pass-through at the gasket layer, but the gasket core calls the device
driver with a hardcoded reset type of zero, which is not documented as
having a predefined meaning.
In light of all this, remove the reset type parameter from the
framework. Remove the reset ioctl reset type parameter, and bump the
framework version number to reflect the interface change.
Signed-off-by: Todd Poynor <toddpoynor@google.com>
---
drivers/staging/gasket/gasket.h | 4 ++--
drivers/staging/gasket/gasket_constants.h | 2 +-
drivers/staging/gasket/gasket_core.c | 11 +++++------
drivers/staging/gasket/gasket_core.h | 13 +++----------
drivers/staging/gasket/gasket_ioctl.c | 3 +--
5 files changed, 12 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/gasket/gasket.h b/drivers/staging/gasket/gasket.h
index 9f709f0c5a2bb..a0f065c517a52 100644
--- a/drivers/staging/gasket/gasket.h
+++ b/drivers/staging/gasket/gasket.h
@@ -52,8 +52,8 @@ struct gasket_coherent_alloc_config_ioctl {
/* Base number for all Gasket-common IOCTLs */
#define GASKET_IOCTL_BASE 0xDC
-/* Reset the device using the specified reset type. */
-#define GASKET_IOCTL_RESET _IOW(GASKET_IOCTL_BASE, 0, unsigned long)
+/* Reset the device. */
+#define GASKET_IOCTL_RESET _IO(GASKET_IOCTL_BASE, 0)
/* Associate the specified [event]fd with the specified interrupt. */
#define GASKET_IOCTL_SET_EVENTFD \
diff --git a/drivers/staging/gasket/gasket_constants.h b/drivers/staging/gasket/gasket_constants.h
index 82ed3f21e8aed..50d87c7b178c2 100644
--- a/drivers/staging/gasket/gasket_constants.h
+++ b/drivers/staging/gasket/gasket_constants.h
@@ -3,7 +3,7 @@
#ifndef __GASKET_CONSTANTS_H__
#define __GASKET_CONSTANTS_H__
-#define GASKET_FRAMEWORK_VERSION "1.1.1"
+#define GASKET_FRAMEWORK_VERSION "1.1.2"
/*
* The maximum number of simultaneous device types supported by the framework.
diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 19331feb9b09f..99994e30b154b 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1295,7 +1295,7 @@ static int gasket_release(struct inode *inode, struct file *file)
ownership->owner = 0;
/* Forces chip reset before we unmap the page tables. */
- driver_desc->device_reset_cb(gasket_dev, 0);
+ driver_desc->device_reset_cb(gasket_dev);
for (i = 0; i < driver_desc->num_page_tables; ++i) {
gasket_page_table_unmap_all(gasket_dev->page_table[i]);
@@ -1623,18 +1623,18 @@ const char *gasket_num_name_lookup(uint num,
}
EXPORT_SYMBOL(gasket_num_name_lookup);
-int gasket_reset(struct gasket_dev *gasket_dev, uint reset_type)
+int gasket_reset(struct gasket_dev *gasket_dev)
{
int ret;
mutex_lock(&gasket_dev->mutex);
- ret = gasket_reset_nolock(gasket_dev, reset_type);
+ ret = gasket_reset_nolock(gasket_dev);
mutex_unlock(&gasket_dev->mutex);
return ret;
}
EXPORT_SYMBOL(gasket_reset);
-int gasket_reset_nolock(struct gasket_dev *gasket_dev, uint reset_type)
+int gasket_reset_nolock(struct gasket_dev *gasket_dev)
{
int ret;
int i;
@@ -1644,8 +1644,7 @@ int gasket_reset_nolock(struct gasket_dev *gasket_dev, uint reset_type)
if (!driver_desc->device_reset_cb)
return 0;
- /* Perform a device reset of the requested type. */
- ret = driver_desc->device_reset_cb(gasket_dev, reset_type);
+ ret = driver_desc->device_reset_cb(gasket_dev);
if (ret) {
dev_dbg(gasket_dev->dev, "Device reset cb returned %d.\n",
ret);
diff --git a/drivers/staging/gasket/gasket_core.h b/drivers/staging/gasket/gasket_core.h
index 713bf42de41a4..67f5960943a8a 100644
--- a/drivers/staging/gasket/gasket_core.h
+++ b/drivers/staging/gasket/gasket_core.h
@@ -580,17 +580,12 @@ struct gasket_driver_desc {
/*
* device_reset_cb: Reset the hardware in question.
* @dev: Pointer to the gasket_dev structure for this device.
- * @type: Integer representing reset type. (All
- * Gasket resets have an integer representing their type
- * defined in (device)_ioctl.h; the specific resets are
- * device-dependent, but are handled in the device-specific
- * callback anyways.)
*
* Called by reset ioctls. This function should not
* lock the gasket_dev mutex. It should return 0 on success
* and an error on failure.
*/
- int (*device_reset_cb)(struct gasket_dev *dev, uint reset_type);
+ int (*device_reset_cb)(struct gasket_dev *dev);
};
/*
@@ -615,15 +610,13 @@ void gasket_unregister_device(const struct gasket_driver_desc *desc);
/*
* Reset the Gasket device.
* @gasket_dev: Gasket device struct.
- * @reset_type: Uint representing requested reset type. Should be
- * valid in the underlying callback.
*
* Calls device_reset_cb. Returns 0 on success and an error code othewrise.
* gasket_reset_nolock will not lock the mutex, gasket_reset will.
*
*/
-int gasket_reset(struct gasket_dev *gasket_dev, uint reset_type);
-int gasket_reset_nolock(struct gasket_dev *gasket_dev, uint reset_type);
+int gasket_reset(struct gasket_dev *gasket_dev);
+int gasket_reset_nolock(struct gasket_dev *gasket_dev);
/*
* Memory management functions. These will likely be spun off into their own
diff --git a/drivers/staging/gasket/gasket_ioctl.c b/drivers/staging/gasket/gasket_ioctl.c
index d3397cc74e69f..0ca48e688818f 100644
--- a/drivers/staging/gasket/gasket_ioctl.c
+++ b/drivers/staging/gasket/gasket_ioctl.c
@@ -304,8 +304,7 @@ long gasket_handle_ioctl(struct file *filp, uint cmd, void __user *argp)
*/
switch (cmd) {
case GASKET_IOCTL_RESET:
- trace_gasket_ioctl_integer_data(arg);
- retval = gasket_reset(gasket_dev, arg);
+ retval = gasket_reset(gasket_dev);
break;
case GASKET_IOCTL_SET_EVENTFD:
retval = gasket_set_event_fd(gasket_dev, argp);
--
2.18.0.597.ga71716f1ad-goog
next prev parent reply other threads:[~2018-08-02 8:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 8:42 [PATCH 0/8] staging: gasket: cleanups du jour Todd Poynor
2018-08-02 8:42 ` [PATCH 1/8] staging: gasket: apex: enable power save mode by default Todd Poynor
2018-08-02 8:42 ` [PATCH 2/8] staging: gasket: core: print driver version code at registration time Todd Poynor
2018-08-02 8:57 ` Greg Kroah-Hartman
2018-08-02 8:42 ` [PATCH 3/8] staging: gasket: core: move driver loaded log after error cases Todd Poynor
2018-08-02 8:57 ` Greg Kroah-Hartman
2018-08-02 8:42 ` [PATCH 4/8] staging: gasket: core: device register debug log cleanups Todd Poynor
2018-08-02 8:57 ` Greg Kroah-Hartman
2018-08-02 8:42 ` [PATCH 5/8] staging: gasket: core: add subsystem and device info to error logs Todd Poynor
2018-08-02 8:58 ` Greg Kroah-Hartman
2018-08-02 8:42 ` Todd Poynor [this message]
2018-08-02 8:42 ` [PATCH 7/8] staging: gasket: apex: drop reset type param Todd Poynor
2018-08-02 8:42 ` [PATCH 8/8] Revert "staging: gasket: core: hold reference to pci_dev while used" Todd Poynor
2018-08-02 9:00 ` Greg Kroah-Hartman
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=20180802084245.239689-7-toddpoynor@gmail.com \
--to=toddpoynor@gmail.com \
--cc=benchan@chromium.org \
--cc=devel@driverdev.osuosl.org \
--cc=dtor@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jnjoseph@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rspringer@google.com \
--cc=toddpoynor@google.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
Powered by JetHome