[PATCH 2/3] staging: greybus: use preferred kernel type u16

2016-09-19 Thread Chaehyun Lim
As suggested by checkpatch.pl:

CHECK: Prefer kernel type 'u16' over 'uint16_t'

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/greybus/audio_codec.c | 12 ++--
 drivers/staging/greybus/audio_codec.h | 16 
 drivers/staging/greybus/audio_gb.c| 18 +-
 3 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index c9e1989..5ce2542 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -46,7 +46,7 @@ static int gbaudio_module_enable_tx(struct gbaudio_codec_info 
*codec,
struct gbaudio_module_info *module, int id)
 {
int module_state, ret = 0;
-   uint16_t data_cport, i2s_port, cportid;
+   u16 data_cport, i2s_port, cportid;
u8 sig_bits, channels;
uint32_t format, rate;
struct gbaudio_data_connection *data;
@@ -131,7 +131,7 @@ static int gbaudio_module_enable_tx(struct 
gbaudio_codec_info *codec,
 static int gbaudio_module_disable_tx(struct gbaudio_module_info *module, int 
id)
 {
int ret;
-   uint16_t data_cport, cportid, i2s_port;
+   u16 data_cport, cportid, i2s_port;
int module_state;
struct gbaudio_data_connection *data;
 
@@ -181,7 +181,7 @@ static int gbaudio_module_enable_rx(struct 
gbaudio_codec_info *codec,
struct gbaudio_module_info *module, int id)
 {
int module_state, ret = 0;
-   uint16_t data_cport, i2s_port, cportid;
+   u16 data_cport, i2s_port, cportid;
u8 sig_bits, channels;
uint32_t format, rate;
struct gbaudio_data_connection *data;
@@ -266,7 +266,7 @@ static int gbaudio_module_enable_rx(struct 
gbaudio_codec_info *codec,
 static int gbaudio_module_disable_rx(struct gbaudio_module_info *module, int 
id)
 {
int ret;
-   uint16_t data_cport, cportid, i2s_port;
+   u16 data_cport, cportid, i2s_port;
int module_state;
struct gbaudio_data_connection *data;
 
@@ -855,7 +855,7 @@ EXPORT_SYMBOL(gbaudio_register_module);
 
 static void gbaudio_codec_clean_data_tx(struct gbaudio_data_connection *data)
 {
-   uint16_t i2s_port, cportid;
+   u16 i2s_port, cportid;
int ret;
 
if (list_is_singular(>module_list)) {
@@ -877,7 +877,7 @@ static void gbaudio_codec_clean_data_tx(struct 
gbaudio_data_connection *data)
 
 static void gbaudio_codec_clean_data_rx(struct gbaudio_data_connection *data)
 {
-   uint16_t i2s_port, cportid;
+   u16 i2s_port, cportid;
int ret;
 
if (list_is_singular(>module_list)) {
diff --git a/drivers/staging/greybus/audio_codec.h 
b/drivers/staging/greybus/audio_codec.h
index fabaccc..ca027bd 100644
--- a/drivers/staging/greybus/audio_codec.h
+++ b/drivers/staging/greybus/audio_codec.h
@@ -231,25 +231,25 @@ extern int gb_audio_gb_enable_widget(struct gb_connection 
*connection,
 extern int gb_audio_gb_disable_widget(struct gb_connection *connection,
  u8 widget_id);
 extern int gb_audio_gb_get_pcm(struct gb_connection *connection,
-  uint16_t data_cport, uint32_t *format,
+  u16 data_cport, uint32_t *format,
   uint32_t *rate, u8 *channels,
   u8 *sig_bits);
 extern int gb_audio_gb_set_pcm(struct gb_connection *connection,
-  uint16_t data_cport, uint32_t format,
+  u16 data_cport, uint32_t format,
   uint32_t rate, u8 channels,
   u8 sig_bits);
 extern int gb_audio_gb_set_tx_data_size(struct gb_connection *connection,
-   uint16_t data_cport, uint16_t size);
+   u16 data_cport, u16 size);
 extern int gb_audio_gb_activate_tx(struct gb_connection *connection,
-  uint16_t data_cport);
+  u16 data_cport);
 extern int gb_audio_gb_deactivate_tx(struct gb_connection *connection,
-uint16_t data_cport);
+u16 data_cport);
 extern int gb_audio_gb_set_rx_data_size(struct gb_connection *connection,
-   uint16_t data_cport, uint16_t size);
+   u16 data_cport, u16 size);
 extern int gb_audio_gb_activate_rx(struct gb_connection *connection,
-  uint16_t data_cport);
+  u16 data_cport);
 extern int gb_audio_gb_deactivate_rx(struct gb_connection *connection,
-uint16_t data_cport);
+u16 data_cport);
 extern int gb_audio_apbridgea_set_config(struct gb_connection *connection,
   

[PATCH 3/3] staging: greybus: use preferred kernel type u32

2016-09-19 Thread Chaehyun Lim
As suggested by checkpatch.pl:

CHECK: Prefer kernel type 'u32' over 'uint32_t'

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/greybus/audio_codec.c |  6 ++--
 drivers/staging/greybus/audio_codec.h | 10 +++
 drivers/staging/greybus/audio_gb.c|  4 +--
 drivers/staging/greybus/sdio.c|  2 +-
 drivers/staging/greybus/tools/loopback_test.c | 40 +--
 5 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index 5ce2542..ae0daeb 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -48,7 +48,7 @@ static int gbaudio_module_enable_tx(struct gbaudio_codec_info 
*codec,
int module_state, ret = 0;
u16 data_cport, i2s_port, cportid;
u8 sig_bits, channels;
-   uint32_t format, rate;
+   u32 format, rate;
struct gbaudio_data_connection *data;
struct gbaudio_stream_params *params;
 
@@ -183,7 +183,7 @@ static int gbaudio_module_enable_rx(struct 
gbaudio_codec_info *codec,
int module_state, ret = 0;
u16 data_cport, i2s_port, cportid;
u8 sig_bits, channels;
-   uint32_t format, rate;
+   u32 format, rate;
struct gbaudio_data_connection *data;
struct gbaudio_stream_params *params;
 
@@ -414,7 +414,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream 
*substream,
 {
int ret;
u8 sig_bits, channels;
-   uint32_t format, rate;
+   u32 format, rate;
struct gbaudio_module_info *module;
struct gbaudio_data_connection *data;
struct gb_bundle *bundle;
diff --git a/drivers/staging/greybus/audio_codec.h 
b/drivers/staging/greybus/audio_codec.h
index ca027bd..43a2e4a 100644
--- a/drivers/staging/greybus/audio_codec.h
+++ b/drivers/staging/greybus/audio_codec.h
@@ -99,7 +99,7 @@ enum gbaudio_codec_state {
 struct gbaudio_stream_params {
int state;
u8 sig_bits, channels;
-   uint32_t format, rate;
+   u32 format, rate;
 };
 
 struct gbaudio_codec_dai {
@@ -231,12 +231,12 @@ extern int gb_audio_gb_enable_widget(struct gb_connection 
*connection,
 extern int gb_audio_gb_disable_widget(struct gb_connection *connection,
  u8 widget_id);
 extern int gb_audio_gb_get_pcm(struct gb_connection *connection,
-  u16 data_cport, uint32_t *format,
-  uint32_t *rate, u8 *channels,
+  u16 data_cport, u32 *format,
+  u32 *rate, u8 *channels,
   u8 *sig_bits);
 extern int gb_audio_gb_set_pcm(struct gb_connection *connection,
-  u16 data_cport, uint32_t format,
-  uint32_t rate, u8 channels,
+  u16 data_cport, u32 format,
+  u32 rate, u8 channels,
   u8 sig_bits);
 extern int gb_audio_gb_set_tx_data_size(struct gb_connection *connection,
u16 data_cport, u16 size);
diff --git a/drivers/staging/greybus/audio_gb.c 
b/drivers/staging/greybus/audio_gb.c
index 42f287d..7884d84 100644
--- a/drivers/staging/greybus/audio_gb.c
+++ b/drivers/staging/greybus/audio_gb.c
@@ -108,7 +108,7 @@ int gb_audio_gb_disable_widget(struct gb_connection 
*connection,
 EXPORT_SYMBOL_GPL(gb_audio_gb_disable_widget);
 
 int gb_audio_gb_get_pcm(struct gb_connection *connection, u16 data_cport,
-   uint32_t *format, uint32_t *rate, u8 *channels,
+   u32 *format, u32 *rate, u8 *channels,
u8 *sig_bits)
 {
struct gb_audio_get_pcm_request req;
@@ -132,7 +132,7 @@ int gb_audio_gb_get_pcm(struct gb_connection *connection, 
u16 data_cport,
 EXPORT_SYMBOL_GPL(gb_audio_gb_get_pcm);
 
 int gb_audio_gb_set_pcm(struct gb_connection *connection, u16 data_cport,
-   uint32_t format, uint32_t rate, u8 channels,
+   u32 format, u32 rate, u8 channels,
u8 sig_bits)
 {
struct gb_audio_set_pcm_request req;
diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c
index c7133b1..886e62e 100644
--- a/drivers/staging/greybus/sdio.c
+++ b/drivers/staging/greybus/sdio.c
@@ -52,7 +52,7 @@ struct gb_sdio_host {
 
 static inline bool single_op(struct mmc_command *cmd)
 {
-   uint32_t opcode = cmd->opcode;
+   u32 opcode = cmd->opcode;
 
return opcode == MMC_WRITE_BLOCK ||
   opcode == MMC_READ_SINGLE_BLOCK;
diff --git a/drivers/staging/greybus/tools/loopback_test.c 
b/drivers/staging/greybus/tools/loopback_test.c
index f7f4cd6..2d75fa8 100644
--- a/drivers/staging/greybus/tools/loopback_test.c
+++ b/drivers/staging/greybus/tools/loopback_test.c
@@ -40,31 +40,31 @@ static struct 

[PATCH 1/3] staging: greybus: use preferred kernel type u8

2016-09-19 Thread Chaehyun Lim
As suggested by checkpatch.pl:

CHECK: Prefer kernel type 'u8' over 'uint8_t'

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/greybus/audio_codec.c |  6 +++---
 drivers/staging/greybus/audio_codec.h | 18 +-
 drivers/staging/greybus/audio_gb.c| 16 
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/greybus/audio_codec.c 
b/drivers/staging/greybus/audio_codec.c
index 2f70295..c9e1989 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -47,7 +47,7 @@ static int gbaudio_module_enable_tx(struct gbaudio_codec_info 
*codec,
 {
int module_state, ret = 0;
uint16_t data_cport, i2s_port, cportid;
-   uint8_t sig_bits, channels;
+   u8 sig_bits, channels;
uint32_t format, rate;
struct gbaudio_data_connection *data;
struct gbaudio_stream_params *params;
@@ -182,7 +182,7 @@ static int gbaudio_module_enable_rx(struct 
gbaudio_codec_info *codec,
 {
int module_state, ret = 0;
uint16_t data_cport, i2s_port, cportid;
-   uint8_t sig_bits, channels;
+   u8 sig_bits, channels;
uint32_t format, rate;
struct gbaudio_data_connection *data;
struct gbaudio_stream_params *params;
@@ -413,7 +413,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream 
*substream,
 struct snd_soc_dai *dai)
 {
int ret;
-   uint8_t sig_bits, channels;
+   u8 sig_bits, channels;
uint32_t format, rate;
struct gbaudio_module_info *module;
struct gbaudio_data_connection *data;
diff --git a/drivers/staging/greybus/audio_codec.h 
b/drivers/staging/greybus/audio_codec.h
index 0a86459..fabaccc 100644
--- a/drivers/staging/greybus/audio_codec.h
+++ b/drivers/staging/greybus/audio_codec.h
@@ -98,7 +98,7 @@ enum gbaudio_codec_state {
 
 struct gbaudio_stream_params {
int state;
-   uint8_t sig_bits, channels;
+   u8 sig_bits, channels;
uint32_t format, rate;
 };
 
@@ -221,23 +221,23 @@ void gbaudio_unregister_module(struct gbaudio_module_info 
*module);
 extern int gb_audio_gb_get_topology(struct gb_connection *connection,
struct gb_audio_topology **topology);
 extern int gb_audio_gb_get_control(struct gb_connection *connection,
-  uint8_t control_id, uint8_t index,
+  u8 control_id, u8 index,
   struct gb_audio_ctl_elem_value *value);
 extern int gb_audio_gb_set_control(struct gb_connection *connection,
-  uint8_t control_id, uint8_t index,
+  u8 control_id, u8 index,
   struct gb_audio_ctl_elem_value *value);
 extern int gb_audio_gb_enable_widget(struct gb_connection *connection,
-uint8_t widget_id);
+u8 widget_id);
 extern int gb_audio_gb_disable_widget(struct gb_connection *connection,
- uint8_t widget_id);
+ u8 widget_id);
 extern int gb_audio_gb_get_pcm(struct gb_connection *connection,
   uint16_t data_cport, uint32_t *format,
-  uint32_t *rate, uint8_t *channels,
-  uint8_t *sig_bits);
+  uint32_t *rate, u8 *channels,
+  u8 *sig_bits);
 extern int gb_audio_gb_set_pcm(struct gb_connection *connection,
   uint16_t data_cport, uint32_t format,
-  uint32_t rate, uint8_t channels,
-  uint8_t sig_bits);
+  uint32_t rate, u8 channels,
+  u8 sig_bits);
 extern int gb_audio_gb_set_tx_data_size(struct gb_connection *connection,
uint16_t data_cport, uint16_t size);
 extern int gb_audio_gb_activate_tx(struct gb_connection *connection,
diff --git a/drivers/staging/greybus/audio_gb.c 
b/drivers/staging/greybus/audio_gb.c
index a2f1c92..c386cd8 100644
--- a/drivers/staging/greybus/audio_gb.c
+++ b/drivers/staging/greybus/audio_gb.c
@@ -47,7 +47,7 @@ int gb_audio_gb_get_topology(struct gb_connection *connection,
 EXPORT_SYMBOL_GPL(gb_audio_gb_get_topology);
 
 int gb_audio_gb_get_control(struct gb_connection *connection,
-   uint8_t control_id, uint8_t index,
+   u8 control_id, u8 index,
struct gb_audio_ctl_elem_value *value)
 {
struct gb_audio_get_control_request req;
@@ -69,7 +69,7 @@ int gb_audio_gb_get_control(struct gb_connection *connection,
 EXPORT_SYMBOL_GPL(gb_audio_gb_get_control);
 
 int gb_audio_gb_set_control(struct gb_connection *connection,
-   

Re: staging: vme_user: accept bus_num of zero

2016-09-19 Thread Aaron Sierra
- Original Message -
> From: "Martyn Welch" 
> Sent: Thursday, September 8, 2016 2:17:35 PM

> On Fri, Sep 02, 2016 at 03:59:45PM -0500, Aaron Sierra wrote:
>> The driver's bus_num parameter is used to select a VME bus during probe.
>> This parameter is used both as a boolean to indicate that probing should
>> occur as well as which bus should be probed. However, the first bus in
>> the system is bus zero, so this method prevents the first bus from being
>> accepted during probe.
>> 
> 
> Umm, no. The array "bus" holds the buses that should be probed, bus_num
> holds the length of the array passed.

Martyn,
Of course you're right about this patch being wrong. I'm sorry for the
noise. I'm not sure how I missed your patch "VME: Provide access to VME
bus enumeration and fix vme_user match function" that addressed my
concern about "bus=0" not working which I raised back in 2013 with my
patch "vme_user: Remove superfluous bus module parameter":

http://www.spinics.net/lists/linux-driver-devel/msg39943.html

-Aaron S

> 
>> This patch changes the default value of bus_num to -1, so that any
>> number in the range of 0 to VME_USER_BUS_MAX will be accepted during
>> probe.
>> 
>> Signed-off-by: Aaron Sierra 
>> ---
>>  drivers/staging/vme/devices/vme_user.c | 9 +
>>  1 file changed, 1 insertion(+), 8 deletions(-)
>> 
>> diff --git a/drivers/staging/vme/devices/vme_user.c
>> b/drivers/staging/vme/devices/vme_user.c
>> index b95883b..fc660bd 100644
>> --- a/drivers/staging/vme/devices/vme_user.c
>> +++ b/drivers/staging/vme/devices/vme_user.c
>> @@ -45,7 +45,7 @@
>>  static const char driver_name[] = "vme_user";
>>  
>>  static int bus[VME_USER_BUS_MAX];
>> -static unsigned int bus_num;
>> +static int bus_num = -1;
>>  
>>  /* Currently Documentation/devices.txt defines the following for VME:
>>   *
>> @@ -735,12 +735,6 @@ static int __init vme_user_init(void)
>>  
>>  pr_info("VME User Space Access Driver\n");
>>  
>> -if (bus_num == 0) {
>> -pr_err("No cards, skipping registration\n");
>> -retval = -ENODEV;
>> -goto err_nocard;
>> -}
>> -
>>  /* Let's start by supporting one bus, we can support more than one
>>   * in future revisions if that ever becomes necessary.
>>   */
>> @@ -763,7 +757,6 @@ static int __init vme_user_init(void)
>>  return retval;
>>  
>>  err_reg:
>> -err_nocard:
>>  return retval;
>>  }
>>  
>> --
>> 1.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/22] staging: unisys: visorbus: remove parser_done prototype

2016-09-19 Thread David Kershner
Remove the unneeded prototype parser_done.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index bd1e3fb..97e99e9 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -270,9 +270,6 @@ static struct platform_device visorchipset_platform_device 
= {
.dev.release = visorchipset_dev_release,
 };
 
-/* Function prototypes */
-static void parser_done(struct parser_context *ctx);
-
 static uuid_le
 parser_id_get(struct parser_context *ctx)
 {
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 21/22] staging: unisys: visorbus: remove fix_vbus_dev_info prototype

2016-09-19 Thread David Kershner
Move the visordriver_probe_device and visorbus_register_visor_driver
functions lower in the file to get rid of the function prototype
fix_vbus_dev_info.

Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 256 
 1 file changed, 127 insertions(+), 129 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index d41e3d9..3918bb5 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -35,8 +35,6 @@ static int visorbus_forcenomatch;
 
 static int busreg_rc = -ENODEV; /* stores the result from bus registration */
 
-static void fix_vbus_dev_info(struct visor_device *visordev);
-
 /*
  * BUS type attributes
  *
@@ -531,48 +529,6 @@ dev_stop_periodic_work(struct visor_device *dev)
 }
 
 /**
- * visordriver_probe_device() - handle new visor device coming online
- * @xdev: struct device for the visor device being probed
- *
- * 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.
- *
- * If successful, a reference to the device will be held onto via get_device().
- *
- * Return: 0 if successful, meaning the function driver's probe() function
- * was successful with this device, otherwise a negative errno
- * value indicating failure reason
- */
-static int
-visordriver_probe_device(struct device *xdev)
-{
-   int res;
-   struct visor_driver *drv;
-   struct visor_device *dev;
-
-   drv = to_visor_driver(xdev->driver);
-   dev = to_visor_device(xdev);
-
-   if (!drv->probe)
-   return -ENODEV;
-
-   mutex_lock(>visordriver_callback_lock);
-   dev->being_removed = false;
-
-   res = drv->probe(dev);
-   if (res >= 0) {
-   /* success: reference kept via unmatched get_device() */
-   get_device(>device);
-   fix_vbus_dev_info(dev);
-   }
-
-   mutex_unlock(>visordriver_callback_lock);
-   return res;
-}
-
-/**
  * visordriver_remove_device() - handle visor device going away
  * @xdev: struct device for the visor device being removed
  *
@@ -602,91 +558,6 @@ visordriver_remove_device(struct device *xdev)
 }
 
 /**
- * visorbus_register_visor_driver() - registers the provided visor driver
- *for handling one or more visor device
- *types (channel_types)
- * @drv: the driver to register
- *
- * A visor function 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(_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 

[PATCH 22/22] staging: unisys: visorbus: move parahotplug_request_list and related lock

2016-09-19 Thread David Kershner
parahotplug_request_list and parahotplug_request_list_lock should be
defined closer to where we are actually using them.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 5603bb6..39e8aca 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -177,9 +177,6 @@ struct parahotplug_request {
struct controlvm_message msg;
 };
 
-static LIST_HEAD(parahotplug_request_list);
-static DEFINE_SPINLOCK(parahotplug_request_list_lock); /* lock for above */
-
 /* info for /dev/visorchipset */
 static dev_t major_dev = -1; /*< indicates major num for device */
 
@@ -1208,6 +1205,9 @@ parahotplug_request_destroy(struct parahotplug_request 
*req)
kfree(req);
 }
 
+static LIST_HEAD(parahotplug_request_list);
+static DEFINE_SPINLOCK(parahotplug_request_list_lock); /* lock for above */
+
 /**
  * parahotplug_request_complete() - mark request as complete
  * @id: the id of the request
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/22] staging: unisys: visorbus: move parser_init_byte_stream

2016-09-19 Thread David Kershner
The function parser_init_byte_stream needs to be moved lower in the file to
avoid extraneous function prototypes.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 116 -
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 168d42f..e72f8f6 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -283,64 +283,6 @@ static void controlvm_respond_physdev_changestate(
 
 static void parser_done(struct parser_context *ctx);
 
-static struct parser_context *
-parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
-{
-   int allocbytes = sizeof(struct parser_context) + bytes;
-   struct parser_context *ctx;
-
-   if (retry)
-   *retry = false;
-
-   /*
-* alloc an 0 extra byte to ensure payload is
-* '\0'-terminated
-*/
-   allocbytes++;
-   if ((controlvm_payload_bytes_buffered + bytes)
-   > MAX_CONTROLVM_PAYLOAD_BYTES) {
-   if (retry)
-   *retry = true;
-   return NULL;
-   }
-   ctx = kzalloc(allocbytes, GFP_KERNEL | __GFP_NORETRY);
-   if (!ctx) {
-   if (retry)
-   *retry = true;
-   return NULL;
-   }
-
-   ctx->allocbytes = allocbytes;
-   ctx->param_bytes = bytes;
-   ctx->curr = NULL;
-   ctx->bytes_remaining = 0;
-   ctx->byte_stream = false;
-   if (local) {
-   void *p;
-
-   if (addr > virt_to_phys(high_memory - 1))
-   goto err_finish_ctx;
-   p = __va((unsigned long)(addr));
-   memcpy(ctx->data, p, bytes);
-   } else {
-   void *mapping = memremap(addr, bytes, MEMREMAP_WB);
-
-   if (!mapping)
-   goto err_finish_ctx;
-   memcpy(ctx->data, mapping, bytes);
-   memunmap(mapping);
-   }
-
-   ctx->byte_stream = true;
-   controlvm_payload_bytes_buffered += ctx->param_bytes;
-
-   return ctx;
-
-err_finish_ctx:
-   parser_done(ctx);
-   return NULL;
-}
-
 static uuid_le
 parser_id_get(struct parser_context *ctx)
 {
@@ -1976,6 +1918,64 @@ visorchipset_file_cleanup(dev_t major_dev)
unregister_chrdev_region(major_dev, 1);
 }
 
+static struct parser_context *
+parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
+{
+   int allocbytes = sizeof(struct parser_context) + bytes;
+   struct parser_context *ctx;
+
+   if (retry)
+   *retry = false;
+
+   /*
+* alloc an 0 extra byte to ensure payload is
+* '\0'-terminated
+*/
+   allocbytes++;
+   if ((controlvm_payload_bytes_buffered + bytes)
+   > MAX_CONTROLVM_PAYLOAD_BYTES) {
+   if (retry)
+   *retry = true;
+   return NULL;
+   }
+   ctx = kzalloc(allocbytes, GFP_KERNEL | __GFP_NORETRY);
+   if (!ctx) {
+   if (retry)
+   *retry = true;
+   return NULL;
+   }
+
+   ctx->allocbytes = allocbytes;
+   ctx->param_bytes = bytes;
+   ctx->curr = NULL;
+   ctx->bytes_remaining = 0;
+   ctx->byte_stream = false;
+   if (local) {
+   void *p;
+
+   if (addr > virt_to_phys(high_memory - 1))
+   goto err_finish_ctx;
+   p = __va((unsigned long)(addr));
+   memcpy(ctx->data, p, bytes);
+   } else {
+   void *mapping = memremap(addr, bytes, MEMREMAP_WB);
+
+   if (!mapping)
+   goto err_finish_ctx;
+   memcpy(ctx->data, mapping, bytes);
+   memunmap(mapping);
+   }
+
+   ctx->byte_stream = true;
+   controlvm_payload_bytes_buffered += ctx->param_bytes;
+
+   return ctx;
+
+err_finish_ctx:
+   parser_done(ctx);
+   return NULL;
+}
+
 /**
  * handle_command() - process a controlvm message
  * @inmsg:the message to process
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/22] staging: unisys: visorbus: move textid store and show functions

2016-09-19 Thread David Kershner
The textid store and show functions were moved to allow us to remove
the function prototypes.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 63 --
 1 file changed, 29 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 951eaea..5ba5f19 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -288,9 +288,36 @@ static ssize_t error_store(struct device *dev, struct 
device_attribute *attr,
 static DEVICE_ATTR_RW(error);
 
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
-  char *buf);
+  char *buf)
+{
+   u32 text_id = 0;
+
+   visorchannel_read
+   (controlvm_channel,
+offsetof(struct spar_controlvm_channel_protocol,
+ installation_text_id),
+_id, sizeof(u32));
+   return scnprintf(buf, PAGE_SIZE, "%i\n", text_id);
+}
+
 static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
-   const char *buf, size_t count);
+   const char *buf, size_t count)
+{
+   u32 text_id;
+   int ret;
+
+   if (kstrtou32(buf, 10, _id))
+   return -EINVAL;
+
+   ret = visorchannel_write
+   (controlvm_channel,
+offsetof(struct spar_controlvm_channel_protocol,
+ installation_text_id),
+_id, sizeof(u32));
+   if (ret)
+   return ret;
+   return count;
+}
 static DEVICE_ATTR_RW(textid);
 
 static ssize_t remaining_steps_show(struct device *dev,
@@ -449,38 +476,6 @@ parser_string_get(struct parser_context *ctx)
return value;
 }
 
-static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
-  char *buf)
-{
-   u32 text_id = 0;
-
-   visorchannel_read
-   (controlvm_channel,
-offsetof(struct spar_controlvm_channel_protocol,
- installation_text_id),
-_id, sizeof(u32));
-   return scnprintf(buf, PAGE_SIZE, "%i\n", text_id);
-}
-
-static ssize_t textid_store(struct device *dev, struct device_attribute *attr,
-   const char *buf, size_t count)
-{
-   u32 text_id;
-   int ret;
-
-   if (kstrtou32(buf, 10, _id))
-   return -EINVAL;
-
-   ret = visorchannel_write
-   (controlvm_channel,
-offsetof(struct spar_controlvm_channel_protocol,
- installation_text_id),
-_id, sizeof(u32));
-   if (ret)
-   return ret;
-   return count;
-}
-
 static ssize_t remaining_steps_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 19/22] staging: unisys: visorbus: move deviceenabled/disabled store functions

2016-09-19 Thread David Kershner
Move the deviceenabled/devicedisabled store functions so that
function prototypes can be removed.

This caused us to move several of the structures farther
down in the file as well.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 418 -
 1 file changed, 205 insertions(+), 213 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index d3efe75..5603bb6 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -353,59 +353,6 @@ static ssize_t remaining_steps_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(remaining_steps);
 
-static ssize_t devicedisabled_store(struct device *dev,
-   struct device_attribute *attr,
-   const char *buf, size_t count);
-static DEVICE_ATTR_WO(devicedisabled);
-
-static ssize_t deviceenabled_store(struct device *dev,
-  struct device_attribute *attr,
-  const char *buf, size_t count);
-static DEVICE_ATTR_WO(deviceenabled);
-
-static struct attribute *visorchipset_install_attrs[] = {
-   _attr_toolaction.attr,
-   _attr_boottotool.attr,
-   _attr_error.attr,
-   _attr_textid.attr,
-   _attr_remaining_steps.attr,
-   NULL
-};
-
-static struct attribute_group visorchipset_install_group = {
-   .name = "install",
-   .attrs = visorchipset_install_attrs
-};
-
-static struct attribute *visorchipset_parahotplug_attrs[] = {
-   _attr_devicedisabled.attr,
-   _attr_deviceenabled.attr,
-   NULL
-};
-
-static struct attribute_group visorchipset_parahotplug_group = {
-   .name = "parahotplug",
-   .attrs = visorchipset_parahotplug_attrs
-};
-
-static const struct attribute_group *visorchipset_dev_groups[] = {
-   _install_group,
-   _parahotplug_group,
-   NULL
-};
-
-static void visorchipset_dev_release(struct device *dev)
-{
-}
-
-/* /sys/devices/platform/visorchipset */
-static struct platform_device visorchipset_platform_device = {
-   .name = "visorchipset",
-   .id = -1,
-   .dev.groups = visorchipset_dev_groups,
-   .dev.release = visorchipset_dev_release,
-};
-
 static uuid_le
 parser_id_get(struct parser_context *ctx)
 {
@@ -1185,79 +1132,6 @@ initialize_controlvm_payload(void)
  _payload_info);
 }
 
-/**
- * visorchipset_chipset_ready() - sends chipset_ready action
- *
- * Send ACTION=online for DEVPATH=/sys/devices/platform/visorchipset.
- *
- * Return: CONTROLVM_RESP_SUCCESS
- */
-static int
-visorchipset_chipset_ready(void)
-{
-   kobject_uevent(_platform_device.dev.kobj, KOBJ_ONLINE);
-   return CONTROLVM_RESP_SUCCESS;
-}
-
-static int
-visorchipset_chipset_selftest(void)
-{
-   char env_selftest[20];
-   char *envp[] = { env_selftest, NULL };
-
-   sprintf(env_selftest, "SPARSP_SELFTEST=%d", 1);
-   kobject_uevent_env(_platform_device.dev.kobj, KOBJ_CHANGE,
-  envp);
-   return CONTROLVM_RESP_SUCCESS;
-}
-
-/**
- * visorchipset_chipset_notready() - sends chipset_notready action
- *
- * Send ACTION=offline for DEVPATH=/sys/devices/platform/visorchipset.
- *
- * Return: CONTROLVM_RESP_SUCCESS
- */
-static int
-visorchipset_chipset_notready(void)
-{
-   kobject_uevent(_platform_device.dev.kobj, KOBJ_OFFLINE);
-   return CONTROLVM_RESP_SUCCESS;
-}
-
-static void
-chipset_ready(struct controlvm_message_header *msg_hdr)
-{
-   int rc = visorchipset_chipset_ready();
-
-   if (rc != CONTROLVM_RESP_SUCCESS)
-   rc = -rc;
-   if (msg_hdr->flags.response_expected)
-   controlvm_respond(msg_hdr, rc);
-}
-
-static void
-chipset_selftest(struct controlvm_message_header *msg_hdr)
-{
-   int rc = visorchipset_chipset_selftest();
-
-   if (rc != CONTROLVM_RESP_SUCCESS)
-   rc = -rc;
-   if (msg_hdr->flags.response_expected)
-   controlvm_respond(msg_hdr, rc);
-}
-
-static void
-chipset_notready(struct controlvm_message_header *msg_hdr)
-{
-   int rc = visorchipset_chipset_notready();
-
-   if (rc != CONTROLVM_RESP_SUCCESS)
-   rc = -rc;
-   if (msg_hdr->flags.response_expected)
-   controlvm_respond(msg_hdr, rc);
-}
-
 /*
  * The general parahotplug flow works as follows. The visorchipset
  * driver receives a DEVICE_CHANGESTATE message from Command
@@ -1335,38 +1209,6 @@ parahotplug_request_destroy(struct parahotplug_request 
*req)
 }
 
 /**
- * parahotplug_request_kickoff() - initiate parahotplug request
- * @req: the request to initiate
- *
- * Cause uevent to run the user level script to do the disable/enable specified
- * in the parahotplug_request.
- */

[PATCH 18/22] staging: unisys: visorbus: move the remaining_steps_show/store functions

2016-09-19 Thread David Kershner
Moving the remaining_steps functions allows us to get rid of an unneeded
prototype.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 62 --
 1 file changed, 28 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 5ba5f19..d3efe75 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -321,10 +321,36 @@ static ssize_t textid_store(struct device *dev, struct 
device_attribute *attr,
 static DEVICE_ATTR_RW(textid);
 
 static ssize_t remaining_steps_show(struct device *dev,
-   struct device_attribute *attr, char *buf);
+   struct device_attribute *attr, char *buf)
+{
+   u16 remaining_steps = 0;
+
+   visorchannel_read(controlvm_channel,
+ offsetof(struct spar_controlvm_channel_protocol,
+  installation_remaining_steps),
+ _steps, sizeof(u16));
+   return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps);
+}
+
 static ssize_t remaining_steps_store(struct device *dev,
 struct device_attribute *attr,
-const char *buf, size_t count);
+const char *buf, size_t count)
+{
+   u16 remaining_steps;
+   int ret;
+
+   if (kstrtou16(buf, 10, _steps))
+   return -EINVAL;
+
+   ret = visorchannel_write
+   (controlvm_channel,
+offsetof(struct spar_controlvm_channel_protocol,
+ installation_remaining_steps),
+_steps, sizeof(u16));
+   if (ret)
+   return ret;
+   return count;
+}
 static DEVICE_ATTR_RW(remaining_steps);
 
 static ssize_t devicedisabled_store(struct device *dev,
@@ -476,38 +502,6 @@ parser_string_get(struct parser_context *ctx)
return value;
 }
 
-static ssize_t remaining_steps_show(struct device *dev,
-   struct device_attribute *attr, char *buf)
-{
-   u16 remaining_steps = 0;
-
-   visorchannel_read(controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
-  installation_remaining_steps),
- _steps, sizeof(u16));
-   return scnprintf(buf, PAGE_SIZE, "%hu\n", remaining_steps);
-}
-
-static ssize_t remaining_steps_store(struct device *dev,
-struct device_attribute *attr,
-const char *buf, size_t count)
-{
-   u16 remaining_steps;
-   int ret;
-
-   if (kstrtou16(buf, 10, _steps))
-   return -EINVAL;
-
-   ret = visorchannel_write
-   (controlvm_channel,
-offsetof(struct spar_controlvm_channel_protocol,
- installation_remaining_steps),
-_steps, sizeof(u16));
-   if (ret)
-   return ret;
-   return count;
-}
-
 struct visor_busdev {
u32 bus_no;
u32 dev_no;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/22] staging: unisys: visorbus: remove prototype controlvm_respond

2016-09-19 Thread David Kershner
Remove the unneeded prototype for controlvm_respond.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 1b824ad..f092526 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -271,8 +271,6 @@ static struct platform_device visorchipset_platform_device 
= {
 };
 
 /* Function prototypes */
-static void controlvm_respond(struct controlvm_message_header *msg_hdr,
- int response);
 static void controlvm_respond_chipset_init(
struct controlvm_message_header *msg_hdr, int response,
enum ultra_chipset_feature features);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/22] staging: unisys: visorbus: move parahotplug_process_list

2016-09-19 Thread David Kershner
The function parahotplug_process_list needs to be moved lower in the file
to avoid extraneous function prototypes.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 63 +-
 1 file changed, 31 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 83254d8..1b824ad 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -179,7 +179,6 @@ struct parahotplug_request {
 
 static LIST_HEAD(parahotplug_request_list);
 static DEFINE_SPINLOCK(parahotplug_request_list_lock); /* lock for above */
-static void parahotplug_process_list(void);
 
 /* info for /dev/visorchipset */
 static dev_t major_dev = -1; /*< indicates major num for device */
@@ -1408,37 +1407,6 @@ parahotplug_request_kickoff(struct parahotplug_request 
*req)
 }
 
 /**
- * parahotplug_process_list() - remove any request from the list that's been on
- *  there too long and respond with an error
- */
-static void
-parahotplug_process_list(void)
-{
-   struct list_head *pos;
-   struct list_head *tmp;
-
-   spin_lock(_request_list_lock);
-
-   list_for_each_safe(pos, tmp, _request_list) {
-   struct parahotplug_request *req =
-   list_entry(pos, struct parahotplug_request, list);
-
-   if (!time_after_eq(jiffies, req->expiration))
-   continue;
-
-   list_del(pos);
-   if (req->msg.hdr.flags.response_expected)
-   controlvm_respond_physdev_changestate(
-   >msg.hdr,
-   CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT,
-   req->msg.cmd.device_change_state.state);
-   parahotplug_request_destroy(req);
-   }
-
-   spin_unlock(_request_list_lock);
-}
-
-/**
  * parahotplug_request_complete() - mark request as complete
  * @id: the id of the request
  * @active: indicates whether the request is assigned to active partition
@@ -2091,6 +2059,37 @@ read_controlvm_event(struct controlvm_message *msg)
return false;
 }
 
+/**
+ * parahotplug_process_list() - remove any request from the list that's been on
+ *  there too long and respond with an error
+ */
+static void
+parahotplug_process_list(void)
+{
+   struct list_head *pos;
+   struct list_head *tmp;
+
+   spin_lock(_request_list_lock);
+
+   list_for_each_safe(pos, tmp, _request_list) {
+   struct parahotplug_request *req =
+   list_entry(pos, struct parahotplug_request, list);
+
+   if (!time_after_eq(jiffies, req->expiration))
+   continue;
+
+   list_del(pos);
+   if (req->msg.hdr.flags.response_expected)
+   controlvm_respond_physdev_changestate(
+   >msg.hdr,
+   CONTROLVM_RESP_ERROR_DEVICE_UDEV_TIMEOUT,
+   req->msg.cmd.device_change_state.state);
+   parahotplug_request_destroy(req);
+   }
+
+   spin_unlock(_request_list_lock);
+}
+
 static void
 controlvm_periodic_work(struct work_struct *work)
 {
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/22] staging: unisys: visorbus: move error store/show functions

2016-09-19 Thread David Kershner
Move the show and store functions for the error DEV_ATTR_RW so that the
function prototypes can be removed.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 61 --
 1 file changed, 28 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index d50e4cd..951eaea 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -256,9 +256,35 @@ static ssize_t boottotool_store(struct device *dev,
 static DEVICE_ATTR_RW(boottotool);
 
 static ssize_t error_show(struct device *dev, struct device_attribute *attr,
- char *buf);
+ char *buf)
+{
+   u32 error = 0;
+
+   visorchannel_read(controlvm_channel,
+ offsetof(struct spar_controlvm_channel_protocol,
+  installation_error),
+ , sizeof(u32));
+   return scnprintf(buf, PAGE_SIZE, "%i\n", error);
+}
+
 static ssize_t error_store(struct device *dev, struct device_attribute *attr,
-  const char *buf, size_t count);
+  const char *buf, size_t count)
+{
+   u32 error;
+   int ret;
+
+   if (kstrtou32(buf, 10, ))
+   return -EINVAL;
+
+   ret = visorchannel_write
+   (controlvm_channel,
+offsetof(struct spar_controlvm_channel_protocol,
+ installation_error),
+, sizeof(u32));
+   if (ret)
+   return ret;
+   return count;
+}
 static DEVICE_ATTR_RW(error);
 
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
@@ -423,37 +449,6 @@ parser_string_get(struct parser_context *ctx)
return value;
 }
 
-static ssize_t error_show(struct device *dev, struct device_attribute *attr,
- char *buf)
-{
-   u32 error = 0;
-
-   visorchannel_read(controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
-  installation_error),
- , sizeof(u32));
-   return scnprintf(buf, PAGE_SIZE, "%i\n", error);
-}
-
-static ssize_t error_store(struct device *dev, struct device_attribute *attr,
-  const char *buf, size_t count)
-{
-   u32 error;
-   int ret;
-
-   if (kstrtou32(buf, 10, ))
-   return -EINVAL;
-
-   ret = visorchannel_write
-   (controlvm_channel,
-offsetof(struct spar_controlvm_channel_protocol,
- installation_error),
-, sizeof(u32));
-   if (ret)
-   return ret;
-   return count;
-}
-
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
   char *buf)
 {
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/22] staging: unisys: visorbus: move boottotool

2016-09-19 Thread David Kershner
Move the boottotool show and store functions so the function
prototypes can be removed.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 72 --
 1 file changed, 33 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index c53b0fb..d50e4cd 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -219,10 +219,40 @@ static ssize_t toolaction_store(struct device *dev,
 static DEVICE_ATTR_RW(toolaction);
 
 static ssize_t boottotool_show(struct device *dev,
-  struct device_attribute *attr, char *buf);
+  struct device_attribute *attr,
+  char *buf)
+{
+   struct efi_spar_indication efi_spar_indication;
+
+   visorchannel_read(controlvm_channel,
+ offsetof(struct spar_controlvm_channel_protocol,
+  efi_spar_ind), _spar_indication,
+ sizeof(struct efi_spar_indication));
+   return scnprintf(buf, PAGE_SIZE, "%u\n",
+efi_spar_indication.boot_to_tool);
+}
+
 static ssize_t boottotool_store(struct device *dev,
-   struct device_attribute *attr, const char *buf,
-   size_t count);
+   struct device_attribute *attr,
+   const char *buf, size_t count)
+{
+   int val, ret;
+   struct efi_spar_indication efi_spar_indication;
+
+   if (kstrtoint(buf, 10, ))
+   return -EINVAL;
+
+   efi_spar_indication.boot_to_tool = val;
+   ret = visorchannel_write
+   (controlvm_channel,
+offsetof(struct spar_controlvm_channel_protocol,
+ efi_spar_ind), &(efi_spar_indication),
+sizeof(struct efi_spar_indication));
+
+   if (ret)
+   return ret;
+   return count;
+}
 static DEVICE_ATTR_RW(boottotool);
 
 static ssize_t error_show(struct device *dev, struct device_attribute *attr,
@@ -393,42 +423,6 @@ parser_string_get(struct parser_context *ctx)
return value;
 }
 
-static ssize_t boottotool_show(struct device *dev,
-  struct device_attribute *attr,
-  char *buf)
-{
-   struct efi_spar_indication efi_spar_indication;
-
-   visorchannel_read(controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
-  efi_spar_ind), _spar_indication,
- sizeof(struct efi_spar_indication));
-   return scnprintf(buf, PAGE_SIZE, "%u\n",
-efi_spar_indication.boot_to_tool);
-}
-
-static ssize_t boottotool_store(struct device *dev,
-   struct device_attribute *attr,
-   const char *buf, size_t count)
-{
-   int val, ret;
-   struct efi_spar_indication efi_spar_indication;
-
-   if (kstrtoint(buf, 10, ))
-   return -EINVAL;
-
-   efi_spar_indication.boot_to_tool = val;
-   ret = visorchannel_write
-   (controlvm_channel,
-offsetof(struct spar_controlvm_channel_protocol,
- efi_spar_ind), &(efi_spar_indication),
-sizeof(struct efi_spar_indication));
-
-   if (ret)
-   return ret;
-   return count;
-}
-
 static ssize_t error_show(struct device *dev, struct device_attribute *attr,
  char *buf)
 {
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/22] staging: unisys: visorbus: remove controlvm_respond_chipset_init prototype

2016-09-19 Thread David Kershner
Remove the unneeded controlvm_respond_chipset_init prototype by
moving the functions controlvm_init_response and
controlvm_respond_chipset_init up in the file.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 63 --
 1 file changed, 30 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index f092526..6b8f793 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -271,9 +271,6 @@ static struct platform_device visorchipset_platform_device 
= {
 };
 
 /* Function prototypes */
-static void controlvm_respond_chipset_init(
-   struct controlvm_message_header *msg_hdr, int response,
-   enum ultra_chipset_feature features);
 static void controlvm_respond_physdev_changestate(
struct controlvm_message_header *msg_hdr, int response,
struct spar_segment_state state);
@@ -580,6 +577,36 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, 
u32 dev_no,
 }
 
 static void
+controlvm_init_response(struct controlvm_message *msg,
+   struct controlvm_message_header *msg_hdr, int response)
+{
+   memset(msg, 0, sizeof(struct controlvm_message));
+   memcpy(>hdr, msg_hdr, sizeof(struct controlvm_message_header));
+   msg->hdr.payload_bytes = 0;
+   msg->hdr.payload_vm_offset = 0;
+   msg->hdr.payload_max_bytes = 0;
+   if (response < 0) {
+   msg->hdr.flags.failed = 1;
+   msg->hdr.completion_status = (u32)(-response);
+   }
+}
+
+static void
+controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
+  int response,
+  enum ultra_chipset_feature features)
+{
+   struct controlvm_message outmsg;
+
+   controlvm_init_response(, msg_hdr, response);
+   outmsg.cmd.init_chipset.features = features;
+   if (!visorchannel_signalinsert(controlvm_channel,
+  CONTROLVM_QUEUE_REQUEST, )) {
+   return;
+   }
+}
+
+static void
 chipset_init(struct controlvm_message *inmsg)
 {
static int chipset_inited;
@@ -614,21 +641,6 @@ out_respond:
 }
 
 static void
-controlvm_init_response(struct controlvm_message *msg,
-   struct controlvm_message_header *msg_hdr, int response)
-{
-   memset(msg, 0, sizeof(struct controlvm_message));
-   memcpy(>hdr, msg_hdr, sizeof(struct controlvm_message_header));
-   msg->hdr.payload_bytes = 0;
-   msg->hdr.payload_vm_offset = 0;
-   msg->hdr.payload_max_bytes = 0;
-   if (response < 0) {
-   msg->hdr.flags.failed = 1;
-   msg->hdr.completion_status = (u32)(-response);
-   }
-}
-
-static void
 controlvm_respond(struct controlvm_message_header *msg_hdr, int response)
 {
struct controlvm_message outmsg;
@@ -643,21 +655,6 @@ controlvm_respond(struct controlvm_message_header 
*msg_hdr, int response)
}
 }
 
-static void
-controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
-  int response,
-  enum ultra_chipset_feature features)
-{
-   struct controlvm_message outmsg;
-
-   controlvm_init_response(, msg_hdr, response);
-   outmsg.cmd.init_chipset.features = features;
-   if (!visorchannel_signalinsert(controlvm_channel,
-  CONTROLVM_QUEUE_REQUEST, )) {
-   return;
-   }
-}
-
 static void controlvm_respond_physdev_changestate(
struct controlvm_message_header *msg_hdr, int response,
struct spar_segment_state state)
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/22] staging: unisys: visorbus: move toolaction functions to remove prototypes

2016-09-19 Thread David Kershner
The toolchain functions show and store needed to be moved so the prototypes
were no longer needed.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 64 --
 1 file changed, 29 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 97e99e9..c53b0fb 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -185,10 +185,37 @@ static dev_t major_dev = -1; /*< indicates major num for 
device */
 
 /* prototypes for attributes */
 static ssize_t toolaction_show(struct device *dev,
-  struct device_attribute *attr, char *buf);
+  struct device_attribute *attr,
+  char *buf)
+{
+   u8 tool_action = 0;
+
+   visorchannel_read(controlvm_channel,
+ offsetof(struct spar_controlvm_channel_protocol,
+  tool_action), _action, sizeof(u8));
+   return scnprintf(buf, PAGE_SIZE, "%u\n", tool_action);
+}
+
 static ssize_t toolaction_store(struct device *dev,
struct device_attribute *attr,
-   const char *buf, size_t count);
+   const char *buf, size_t count)
+{
+   u8 tool_action;
+   int ret;
+
+   if (kstrtou8(buf, 10, _action))
+   return -EINVAL;
+
+   ret = visorchannel_write
+   (controlvm_channel,
+offsetof(struct spar_controlvm_channel_protocol,
+ tool_action),
+_action, sizeof(u8));
+
+   if (ret)
+   return ret;
+   return count;
+}
 static DEVICE_ATTR_RW(toolaction);
 
 static ssize_t boottotool_show(struct device *dev,
@@ -366,39 +393,6 @@ parser_string_get(struct parser_context *ctx)
return value;
 }
 
-static ssize_t toolaction_show(struct device *dev,
-  struct device_attribute *attr,
-  char *buf)
-{
-   u8 tool_action = 0;
-
-   visorchannel_read(controlvm_channel,
- offsetof(struct spar_controlvm_channel_protocol,
-  tool_action), _action, sizeof(u8));
-   return scnprintf(buf, PAGE_SIZE, "%u\n", tool_action);
-}
-
-static ssize_t toolaction_store(struct device *dev,
-   struct device_attribute *attr,
-   const char *buf, size_t count)
-{
-   u8 tool_action;
-   int ret;
-
-   if (kstrtou8(buf, 10, _action))
-   return -EINVAL;
-
-   ret = visorchannel_write
-   (controlvm_channel,
-offsetof(struct spar_controlvm_channel_protocol,
- tool_action),
-_action, sizeof(u8));
-
-   if (ret)
-   return ret;
-   return count;
-}
-
 static ssize_t boottotool_show(struct device *dev,
   struct device_attribute *attr,
   char *buf)
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 20/22] staging: unisys: visorbus move visorbus_type to remove prototypes

2016-09-19 Thread David Kershner
Move the struct visorbus_type down in the file to get rid of
the function prototypes visorbus_uevent and visorbus_match.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 26 -
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 8ed60c0..d41e3d9 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -35,8 +35,6 @@ static int visorbus_forcenomatch;
 
 static int busreg_rc = -ENODEV; /* stores the result from bus registration */
 
-static int visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env);
-static int visorbus_match(struct device *xdev, struct device_driver *xdrv);
 static void fix_vbus_dev_info(struct visor_device *visordev);
 
 /*
@@ -99,18 +97,6 @@ static const struct attribute_group *visorbus_dev_groups[] = 
{
NULL,
 };
 
-/*
- * This describes the TYPE of bus.
- *  (Don't confuse this with an INSTANCE of the bus.)
- */
-struct bus_type visorbus_type = {
-   .name = "visorbus",
-   .match = visorbus_match,
-   .uevent = visorbus_uevent,
-   .dev_groups = visorbus_dev_groups,
-   .bus_groups = visorbus_bus_groups,
-};
-
 /* filled in with info about parent chipset driver when we register with it */
 static struct ultra_vbus_deviceinfo chipset_driverinfo;
 /* filled in with info about this driver, wrt it servicing client busses */
@@ -174,6 +160,18 @@ visorbus_match(struct device *xdev, struct device_driver 
*xdrv)
return 0;
 }
 
+/*
+ * This describes the TYPE of bus.
+ *  (Don't confuse this with an INSTANCE of the bus.)
+ */
+struct bus_type visorbus_type = {
+   .name = "visorbus",
+   .match = visorbus_match,
+   .uevent = visorbus_uevent,
+   .dev_groups = visorbus_dev_groups,
+   .bus_groups = visorbus_bus_groups,
+};
+
 /**
  * visorbus_releae_busdevice() - called when device_unregister() is called for
  *   the bus device instance, after all other tasks
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/22] staging: unisys: visorbus: move controlvm_payload_bytes_buffered

2016-09-19 Thread David Kershner
From: Jon Frisch 

This patch moves the unsigned long controlvm_payload_bytes_buffered
from the module parameters location to a more appropriate location
below the controlvm_payload_info.

Signed-off-by: Jon Frisch 
Signed-off-by: David Kershner 
Reported-by: Greg Kroah-Hartman 
---
 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 84c2858..de2e92f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -50,7 +50,6 @@
  * Module parameters
  */
 static int visorchipset_major;
-static unsigned long controlvm_payload_bytes_buffered;
 
 static int
 visorchipset_open(struct inode *inode, struct file *file)
@@ -106,6 +105,7 @@ struct visor_controlvm_payload_info {
 };
 
 static struct visor_controlvm_payload_info controlvm_payload_info;
+static unsigned long controlvm_payload_bytes_buffered;
 
 /*
  * The following globals are used to handle the scenario where we are unable to
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/22] staging: unisys: visorbus: reorder controlvm_periodic_work

2016-09-19 Thread David Kershner
Move controlvm_periodic_work lower in the file to avoid having
to create function prototypes.

Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
Reviewed-by: Tim Sell 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 134 -
 1 file changed, 67 insertions(+), 67 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index de2e92f..7cb7c00 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1752,73 +1752,6 @@ static u64 controlvm_get_channel_address(void)
 }
 
 static void
-controlvm_periodic_work(struct work_struct *work)
-{
-   struct controlvm_message inmsg;
-   bool got_command = false;
-   bool handle_command_failed = false;
-
-   while (visorchannel_signalremove(controlvm_channel,
-CONTROLVM_QUEUE_RESPONSE,
-))
-   ;
-   if (!got_command) {
-   if (controlvm_pending_msg_valid) {
-   /*
-* we throttled processing of a prior
-* msg, so try to process it again
-* rather than reading a new one
-*/
-   inmsg = controlvm_pending_msg;
-   controlvm_pending_msg_valid = false;
-   got_command = true;
-   } else {
-   got_command = read_controlvm_event();
-   }
-   }
-
-   handle_command_failed = false;
-   while (got_command && (!handle_command_failed)) {
-   most_recent_message_jiffies = jiffies;
-   if (handle_command(inmsg,
-  visorchannel_get_physaddr
-  (controlvm_channel)))
-   got_command = read_controlvm_event();
-   else {
-   /*
-* this is a scenario where throttling
-* is required, but probably NOT an
-* error...; we stash the current
-* controlvm msg so we will attempt to
-* reprocess it on our next loop
-*/
-   handle_command_failed = true;
-   controlvm_pending_msg = inmsg;
-   controlvm_pending_msg_valid = true;
-   }
-   }
-
-   /* parahotplug_worker */
-   parahotplug_process_list();
-
-   if (time_after(jiffies,
-  most_recent_message_jiffies + (HZ * MIN_IDLE_SECONDS))) {
-   /*
-* it's been longer than MIN_IDLE_SECONDS since we
-* processed our last controlvm message; slow down the
-* polling
-*/
-   if (poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_SLOW)
-   poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_SLOW;
-   } else {
-   if (poll_jiffies != POLLJIFFIES_CONTROLVMCHANNEL_FAST)
-   poll_jiffies = POLLJIFFIES_CONTROLVMCHANNEL_FAST;
-   }
-
-   schedule_delayed_work(_controlvm_work, poll_jiffies);
-}
-
-static void
 setup_crash_devices_work_queue(struct work_struct *work)
 {
struct controlvm_message local_crash_bus_msg;
@@ -2158,6 +2091,73 @@ visorchipset_file_cleanup(dev_t major_dev)
unregister_chrdev_region(major_dev, 1);
 }
 
+static void
+controlvm_periodic_work(struct work_struct *work)
+{
+   struct controlvm_message inmsg;
+   bool got_command = false;
+   bool handle_command_failed = false;
+
+   while (visorchannel_signalremove(controlvm_channel,
+CONTROLVM_QUEUE_RESPONSE,
+))
+   ;
+   if (!got_command) {
+   if (controlvm_pending_msg_valid) {
+   /*
+* we throttled processing of a prior
+* msg, so try to process it again
+* rather than reading a new one
+*/
+   inmsg = controlvm_pending_msg;
+   controlvm_pending_msg_valid = false;
+   got_command = true;
+   } else {
+   got_command = read_controlvm_event();
+   }
+   }
+
+   handle_command_failed = false;
+   while (got_command && (!handle_command_failed)) {
+   most_recent_message_jiffies = jiffies;
+   if (handle_command(inmsg,
+  visorchannel_get_physaddr
+  (controlvm_channel)))
+   got_command = read_controlvm_event();
+  

[PATCH 03/22] staging: unisys: visorbus: remove unused dump_vhba_bus

2016-09-19 Thread David Kershner
From: Jon Frisch 

This patch removes the unused u32 dump_vhba_bus.

Signed-off-by: Jon Frisch 
Signed-off-by: David Kershner 
Reported-by: Greg Kroah-Hartman 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 656583e..84c2858 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -51,7 +51,6 @@
  */
 static int visorchipset_major;
 static unsigned long controlvm_payload_bytes_buffered;
-static u32 dump_vhba_bus;
 
 static int
 visorchipset_open(struct inode *inode, struct file *file)
@@ -1011,10 +1010,8 @@ bus_create(struct controlvm_message *inmsg)
goto out_bus_epilog;
}
bus_info->visorchannel = visorchannel;
-   if (uuid_le_cmp(cmd->create_bus.bus_inst_uuid, spar_siovm_uuid) == 0) {
-   dump_vhba_bus = bus_no;
+   if (uuid_le_cmp(cmd->create_bus.bus_inst_uuid, spar_siovm_uuid) == 0)
save_crash_message(inmsg, CRASH_BUS);
-   }
 
POSTCODE_LINUX_3(BUS_CREATE_EXIT_PC, bus_no, POSTCODE_SEVERITY_INFO);
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/22] staging: unisys: visorbus remove unused module parameter

2016-09-19 Thread David Kershner
From: Jon Frisch 

This patch removes the unused module parameter
visorchipset_visorbusregwait

Signed-off-by: Jon Frisch 
Signed-off-by: David Kershner 
Reported-by: Greg Kroah-Hartman 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index ad8a407..656583e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -50,7 +50,6 @@
  * Module parameters
  */
 static int visorchipset_major;
-static int visorchipset_visorbusregwait = 1;   /* default is on */
 static unsigned long controlvm_payload_bytes_buffered;
 static u32 dump_vhba_bus;
 
@@ -2311,9 +2310,6 @@ static void exit_unisys(void)
 module_param_named(major, visorchipset_major, int, S_IRUGO);
 MODULE_PARM_DESC(visorchipset_major,
 "major device number to use for the device node");
-module_param_named(visorbusregwait, visorchipset_visorbusregwait, int, 
S_IRUGO);
-MODULE_PARM_DESC(visorchipset_visorbusregwait,
-"1 to have the module wait for the visor bus to register");
 
 module_init(init_unisys);
 module_exit(exit_unisys);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/22] staging: unisys: visorbus: Remove prototypes and other cleanups

2016-09-19 Thread David Kershner
This patchset removes unused crud from the visorbus driver, which includes
shuffling a lot of code around so function prototypes could be deleted.

David Kershner (18):
  staging: unisys: visorbus: reorder controlvm_periodic_work
  staging: unisys: visorbus: move handle_command
  staging: unisys: visorbus: move parser_init_byte_stream
  staging: unisys: visorbus: move read_controlvm_event
  staging: unisys: visorbus: move parahotplug_process_list
  staging: unisys: visorbus: remove prototype controlvm_respond
  staging: unisys: visorbus: remove controlvm_respond_chipset_init
prototype
  staging: unisys: visorbus: remove
controlvm_respond_physdev_changestate
  staging: unisys: visorbus: remove parser_done prototype
  staging: unisys: visorbus: move toolaction functions to remove
prototypes
  staging: unisys: visorbus: move boottotool
  staging: unisys: visorbus: move error store/show functions
  staging: unisys: visorbus: move textid store and show functions
  staging: unisys: visorbus: move the remaining_steps_show/store
functions
  staging: unisys: visorbus: move deviceenabled/disabled store functions
  staging: unisys: visorbus move visorbus_type to remove prototypes
  staging: unisys: visorbus: remove fix_vbus_dev_info prototype
  staging: unisys: visorbus: move parahotplug_request_list and related
lock

Jon Frisch (4):
  staging: unisys: visorbus remove unused module parameter
  staging: unisys: visorbus: remove unused long long bus_count
  staging: unisys: visorbus: remove unused dump_vhba_bus
  staging: unisys: visorbus: move controlvm_payload_bytes_buffered

 drivers/staging/unisys/visorbus/visorbus_main.c |  287 +++--
 drivers/staging/unisys/visorbus/visorchipset.c  | 1462 +++
 2 files changed, 842 insertions(+), 907 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: lustre: lustre/ldlm: Fixed sparse warnings

2016-09-19 Thread James Simmons

> Added __acquires / __releases sparse locking annotations
> to lock_res_and_lock() and unlock_res_and_lock() functions
> in l_lock.c, to fix below sparse warnings:
> 
> l_lock.c:47:22: warning: context imbalance in 'lock_res_and_lock' - wrong 
> count at exit
> l_lock.c:61:6: warning: context imbalance in 'unlock_res_and_lock' - 
> unexpected unlock
> 
> Signed-off-by: Nayeemahmed Badebade 

Reviewed-by: James Simmons 

> ---
> 
> Changes in v2:
>  * Corrected sparse annotations for the lock
>lock->l_resource->lr_lock
> 
>  drivers/staging/lustre/lustre/ldlm/l_lock.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/staging/lustre/lustre/ldlm/l_lock.c 
> b/drivers/staging/lustre/lustre/ldlm/l_lock.c
> index ea8840c..3845f38 100644
> --- a/drivers/staging/lustre/lustre/ldlm/l_lock.c
> +++ b/drivers/staging/lustre/lustre/ldlm/l_lock.c
> @@ -45,6 +45,8 @@
>   * being an atomic operation.
>   */
>  struct ldlm_resource *lock_res_and_lock(struct ldlm_lock *lock)
> + __acquires(>l_lock)
> + __acquires(>l_resource->lr_lock)
>  {
>   spin_lock(>l_lock);
> 
> @@ -59,6 +61,8 @@ struct ldlm_resource *lock_res_and_lock(struct ldlm_lock 
> *lock)
>   * Unlock a lock and its resource previously locked with lock_res_and_lock
>   */
>  void unlock_res_and_lock(struct ldlm_lock *lock)
> + __releases(>l_resource->lr_lock)
> + __releases(>l_lock)
>  {
>   /* on server-side resource of lock doesn't change */
>   ldlm_clear_res_locked(lock);
> --
> 1.9.1
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:greybus-test 1/22] drivers/staging/greybus/bootrom.c:298:35-39: ERROR: fw is NULL but dereferenced.

2016-09-19 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
greybus-test
head:   2bbadafbe4eacab57aa7bc8e50287c1366303807
commit: f44dd184634d401f5cf88a6d8b4a60d5ff4f417f [1/22] Merge greybus driver 
tree into 4.8-rc6


coccinelle warnings: (new ones prefixed by >>)

>> drivers/staging/greybus/bootrom.c:298:35-39: ERROR: fw is NULL but 
>> dereferenced.

vim +298 drivers/staging/greybus/bootrom.c

90f1b617 drivers/staging/greybus/firmware.c Viresh Kumar 2015-08-12  282
dev_err(dev, "%s: error allocating response\n", __func__);
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  283
ret = -ENOMEM;
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  284
goto unlock;
90f1b617 drivers/staging/greybus/firmware.c Viresh Kumar 2015-08-12  285
}
90f1b617 drivers/staging/greybus/firmware.c Viresh Kumar 2015-08-12  286  
90f1b617 drivers/staging/greybus/firmware.c Viresh Kumar 2015-08-12  287
firmware_response = op->response->payload;
98645a9c drivers/staging/greybus/firmware.c Johan Hovold 2015-11-19  288
memcpy(firmware_response->data, fw->data + offset, size);
90f1b617 drivers/staging/greybus/firmware.c Viresh Kumar 2015-08-12  289  
fc41c2da drivers/staging/greybus/firmware.c Eli Sennesh  2016-01-08  290
dev_dbg(dev, "responding with firmware (offs = %u, size = %u)\n", offset,
fc41c2da drivers/staging/greybus/firmware.c Eli Sennesh  2016-01-08  291
size);
fc41c2da drivers/staging/greybus/firmware.c Eli Sennesh  2016-01-08  292  
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  293  
unlock:
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  294
mutex_unlock(>mutex);
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  295  
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  296  
queue_work:
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  297
/* Refresh timeout */
a4293e1d drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-06-22 @298
if (!ret && (offset + size == fw->size))
a4293e1d drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-06-22  299
next_request = NEXT_REQ_READY_TO_BOOT;
a4293e1d drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-06-22  300
else
a4293e1d drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-06-22  301
next_request = NEXT_REQ_GET_FIRMWARE;
a4293e1d drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-06-22  302  
dbb8cfeb drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-06-22  303
gb_bootrom_set_timeout(bootrom, next_request, NEXT_REQ_TIMEOUT_MS);
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  304  
a956d939 drivers/staging/greybus/bootrom.c  Viresh Kumar 2016-05-09  305
return ret;
90f1b617 drivers/staging/greybus/firmware.c Viresh Kumar 2015-08-12  306  }

:: The code at line 298 was first introduced by commit
:: a4293e1d4e6416477976ee3bd248589d3fc4bb19 greybus: bootrom: Enhance 
timeout error message

:: TO: Viresh Kumar 
:: CC: Greg Kroah-Hartman 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] hv: do not lose pending heartbeat vmbus packets

2016-09-19 Thread Haiyang Zhang
> -Original Message-
> From: Long Li [mailto:lon...@exchange.microsoft.com]
> Sent: Monday, September 12, 2016 11:31 PM
> To: KY Srinivasan ; Haiyang Zhang
> 
> Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Long Li
> 
> Subject: [PATCH] hv: do not lose pending heartbeat vmbus packets
>
> From: Long Li 
> 
> The host keeps sending heartbeat packets independent of guest responding
> to them. In some situations, there might be multiple heartbeat packets
> pending in the ring buffer. Don't lose them, read them all.
> 
> Signed-off-by: Long Li 

Please also apply it to "stable".

Signed-off-by: Haiyang Zhang 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: ptlrpc: re-export lustre_swab_[lmv|lov]_mds_md

2016-09-19 Thread James Simmons
Being over zealous in removing unused EXPORT_SYMBOLs two functions
lustre_swab_[lmv|lov]_mds_md exports were removed. They need to be
exported so this patch restores those EXPORT_SYMBOLS. Same mistake
was done when porting to the upstream client.

Signed-off-by: James Simmons 
Reviewed-on: http://review.whamcloud.com/14545
Reviewed-on: http://review.whamcloud.com/15159
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6486
Reviewed-by: Dmitry Eremin 
Reviewed-by: Bob Glossman 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---
 .../staging/lustre/lustre/ptlrpc/pack_generic.c|2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c 
b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
index 1349bf6..8717685 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
@@ -1861,6 +1861,7 @@ void lustre_swab_lmv_mds_md(union lmv_mds_md *lmm)
break;
}
 }
+EXPORT_SYMBOL(lustre_swab_lmv_mds_md);
 
 void lustre_swab_lmv_user_md(struct lmv_user_md *lum)
 {
@@ -1914,6 +1915,7 @@ void lustre_swab_lov_mds_md(struct lov_mds_md *lmm)
__swab16s(>lmm_stripe_count);
__swab16s(>lmm_layout_gen);
 }
+EXPORT_SYMBOL(lustre_swab_lov_mds_md);
 
 void lustre_swab_lov_user_md_objects(struct lov_user_ost_data *lod,
 int stripe_count)
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC 3/3] phy,leds: add support for led triggers on phy link state change

2016-09-19 Thread Zach Brown
On Wed, Sep 14, 2016 at 04:16:15PM -0700, Florian Fainelli wrote:
> On 09/14/2016 02:55 PM, Zach Brown wrote:
> > From: Josh Cartwright 
> > 
> > Create an option CONFIG_LED_TRIGGER_PHY (default n), which will
> > create a set of led triggers for each instantiated PHY device.  There is
> > one LED trigger per link-speed, per-phy.
> > 
> > This allows for a user to configure their system to allow a set of LEDs
> > to represent link state changes on the phy.
> 
> The part that seems to be missing from this changeset (not an issue) is
> how you can "accelerate" the triggers, or rather make sure that the
> trigger configuration potentially calls back into the PHY driver when
> the requested trigger is actually supported by the on-PHY LEDs.
> 
> Other than that, just minor nits here and there.
> 
> > 
> > Signed-off-by: Josh Cartwright 
> > Signed-off-by: Nathan Sullivan 
> > Signed-off-by: Zach Brown 
> > ---
> 
> > +config LED_TRIGGER_PHY
> > +   bool "Support LED triggers for tracking link state"
> > +   depends on LEDS_TRIGGERS
> > +   ---help---
> > + Adds support for a set of LED trigger events per-PHY.  Link
> > + state change will trigger the events, for consumption by an
> > + LED class driver.  There are triggers for each link speed,
> > + and are of the form:
> > +  ::
> > +
> > + Where speed is one of: 10Mb, 100Mb, Gb, 2.5Gb, or 10GbE.
> 
> I would do s/10GbE/10Gb/ just to be consistent with the other speeds, or
> maybe, to avoid too much duplicationg of how we represent speeds, use
> the same set of strings that drivers/net/phy/phy.c::phy_speed_to_str uses.
> 
> 
> > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> > index c6f6683..3345767 100644
> > --- a/drivers/net/phy/phy.c
> > +++ b/drivers/net/phy/phy.c
> > @@ -936,6 +936,7 @@ void phy_state_machine(struct work_struct *work)
> > phydev->state = PHY_NOLINK;
> > netif_carrier_off(phydev->attached_dev);
> > phydev->adjust_link(phydev->attached_dev);
> > +   phy_led_trigger_change_speed(phydev);
> 
> Since we have essentially two actions to take when performing link state
> changes:
> 
> - call the adjust_link callback
> - call into the LED trigger
> 
> we might consider encapsulating this into a function that could be named
> phy_adjust_link() and does both of these. That would be a preliminary
> patch to this this one.
> 
> >  
> > @@ -345,6 +347,8 @@ struct phy_device *phy_device_create(struct mii_bus 
> > *bus, int addr, int phy_id,
> >  
> > dev->state = PHY_DOWN;
> >  
> > +   phy_led_triggers_register(dev);
> > +
> > mutex_init(>lock);
> > INIT_DELAYED_WORK(>state_queue, phy_state_machine);
> > INIT_WORK(>phy_queue, phy_change);
> 
> Humm, should it be before the PHY state machine workqueue creation or
> after? Just wondering if there is a remote chance we could get an user
> to immediately program a trigger and this could create a problem, maybe
> not so much.
> 
I'm not sure, but I don't think there would be an issue since the interaction
between the triggers and the phy system only goes in one direction. The
triggers don't influence the phy system to my understanding.

> > diff --git a/drivers/net/phy/phy_led_triggers.c 
> > b/drivers/net/phy/phy_led_triggers.c
> > new file mode 100644
> > index 000..6c40414
> > --- /dev/null
> > +++ b/drivers/net/phy/phy_led_triggers.c
> > @@ -0,0 +1,109 @@
> > +/* Copyright (C) 2016 National Instruments Corp.
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + */
> > +#include 
> > +#include 
> > +
> > +void phy_led_trigger_change_speed(struct phy_device *phy)
> > +{
> > +   struct phy_led_trigger *plt;
> > +
> > +   if (!phy->link) {
> > +   if (phy->last_triggered) {
> > +   led_trigger_event(>last_triggered->trigger,
> > + LED_OFF);
> > +   phy->last_triggered = NULL;
> > +   }
> > +   return;
> > +   }
> > +
> > +   switch (phy->speed) {
> > +   case SPEED_10:
> > +   plt = >phy_led_trigger[0];
> > +   break;
> > +   case SPEED_100:
> > +   plt = >phy_led_trigger[1];
> > +   break;
> > +   case SPEED_1000:
> > +   plt = >phy_led_trigger[2];
> > +   break;
> > +   case SPEED_2500:
> > +   plt = >phy_led_trigger[3];
> > +   

[PATCH V2] rtl8xxxu: Stop log spam from each successful interrupt

2016-09-19 Thread Larry Finger
As soon as debugging is turned on, the logs are filled with messages
reporting the interrupt status. As this quantity is usually zero, this
output is not needed. In fact, there will be a report if the status is
not zero, thus the debug line in question could probably be deleted.
Rather than taking that action, I have changed it to only be printed
when the newly added RTL8XXXU_DEBUG_INTERRUPT bit is set in the debug
mask.

Signed-off-by: Larry Finger 
---
V2 - Added new debugging flag as requested by Jes.
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h  | 1 +
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 870c9cd..4508b6d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -29,6 +29,7 @@
 #define RTL8XXXU_DEBUG_H2C 0x800
 #define RTL8XXXU_DEBUG_ACTION  0x1000
 #define RTL8XXXU_DEBUG_EFUSE   0x2000
+#define RTL8XXXU_DEBUG_INTERRUPT   0x4000
 
 #define RTW_USB_CONTROL_MSG_TIMEOUT500
 #define RTL8XXXU_MAX_REG_POLL  500
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 9f6dbb4..efba8f1 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -5260,7 +5260,8 @@ static void rtl8xxxu_int_complete(struct urb *urb)
struct device *dev = >udev->dev;
int ret;
 
-   dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
+   if (rtl8xxxu_debug & RTL8XXXU_DEBUG_INTERRUPT)
+   dev_dbg(dev, "%s: status %i\n", __func__, urb->status);
if (urb->status == 0) {
usb_anchor_urb(urb, >int_anchor);
ret = usb_submit_urb(urb, GFP_ATOMIC);
-- 
2.6.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] staging: most: hdm-usb: remove redundant spinlocks

2016-09-19 Thread Christian Gromm
This patch removes the spinlocks when accessing the usb_anchor list,
because the struct usb_anchor is using its own lock.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index 58f65a4..f872ce9 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -197,12 +197,8 @@ static void free_anchored_buffers(struct most_dev *mdev, 
unsigned int channel,
 {
struct mbo *mbo;
struct urb *urb;
-   spinlock_t *lock = mdev->anchor_list_lock + channel; /* temp. lock */
-   unsigned long flags;
 
-   spin_lock_irqsave(lock, flags);
while ((urb = usb_get_from_anchor(>busy_urbs[channel]))) {
-   spin_unlock_irqrestore(lock, flags);
mbo = urb->context;
usb_kill_urb(urb);
if (mbo && mbo->complete) {
@@ -211,9 +207,7 @@ static void free_anchored_buffers(struct most_dev *mdev, 
unsigned int channel,
mbo->complete(mbo);
}
usb_free_urb(urb);
-   spin_lock_irqsave(lock, flags);
}
-   spin_unlock_irqrestore(lock, flags);
 }
 
 /**
@@ -605,10 +599,8 @@ static int hdm_enqueue(struct most_interface *iface, int 
channel,
struct device *dev;
int retval = 0;
struct urb *urb;
-   unsigned long flags;
unsigned long length;
void *virt_address;
-   spinlock_t *lock; /* temp. lock */
 
if (unlikely(!iface || !mbo))
return -EIO;
@@ -657,10 +649,7 @@ static int hdm_enqueue(struct most_interface *iface, int 
channel,
}
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
-   lock = mdev->anchor_list_lock + channel;
-   spin_lock_irqsave(lock, flags);
usb_anchor_urb(urb, >busy_urbs[channel]);
-   spin_unlock_irqrestore(lock, flags);
 
retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) {
@@ -670,9 +659,7 @@ static int hdm_enqueue(struct most_interface *iface, int 
channel,
return 0;
 
 _error_1:
-   spin_lock_irqsave(lock, flags);
usb_unanchor_urb(urb);
-   spin_unlock_irqrestore(lock, flags);
 _error:
usb_free_urb(urb);
return retval;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] staging: most: hdm-usb: rename channel related spinlock

2016-09-19 Thread Christian Gromm
To increase comprehension this patch renames the channel related
spinlock with a more fitting name.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index 9474b43..06e547d 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -102,7 +102,7 @@ struct clear_hold_work {
  * @link_stat: link status of hardware
  * @description: device description
  * @suffix: suffix for channel name
- * @anchor_list_lock: locks list access
+ * @channel_lock: synchronize channel access
  * @padding_active: indicates channel uses padding
  * @is_channel_healthy: health status table of each channel
  * @busy_urbs: list of anchored items
@@ -122,7 +122,7 @@ struct most_dev {
u16 link_stat;
char description[MAX_STRING_LEN];
char suffix[MAX_NUM_ENDPOINTS][MAX_SUFFIX_LEN];
-   spinlock_t anchor_list_lock[MAX_NUM_ENDPOINTS];
+   spinlock_t channel_lock[MAX_NUM_ENDPOINTS]; /* sync channel access */
bool padding_active[MAX_NUM_ENDPOINTS];
bool is_channel_healthy[MAX_NUM_ENDPOINTS];
struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
@@ -270,7 +270,7 @@ static int hdm_poison_channel(struct most_interface *iface, 
int channel)
return -ECHRNG;
}
 
-   lock = mdev->anchor_list_lock + channel;
+   lock = mdev->channel_lock + channel;
spin_lock_irqsave(lock, flags);
mdev->is_channel_healthy[channel] = false;
spin_unlock_irqrestore(lock, flags);
@@ -373,7 +373,7 @@ static void hdm_write_completion(struct urb *urb)
struct most_dev *mdev = to_mdev(mbo->ifp);
unsigned int channel = mbo->hdm_channel_id;
struct device *dev = >usb_device->dev;
-   spinlock_t *lock = mdev->anchor_list_lock + channel; /* temp. lock */
+   spinlock_t *lock = mdev->channel_lock + channel;
unsigned long flags;
 
spin_lock_irqsave(lock, flags);
@@ -527,7 +527,7 @@ static void hdm_read_completion(struct urb *urb)
struct most_dev *mdev = to_mdev(mbo->ifp);
unsigned int channel = mbo->hdm_channel_id;
struct device *dev = >usb_device->dev;
-   spinlock_t *lock = mdev->anchor_list_lock + channel; /* temp. lock */
+   spinlock_t *lock = mdev->channel_lock + channel;
unsigned long flags;
 
spin_lock_irqsave(lock, flags);
@@ -1261,7 +1261,7 @@ hdm_probe(struct usb_interface *interface, const struct 
usb_device_id *id)
tmp_cap->direction = MOST_CH_TX;
tmp_cap++;
init_usb_anchor(>busy_urbs[i]);
-   spin_lock_init(>anchor_list_lock[i]);
+   spin_lock_init(>channel_lock[i]);
err = drci_wr_reg(usb_dev,
  DRCI_REG_BASE + DRCI_COMMAND +
  ep_desc->bEndpointAddress * 16,
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] staging: most: hdm-usb: remove calls to usb_unachor_urb

2016-09-19 Thread Christian Gromm
This patch removes the calls to usb_unanchor_urb() from the completion
routines, since disassociation of the URBs is already handles by the
USB subsystem.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index f872ce9..9474b43 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -401,7 +401,6 @@ static void hdm_write_completion(struct urb *urb)
mbo->status = MBO_E_INVAL;
break;
}
-   usb_unanchor_urb(urb);
} else {
mbo->status = MBO_SUCCESS;
mbo->processed_length = urb->actual_length;
@@ -558,7 +557,6 @@ static void hdm_read_completion(struct urb *urb)
mbo->status = MBO_E_INVAL;
break;
}
-   usb_unanchor_urb(urb);
} else {
mbo->processed_length = urb->actual_length;
mbo->status = MBO_SUCCESS;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] staging: most: hdm-usb: remove proprietary urb anchoring

2016-09-19 Thread Christian Gromm
This patch removes the propietary tracking of URBs. Instead the structure
usb_anchor of the USB subsystem is used.

Signed-off-by: Christian Gromm 
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 75 ++
 1 file changed, 21 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index 5b27e96..58f65a4 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -65,17 +65,6 @@
 #define DRCI_WRITE_REQ 0xA1
 
 /**
- * struct buf_anchor - used to create a list of pending URBs
- * @urb: pointer to USB request block
- * @list: linked list
- * @urb_completion:
- */
-struct buf_anchor {
-   struct urb *urb;
-   struct list_head list;
-};
-
-/**
  * struct most_dci_obj - Direct Communication Interface
  * @kobj:position in sysfs
  * @usb_device: pointer to the usb device
@@ -116,7 +105,7 @@ struct clear_hold_work {
  * @anchor_list_lock: locks list access
  * @padding_active: indicates channel uses padding
  * @is_channel_healthy: health status table of each channel
- * @anchor_list: list of anchored items
+ * @busy_urbs: list of anchored items
  * @io_mutex: synchronize I/O with disconnect
  * @link_stat_timer: timer for link status reports
  * @poll_work_obj: work for polling link status
@@ -137,7 +126,7 @@ struct most_dev {
bool padding_active[MAX_NUM_ENDPOINTS];
bool is_channel_healthy[MAX_NUM_ENDPOINTS];
struct clear_hold_work clear_work[MAX_NUM_ENDPOINTS];
-   struct list_head *anchor_list;
+   struct usb_anchor *busy_urbs;
struct mutex io_mutex;
struct timer_list link_stat_timer;
struct work_struct poll_work_obj;
@@ -207,29 +196,22 @@ static void free_anchored_buffers(struct most_dev *mdev, 
unsigned int channel,
  enum mbo_status_flags status)
 {
struct mbo *mbo;
-   struct buf_anchor *anchor, *tmp;
+   struct urb *urb;
spinlock_t *lock = mdev->anchor_list_lock + channel; /* temp. lock */
unsigned long flags;
 
spin_lock_irqsave(lock, flags);
-   list_for_each_entry_safe(anchor, tmp, >anchor_list[channel],
-list) {
-   struct urb *urb = anchor->urb;
-
+   while ((urb = usb_get_from_anchor(>busy_urbs[channel]))) {
spin_unlock_irqrestore(lock, flags);
-   if (likely(urb)) {
-   mbo = urb->context;
-   usb_kill_urb(urb);
-   if (mbo && mbo->complete) {
-   mbo->status = status;
-   mbo->processed_length = 0;
-   mbo->complete(mbo);
-   }
-   usb_free_urb(urb);
+   mbo = urb->context;
+   usb_kill_urb(urb);
+   if (mbo && mbo->complete) {
+   mbo->status = status;
+   mbo->processed_length = 0;
+   mbo->complete(mbo);
}
+   usb_free_urb(urb);
spin_lock_irqsave(lock, flags);
-   list_del(>list);
-   kfree(anchor);
}
spin_unlock_irqrestore(lock, flags);
 }
@@ -394,7 +376,6 @@ static int hdm_remove_padding(struct most_dev *mdev, int 
channel,
 static void hdm_write_completion(struct urb *urb)
 {
struct mbo *mbo = urb->context;
-   struct buf_anchor *anchor = mbo->priv;
struct most_dev *mdev = to_mdev(mbo->ifp);
unsigned int channel = mbo->hdm_channel_id;
struct device *dev = >usb_device->dev;
@@ -426,14 +407,13 @@ static void hdm_write_completion(struct urb *urb)
mbo->status = MBO_E_INVAL;
break;
}
+   usb_unanchor_urb(urb);
} else {
mbo->status = MBO_SUCCESS;
mbo->processed_length = urb->actual_length;
}
 
-   list_del(>list);
spin_unlock_irqrestore(lock, flags);
-   kfree(anchor);
 
if (likely(mbo->complete))
mbo->complete(mbo);
@@ -551,7 +531,6 @@ static void hdm_write_completion(struct urb *urb)
 static void hdm_read_completion(struct urb *urb)
 {
struct mbo *mbo = urb->context;
-   struct buf_anchor *anchor = mbo->priv;
struct most_dev *mdev = to_mdev(mbo->ifp);
unsigned int channel = mbo->hdm_channel_id;
struct device *dev = >usb_device->dev;
@@ -585,6 +564,7 @@ static void hdm_read_completion(struct urb *urb)
mbo->status = MBO_E_INVAL;
break;
}
+   usb_unanchor_urb(urb);
} else {
mbo->processed_length = urb->actual_length;
mbo->status = MBO_SUCCESS;
@@ -595,9 +575,7 @@ static void hdm_read_completion(struct urb *urb)
  

[PATCH 0/4] staging: most: fix issues of hdm-usb

2016-09-19 Thread Christian Gromm
This patch set is needed to fix issues of the HDM USB module of the
MOST driver.

Christian Gromm (4):
  staging: most: hdm-usb: remove proprietary urb anchoring
  staging: most: hdm-usb: remove redundant spinlocks
  staging: most: hdm-usb: remove calls to usb_unachor_urb
  staging: most: hdm-usb: rename channel related spinlock

 drivers/staging/most/hdm-usb/hdm_usb.c | 98 +-
 1 file changed, 25 insertions(+), 73 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] stagging:iio:ad9834: add devicetree property support

2016-09-19 Thread Lars-Peter Clausen
On 09/18/2016 10:52 AM, Gwenhael Goavec-Merou wrote:
[...]
> +#if defined(CONFIG_OF)
> +static struct ad9834_platform_data *ad9834_parse_dt(struct spi_device *spi)
> +{
> + struct ad9834_platform_data *pdata;
> + struct device_node *np = spi->dev.of_node;
> +
> + pdata = devm_kzalloc(>dev, sizeof(*pdata), GFP_KERNEL);
> + if (!pdata)
> + return ERR_PTR(-ENOMEM);
> +
> + pdata->freq0 = 134000;
> + of_property_read_u32(np, "freq0", >freq0);
> +
> + pdata->freq1 = 134000;
> + of_property_read_u32(np, "freq1", >freq1);
> +
> + pdata->phase0 = 0;
> + of_property_read_u16(np, "phase0", >phase0);
> +
> + pdata->phase1 = 0;
> + of_property_read_u16(np, "phase1", >phase1);
> +
> + pdata->en_div2 = of_property_read_bool(np, "en_div2");
> + pdata->en_signbit_msb_out = of_property_read_bool(np,
> + "en_signbit_msb_out");

Sorry, I should have been more clear what I meant in the previous mail.

The devicetree describes the hardware, which components are present and how
they are connected to each other and sometimes system level operating
constraints.

The parameters above in my opinion are application specific configuration
parameters though. At least phase and frequency. I'm not quite sure what
exactly decides how the SIGN_OUT pin should be used, they might be hardware
setup dependent.

But I'm not that familiar with the typical usecase of these types of
devices, so if you disagree please say so. Maybe you can explain your setup
a bit and what you need from the chip and the driver.

> +
> + return pdata;
> +}
> +#else
> +static struct ad9834_platform_data *ad9834_parse_dt(struct spi_device *spi)
> +{
> + return NULL;
> +}
> +#endif
> +
>  static int ad9834_probe(struct spi_device *spi)
>  {
>   struct ad9834_platform_data *pdata = dev_get_platdata(>dev);
>   struct ad9834_state *st;
>   struct iio_dev *indio_dev;
>   struct regulator *reg;
> + struct clk *clk = NULL;
>   int ret;
>  
> + if (!pdata && spi->dev.of_node) {
> + pdata = ad9834_parse_dt(spi);
> + if (IS_ERR(pdata))
> + return PTR_ERR(pdata);
> + }
> +
>   if (!pdata) {
>   dev_dbg(>dev, "no platform data?\n");
>   return -ENODEV;
>   }
>  
> + if (!pdata->mclk) {
> + clk = devm_clk_get(>dev, NULL);

I'd make the clock name explicit clk_get(..., "mclk");

> + if (IS_ERR(clk))

Should be 'return PTR_ERR(clk);'. clk_get() will return EPROBE_DEFER if the
clock has been specified but is not yet available, but it will return an
error, if e.g. there is an error in the specification. We should propagate
this error.

> + return -EPROBE_DEFER;
> +
> + ret = clk_prepare_enable(clk);
> + if (ret < 0)
> + return ret;
> + }
> +
[...]
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: r8192U_core: fix checkpatch permission warnings

2016-09-19 Thread Xavier Roumegue
Fix the following warnings:
Symbolic permissions are not preferred. Consider using octal permissions.

Signed-off-by: Xavier Roumegue 
---
 drivers/staging/rtl8192u/r8192U_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index b86b28a..cdb64e3 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -114,9 +114,9 @@ static int channels = 0x3fff;
 
 
 
-module_param(ifname, charp, S_IRUGO | S_IWUSR);
-module_param(hwwep, int, S_IRUGO | S_IWUSR);
-module_param(channels, int, S_IRUGO | S_IWUSR);
+module_param(ifname, charp, 0644);
+module_param(hwwep, int, 0644);
+module_param(channels, int, 0644);
 
 MODULE_PARM_DESC(ifname, " Net interface name, wlan%d=default");
 MODULE_PARM_DESC(hwwep, " Try to use hardware security support. ");
-- 
2.9.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


HELLO

2016-09-19 Thread george gibson
Hello

How are you? i hope all is well with you. I have tried reachiny you without 
luck. My client is looking for a good business
to invest in your country. If you have any good business in mind please get 
back to me urgently so i can give you more update.
We are looking at Real Estate, Spa & fittness,hotel, Mining, oil & gas or any 
good business that you think will generate good
return on investment. he is will to partner with you. your response will be 
highly needed.

Regards

George
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Good to finally reach you

2016-09-19 Thread george gibson
Hello

How are you? i hope all is well with you. I have tried reachiny you without 
luck. My client is looking for a good business
to invest in your country. If you have any good business in mind please get 
back to me urgently so i can give you more update.
We are looking at Real Estate, Spa & fittness,hotel, Mining, oil & gas or any 
good business that you think will generate good
return on investment. he is will to partner with you. your response will be 
highly needed.

Regards

George
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Good to finally reach you

2016-09-19 Thread george gibson
Hello

How are you? i hope all is well with you. I have tried reachiny you without 
luck. My client is looking for a good business
to invest in your country. If you have any good business in mind please get 
back to me urgently so i can give you more update.
We are looking at Real Estate, Spa & fittness,hotel, Mining, oil & gas or any 
good business that you think will generate good
return on investment. he is will to partner with you. your response will be 
highly needed.

Regards

George
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [lustre-devel] [PATCH 030/124] staging: lustre: llite: Replace write mutex with range lock

2016-09-19 Thread Jan Kara
On Mon 19-09-16 09:25:48, Dilger, Andreas wrote:
> On Sep 19, 2016, at 09:28, Greg Kroah-Hartman  
> wrote:
> > 
> > On Sun, Sep 18, 2016 at 04:37:29PM -0400, James Simmons wrote:
> >> + * Range lock is used to allow multiple threads writing a single shared
> >> + * file given each thread is writing to a non-overlapping portion of the
> >> + * file.
> >> + *
> >> + * Refer to the possible upstream kernel version of range lock by
> >> + * Jan Kara : https://lkml.org/lkml/2013/1/31/480
> >> + *
> >> + * This file could later replaced by the upstream kernel version.
> > 
> > It doesn't look like range_lock ever got accepted in the kernel tree,
> > any idea what happened to it?  Having a per-filesystem lock type seems
> > odd to me...
> 
> I've added Jan and linux-fsdevel to the CC list to see what interest
> there is in the range locking implementaion.  At the time we added this
> to Lustre it appeared that this was moving nicely torward landing, but
> it seems to have stalled.
> 
> I think the range locking implementation is fairly generic, and if there
> are other users in the kernel it could easily be pulled out of the staging
> dir into vfs/.  I'm not against it going into vfs/ directly either, but
> not sure whether that is acceptable if the only user is in staging.

Yeah, so the problem with my range_lock implementation (and your one looks
fairly similar from a quick look) is that it is fairly heavyweight. That
may be OK for an inode_lock replacement but it needs a careful
benchmarking. Davidlohr was looking into making the implementation more
efficient (he wanted to use it for mmap_sem) but I think it got preempted
by other work.

Honza
-- 
Jan Kara 
SUSE Labs, CR
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 000/124] missing patches from Lustre 2.7 release

2016-09-19 Thread Greg Kroah-Hartman
On Sun, Sep 18, 2016 at 04:36:59PM -0400, James Simmons wrote:
> This batch of patches includes various cleanups and fixes from
> the Lustre 2.7 release. Most of these patches are removal of
> cruft and unsigned to signed comparsion fixes. Also added in
> the latest LNet fixes as well.

All now queued up, thanks.

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 070/124] staging: lustre: statahead: small fixes and cleanup

2016-09-19 Thread Greg Kroah-Hartman
On Sun, Sep 18, 2016 at 04:38:09PM -0400, James Simmons wrote:
> From: Lai Siyao 
> 
> small fixes:
>  * when 'unplug' is set for ll_statahead(), sa_put() shouldn't kill
>the entry found, because its inflight RPC may not finish yet.
>  * remove 'sai_generation', add 'lli_sa_generation' because the
>former one is not safe to access without lock.
>  * revalidate_statahead_dentry() may fail to wait for statahead
>entry to become ready, in this case it should not release this
>entry, because it may be used by inflight statahead RPC.
> 
> cleanups:
>  * rename ll_statahead_enter() to ll_statahead().
>  * move dentry 'lld_sa_generation' update to ll_statahead() to
>simplify code and logic.
>  * other small cleanups.

That's a lot of different things to be doing all at once in a single
patch.  I know this came from your tree, but in the future, please push
back and ask for broken up patches, as that is required for "upstream"
here.  I'll take this for now :(

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 030/124] staging: lustre: llite: Replace write mutex with range lock

2016-09-19 Thread Greg Kroah-Hartman
On Sun, Sep 18, 2016 at 04:37:29PM -0400, James Simmons wrote:
> + * Range lock is used to allow multiple threads writing a single shared
> + * file given each thread is writing to a non-overlapping portion of the
> + * file.
> + *
> + * Refer to the possible upstream kernel version of range lock by
> + * Jan Kara : https://lkml.org/lkml/2013/1/31/480
> + *
> + * This file could later replaced by the upstream kernel version.

It doesn't look like range_lock ever got accepted in the kernel tree,
any idea what happened to it?  Having a per-filesystem lock type seems
odd to me...

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel