Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1410748 > unrolled thread
| Started by | David Kershner <david.kershner@unisys.com> |
|---|---|
| First post | 2016-06-01 04:30 +0200 |
| Last post | 2016-06-01 04:40 +0200 |
| Articles | 18 on this page of 38 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH v2 00/27] Fixed issues raised by tglx, then move visorbus to drivers/virt David Kershner <david.kershner@unisys.com> - 2016-06-01 04:30 +0200
[PATCH v2 13/27] staging: unisys: visorbus: Make visordriver_callback_lock a mutex David Kershner <david.kershner@unisys.com> - 2016-06-01 04:30 +0200
Re: [PATCH v2 13/27] staging: unisys: visorbus: Make visordriver_callback_lock a mutex Thomas Gleixner <tglx@linutronix.de> - 2016-06-01 08:50 +0200
[PATCH v2 27/27] drivers: Add visorbus to the drivers directory David Kershner <david.kershner@unisys.com> - 2016-06-01 04:30 +0200
[PATCH v2 17/27] staging: unisys: visorbus: vbusdeviceinfo function descriptions more kerneldoc-like David Kershner <david.kershner@unisys.com> - 2016-06-01 04:30 +0200
[PATCH v2 12/27] staging: unisys: visorbus: remove periodic_work.h/.c David Kershner <david.kershner@unisys.com> - 2016-06-01 04:30 +0200
[PATCH v2 06/27] staging: unisys: visorbus: modify format string to match argument David Kershner <david.kershner@unisys.com> - 2016-06-01 04:30 +0200
[PATCH v2 16/27] staging: unisys: Remove reference to unused STANDALONE_CLIENT David Kershner <david.kershner@unisys.com> - 2016-06-01 04:30 +0200
[PATCH v2 05/27] staging: unisys: visorbus: remove unused struct David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 07/27] staging: unisys: visornic: Correct comment spelling mistake David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 24/27] staging: unisys: Move vbushelper.h to visorbus directory David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 10/27] staging: unisys: visorinput: remove unnecessary locking David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
Re: [PATCH v2 10/27] staging: unisys: visorinput: remove unnecessary locking Thomas Gleixner <tglx@linutronix.de> - 2016-06-01 08:50 +0200
RE: [PATCH v2 10/27] staging: unisys: visorinput: remove unnecessary locking "Sell, Timothy C" <Timothy.Sell@unisys.com> - 2016-06-03 06:40 +0200
Re: [PATCH v2 10/27] staging: unisys: visorinput: remove unnecessary locking Neil Horman <nhorman@redhat.com> - 2016-06-01 16:20 +0200
RE: [PATCH v2 10/27] staging: unisys: visorinput: remove unnecessary locking "Sell, Timothy C" <Timothy.Sell@unisys.com> - 2016-06-01 17:10 +0200
Re: [PATCH v2 10/27] staging: unisys: visorinput: remove unnecessary locking Neil Horman <nhorman@redhat.com> - 2016-06-01 20:50 +0200
RE: [PATCH v2 10/27] staging: unisys: visorinput: remove unnecessary locking "Sell, Timothy C" <Timothy.Sell@unisys.com> - 2016-06-02 07:10 +0200
Re: [PATCH v2 10/27] staging: unisys: visorinput: remove unnecessary locking Neil Horman <nhorman@redhat.com> - 2016-06-02 14:50 +0200
[PATCH v2 15/27] staging: unisys: visorbus: Remove unused functions David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 20/27] staging: unisys: visorbus: make visorchannel function descriptions more kerneldoc-like David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
Re: [PATCH v2 20/27] staging: unisys: visorbus: make visorchannel function descriptions more kerneldoc-like Thomas Gleixner <tglx@linutronix.de> - 2016-06-01 08:50 +0200
[PATCH v2 23/27] staging: unisys: visorbus: Add kerneldoc-style comments for visorbus API David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 04/27] staging: unisys: visorbus: remove unused module parameters David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 18/27] staging: unisys: visorbus: make function descriptions more kerneldoc-like David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 14/27] staging: unisys: visorbus: Remove unnecessary EXPORT_SYMBOL statements David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 02/27] staging: unisys: visorchipset change -1 return value David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
Re: [PATCH v2 02/27] staging: unisys: visorchipset change -1 return value Neil Horman <nhorman@redhat.com> - 2016-06-01 15:20 +0200
[PATCH v2 08/27] staging: unisys: include: Remove thread-related enum members David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 22/27] staging: unisys: visorbus: Move visorbus-unique functions to private header David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 03/27] staging: unisys: iovmcall_gnuc.h change -1 return values David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
Re: [PATCH v2 03/27] staging: unisys: iovmcall_gnuc.h change -1 return values Neil Horman <nhorman@redhat.com> - 2016-06-01 15:40 +0200
[PATCH v2 21/27] staging: unisys: visorbus: make visorchipset function descriptions more kerneldoc-like David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 01/27] staging: unisys: visorbus change -1 return values David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
Re: [PATCH v2 01/27] staging: unisys: visorbus change -1 return values Neil Horman <nhorman@redhat.com> - 2016-06-01 15:30 +0200
[PATCH v2 19/27] staging: unisys: visorbus: make visorbus_private.h function descriptions more kerneldoc-like David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 11/27] staging: unisys: visorbus: use kernel timer instead of workqueue David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
[PATCH v2 09/27] staging: unisys: visorbus: removed unused periodic_test_workqueue David Kershner <david.kershner@unisys.com> - 2016-06-01 04:40 +0200
Page 2 of 2 — ← Prev page 1 [2]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 20/27] staging: unisys: visorbus: make visorchannel function descriptions more kerneldoc-like |
| Message-ID | <rF4eB-2rF-15@gated-at.bofh.it> |
| In reply to | #1410748 |
From: David Binder <david.binder@unisys.com>
Per audit feedback from Thomas Gleixner, function descriptions in
visorchannel.c now utilize a more kerneldoc-like formatting. The affected
comments do not implement other kerneldoc requirements.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
---
drivers/staging/unisys/visorbus/visorchannel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c
index 43315c2..b9f0b6b 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -55,7 +55,8 @@ struct visorchannel {
uuid_le inst;
};
-/* Creates the struct visorchannel abstraction for a data area in memory,
+/**
+ * Creates the struct visorchannel abstraction for a data area in memory,
* but does NOT modify this data area.
*/
static struct visorchannel *
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2016-06-01 08:50 +0200 |
| Subject | Re: [PATCH v2 20/27] staging: unisys: visorbus: make visorchannel function descriptions more kerneldoc-like |
| Message-ID | <rF88x-4XQ-21@gated-at.bofh.it> |
| In reply to | #1410762 |
On Tue, 31 May 2016, David Kershner wrote: > From: David Binder <david.binder@unisys.com> > > Per audit feedback from Thomas Gleixner, function descriptions in > visorchannel.c now utilize a more kerneldoc-like formatting. The affected > comments do not implement other kerneldoc requirements. That was not my feedback. If you start a comment with '/**' then it should be a kernel-doc function/struct documentation. If not then it starts with '/*'. Thanks, tglx
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 23/27] staging: unisys: visorbus: Add kerneldoc-style comments for visorbus API |
| Message-ID | <rF4eB-2rF-11@gated-at.bofh.it> |
| In reply to | #1410748 |
From: David Binder <david.binder@unisys.com>
Adds kerneldoc-style comments for those functions which may be used outside
of the visorbus driver.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
---
drivers/staging/unisys/include/visorbus.h | 127 ++++++++++++++++++++++++
drivers/staging/unisys/visorbus/visorbus_main.c | 42 --------
2 files changed, 127 insertions(+), 42 deletions(-)
diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h
index 2c103e8..99c7beb 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -177,22 +177,149 @@ struct visor_device {
#define to_visor_device(x) container_of(x, struct visor_device, device)
+/**
+ * visorbus_register_visor_driver() - registers the provided driver
+ * @struct visor_driver *: the driver to register
+ *
+ * A particular type of visor driver calls this function to register
+ * the driver. The caller MUST fill in the following fields within the
+ * #drv structure:
+ * name, version, owner, channel_types, probe, remove
+ *
+ * Here's how the whole Linux bus / driver / device model works.
+ *
+ * At system start-up, the visorbus kernel module is loaded, which registers
+ * visorbus_type as a bus type, using bus_register().
+ *
+ * All kernel modules that support particular device types on a
+ * visorbus bus are loaded. Each of these kernel modules calls
+ * visorbus_register_visor_driver() in their init functions, passing a
+ * visor_driver struct. visorbus_register_visor_driver() in turn calls
+ * register_driver(&visor_driver.driver). This .driver member is
+ * initialized with generic methods (like probe), whose sole responsibility
+ * is to act as a broker for the real methods, which are within the
+ * visor_driver struct. (This is the way the subclass behavior is
+ * implemented, since visor_driver is essentially a subclass of the
+ * generic driver.) Whenever a driver_register() happens, core bus code in
+ * the kernel does (see device_attach() in drivers/base/dd.c):
+ *
+ * for each dev associated with the bus (the bus that driver is on) that
+ * does not yet have a driver
+ * if bus.match(dev,newdriver) == yes_matched ** .match specified
+ * ** during bus_register().
+ * newdriver.probe(dev) ** for visor drivers, this will call
+ * ** the generic driver.probe implemented in visorbus.c,
+ * ** which in turn calls the probe specified within the
+ * ** struct visor_driver (which was specified by the
+ * ** actual device driver as part of
+ * ** visorbus_register_visor_driver()).
+ *
+ * The above dance also happens when a new device appears.
+ * So the question is, how are devices created within the system?
+ * Basically, just call device_add(dev). See pci_bus_add_devices().
+ * pci_scan_device() shows an example of how to build a device struct. It
+ * returns the newly-created struct to pci_scan_single_device(), who adds it
+ * to the list of devices at PCIBUS.devices. That list of devices is what
+ * is traversed by pci_bus_add_devices().
+ *
+ * Return: integer indicating success (zero) or failure (non-zero)
+ */
int visorbus_register_visor_driver(struct visor_driver *);
+
+/**
+ * visorbus_unregister_visor_driver() - unregisters the provided driver
+ * @struct visor_driver *: the driver to unregister
+ */
void visorbus_unregister_visor_driver(struct visor_driver *);
+
+/**
+ * visorbus_read_channel() - reads from the designated channel into
+ * the provided buffer
+ * @dev: the device whose channel is read from
+ * @offset: the offset into the channel at which reading starts
+ * @dest: the destination buffer that is written into from the channel
+ * @nbytes: the number of bytes to read from the channel
+ *
+ * If receiving a message, use the visorchannel_signalremove()
+ * function instead.
+ *
+ * Return: integer indicating success (zero) or failure (non-zero)
+ */
int visorbus_read_channel(struct visor_device *dev,
unsigned long offset, void *dest,
unsigned long nbytes);
+
+/**
+ * visorbus_write_channel() - writes the provided buffer into the designated
+ * channel
+ * @dev: the device whose channel is written to
+ * @offset: the offset into the channel at which writing starts
+ * @src: the source buffer that is written into the channel
+ * @nbytes: the number of bytes to write into the channel
+ *
+ * If sending a message, use the visorchannel_signalinsert()
+ * function instead.
+ *
+ * Return: integer indicating success (zero) or failure (non-zero)
+ */
int visorbus_write_channel(struct visor_device *dev,
unsigned long offset, void *src,
unsigned long nbytes);
+/**
+ * visorbus_enable_channel_interrupts() - enables interrupts on the
+ * designated device
+ * @dev: the device on which to enable interrupts
+ */
void visorbus_enable_channel_interrupts(struct visor_device *dev);
+
+/**
+ * visorbus_disable_channel_interrupts() - disables interrupts on the
+ * designated device
+ * @dev: the device on which to disable interrupts
+ */
void visorbus_disable_channel_interrupts(struct visor_device *dev);
+/**
+ * visorchannel_signalremove() - removes a message from the designated
+ * channel/queue
+ * @channel: the channel the message will be removed from
+ * @queue: the queue the message will be removed from
+ * @msg: the message to remove
+ *
+ * Return: boolean indicating whether the removal succeeded or failed
+ */
bool visorchannel_signalremove(struct visorchannel *channel, u32 queue,
void *msg);
+
+/**
+ * visorchannel_signalinsert() - inserts a message into the designated
+ * channel/queue
+ * @channel: the channel the message will be added to
+ * @queue: the queue the message will be added to
+ * @msg: the message to insert
+ *
+ * Return: boolean indicating whether the insertion succeeded or failed
+ */
bool visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
void *msg);
+
+/**
+ * visorchannel_signalempty() - checks if the designated channel/queue
+ * contains any messages
+ * @channel: the channel to query
+ * @queue: the queue in the channel to query
+ *
+ * Return: boolean indicating whether any messages in the designated
+ * channel/queue are present
+ */
bool visorchannel_signalempty(struct visorchannel *channel, u32 queue);
+
+/**
+ * visorchannel_get_uuid() - queries the UUID of the designated channel
+ * @channel: the channel to query
+ *
+ * Return: the UUID of the provided channel
+ */
uuid_le visorchannel_get_uuid(struct visorchannel *channel);
#define BUS_ROOT_DEVICE UINT_MAX
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 850998e..0a537c7 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -616,48 +616,6 @@ visordriver_remove_device(struct device *xdev)
return 0;
}
-/**
- * A particular type of visor driver calls this function to register
- * the driver. The caller MUST fill in the following fields within the
- * #drv structure:
- * name, version, owner, channel_types, probe, remove
- *
- * Here's how the whole Linux bus / driver / device model works.
- *
- * At system start-up, the visorbus kernel module is loaded, which registers
- * visorbus_type as a bus type, using bus_register().
- *
- * All kernel modules that support particular device types on a
- * visorbus bus are loaded. Each of these kernel modules calls
- * visorbus_register_visor_driver() in their init functions, passing a
- * visor_driver struct. visorbus_register_visor_driver() in turn calls
- * register_driver(&visor_driver.driver). This .driver member is
- * initialized with generic methods (like probe), whose sole responsibility
- * is to act as a broker for the real methods, which are within the
- * visor_driver struct. (This is the way the subclass behavior is
- * implemented, since visor_driver is essentially a subclass of the
- * generic driver.) Whenever a driver_register() happens, core bus code in
- * the kernel does (see device_attach() in drivers/base/dd.c):
- *
- * for each dev associated with the bus (the bus that driver is on) that
- * does not yet have a driver
- * if bus.match(dev,newdriver) == yes_matched ** .match specified
- * ** during bus_register().
- * newdriver.probe(dev) ** for visor drivers, this will call
- * ** the generic driver.probe implemented in visorbus.c,
- * ** which in turn calls the probe specified within the
- * ** struct visor_driver (which was specified by the
- * ** actual device driver as part of
- * ** visorbus_register_visor_driver()).
- *
- * The above dance also happens when a new device appears.
- * So the question is, how are devices created within the system?
- * Basically, just call device_add(dev). See pci_bus_add_devices().
- * pci_scan_device() shows an example of how to build a device struct. It
- * returns the newly-created struct to pci_scan_single_device(), who adds it
- * to the list of devices at PCIBUS.devices. That list of devices is what
- * is traversed by pci_bus_add_devices().
- */
int visorbus_register_visor_driver(struct visor_driver *drv)
{
int rc = 0;
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 04/27] staging: unisys: visorbus: remove unused module parameters |
| Message-ID | <rF4eB-2rF-13@gated-at.bofh.it> |
| In reply to | #1410748 |
From: David Binder <david.binder@unisys.com> Removes unused module parameters from visorbus_main.c, in response to findings by SonarQube. Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> --- drivers/staging/unisys/visorbus/visorbus_main.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index d32b898..8278624 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -27,10 +27,9 @@ #define MYDRVNAME "visorbus" /* module parameters */ -static int visorbus_debug; static int visorbus_forcematch; static int visorbus_forcenomatch; -static int visorbus_debugref; + #define SERIALLOOPBACKCHANADDR (100 * 1024 * 1024) /* Display string that is guaranteed to be no longer the 99 characters*/ @@ -1329,9 +1328,6 @@ visorbus_exit(void) remove_bus_type(); } -module_param_named(debug, visorbus_debug, int, S_IRUGO); -MODULE_PARM_DESC(visorbus_debug, "1 to debug"); - module_param_named(forcematch, visorbus_forcematch, int, S_IRUGO); MODULE_PARM_DESC(visorbus_forcematch, "1 to force a successful dev <--> drv match"); @@ -1339,6 +1335,3 @@ MODULE_PARM_DESC(visorbus_forcematch, module_param_named(forcenomatch, visorbus_forcenomatch, int, S_IRUGO); MODULE_PARM_DESC(visorbus_forcenomatch, "1 to force an UNsuccessful dev <--> drv match"); - -module_param_named(debugref, visorbus_debugref, int, S_IRUGO); -MODULE_PARM_DESC(visorbus_debugref, "1 to debug reference counting"); -- 1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 18/27] staging: unisys: visorbus: make function descriptions more kerneldoc-like |
| Message-ID | <rF4eB-2rF-17@gated-at.bofh.it> |
| In reply to | #1410748 |
From: David Binder <david.binder@unisys.com>
Per audit feedback from Thomas Gleixner, function descriptions in
visorbus_main.c now utilize a more kerneldoc-like formatting. The affected
comments do not implement other kerneldoc requirements.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
---
drivers/staging/unisys/visorbus/visorbus_main.c | 178 +++++++++++++-----------
1 file changed, 98 insertions(+), 80 deletions(-)
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index c3f53fb..850998e 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -166,7 +166,8 @@ visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env)
return 0;
}
-/* This is called automatically upon adding a visor_device (device_add), or
+/**
+ * This is called automatically upon adding a visor_device (device_add), or
* adding a visor_driver (visorbus_register_visor_driver), and returns 1 iff the
* provided driver can control the specified device.
*/
@@ -200,9 +201,10 @@ visorbus_match(struct device *xdev, struct device_driver *xdrv)
return 0;
}
-/** This is called when device_unregister() is called for the bus device
- * instance, after all other tasks involved with destroying the device
- * are complete.
+/**
+ * This is called when device_unregister() is called for the bus device
+ * instance, after all other tasks involved with destroying the device
+ * are complete.
*/
static void
visorbus_release_busdevice(struct device *xdev)
@@ -212,8 +214,9 @@ visorbus_release_busdevice(struct device *xdev)
kfree(dev);
}
-/** This is called when device_unregister() is called for each child
- * device instance.
+/**
+ * This is called when device_unregister() is called for each child
+ * device instance.
*/
static void
visorbus_release_device(struct device *xdev)
@@ -556,10 +559,11 @@ dev_stop_periodic_work(struct visor_device *dev)
put_device(&dev->device);
}
-/** This is called automatically upon adding a visor_device (device_add), or
- * adding a visor_driver (visorbus_register_visor_driver), but only after
- * visorbus_match has returned 1 to indicate a successful match between
- * driver and device.
+/**
+ * This is called automatically upon adding a visor_device (device_add), or
+ * adding a visor_driver (visorbus_register_visor_driver), but only after
+ * visorbus_match has returned 1 to indicate a successful match between
+ * driver and device.
*/
static int
visordriver_probe_device(struct device *xdev)
@@ -588,9 +592,10 @@ visordriver_probe_device(struct device *xdev)
return res;
}
-/** This is called when device_unregister() is called for each child device
- * instance, to notify the appropriate visorbus_driver that the device is
- * going away, and to decrease the reference count of the device.
+/**
+ * This is called when device_unregister() is called for each child device
+ * instance, to notify the appropriate visorbus_driver that the device is
+ * going away, and to decrease the reference count of the device.
*/
static int
visordriver_remove_device(struct device *xdev)
@@ -611,47 +616,47 @@ visordriver_remove_device(struct device *xdev)
return 0;
}
-/** A particular type of visor driver calls this function to register
- * the driver. The caller MUST fill in the following fields within the
- * #drv structure:
- * name, version, owner, channel_types, probe, remove
+/**
+ * A particular type of visor driver calls this function to register
+ * the driver. The caller MUST fill in the following fields within the
+ * #drv structure:
+ * name, version, owner, channel_types, probe, remove
*
- * Here's how the whole Linux bus / driver / device model works.
+ * Here's how the whole Linux bus / driver / device model works.
*
- * At system start-up, the visorbus kernel module is loaded, which registers
- * visorbus_type as a bus type, using bus_register().
+ * At system start-up, the visorbus kernel module is loaded, which registers
+ * visorbus_type as a bus type, using bus_register().
*
- * All kernel modules that support particular device types on a
- * visorbus bus are loaded. Each of these kernel modules calls
- * visorbus_register_visor_driver() in their init functions, passing a
- * visor_driver struct. visorbus_register_visor_driver() in turn calls
- * register_driver(&visor_driver.driver). This .driver member is
- * initialized with generic methods (like probe), whose sole responsibility
- * is to act as a broker for the real methods, which are within the
- * visor_driver struct. (This is the way the subclass behavior is
- * implemented, since visor_driver is essentially a subclass of the
- * generic driver.) Whenever a driver_register() happens, core bus code in
- * the kernel does (see device_attach() in drivers/base/dd.c):
+ * All kernel modules that support particular device types on a
+ * visorbus bus are loaded. Each of these kernel modules calls
+ * visorbus_register_visor_driver() in their init functions, passing a
+ * visor_driver struct. visorbus_register_visor_driver() in turn calls
+ * register_driver(&visor_driver.driver). This .driver member is
+ * initialized with generic methods (like probe), whose sole responsibility
+ * is to act as a broker for the real methods, which are within the
+ * visor_driver struct. (This is the way the subclass behavior is
+ * implemented, since visor_driver is essentially a subclass of the
+ * generic driver.) Whenever a driver_register() happens, core bus code in
+ * the kernel does (see device_attach() in drivers/base/dd.c):
*
- * for each dev associated with the bus (the bus that driver is on) that
- * does not yet have a driver
- * if bus.match(dev,newdriver) == yes_matched ** .match specified
- * ** during bus_register().
- * newdriver.probe(dev) ** for visor drivers, this will call
- * ** the generic driver.probe implemented in visorbus.c,
- * ** which in turn calls the probe specified within the
- * ** struct visor_driver (which was specified by the
- * ** actual device driver as part of
- * ** visorbus_register_visor_driver()).
- *
- * The above dance also happens when a new device appears.
- * So the question is, how are devices created within the system?
- * Basically, just call device_add(dev). See pci_bus_add_devices().
- * pci_scan_device() shows an example of how to build a device struct. It
- * returns the newly-created struct to pci_scan_single_device(), who adds it
- * to the list of devices at PCIBUS.devices. That list of devices is what
- * is traversed by pci_bus_add_devices().
+ * for each dev associated with the bus (the bus that driver is on) that
+ * does not yet have a driver
+ * if bus.match(dev,newdriver) == yes_matched ** .match specified
+ * ** during bus_register().
+ * newdriver.probe(dev) ** for visor drivers, this will call
+ * ** the generic driver.probe implemented in visorbus.c,
+ * ** which in turn calls the probe specified within the
+ * ** struct visor_driver (which was specified by the
+ * ** actual device driver as part of
+ * ** visorbus_register_visor_driver()).
*
+ * The above dance also happens when a new device appears.
+ * So the question is, how are devices created within the system?
+ * Basically, just call device_add(dev). See pci_bus_add_devices().
+ * pci_scan_device() shows an example of how to build a device struct. It
+ * returns the newly-created struct to pci_scan_single_device(), who adds it
+ * to the list of devices at PCIBUS.devices. That list of devices is what
+ * is traversed by pci_bus_add_devices().
*/
int visorbus_register_visor_driver(struct visor_driver *drv)
{
@@ -688,8 +693,9 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
}
EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);
-/** A particular type of visor driver calls this function to unregister
- * the driver, i.e., within its module_exit function.
+/**
+ * A particular type of visor driver calls this function to unregister
+ * the driver, i.e., within its module_exit function.
*/
void
visorbus_unregister_visor_driver(struct visor_driver *drv)
@@ -715,8 +721,9 @@ visorbus_write_channel(struct visor_device *dev, unsigned long offset,
}
EXPORT_SYMBOL_GPL(visorbus_write_channel);
-/** We don't really have a real interrupt, so for now we just call the
- * interrupt function periodically...
+/**
+ * We don't really have a real interrupt, so for now we just call the
+ * interrupt function periodically...
*/
void
visorbus_enable_channel_interrupts(struct visor_device *dev)
@@ -732,19 +739,20 @@ visorbus_disable_channel_interrupts(struct visor_device *dev)
}
EXPORT_SYMBOL_GPL(visorbus_disable_channel_interrupts);
-/** This is how everything starts from the device end.
- * This function is called when a channel first appears via a ControlVM
- * message. In response, this function allocates a visor_device to
- * correspond to the new channel, and attempts to connect it the appropriate
- * driver. If the appropriate driver is found, the visor_driver.probe()
- * function for that driver will be called, and will be passed the new
- * visor_device that we just created.
+/**
+ * This is how everything starts from the device end.
+ * This function is called when a channel first appears via a ControlVM
+ * message. In response, this function allocates a visor_device to
+ * correspond to the new channel, and attempts to connect it the appropriate
+ * driver. If the appropriate driver is found, the visor_driver.probe()
+ * function for that driver will be called, and will be passed the new
+ * visor_device that we just created.
*
- * It's ok if the appropriate driver is not yet loaded, because in that case
- * the new device struct will just stick around in the bus' list of devices.
- * When the appropriate driver calls visorbus_register_visor_driver(), the
- * visor_driver.probe() for the new driver will be called with the new
- * device.
+ * It's ok if the appropriate driver is not yet loaded, because in that case
+ * the new device struct will just stick around in the bus' list of devices.
+ * When the appropriate driver calls visorbus_register_visor_driver(), the
+ * visor_driver.probe() for the new driver will be called with the new
+ * device.
*/
static int
create_visor_device(struct visor_device *dev)
@@ -834,10 +842,10 @@ get_vbus_header_info(struct visorchannel *chan,
return 0;
}
-/* Write the contents of <info> to the struct
+/**
+ * Write the contents of <info> to the struct
* spar_vbus_channel_protocol.chp_info.
*/
-
static int
write_vbus_chp_info(struct visorchannel *chan,
struct spar_vbus_headerinfo *hdr_info,
@@ -853,10 +861,10 @@ write_vbus_chp_info(struct visorchannel *chan,
return 0;
}
-/* Write the contents of <info> to the struct
+/**
+ * Write the contents of <info> to the struct
* spar_vbus_channel_protocol.bus_info.
*/
-
static int
write_vbus_bus_info(struct visorchannel *chan,
struct spar_vbus_headerinfo *hdr_info,
@@ -872,7 +880,8 @@ write_vbus_bus_info(struct visorchannel *chan,
return 0;
}
-/* Write the contents of <info> to the
+/**
+ * Write the contents of <info> to the
* struct spar_vbus_channel_protocol.dev_info[<devix>].
*/
static int
@@ -892,7 +901,8 @@ write_vbus_dev_info(struct visorchannel *chan,
return 0;
}
-/* For a child device just created on a client bus, fill in
+/**
+ * For a child device just created on a client bus, fill in
* information about the driver that is controlling this device into
* the the appropriate slot within the vbus channel of the bus
* instance.
@@ -949,7 +959,8 @@ fix_vbus_dev_info(struct visor_device *visordev)
&clientbus_driverinfo);
}
-/** Create a device instance for the visor bus itself.
+/**
+ * Create a device instance for the visor bus itself.
*/
static int
create_bus_instance(struct visor_device *dev)
@@ -990,7 +1001,8 @@ create_bus_instance(struct visor_device *dev)
return 0;
}
-/** Remove a device instance for the visor bus itself.
+/**
+ * Remove a device instance for the visor bus itself.
*/
static void
remove_bus_instance(struct visor_device *dev)
@@ -1012,8 +1024,9 @@ remove_bus_instance(struct visor_device *dev)
device_unregister(&dev->device);
}
-/** Create and register the one-and-only one instance of
- * the visor bus type (visorbus_type).
+/**
+ * Create and register the one-and-only one instance of
+ * the visor bus type (visorbus_type).
*/
static int
create_bus_type(void)
@@ -1022,7 +1035,8 @@ create_bus_type(void)
return busreg_rc;
}
-/** Remove the one-and-only one instance of the visor bus type (visorbus_type).
+/**
+ * Remove the one-and-only one instance of the visor bus type (visorbus_type).
*/
static void
remove_bus_type(void)
@@ -1030,7 +1044,8 @@ remove_bus_type(void)
bus_unregister(&visorbus_type);
}
-/** Remove all child visor bus device instances.
+/**
+ * Remove all child visor bus device instances.
*/
static void
remove_all_visor_devices(void)
@@ -1105,7 +1120,8 @@ chipset_device_destroy(struct visor_device *dev_info)
(*chipset_responders.device_destroy) (dev_info, 0);
}
-/* This is the callback function specified for a function driver, to
+/**
+ * This is the callback function specified for a function driver, to
* be called when a pending "pause device" operation has been
* completed.
*/
@@ -1126,7 +1142,8 @@ pause_state_change_complete(struct visor_device *dev, int status)
(*chipset_responders.device_pause) (dev, status);
}
-/* This is the callback function specified for a function driver, to
+/**
+ * This is the callback function specified for a function driver, to
* be called when a pending "resume device" operation has been
* completed.
*/
@@ -1147,7 +1164,8 @@ resume_state_change_complete(struct visor_device *dev, int status)
(*chipset_responders.device_resume) (dev, status);
}
-/* Tell the subordinate function driver for a specific device to pause
+/**
+ * Tell the subordinate function driver for a specific device to pause
* or resume that device. Result is returned asynchronously via a
* callback function.
*/
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 14/27] staging: unisys: visorbus: Remove unnecessary EXPORT_SYMBOL statements |
| Message-ID | <rF4eB-2rF-19@gated-at.bofh.it> |
| In reply to | #1410748 |
From: Bryan Thompson <bryan.thompson@unisys.com>
The driver that is now visorbus started out as multiple separate drivers,
and when they were merged the EXPORT_SYMBOL statements that were required
for separate drivers were left in the code. This patch removes those now
unnecessary exports.
Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
---
drivers/staging/unisys/visorbus/visorbus_main.c | 1 -
drivers/staging/unisys/visorbus/visorchannel.c | 17 -----------------
drivers/staging/unisys/visorbus/visorchipset.c | 2 --
3 files changed, 20 deletions(-)
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 44609ee..247a9ad 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -721,7 +721,6 @@ visorbus_clear_channel(struct visor_device *dev, unsigned long offset, u8 ch,
{
return visorchannel_clear(dev->visorchannel, offset, ch, nbytes);
}
-EXPORT_SYMBOL_GPL(visorbus_clear_channel);
/** We don't really have a real interrupt, so for now we just call the
* interrupt function periodically...
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c
index 4337358..1f626c3 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -148,7 +148,6 @@ visorchannel_create(u64 physaddr, unsigned long channel_bytes,
return visorchannel_create_guts(physaddr, channel_bytes, gfp, 0, guid,
false);
}
-EXPORT_SYMBOL_GPL(visorchannel_create);
struct visorchannel *
visorchannel_create_with_lock(u64 physaddr, unsigned long channel_bytes,
@@ -157,7 +156,6 @@ visorchannel_create_with_lock(u64 physaddr, unsigned long channel_bytes,
return visorchannel_create_guts(physaddr, channel_bytes, gfp, 0, guid,
true);
}
-EXPORT_SYMBOL_GPL(visorchannel_create_with_lock);
void
visorchannel_destroy(struct visorchannel *channel)
@@ -171,21 +169,18 @@ visorchannel_destroy(struct visorchannel *channel)
}
kfree(channel);
}
-EXPORT_SYMBOL_GPL(visorchannel_destroy);
u64
visorchannel_get_physaddr(struct visorchannel *channel)
{
return channel->physaddr;
}
-EXPORT_SYMBOL_GPL(visorchannel_get_physaddr);
ulong
visorchannel_get_nbytes(struct visorchannel *channel)
{
return channel->nbytes;
}
-EXPORT_SYMBOL_GPL(visorchannel_get_nbytes);
char *
visorchannel_uuid_id(uuid_le *guid, char *s)
@@ -193,28 +188,24 @@ visorchannel_uuid_id(uuid_le *guid, char *s)
sprintf(s, "%pUL", guid);
return s;
}
-EXPORT_SYMBOL_GPL(visorchannel_uuid_id);
char *
visorchannel_id(struct visorchannel *channel, char *s)
{
return visorchannel_uuid_id(&channel->guid, s);
}
-EXPORT_SYMBOL_GPL(visorchannel_id);
char *
visorchannel_zoneid(struct visorchannel *channel, char *s)
{
return visorchannel_uuid_id(&channel->chan_hdr.zone_uuid, s);
}
-EXPORT_SYMBOL_GPL(visorchannel_zoneid);
u64
visorchannel_get_clientpartition(struct visorchannel *channel)
{
return channel->chan_hdr.partition_handle;
}
-EXPORT_SYMBOL_GPL(visorchannel_get_clientpartition);
int
visorchannel_set_clientpartition(struct visorchannel *channel,
@@ -223,7 +214,6 @@ visorchannel_set_clientpartition(struct visorchannel *channel,
channel->chan_hdr.partition_handle = partition_handle;
return 0;
}
-EXPORT_SYMBOL_GPL(visorchannel_set_clientpartition);
uuid_le
visorchannel_get_uuid(struct visorchannel *channel)
@@ -243,7 +233,6 @@ visorchannel_read(struct visorchannel *channel, ulong offset,
return 0;
}
-EXPORT_SYMBOL_GPL(visorchannel_read);
int
visorchannel_write(struct visorchannel *channel, ulong offset,
@@ -265,7 +254,6 @@ visorchannel_write(struct visorchannel *channel, ulong offset,
return 0;
}
-EXPORT_SYMBOL_GPL(visorchannel_write);
int
visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch,
@@ -301,14 +289,12 @@ out_free_page:
free_page((unsigned long)buf);
return err;
}
-EXPORT_SYMBOL_GPL(visorchannel_clear);
void __iomem *
visorchannel_get_header(struct visorchannel *channel)
{
return (void __iomem *)&channel->chan_hdr;
}
-EXPORT_SYMBOL_GPL(visorchannel_get_header);
/** Return offset of a specific SIGNAL_QUEUE_HEADER from the beginning of a
* channel header
@@ -522,7 +508,6 @@ visorchannel_signalqueue_slots_avail(struct visorchannel *channel, u32 queue)
slots_avail = sig_hdr.max_signals - slots_used;
return (int)slots_avail;
}
-EXPORT_SYMBOL_GPL(visorchannel_signalqueue_slots_avail);
int
visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue)
@@ -533,7 +518,6 @@ visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue)
return 0;
return (int)sig_hdr.max_signals;
}
-EXPORT_SYMBOL_GPL(visorchannel_signalqueue_max_slots);
static void
sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq)
@@ -632,4 +616,3 @@ visorchannel_debug(struct visorchannel *channel, int num_queues,
seq_printf(seq, "--- End channel @0x%-16.16Lx for 0x%lx bytes ---\n",
addr + off, nbytes);
}
-EXPORT_SYMBOL_GPL(visorchannel_debug);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index b6a4d21..1da980f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -682,7 +682,6 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
vdev = to_visor_device(dev);
return vdev;
}
-EXPORT_SYMBOL(visorbus_get_device_by_id);
void
visorchipset_register_busdev(
@@ -707,7 +706,6 @@ visorchipset_register_busdev(
up(¬ifier_lock);
}
-EXPORT_SYMBOL_GPL(visorchipset_register_busdev);
static void
chipset_init(struct controlvm_message *inmsg)
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 02/27] staging: unisys: visorchipset change -1 return value |
| Message-ID | <rF4eC-2rF-29@gated-at.bofh.it> |
| In reply to | #1410748 |
From: Erik Arfvidson <erik.arfvidson@unisys.com> This patch changes the vague -1 return value to -EINVAL Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> --- drivers/staging/unisys/visorbus/visorchipset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 5ba5936..d248c94 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1613,7 +1613,7 @@ parahotplug_request_complete(int id, u16 active) } spin_unlock(¶hotplug_request_list_lock); - return -1; + return -EINVAL; } /* -- 1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Neil Horman <nhorman@redhat.com> |
|---|---|
| Date | 2016-06-01 15:20 +0200 |
| Subject | Re: [PATCH v2 02/27] staging: unisys: visorchipset change -1 return value |
| Message-ID | <rFedY-qG-41@gated-at.bofh.it> |
| In reply to | #1410769 |
On Tue, May 31, 2016 at 10:26:28PM -0400, David Kershner wrote: > From: Erik Arfvidson <erik.arfvidson@unisys.com> > > This patch changes the vague -1 return value to -EINVAL > > Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> > Signed-off-by: David Kershner <david.kershner@unisys.com> > Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> > --- > drivers/staging/unisys/visorbus/visorchipset.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c > index 5ba5936..d248c94 100644 > --- a/drivers/staging/unisys/visorbus/visorchipset.c > +++ b/drivers/staging/unisys/visorbus/visorchipset.c > @@ -1613,7 +1613,7 @@ parahotplug_request_complete(int id, u16 active) > } > > spin_unlock(¶hotplug_request_list_lock); > - return -1; > + return -EINVAL; > } > > /* > -- > 1.9.1 > Why return anything here, every caller of this function ignores the return code entirely. Alternatively, passing the EINVAL back from the caller seems reasonable. Neil
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 08/27] staging: unisys: include: Remove thread-related enum members |
| Message-ID | <rF4eC-2rF-33@gated-at.bofh.it> |
| In reply to | #1410748 |
From: David Binder <david.binder@unisys.com>
Code relating to ktheads was previously removed from s-Par driver code.
This patch cleans up lingering remnants of kthreads by removing thread-
related enum types.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
---
drivers/staging/unisys/include/guestlinuxdebug.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/unisys/include/guestlinuxdebug.h b/drivers/staging/unisys/include/guestlinuxdebug.h
index b81287f..5af3f77 100644
--- a/drivers/staging/unisys/include/guestlinuxdebug.h
+++ b/drivers/staging/unisys/include/guestlinuxdebug.h
@@ -56,7 +56,7 @@ enum driver_pc { /* POSTCODE driver identifier tuples */
UISLIB_PC = 0xD0,
UISLIB_PC_uislib_c = 0xD1,
UISLIB_PC_uisqueue_c = 0xD2,
- UISLIB_PC_uisthread_c = 0xD3,
+ /* 0xD3 RESERVED */
UISLIB_PC_uisutils_c = 0xD4,
};
@@ -91,7 +91,7 @@ enum event_pc { /* POSTCODE event identifier tuples */
DRIVER_EXIT_PC = 0x0AC,
MALLOC_FAILURE_PC = 0x0AD,
QUEUE_DELAYED_WORK_PC = 0x0AE,
- UISLIB_THREAD_FAILURE_PC = 0x0B7,
+ /* 0x0B7 RESERVED */
VBUS_CHANNEL_ENTRY_PC = 0x0B8,
VBUS_CHANNEL_FAILURE_PC = 0x0B9,
VBUS_CHANNEL_EXIT_PC = 0x0BA,
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 22/27] staging: unisys: visorbus: Move visorbus-unique functions to private header |
| Message-ID | <rF4eC-2rF-37@gated-at.bofh.it> |
| In reply to | #1410748 |
From: David Binder <david.binder@unisys.com> Moves function prototypes that are unique to visorbus from include/visorbus.h to visorbus/visorbus_private.h. Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> --- drivers/staging/unisys/include/visorbus.h | 25 -------------------- drivers/staging/unisys/visorbus/visorbus_private.h | 27 ++++++++++++++++++++++ drivers/staging/unisys/visorbus/visorchannel.c | 1 + 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 94dd48e..2c103e8 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -188,37 +188,12 @@ int visorbus_write_channel(struct visor_device *dev, void visorbus_enable_channel_interrupts(struct visor_device *dev); void visorbus_disable_channel_interrupts(struct visor_device *dev); -/* Note that for visorchannel_create() - * <channel_bytes> and <guid> arguments may be 0 if we are a channel CLIENT. - * In this case, the values can simply be read from the channel header. - */ -struct visorchannel *visorchannel_create(u64 physaddr, - unsigned long channel_bytes, - gfp_t gfp, uuid_le guid); -struct visorchannel *visorchannel_create_with_lock(u64 physaddr, - unsigned long channel_bytes, - gfp_t gfp, uuid_le guid); -void visorchannel_destroy(struct visorchannel *channel); -int visorchannel_read(struct visorchannel *channel, ulong offset, - void *local, ulong nbytes); -int visorchannel_write(struct visorchannel *channel, ulong offset, - void *local, ulong nbytes); bool visorchannel_signalremove(struct visorchannel *channel, u32 queue, void *msg); bool visorchannel_signalinsert(struct visorchannel *channel, u32 queue, void *msg); bool visorchannel_signalempty(struct visorchannel *channel, u32 queue); - -u64 visorchannel_get_physaddr(struct visorchannel *channel); -ulong visorchannel_get_nbytes(struct visorchannel *channel); -char *visorchannel_id(struct visorchannel *channel, char *s); -char *visorchannel_zoneid(struct visorchannel *channel, char *s); -u64 visorchannel_get_clientpartition(struct visorchannel *channel); -int visorchannel_set_clientpartition(struct visorchannel *channel, - u64 partition_handle); uuid_le visorchannel_get_uuid(struct visorchannel *channel); -char *visorchannel_uuid_id(uuid_le *guid, char *s); -void __iomem *visorchannel_get_header(struct visorchannel *channel); #define BUS_ROOT_DEVICE UINT_MAX struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h index f48f230..0ee7904 100644 --- a/drivers/staging/unisys/visorbus/visorbus_private.h +++ b/drivers/staging/unisys/visorbus/visorbus_private.h @@ -66,4 +66,31 @@ visorchipset_register_busdev( /* visorbus init and exit functions */ int visorbus_init(void); void visorbus_exit(void); + +/* Visorchannel access functions */ + +/* Note that for visorchannel_create() + * <channel_bytes> and <guid> arguments may be 0 if we are a channel CLIENT. + * In this case, the values can simply be read from the channel header. + */ +struct visorchannel *visorchannel_create(u64 physaddr, + unsigned long channel_bytes, + gfp_t gfp, uuid_le guid); +struct visorchannel *visorchannel_create_with_lock(u64 physaddr, + unsigned long channel_bytes, + gfp_t gfp, uuid_le guid); +void visorchannel_destroy(struct visorchannel *channel); +int visorchannel_read(struct visorchannel *channel, ulong offset, + void *local, ulong nbytes); +int visorchannel_write(struct visorchannel *channel, ulong offset, + void *local, ulong nbytes); +u64 visorchannel_get_physaddr(struct visorchannel *channel); +ulong visorchannel_get_nbytes(struct visorchannel *channel); +char *visorchannel_id(struct visorchannel *channel, char *s); +char *visorchannel_zoneid(struct visorchannel *channel, char *s); +u64 visorchannel_get_clientpartition(struct visorchannel *channel); +int visorchannel_set_clientpartition(struct visorchannel *channel, + u64 partition_handle); +char *visorchannel_uuid_id(uuid_le *guid, char *s); +void __iomem *visorchannel_get_header(struct visorchannel *channel); #endif diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c index b9f0b6b..1b743d7 100644 --- a/drivers/staging/unisys/visorbus/visorchannel.c +++ b/drivers/staging/unisys/visorbus/visorchannel.c @@ -25,6 +25,7 @@ #include "version.h" #include "visorbus.h" #include "controlvmchannel.h" +#include "visorbus_private.h" #define MYDRVNAME "visorchannel" -- 1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 03/27] staging: unisys: iovmcall_gnuc.h change -1 return values |
| Message-ID | <rF4eC-2rF-41@gated-at.bofh.it> |
| In reply to | #1410748 |
From: Erik Arfvidson <erik.arfvidson@unisys.com>
This patch changes the vague -1 return values to -EPERM.
This operation is not supported is a good alternative
to -1 because the return is basically telling the caller
that the processor doesn't support vmcall operations.
Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
---
drivers/staging/unisys/visorbus/iovmcall_gnuc.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/unisys/visorbus/iovmcall_gnuc.h b/drivers/staging/unisys/visorbus/iovmcall_gnuc.h
index b08b6ec..98ea7f3 100644
--- a/drivers/staging/unisys/visorbus/iovmcall_gnuc.h
+++ b/drivers/staging/unisys/visorbus/iovmcall_gnuc.h
@@ -22,7 +22,7 @@ __unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
if (!(cpuid_ecx & 0x80000000))
- return -1;
+ return -EPERM;
__asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
"a"(tuple), "b"(reg_ebx), "c"(reg_ecx));
@@ -40,7 +40,7 @@ __unisys_extended_vmcall_gnuc(unsigned long long tuple,
cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
if (!(cpuid_ecx & 0x80000000))
- return -1;
+ return -EPERM;
__asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
"a"(tuple), "b"(reg_ebx), "c"(reg_ecx), "d"(reg_edx));
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Neil Horman <nhorman@redhat.com> |
|---|---|
| Date | 2016-06-01 15:40 +0200 |
| Subject | Re: [PATCH v2 03/27] staging: unisys: iovmcall_gnuc.h change -1 return values |
| Message-ID | <rFexj-yn-1@gated-at.bofh.it> |
| In reply to | #1410776 |
On Tue, May 31, 2016 at 10:26:29PM -0400, David Kershner wrote:
> From: Erik Arfvidson <erik.arfvidson@unisys.com>
>
> This patch changes the vague -1 return values to -EPERM.
> This operation is not supported is a good alternative
> to -1 because the return is basically telling the caller
> that the processor doesn't support vmcall operations.
>
> Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
> Signed-off-by: David Kershner <david.kershner@unisys.com>
> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
> ---
> drivers/staging/unisys/visorbus/iovmcall_gnuc.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/unisys/visorbus/iovmcall_gnuc.h b/drivers/staging/unisys/visorbus/iovmcall_gnuc.h
> index b08b6ec..98ea7f3 100644
> --- a/drivers/staging/unisys/visorbus/iovmcall_gnuc.h
> +++ b/drivers/staging/unisys/visorbus/iovmcall_gnuc.h
> @@ -22,7 +22,7 @@ __unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
>
> cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
> if (!(cpuid_ecx & 0x80000000))
> - return -1;
> + return -EPERM;
>
> __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
> "a"(tuple), "b"(reg_ebx), "c"(reg_ecx));
> @@ -40,7 +40,7 @@ __unisys_extended_vmcall_gnuc(unsigned long long tuple,
>
> cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
> if (!(cpuid_ecx & 0x80000000))
> - return -1;
> + return -EPERM;
>
> __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
> "a"(tuple), "b"(reg_ebx), "c"(reg_ecx), "d"(reg_edx));
> --
> 1.9.1
>
This gets properly checked as far as return codes go for the most part, which is
good, but in the case of an issuing of the
VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET ioctl, the return code is simply copied
into a user space buffer. That might be expected if -1 is used as an error
condition marker, but I would check before you assume that a user space caller
will handle -EINVAL properly there.
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 21/27] staging: unisys: visorbus: make visorchipset function descriptions more kerneldoc-like |
| Message-ID | <rF4eC-2rF-45@gated-at.bofh.it> |
| In reply to | #1410748 |
From: David Binder <david.binder@unisys.com> Per audit feedback from Thomas Gleixner, function descriptions in visorchipset.c now utilize a more kerneldoc-like formatting. The affected comments do not implement other kerneldoc requirements. Signed-off-by: David Binder <david.binder@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> --- drivers/staging/unisys/visorbus/visorchipset.c | 41 +++++++++++++++----------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 1da980f..189ba40 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1300,7 +1300,8 @@ my_device_destroy(struct controlvm_message *inmsg) inmsg->hdr.flags.response_expected == 1, 1); } -/* When provided with the physical address of the controlvm channel +/** + * When provided with the physical address of the controlvm channel * (phys_addr), the offset to the payload area we need to manage * (offset), and the size of this payload area (bytes), fills in the * controlvm_payload_info struct. Returns true for success or false @@ -1368,8 +1369,9 @@ initialize_controlvm_payload(void) &controlvm_payload_info); } -/* Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset. - * Returns CONTROLVM_RESP_xxx code. +/** + * Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset. + * Returns CONTROLVM_RESP_xxx code. */ static int visorchipset_chipset_ready(void) @@ -1390,8 +1392,9 @@ visorchipset_chipset_selftest(void) return CONTROLVM_RESP_SUCCESS; } -/* Send ACTION=offline for DEVPATH=/sys/devices/platform/visorchipset. - * Returns CONTROLVM_RESP_xxx code. +/** + * Send ACTION=offline for DEVPATH=/sys/devices/platform/visorchipset. + * Returns CONTROLVM_RESP_xxx code. */ static int visorchipset_chipset_notready(void) @@ -1433,7 +1436,8 @@ chipset_notready(struct controlvm_message_header *msg_hdr) controlvm_respond(msg_hdr, rc); } -/* This is your "one-stop" shop for grabbing the next message from the +/** + * This is your "one-stop" shop for grabbing the next message from the * CONTROLVM_QUEUE_EVENT queue in the controlvm channel. */ static bool @@ -1464,7 +1468,7 @@ read_controlvm_event(struct controlvm_message *msg) #define PARAHOTPLUG_TIMEOUT_MS 2000 -/* +/** * Generate unique int to match an outstanding CONTROLVM message with a * udev script /proc response */ @@ -1476,7 +1480,7 @@ parahotplug_next_id(void) return atomic_inc_return(&id); } -/* +/** * Returns the time (in jiffies) when a CONTROLVM message on the list * should expire -- PARAHOTPLUG_TIMEOUT_MS in the future */ @@ -1486,7 +1490,7 @@ parahotplug_next_expiration(void) return jiffies + msecs_to_jiffies(PARAHOTPLUG_TIMEOUT_MS); } -/* +/** * Create a parahotplug_request, which is basically a wrapper for a * CONTROLVM_MESSAGE that we can stick on a list */ @@ -1506,7 +1510,7 @@ parahotplug_request_create(struct controlvm_message *msg) return req; } -/* +/** * Free a parahotplug_request. */ static void @@ -1515,7 +1519,7 @@ parahotplug_request_destroy(struct parahotplug_request *req) kfree(req); } -/* +/** * Cause uevent to run the user level script to do the disable/enable * specified in (the CONTROLVM message in) the specified * parahotplug_request @@ -1545,7 +1549,7 @@ parahotplug_request_kickoff(struct parahotplug_request *req) envp); } -/* +/** * Remove any request from the list that's been on there too long and * respond with an error. */ @@ -1576,7 +1580,7 @@ parahotplug_process_list(void) spin_unlock(¶hotplug_request_list_lock); } -/* +/** * Called from the /proc handler, which means the user script has * finished the enable/disable. Find the matching identifier, and * respond to the CONTROLVM message with success. @@ -1613,7 +1617,7 @@ parahotplug_request_complete(int id, u16 active) return -EINVAL; } -/* +/** * Enables or disables a PCI device by kicking off a udev script */ static void @@ -1656,7 +1660,8 @@ parahotplug_process_message(struct controlvm_message *inmsg) } } -/* Process a controlvm message. +/** + * Process a controlvm message. * Return result: * false - this function will return false only in the case where the * controlvm message was NOT processed, but processing must be @@ -2024,7 +2029,8 @@ device_resume_response(struct visor_device *dev_info, int response) dev_info->pending_msg_hdr = NULL; } -/* The parahotplug/devicedisabled interface gets called by our support script +/** + * The parahotplug/devicedisabled interface gets called by our support script * when an SR-IOV device has been shut down. The ID is passed to the script * and then passed back when the device has been removed. */ @@ -2041,7 +2047,8 @@ static ssize_t devicedisabled_store(struct device *dev, return count; } -/* The parahotplug/deviceenabled interface gets called by our support script +/** + * The parahotplug/deviceenabled interface gets called by our support script * when an SR-IOV device has been recovered. The ID is passed to the script * and then passed back when the device has been brought back up. */ -- 1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 01/27] staging: unisys: visorbus change -1 return values |
| Message-ID | <rF4eC-2rF-47@gated-at.bofh.it> |
| In reply to | #1410748 |
From: Erik Arfvidson <erik.arfvidson@unisys.com> This patch changes the vague -1 return values to -EFAULT since it would be the most appropriate, given that this error would only occur in an unexpected bad offset field. Resulting in a bad address. Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> --- drivers/staging/unisys/visorbus/visorbus_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 3a147db..d32b898 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -876,10 +876,10 @@ write_vbus_chp_info(struct visorchannel *chan, int off = sizeof(struct channel_header) + hdr_info->chp_info_offset; if (hdr_info->chp_info_offset == 0) - return -1; + return -EFAULT; if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) - return -1; + return -EFAULT; return 0; } @@ -895,10 +895,10 @@ write_vbus_bus_info(struct visorchannel *chan, int off = sizeof(struct channel_header) + hdr_info->bus_info_offset; if (hdr_info->bus_info_offset == 0) - return -1; + return -EFAULT; if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) - return -1; + return -EFAULT; return 0; } @@ -915,10 +915,10 @@ write_vbus_dev_info(struct visorchannel *chan, (hdr_info->device_info_struct_bytes * devix); if (hdr_info->dev_info_offset == 0) - return -1; + return -EFAULT; if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) - return -1; + return -EFAULT; return 0; } -- 1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Neil Horman <nhorman@redhat.com> |
|---|---|
| Date | 2016-06-01 15:30 +0200 |
| Subject | Re: [PATCH v2 01/27] staging: unisys: visorbus change -1 return values |
| Message-ID | <rFenD-uk-13@gated-at.bofh.it> |
| In reply to | #1410778 |
On Tue, May 31, 2016 at 10:26:27PM -0400, David Kershner wrote: > From: Erik Arfvidson <erik.arfvidson@unisys.com> > > This patch changes the vague -1 return values to -EFAULT since > it would be the most appropriate, given that this error > would only occur in an unexpected bad offset field. > Resulting in a bad address. > > Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> > Signed-off-by: David Kershner <david.kershner@unisys.com> > Reviewed-by: Tim Sell <Timothy.Sell@unisys.com> > --- > drivers/staging/unisys/visorbus/visorbus_main.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c > index 3a147db..d32b898 100644 > --- a/drivers/staging/unisys/visorbus/visorbus_main.c > +++ b/drivers/staging/unisys/visorbus/visorbus_main.c > @@ -876,10 +876,10 @@ write_vbus_chp_info(struct visorchannel *chan, > int off = sizeof(struct channel_header) + hdr_info->chp_info_offset; > > if (hdr_info->chp_info_offset == 0) > - return -1; > + return -EFAULT; > > if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) > - return -1; > + return -EFAULT; > return 0; > } > > @@ -895,10 +895,10 @@ write_vbus_bus_info(struct visorchannel *chan, > int off = sizeof(struct channel_header) + hdr_info->bus_info_offset; > > if (hdr_info->bus_info_offset == 0) > - return -1; > + return -EFAULT; > > if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) > - return -1; > + return -EFAULT; > return 0; > } > > @@ -915,10 +915,10 @@ write_vbus_dev_info(struct visorchannel *chan, > (hdr_info->device_info_struct_bytes * devix); > > if (hdr_info->dev_info_offset == 0) > - return -1; > + return -EFAULT; > > if (visorchannel_write(chan, off, info, sizeof(*info)) < 0) > - return -1; > + return -EFAULT; > return 0; > } > > -- > 1.9.1 > This seems fine, but why are you bothering to return anything at all, since the return code is ignored at all the call sites. Or more directly, why aren't you checking these return codes, and acting appropriately if a fault is returned? Neil
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 19/27] staging: unisys: visorbus: make visorbus_private.h function descriptions more kerneldoc-like |
| Message-ID | <rF4eC-2rF-43@gated-at.bofh.it> |
| In reply to | #1410748 |
From: David Binder <david.binder@unisys.com>
Per audit feedback from Thomas Gleixner, function descriptions in
visorbus_private.h now utilize a more kerneldoc-like formatting. The
affected comments do not implement other kerneldoc requirements.
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
---
drivers/staging/unisys/visorbus/visorbus_private.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h
index 39edd20..f48f230 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -51,10 +51,11 @@ struct visorchipset_busdev_responders {
void (*device_resume)(struct visor_device *p, int response);
};
-/** Register functions (in the bus driver) to get called by visorchipset
- * whenever a bus or device appears for which this guest is to be the
- * client for. visorchipset will fill in <responders>, to indicate
- * functions the bus driver should call to indicate message responses.
+/**
+ * Register functions (in the bus driver) to get called by visorchipset
+ * whenever a bus or device appears for which this guest is to be the
+ * client for. visorchipset will fill in <responders>, to indicate
+ * functions the bus driver should call to indicate message responses.
*/
void
visorchipset_register_busdev(
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 11/27] staging: unisys: visorbus: use kernel timer instead of workqueue |
| Message-ID | <rF4eC-2rF-53@gated-at.bofh.it> |
| In reply to | #1410748 |
From: Tim Sell <Timothy.Sell@unisys.com>
A kernel timer is now used as the vehicle to periodically call the
channel_interrupt function of registered visor drivers, instead of a
workqueue.
This simplifies a lot of things by making periodic_work.c and
periodic_work.h no longer necessary. This change also means that the
channel_interrupt() callbacks registered by visor drivers (via
visorbus_register_visor_driver()) will now be called in atomic context
(i.e., canNOT sleep) rather than kernel thread context (CAN sleep).
Fortunately this did NOT necessitate any change to the existing
channel_interrupt() callbacks, because none of them ever perform any
operations that would be invalid in atomic context.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
---
drivers/staging/unisys/include/visorbus.h | 10 +++--
drivers/staging/unisys/visorbus/visorbus_main.c | 54 +++++++------------------
2 files changed, 21 insertions(+), 43 deletions(-)
diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h
index 9baf1ec..9bb88bb 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -34,8 +34,9 @@
#include <linux/poll.h>
#include <linux/kernel.h>
#include <linux/uuid.h>
+#include <linux/seq_file.h>
+#include <linux/slab.h>
-#include "periodic_work.h"
#include "channel.h"
struct visor_driver;
@@ -126,8 +127,8 @@ struct visor_driver {
* device: Device struct meant for use by the bus driver
* only.
* list_all: Used by the bus driver to enumerate devices.
- * periodic_work: Device work queue. Private use by bus driver
- * only.
+ * timer: Timer fired periodically to do interrupt-type
+ * activity.
* being_removed: Indicates that the device is being removed from
* the bus. Private bus driver use only.
* visordriver_callback_lock: Used by the bus driver to lock when handling
@@ -157,7 +158,8 @@ struct visor_device {
/* These fields are for private use by the bus driver only. */
struct device device;
struct list_head list_all;
- struct periodic_work *periodic_work;
+ struct timer_list timer;
+ bool timer_active;
bool being_removed;
struct semaphore visordriver_callback_lock;
bool pausing;
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 608ca1a..24b27ff 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -19,7 +19,6 @@
#include "visorbus.h"
#include "visorbus_private.h"
#include "version.h"
-#include "periodic_work.h"
#include "vbuschannel.h"
#include "guestlinuxdebug.h"
#include "vmcallinterface.h"
@@ -116,7 +115,6 @@ struct bus_type visorbus_type = {
.bus_groups = visorbus_bus_groups,
};
-static struct workqueue_struct *periodic_dev_workqueue;
static long long bus_count; /** number of bus instances */
/** ever-increasing */
@@ -222,10 +220,6 @@ visorbus_release_device(struct device *xdev)
{
struct visor_device *dev = to_visor_device(xdev);
- if (dev->periodic_work) {
- visor_periodic_work_destroy(dev->periodic_work);
- dev->periodic_work = NULL;
- }
if (dev->visorchannel) {
visorchannel_destroy(dev->visorchannel);
dev->visorchannel = NULL;
@@ -530,35 +524,36 @@ unregister_driver_attributes(struct visor_driver *drv)
}
static void
-dev_periodic_work(void *xdev)
+dev_periodic_work(unsigned long __opaque)
{
- struct visor_device *dev = xdev;
+ struct visor_device *dev = (struct visor_device *)__opaque;
struct visor_driver *drv = to_visor_driver(dev->device.driver);
- down(&dev->visordriver_callback_lock);
if (drv->channel_interrupt)
drv->channel_interrupt(dev);
- up(&dev->visordriver_callback_lock);
- if (!visor_periodic_work_nextperiod(dev->periodic_work))
- put_device(&dev->device);
+ mod_timer(&dev->timer, jiffies + POLLJIFFIES_NORMALCHANNEL);
}
static void
dev_start_periodic_work(struct visor_device *dev)
{
- if (dev->being_removed)
+ if (dev->being_removed || dev->timer_active)
return;
/* now up by at least 2 */
get_device(&dev->device);
- if (!visor_periodic_work_start(dev->periodic_work))
- put_device(&dev->device);
+ dev->timer.expires = jiffies + POLLJIFFIES_NORMALCHANNEL;
+ add_timer(&dev->timer);
+ dev->timer_active = true;
}
static void
dev_stop_periodic_work(struct visor_device *dev)
{
- if (visor_periodic_work_stop(dev->periodic_work))
- put_device(&dev->device);
+ if (!dev->timer_active)
+ return;
+ del_timer_sync(&dev->timer);
+ dev->timer_active = false;
+ put_device(&dev->device);
}
/** This is called automatically upon adding a visor_device (device_add), or
@@ -776,17 +771,9 @@ create_visor_device(struct visor_device *dev)
dev->device.release = visorbus_release_device;
/* keep a reference just for us (now 2) */
get_device(&dev->device);
- dev->periodic_work =
- visor_periodic_work_create(POLLJIFFIES_NORMALCHANNEL,
- periodic_dev_workqueue,
- dev_periodic_work,
- dev, dev_name(&dev->device));
- if (!dev->periodic_work) {
- POSTCODE_LINUX_3(DEVICE_CREATE_FAILURE_PC, chipset_dev_no,
- DIAG_SEVERITY_ERR);
- err = -EINVAL;
- goto err_put;
- }
+ init_timer(&dev->timer);
+ dev->timer.data = (unsigned long)(dev);
+ dev->timer.function = dev_periodic_work;
/* bus_id must be a unique name with respect to this bus TYPE
* (NOT bus instance). That's why we need to include the bus
@@ -1265,13 +1252,6 @@ visorbus_init(void)
goto error;
}
- periodic_dev_workqueue = create_singlethread_workqueue("visorbus_dev");
- if (!periodic_dev_workqueue) {
- POSTCODE_LINUX_2(CREATE_WORKQUEUE_PC, DIAG_SEVERITY_ERR);
- err = -ENOMEM;
- goto error;
- }
-
/* This enables us to receive notifications when devices appear for
* which this service partition is to be a server for.
*/
@@ -1294,10 +1274,6 @@ visorbus_exit(void)
visorchipset_register_busdev(NULL, NULL, NULL);
remove_all_visor_devices();
- flush_workqueue(periodic_dev_workqueue); /* better not be any work! */
- destroy_workqueue(periodic_dev_workqueue);
- periodic_dev_workqueue = NULL;
-
list_for_each_safe(listentry, listtmp, &list_all_bus_instances) {
struct visor_device *dev = list_entry(listentry,
struct visor_device,
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | David Kershner <david.kershner@unisys.com> |
|---|---|
| Date | 2016-06-01 04:40 +0200 |
| Subject | [PATCH v2 09/27] staging: unisys: visorbus: removed unused periodic_test_workqueue |
| Message-ID | <rF4eC-2rF-51@gated-at.bofh.it> |
| In reply to | #1410748 |
From: Tim Sell <Timothy.Sell@unisys.com>
periodic_test_workqueue was an unused relic from the past, and was removed.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
---
drivers/staging/unisys/visorbus/visorbus_main.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index c30b4b2..608ca1a 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -116,14 +116,6 @@ struct bus_type visorbus_type = {
.bus_groups = visorbus_bus_groups,
};
-static struct delayed_work periodic_work;
-
-/* YES, we need 2 workqueues.
- * The reason is, workitems on the test queue may need to cancel
- * workitems on the other queue. You will be in for trouble if you try to
- * do this with workitems queued on the same workqueue.
- */
-static struct workqueue_struct *periodic_test_workqueue;
static struct workqueue_struct *periodic_dev_workqueue;
static long long bus_count; /** number of bus instances */
/** ever-increasing */
@@ -1306,13 +1298,6 @@ visorbus_exit(void)
destroy_workqueue(periodic_dev_workqueue);
periodic_dev_workqueue = NULL;
- if (periodic_test_workqueue) {
- cancel_delayed_work(&periodic_work);
- flush_workqueue(periodic_test_workqueue);
- destroy_workqueue(periodic_test_workqueue);
- periodic_test_workqueue = NULL;
- }
-
list_for_each_safe(listentry, listtmp, &list_all_bus_instances) {
struct visor_device *dev = list_entry(listentry,
struct visor_device,
--
1.9.1
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web