Re: [PATCH v9 03/10] x86/hyper-v: make hv_do_hypercall() inline

2017-07-17 Thread kbuild test robot
Hi Vitaly,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.13-rc1 next-20170717]
[cannot apply to tip/x86/core]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Vitaly-Kuznetsov/Hyper-V-paravirtualized-remote-TLB-flushing-and-hypercall-improvements/20170715-023027
config: x86_64-rhel (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

Note: the 
linux-review/Vitaly-Kuznetsov/Hyper-V-paravirtualized-remote-TLB-flushing-and-hypercall-improvements/20170715-023027
 HEAD ac9354b5afdbfbc99257e73a7b3af517ea8ebb91 builds fine.
  It only hurts bisectibility.

All errors (new ones prefixed by >>):

   In file included from arch/x86/hyperv/hv_init.c:23:0:
   arch/x86/include/asm/mshyperv.h: In function 'hv_do_hypercall':
>> arch/x86/include/asm/mshyperv.h:177:30: error: implicit declaration of 
>> function 'virt_to_phys' [-Werror=implicit-function-declaration]
 u64 input_address = input ? virt_to_phys(input) : 0;
 ^~~~
   In file included from arch/x86/include/asm/realmode.h:5:0,
from arch/x86/include/asm/acpi.h:33,
from arch/x86/include/asm/fixmap.h:19,
from arch/x86/include/asm/apic.h:10,
from arch/x86/include/asm/smp.h:12,
from arch/x86/include/asm/mmzone_64.h:10,
from arch/x86/include/asm/mmzone.h:4,
from include/linux/mmzone.h:912,
from include/linux/gfp.h:5,
from include/linux/mm.h:9,
from arch/x86/hyperv/hv_init.c:26:
   arch/x86/include/asm/io.h: At top level:
>> arch/x86/include/asm/io.h:118:27: error: conflicting types for 'virt_to_phys'
static inline phys_addr_t virt_to_phys(volatile void *address)
  ^~~~
   In file included from arch/x86/hyperv/hv_init.c:23:0:
   arch/x86/include/asm/mshyperv.h:177:30: note: previous implicit declaration 
of 'virt_to_phys' was here
 u64 input_address = input ? virt_to_phys(input) : 0;
 ^~~~
   cc1: some warnings being treated as errors

vim +/virt_to_phys +177 arch/x86/include/asm/mshyperv.h

   174  
   175  static inline u64 hv_do_hypercall(u64 control, void *input, void 
*output)
   176  {
 > 177  u64 input_address = input ? virt_to_phys(input) : 0;
   178  u64 output_address = output ? virt_to_phys(output) : 0;
   179  u64 hv_status;
   180  register void *__sp asm(_ASM_SP);
   181  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/4] staging: lustre: constify attribute_group structures.

2017-07-17 Thread kbuild test robot
Hi Arvind,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.13-rc1 next-20170717]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Arvind-Yadav/constify-lustre-attribute_group-structures/20170717-142957
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sparc64 

Note: the 
linux-review/Arvind-Yadav/constify-lustre-attribute_group-structures/20170717-142957
 HEAD a6df15f5fc00a12dffbac94e0ccc52155118946e builds fine.
  It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

>> drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1033:5: error: 
>> conflicting types for 'lprocfs_obd_setup'
int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
^
   In file included from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:41:0,
from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
   drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:470:5: 
note: previous declaration of 'lprocfs_obd_setup' was here
int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
^
   In file included from include/linux/linkage.h:6:0,
from include/linux/kernel.h:6,
from include/asm-generic/bug.h:15,
from arch/sparc/include/asm/bug.h:20,
from include/linux/bug.h:4,
from include/linux/mmdebug.h:4,
from include/linux/gfp.h:4,
from include/linux/slab.h:14,
from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:36,
from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
   drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1066:19: error: 
conflicting types for 'lprocfs_obd_setup'
EXPORT_SYMBOL_GPL(lprocfs_obd_setup);
  ^
   include/linux/export.h:65:21: note: in definition of macro '___EXPORT_SYMBOL'
 extern typeof(sym) sym;  \
^~~
>> drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1066:1: note: in 
>> expansion of macro 'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(lprocfs_obd_setup);
^
   In file included from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:41:0,
from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
   drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:470:5: 
note: previous declaration of 'lprocfs_obd_setup' was here
int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
^

vim +/lprocfs_obd_setup +1033 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c

9b8013023 Oleg Drokin   2015-05-21  1032  
9b8013023 Oleg Drokin   2015-05-21 @1033  int lprocfs_obd_setup(struct 
obd_device *obd, struct lprocfs_vars *list,
9b8013023 Oleg Drokin   2015-05-21  1034  struct 
attribute_group *attrs)
d7e09d039 Peng Tao  2013-05-02  1035  {
d7e09d039 Peng Tao  2013-05-02  1036int rc = 0;
d7e09d039 Peng Tao  2013-05-02  1037  
9b8013023 Oleg Drokin   2015-05-21  1038
init_completion(&obd->obd_kobj_unregister);
9b8013023 Oleg Drokin   2015-05-21  1039rc = 
kobject_init_and_add(&obd->obd_kobj, &obd_ktype,
9b8013023 Oleg Drokin   2015-05-21  1040  
obd->obd_type->typ_kobj,
9b8013023 Oleg Drokin   2015-05-21  1041  "%s", 
obd->obd_name);
9b8013023 Oleg Drokin   2015-05-21  1042if (rc)
9b8013023 Oleg Drokin   2015-05-21  1043return rc;
9b8013023 Oleg Drokin   2015-05-21  1044  
9b8013023 Oleg Drokin   2015-05-21  1045if (attrs) {
9b8013023 Oleg Drokin   2015-05-21  1046rc = 
sysfs_create_group(&obd->obd_kobj, attrs);
9b8013023 Oleg Drokin   2015-05-21  1047if (rc) {
9b8013023 Oleg Drokin   2015-05-21  1048
kobject_put(&obd->obd_kobj);
9b8013023 Oleg Drokin   2015-05-21  1049return rc;
9b8013023 Oleg Drok

Re: [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this. This change should not be separate.

~arvind

On Monday 17 July 2017 11:19 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
  drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c 
b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index bc19f19..ba41983 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1031,7 +1031,7 @@ static void obd_sysfs_release(struct kobject *kobj)
  };
  
  int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,

- struct attribute_group *attrs)
+ const struct attribute_group *attrs)
  {
int rc = 0;
  


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


Re: [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this.

~arvind


On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
  drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9f5e829..eb88bd9 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct 
file *file)
  struct kobject *lustre_kobj;
  EXPORT_SYMBOL_GPL(lustre_kobj);
  
-static struct attribute_group lustre_attr_group = {

+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
  };
  


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


Re: [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this.

~arvind


On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
  drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index fff930f..e0c3e5d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -926,7 +926,7 @@ static ssize_t 
cancel_unused_locks_before_replay_store(struct kobject *kobj,
NULL,
  };
  
-static struct attribute_group ldlm_attr_group = {

+static const struct attribute_group ldlm_attr_group = {
.attrs = ldlm_attrs,
  };
  


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


Re: [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this.

~arvind


On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
  drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c 
b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9f5e829..eb88bd9 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct 
file *file)
  struct kobject *lustre_kobj;
  EXPORT_SYMBOL_GPL(lustre_kobj);
  
-static struct attribute_group lustre_attr_group = {

+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
  };
  


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


Re: [PATCH 0/4] constify lustre attribute_group structures

2017-07-17 Thread Arvind Yadav
Sorry for noise. Please ignore this. It's having build error. Again, I 
will push all changes.


~arvind


On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Arvind Yadav (4):
   [PATCH 1/4] staging: lustre: constify attribute_group structures.
   [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures.
   [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group 
structures.
   [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures.

  drivers/staging/lustre/lustre/include/lprocfs_status.h  | 4 ++--
  drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
  drivers/staging/lustre/lustre/lmv/lproc_lmv.c   | 2 +-
  drivers/staging/lustre/lustre/lov/lproc_lov.c   | 2 +-
  drivers/staging/lustre/lustre/mdc/lproc_mdc.c   | 2 +-
  drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
  drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
  drivers/staging/lustre/lustre/osc/lproc_osc.c   | 2 +-
  8 files changed, 9 insertions(+), 9 deletions(-)



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


Re: [PATCH 1/4] staging: lustre: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Sorry for noise. Please ignore this. I will fix this error and push again.

~arvind


On Monday 17 July 2017 12:45 PM, kbuild test robot wrote:

Hi Arvind,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.13-rc1 next-20170717]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Arvind-Yadav/constify-lustre-attribute_group-structures/20170717-142957
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
 wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
 chmod +x ~/bin/make.cross
 # save the attached .config to linux build tree
 make.cross ARCH=sparc64

Note: the 
linux-review/Arvind-Yadav/constify-lustre-attribute_group-structures/20170717-142957
 HEAD a6df15f5fc00a12dffbac94e0ccc52155118946e builds fine.
   It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):


drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1033:5: error: 
conflicting types for 'lprocfs_obd_setup'

 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
 ^
In file included from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:41:0,
 from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
 from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:470:5: 
note: previous declaration of 'lprocfs_obd_setup' was here
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
 ^
In file included from include/linux/linkage.h:6:0,
 from include/linux/kernel.h:6,
 from include/asm-generic/bug.h:15,
 from arch/sparc/include/asm/bug.h:20,
 from include/linux/bug.h:4,
 from include/linux/mmdebug.h:4,
 from include/linux/gfp.h:4,
 from include/linux/slab.h:14,
 from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:36,
 from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
 from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1066:19: error: 
conflicting types for 'lprocfs_obd_setup'
 EXPORT_SYMBOL_GPL(lprocfs_obd_setup);
   ^
include/linux/export.h:65:21: note: in definition of macro 
'___EXPORT_SYMBOL'
  extern typeof(sym) sym;  \
 ^~~

drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:1066:1: note: in 
expansion of macro 'EXPORT_SYMBOL_GPL'

 EXPORT_SYMBOL_GPL(lprocfs_obd_setup);
 ^
In file included from 
drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:41:0,
 from 
drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:35,
 from 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c:39:
drivers/staging/lustre/lustre/obdclass/../include/lprocfs_status.h:470:5: 
note: previous declaration of 'lprocfs_obd_setup' was here
 int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
 ^

vim +/lprocfs_obd_setup +1033 
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c

9b8013023 Oleg Drokin   2015-05-21  1032
9b8013023 Oleg Drokin   2015-05-21 @1033  int lprocfs_obd_setup(struct 
obd_device *obd, struct lprocfs_vars *list,
9b8013023 Oleg Drokin   2015-05-21  1034  struct 
attribute_group *attrs)
d7e09d039 Peng Tao  2013-05-02  1035  {
d7e09d039 Peng Tao  2013-05-02  1036int rc = 0;
d7e09d039 Peng Tao  2013-05-02  1037
9b8013023 Oleg Drokin   2015-05-21  1038
init_completion(&obd->obd_kobj_unregister);
9b8013023 Oleg Drokin   2015-05-21  1039rc = 
kobject_init_and_add(&obd->obd_kobj, &obd_ktype,
9b8013023 Oleg Drokin   2015-05-21  1040  
obd->obd_type->typ_kobj,
9b8013023 Oleg Drokin   2015-05-21  1041  "%s", 
obd->obd_name);
9b8013023 Oleg Drokin   2015-05-21  1042if (rc)
9b8013023 Oleg Drokin   2015-05-21  1043return rc;
9b8013023 Oleg Drokin   2015-05-21  1044
9b8013023 Oleg Drokin   2015-05-21  1045if (attrs) {
9b8013023 Oleg Drokin   2015-05-21  1046rc = 
sysfs_create_group(&obd->obd_kobj, attrs);
9b8013023 Oleg Drokin   2015-05-21  1047if (rc) {
9b8013023 Oleg Drokin   

[PATCH] atomisp: array underflow in ioctl

2017-07-17 Thread Dan Carpenter
I noticed an array underflow in ov5693_enum_frame_size().  The code
looks like this:

int index = fse->index;

if (index >= N_RES)
retur -EINVAL;

fse->index is a u32 that comes from the user.  We want negative values
to be counted as -EINVAL but they aren't.  There are several ways to fix
this but I feel like the best fix for future proofing is to change the
type of N_RES from int to unsigned long to make it the same as if we
were comparing against ARRAY_SIZE().

Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/media/atomisp/i2c/gc0310.h 
b/drivers/staging/media/atomisp/i2c/gc0310.h
index f31eb277f542..7d8a0aeecb6c 100644
--- a/drivers/staging/media/atomisp/i2c/gc0310.h
+++ b/drivers/staging/media/atomisp/i2c/gc0310.h
@@ -454,6 +454,6 @@ struct gc0310_resolution gc0310_res_video[] = {
 #define N_RES_VIDEO (ARRAY_SIZE(gc0310_res_video))
 
 static struct gc0310_resolution *gc0310_res = gc0310_res_preview;
-static int N_RES = N_RES_PREVIEW;
+static unsigned long N_RES = N_RES_PREVIEW;
 #endif
 
diff --git a/drivers/staging/media/atomisp/i2c/gc2235.h 
b/drivers/staging/media/atomisp/i2c/gc2235.h
index ccbc757045a5..7c3d994180cc 100644
--- a/drivers/staging/media/atomisp/i2c/gc2235.h
+++ b/drivers/staging/media/atomisp/i2c/gc2235.h
@@ -668,5 +668,5 @@ struct gc2235_resolution gc2235_res_video[] = {
 #define N_RES_VIDEO (ARRAY_SIZE(gc2235_res_video))
 
 static struct gc2235_resolution *gc2235_res = gc2235_res_preview;
-static int N_RES = N_RES_PREVIEW;
+static unsigned long N_RES = N_RES_PREVIEW;
 #endif
diff --git a/drivers/staging/media/atomisp/i2c/ov2680.h 
b/drivers/staging/media/atomisp/i2c/ov2680.h
index 944fe8e3bcbf..ab8907e6c9ef 100644
--- a/drivers/staging/media/atomisp/i2c/ov2680.h
+++ b/drivers/staging/media/atomisp/i2c/ov2680.h
@@ -934,7 +934,6 @@ static struct ov2680_resolution ov2680_res_video[] = {
 #define N_RES_VIDEO (ARRAY_SIZE(ov2680_res_video))
 
 static struct ov2680_resolution *ov2680_res = ov2680_res_preview;
-static int N_RES = N_RES_PREVIEW;
-
+static unsigned long N_RES = N_RES_PREVIEW;
 
 #endif
diff --git a/drivers/staging/media/atomisp/i2c/ov2722.h 
b/drivers/staging/media/atomisp/i2c/ov2722.h
index b0d40965d89e..73ecb1679718 100644
--- a/drivers/staging/media/atomisp/i2c/ov2722.h
+++ b/drivers/staging/media/atomisp/i2c/ov2722.h
@@ -1263,5 +1263,5 @@ struct ov2722_resolution ov2722_res_video[] = {
 #define N_RES_VIDEO (ARRAY_SIZE(ov2722_res_video))
 
 static struct ov2722_resolution *ov2722_res = ov2722_res_preview;
-static int N_RES = N_RES_PREVIEW;
+static unsigned long N_RES = N_RES_PREVIEW;
 #endif
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h 
b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h
index d88ac1777d86..8c2e6794463b 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h
+++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h
@@ -1377,5 +1377,5 @@ struct ov5693_resolution ov5693_res_video[] = {
 #define N_RES_VIDEO (ARRAY_SIZE(ov5693_res_video))
 
 static struct ov5693_resolution *ov5693_res = ov5693_res_preview;
-static int N_RES = N_RES_PREVIEW;
+static unsigned long N_RES = N_RES_PREVIEW;
 #endif
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: unisys: visorbus: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
 drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1c785dd..bba10dc 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -249,7 +249,7 @@ static ssize_t typename_show(struct device *dev, struct 
device_attribute *attr,
NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
.name = "channel",
.attrs = channel_attrs,
 };
@@ -340,7 +340,7 @@ static ssize_t channel_id_show(struct device *dev,
NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
.attrs = dev_attrs,
 };
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 2215056..798a92e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1146,7 +1146,7 @@ static ssize_t deviceenabled_store(struct device *dev,
NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
.name = "parahotplug",
.attrs = visorchipset_parahotplug_attrs
 };
-- 
1.9.1

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


Re: [PATCH] staging: unisys: visorbus: constify attribute_group structures.

2017-07-17 Thread Greg KH
On Mon, Jul 17, 2017 at 02:55:37PM +0530, Arvind Yadav wrote:
> attribute_groups are not supposed to change at runtime. All functions
> working with attribute_groups provided by  work
> with const attribute_group. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav 
> ---
>  drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
>  drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

Why not just use the ATTRIBUTE_GROUPS() macro for these?  Or is there
something that is preventing that?

thanks,

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


Re: [PATCH] staging: unisys: visorbus: constify attribute_group structures.

2017-07-17 Thread Arvind Yadav

Hi Greg,


On Monday 17 July 2017 04:15 PM, Greg KH wrote:

On Mon, Jul 17, 2017 at 02:55:37PM +0530, Arvind Yadav wrote:

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
  drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
  drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)

Why not just use the ATTRIBUTE_GROUPS() macro for these?  Or is there
something that is preventing that?

Yes, we can use. if we are only initializing '.attrs'.
ATTRIBUTE_GROUPS() will not work if we will initialize other member of
attribute_group like 'bin_attrs', 'is_visible', and  'name'.


thanks,

greg k-h

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


[PATCH] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread Hari Prasath
From: Hari Prasath 

Adding missing indio_dev->dev.of_node references to allow iio consumers
to access the device channels.

Signed-off-by: Hari Prasath 
---
 drivers/staging/iio/adc/ad7192.c | 1 +
 drivers/staging/iio/adc/ad7780.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index d11c6de..78308a5 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -668,6 +668,7 @@ static int ad7192_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
st->devid = spi_get_device_id(spi)->driver_data;
indio_dev->dev.parent = &spi->dev;
+   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
 
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index dec3ba6..e38d2ab9 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -195,6 +195,7 @@ static int ad7780_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
 
indio_dev->dev.parent = &spi->dev;
+   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = &st->chip_info->channel;
-- 
2.10.0.GIT

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


[PATCH v2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread Hari Prasath
Adding missing indio_dev->dev.of_node references to allow iio consumers
to access the device channels.

Signed-off-by: Hari Prasath 
---
v2: Wrong from email ID in first version of patch

---
 drivers/staging/iio/adc/ad7192.c | 1 +
 drivers/staging/iio/adc/ad7780.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index d11c6de..78308a5 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -668,6 +668,7 @@ static int ad7192_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
st->devid = spi_get_device_id(spi)->driver_data;
indio_dev->dev.parent = &spi->dev;
+   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
 
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index dec3ba6..e38d2ab9 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -195,6 +195,7 @@ static int ad7780_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
 
indio_dev->dev.parent = &spi->dev;
+   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = &st->chip_info->channel;
-- 
2.10.0.GIT

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


Re: [PATCH] staging: gs_fpgaboot: add buffer overflow checks

2017-07-17 Thread Greg Kroah-Hartman
On Sun, Jul 16, 2017 at 08:38:41PM -0400, Jacob von Chorus wrote:
> Four fields in struct fpgaimage are char arrays of length MAX_STR (256).
> The amount of data read into these buffers is controlled by a length
> field in the bitstream file read from userspace. If a corrupt or
> malicious firmware file was supplied, kernel data beyond these buffers
> can be overwritten arbitrarily.
> 
> This patch adds a check of the bitstream's length value to ensure it
> fits within the bounds of the allocated buffers. An error condition is
> returned from gs_read_bitstream if any of the reads fail.
> 
> This patch also fixes a checkpatch.pl CHECK in io.c by removing the FSF
> address paragraph.

Whenever you have a "also" in a patch changelog, that's a huge flag that
this should be a separate patch.  As is the case here, fixing the FSF
address has nothing to do with the buffer overflow checks.

Please break this up into two different patches.


thanks,

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


Re: [PATCH] Staging:vc04_services:vchiq_util.c: kzalloc call changed to kcalloc

2017-07-17 Thread Greg KH
On Sun, Jul 16, 2017 at 07:39:08PM +0300, AndyS wrote:
> From: Andrey Severin 
> 
> kzalloc call was changed to kcalloc by checkpatch.pl recommendation
> 
> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c 
> b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
> index 7fa0310e7b9e..2e52f07bbaa9 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
> @@ -51,7 +51,7 @@ int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size)
>   sema_init(&queue->pop, 0);
>   sema_init(&queue->push, 0);
>  
> - queue->storage = kzalloc(size * sizeof(VCHIQ_HEADER_T *), GFP_KERNEL);
> + queue->storage = kcalloc(size, sizeof(VCHIQ_HEADER_T *), GFP_KERNEL);
>   if (!queue->storage) {
>   vchiu_queue_delete(queue);
>   return 0;
> -- 
> 2.13.2

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch does not have a Signed-off-by: line.  Please read the
  kernel file, Documentation/SubmittingPatches and resend it after
  adding that line.  Note, the line needs to be in the body of the
  email, before the patch, not at the bottom of the patch or in the
  email signature.

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: lustre: fix all braces issues reported by checkpatch

2017-07-17 Thread Greg Kroah-Hartman
On Sat, Jul 15, 2017 at 11:39:22AM -0400, James Simmons wrote:
> Cleanup all braces that was reported by checkpatch. The only
> issue not fixed up is in mdc_lock.c. Removing the braces in
> the case of mdc_lock.c will break the build.
> 
> Signed-off-by: James Simmons 
> --
> v1) Initial patch
> v2) Rebased against latest staging-next tree

Those lines go below:

> ---

That line.

I'll edit it by hand this time...
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v1] staging: rts5208: Change fixed function names with "%s: ", __func__

2017-07-17 Thread Greg KH
On Fri, Jul 14, 2017 at 07:38:43PM +0530, Gaurav Pathak wrote:
> staging: rts5208: Refactored code to avoid few defects.

That's the subject line, why repeat it here?

Please put a "real" description of the patch here.

> 
> Signed-off-by: Gaurav Pathak 
> ---
> Hi, Gaurav hope this text appaers in the email, and i put it at the right 
> place in patch.

You did, but why are you writing to yourself?

thanks,

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


Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-17 Thread Greg Kroah-Hartman
On Thu, Jul 13, 2017 at 12:29:54PM +0100, Okash Khawaja wrote:
> On Wed, Jul 12, 2017 at 07:20:28PM +0100, Alan Cox wrote:
> > 
> > > When opening from kernel, we don't use file pointer. The count mismatch
> > > is between tty->count and #fd's. So opening from kernel leads to #fd's
> > > being less than tty->count. I thought this difference is relevant to
> > > user-space opening of tty, and not to kernel opening of tty. Can you
> > > suggest how to address this mismatch?
> > 
> > Your kernel reference is the same as having a file open reference so I
> > think this actually needs addressing in the maths. In other words count
> > the number of kernel references and also add that into the test for
> > check_tty_count (kernel references + #fds == count).
> > 
> > I'd really like to keep this right because that check has a long history
> > of catching really nasty race conditions in the tty code. The
> > open/close/hangup code is really fragile so worth the debugability.
> 
> I see. Okay based this, check_tty_count can be easily updated to take
> into account kernel references.

Ok, I'll drop this series from my "to-apply" queue and wait for you to
redo it.

thanks,

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


Re: [PATCH 1/3] staging: ccree: Replace kzalloc with devm_kzalloc

2017-07-17 Thread Greg KH
On Sat, Jul 15, 2017 at 01:21:54PM +0530, suni...@techveda.org wrote:
> From: Suniel Mahesh 
> 
> It is recommended to use managed function devm_kzalloc, which
> simplifies driver cleanup paths and driver code.
> This patch does the following:
> (a) replace kzalloc with devm_kzalloc.
> (b) drop kfree(), because memory allocated with devm_kzalloc() is
> automatically freed on driver detach, otherwise it leads to a double
> free.
> (c) remove unnecessary blank lines.
> 
> Signed-off-by: Suniel Mahesh 
> ---
> Note:
> - Patch was tested and built(ARCH=arm) on next-20170714.
>   No build issues reported, however it was not tested on
>   real hardware.
> ---
>  drivers/staging/ccree/ssi_driver.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/ccree/ssi_driver.c 
> b/drivers/staging/ccree/ssi_driver.c
> index 78709b92..f231ecf 100644
> --- a/drivers/staging/ccree/ssi_driver.c
> +++ b/drivers/staging/ccree/ssi_driver.c
> @@ -224,13 +224,15 @@ static int init_cc_resources(struct platform_device 
> *plat_dev)
>   struct resource *req_mem_cc_regs = NULL;
>   void __iomem *cc_base = NULL;
>   bool irq_registered = false;
> - struct ssi_drvdata *new_drvdata = kzalloc(sizeof(struct ssi_drvdata), 
> GFP_KERNEL);
> + struct ssi_drvdata *new_drvdata;
>   struct device *dev = &plat_dev->dev;
>   struct device_node *np = dev->of_node;
>   u32 signature_val;
>   int rc = 0;
>  
> - if (unlikely(!new_drvdata)) {
> + new_drvdata = devm_kzalloc(&plat_dev->dev, sizeof(struct ssi_drvdata),

sizeof(*new_drvdata), right?

thanks,

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


Re: [PATCH v2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread hari prasath
Kindly discard this patch versions. I will send a new one.

On 17 July 2017 at 17:49, Hari Prasath  wrote:
> Adding missing indio_dev->dev.of_node references to allow iio consumers
> to access the device channels.
>
> Signed-off-by: Hari Prasath 
> ---
> v2: Wrong from email ID in first version of patch
>
> ---
>  drivers/staging/iio/adc/ad7192.c | 1 +
>  drivers/staging/iio/adc/ad7780.c | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/drivers/staging/iio/adc/ad7192.c 
> b/drivers/staging/iio/adc/ad7192.c
> index d11c6de..78308a5 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -668,6 +668,7 @@ static int ad7192_probe(struct spi_device *spi)
> spi_set_drvdata(spi, indio_dev);
> st->devid = spi_get_device_id(spi)->driver_data;
> indio_dev->dev.parent = &spi->dev;
> +   indio_dev->dev.of_node = spi->dev.of_node;
> indio_dev->name = spi_get_device_id(spi)->name;
> indio_dev->modes = INDIO_DIRECT_MODE;
>
> diff --git a/drivers/staging/iio/adc/ad7780.c 
> b/drivers/staging/iio/adc/ad7780.c
> index dec3ba6..e38d2ab9 100644
> --- a/drivers/staging/iio/adc/ad7780.c
> +++ b/drivers/staging/iio/adc/ad7780.c
> @@ -195,6 +195,7 @@ static int ad7780_probe(struct spi_device *spi)
> spi_set_drvdata(spi, indio_dev);
>
> indio_dev->dev.parent = &spi->dev;
> +   indio_dev->dev.of_node = spi->dev.of_node;
> indio_dev->name = spi_get_device_id(spi)->name;
> indio_dev->modes = INDIO_DIRECT_MODE;
> indio_dev->channels = &st->chip_info->channel;
> --
> 2.10.0.GIT
>



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread Hari Prasath
Adding missing indio_dev->dev.of_node references to allow iio consumers
to access the device channels.

Signed-off-by: Hari Prasath 
---
v2: Wrong from mail ID in first version of patch
---
 drivers/staging/iio/adc/ad7192.c | 1 -
 drivers/staging/iio/adc/ad7780.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 78308a5..d11c6de 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -668,7 +668,6 @@ static int ad7192_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
st->devid = spi_get_device_id(spi)->driver_data;
indio_dev->dev.parent = &spi->dev;
-   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
 
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index e38d2ab9..dec3ba6 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -195,7 +195,6 @@ static int ad7780_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
 
indio_dev->dev.parent = &spi->dev;
-   indio_dev->dev.of_node = spi->dev.of_node;
indio_dev->name = spi_get_device_id(spi)->name;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = &st->chip_info->channel;
-- 
2.10.0.GIT

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


Re: [PATCH] staging: unisys: visorbus: constify attribute_group structures.

2017-07-17 Thread Greg KH
On Mon, Jul 17, 2017 at 05:43:14PM +0530, Arvind Yadav wrote:
> Hi Greg,
> 
> 
> On Monday 17 July 2017 04:15 PM, Greg KH wrote:
> > On Mon, Jul 17, 2017 at 02:55:37PM +0530, Arvind Yadav wrote:
> > > attribute_groups are not supposed to change at runtime. All functions
> > > working with attribute_groups provided by  work
> > > with const attribute_group. So mark the non-const structs as const.
> > > 
> > > Signed-off-by: Arvind Yadav 
> > > ---
> > >   drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
> > >   drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
> > >   2 files changed, 3 insertions(+), 3 deletions(-)
> > Why not just use the ATTRIBUTE_GROUPS() macro for these?  Or is there
> > something that is preventing that?
> Yes, we can use. if we are only initializing '.attrs'.
> ATTRIBUTE_GROUPS() will not work if we will initialize other member of
> attribute_group like 'bin_attrs', 'is_visible', and  'name'.

That means you should redo this patch :)

Also, your changelog text had a typo, it is "attribute_group", not
"attribute_groups".

thanks,

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


Re: [PATCH 00/37] fine-grained locking in binder driver

2017-07-17 Thread Greg KH
On Fri, Jun 30, 2017 at 08:04:21AM +0200, Greg KH wrote:
> On Thu, Jun 29, 2017 at 12:01:34PM -0700, Todd Kjos wrote:
> > The binder driver uses a global mutex to serialize access to state in a
> > multi-threaded environment. This global lock has been increasingly
> > problematic as Android devices have scaled to more cores. The problem is
> > not so much contention for the global lock which still remains relatively
> > low, but the priority inversion which occurs regularly when a lower
> > priority thread is preempted while holding the lock and a higher priority
> > thread becomes blocked on it. These cases can be especially painful if the
> > lower priority thread runs in the background on a slow core at a low
> > frequency. This often manifests as missed frames or other glitches.
> > 
> > For several years, a hacky solution has been used in many Android devices
> > which disables preemption for most of the time the global mutex is held.
> > This dramatically decreased the cases of glitches induced by priority
> > inversion and increased the average throughput for binder transactions.
> > 
> > Moving to fine-grained locking in this patchset results is a cleaner
> > and more scalable solution than the preempt disable hack. Priority
> > inversion is decreased significantly.
> 
> Yeah, it is great to see this work done!  I'll review these on Monday,
> sorry, am traveling at the moment...

All now queued up in my trees.

thanks,

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


Re: [PATCH] binder: Drop needless locking in binder_mmap()

2017-07-17 Thread Greg Kroah-Hartman
On Mon, Jun 19, 2017 at 05:53:34PM +0300, Dmitry Safonov wrote:
> On 05/24/2017 05:51 PM, Dmitry Safonov wrote:
> > binder_mmap() protected proc->buffer from concurrent changes.
> > It was introduced with commit bd1eff9741af ("Staging: android: binder:
> > Fix crashes when sharing a binder file between processes").
> > 
> > The commit fixed such races alike:
> > 
> > task1
> > =
> > fd = open("/dev/binder",..)
> > fork()
> > >task2
> >|  =
> > mmap(fd)mmap(fd)
> > 
> > Afterwards the situation was changed with the commit a79f41ed9786
> > ("binder: don't allow mmap() by process other than proc->tsk").
> > That commit prohibited mmap'ing of fd, that was opened by some
> > other task.
> > That restriction has made locking in binder_mmap() unnecessary.
> > 
> > Cc: Al Viro 
> > Cc: "Arve Hjønnevåg" 
> > Cc: Greg Kroah-Hartman 
> > Cc: Riley Andrews 
> > Cc: de...@driverdev.osuosl.org
> > Cc: Android Kernel Team 
> > Signed-off-by: Dmitry Safonov 
> > ---
> >   drivers/android/binder.c | 5 -
> >   1 file changed, 5 deletions(-)
> 
> Ping?

The "break up the binder lock" patches should have now made this
obsolete, right?  If not, can you please rebase it on my
char-misc-testing tree and resend?

thanks,

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


Re: [PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by loop

2017-07-17 Thread Greg KH
On Sun, Jun 25, 2017 at 12:47:45PM -0700, k...@exchange.microsoft.com wrote:
> From: Alex Ng 
> 
> Skip loop devices from the freeze/thaw operation.

Ok, but why?  What is the consequences of this?  Please provide a much
better changelog comment, especially for something that is supposed to
be a "fix".

thanks,

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


Re: [PATCHv2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread Lars-Peter Clausen
Hi,

The patch seems to be reverted?

Also should this part in the IIO core take care of automatically setting the
of_node of the IIO device? As far as I can see we don't have to initialize
it manually.

/* If the calling driver did not initialize of_node, do it here */
if (!indio_dev->dev.of_node && indio_dev->dev.parent)
indio_dev->dev.of_node = indio_dev->dev.parent->of_node;

- Lars

On 07/17/2017 02:34 PM, Hari Prasath wrote:
> Adding missing indio_dev->dev.of_node references to allow iio consumers
> to access the device channels.
> 
> Signed-off-by: Hari Prasath 
> ---
>   v2: Wrong from mail ID in first version of patch
> ---
>  drivers/staging/iio/adc/ad7192.c | 1 -
>  drivers/staging/iio/adc/ad7780.c | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7192.c 
> b/drivers/staging/iio/adc/ad7192.c
> index 78308a5..d11c6de 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -668,7 +668,6 @@ static int ad7192_probe(struct spi_device *spi)
>   spi_set_drvdata(spi, indio_dev);
>   st->devid = spi_get_device_id(spi)->driver_data;
>   indio_dev->dev.parent = &spi->dev;
> - indio_dev->dev.of_node = spi->dev.of_node;
>   indio_dev->name = spi_get_device_id(spi)->name;
>   indio_dev->modes = INDIO_DIRECT_MODE;
>  
> diff --git a/drivers/staging/iio/adc/ad7780.c 
> b/drivers/staging/iio/adc/ad7780.c
> index e38d2ab9..dec3ba6 100644
> --- a/drivers/staging/iio/adc/ad7780.c
> +++ b/drivers/staging/iio/adc/ad7780.c
> @@ -195,7 +195,6 @@ static int ad7780_probe(struct spi_device *spi)
>   spi_set_drvdata(spi, indio_dev);
>  
>   indio_dev->dev.parent = &spi->dev;
> - indio_dev->dev.of_node = spi->dev.of_node;
>   indio_dev->name = spi_get_device_id(spi)->name;
>   indio_dev->modes = INDIO_DIRECT_MODE;
>   indio_dev->channels = &st->chip_info->channel;
> 

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


[PATCH] Staging:vc04_services:vchiq_util.c: kzalloc call changed to kcalloc

2017-07-17 Thread AndyS
From: Andrey Severin 

kzalloc call was changed to kcalloc by checkpatch.pl recommendation

Signed-off-by: Andrey Severin 
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
index 7fa0310e7b9e..2e52f07bbaa9 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
@@ -51,7 +51,7 @@ int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size)
sema_init(&queue->pop, 0);
sema_init(&queue->push, 0);
 
-   queue->storage = kzalloc(size * sizeof(VCHIQ_HEADER_T *), GFP_KERNEL);
+   queue->storage = kcalloc(size, sizeof(VCHIQ_HEADER_T *), GFP_KERNEL);
if (!queue->storage) {
vchiu_queue_delete(queue);
return 0;
-- 
2.13.2

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


Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-17 Thread Okash Khawaja


> On 17 Jul 2017, at 13:31, Greg Kroah-Hartman  
> wrote:
> 
>> On Thu, Jul 13, 2017 at 12:29:54PM +0100, Okash Khawaja wrote:
>>> On Wed, Jul 12, 2017 at 07:20:28PM +0100, Alan Cox wrote:
>>> 
 When opening from kernel, we don't use file pointer. The count mismatch
 is between tty->count and #fd's. So opening from kernel leads to #fd's
 being less than tty->count. I thought this difference is relevant to
 user-space opening of tty, and not to kernel opening of tty. Can you
 suggest how to address this mismatch?
>>> 
>>> Your kernel reference is the same as having a file open reference so I
>>> think this actually needs addressing in the maths. In other words count
>>> the number of kernel references and also add that into the test for
>>> check_tty_count (kernel references + #fds == count).
>>> 
>>> I'd really like to keep this right because that check has a long history
>>> of catching really nasty race conditions in the tty code. The
>>> open/close/hangup code is really fragile so worth the debugability.
>> 
>> I see. Okay based this, check_tty_count can be easily updated to take
>> into account kernel references.
> 
> Ok, I'll drop this series from my "to-apply" queue and wait for you to
> redo it.

Sure. I can fix the tty->count mismatch based on Alan's suggestion. However I 
don't understand why the exclusivity flag should belong to tty_port and not 
tty_struct. It will be good to know why. 

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


Re: [PATCH 1/1] drivers/staging/pi433: New driver

2017-07-17 Thread kbuild test robot
Hi Marcus,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.13-rc1 next-20170717]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Wolf-Entwicklungen/drivers-staging-pi433-New-driver/20170716-181617
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m68k 

All errors (new ones prefixed by >>):

   drivers/staging/pi433/rf69.o: In function `rf69_set_frequency':
>> rf69.c:(.text+0x9e2): undefined reference to `__udivdi3'

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/7] staging: fsl-mc: make the driver compile on other architectures

2017-07-17 Thread laurentiu.tudor
From: Laurentiu Tudor 

Apart from a small change (first patch) which adds a missing comment,
this series make the bus driver compile on other architectures, as per
GregKH comment [1].
Compiled tested on:
 - booke powerpc (corenet{32,64}_smp_defconfig) with this ppc patch [2]
 - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF)
 - arm64 (defconfig)

[1] https://www.spinics.net/lists/linux-driver-devel/msg100585.html
[2] https://patchwork.ozlabs.org/patch/789474/

Laurentiu Tudor (7):
  staging: fsl-mc: add missing fsl_mc comment in struct msi_desc
  staging: fsl-mc: use generic memory barriers
  staging: fsl-mc: drop useless gic v3 related #include
  staging: fsl-mc: fix compilation with non-generic msi domain ops
  staging: fsl-mc: fix formating of phys_addr_t on 32 bits
  staging: fsl-mc: rewrite mc command send/receive to work on 32-bits
  staging: fsl-mc: allow the driver compile multi-arch

 drivers/staging/fsl-dpaa2/Kconfig  |  2 +-
 drivers/staging/fsl-mc/bus/Kconfig |  4 +-
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c|  5 ++-
 .../staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c |  3 +-
 drivers/staging/fsl-mc/bus/mc-io.c |  8 ++--
 drivers/staging/fsl-mc/bus/mc-sys.c| 45 +-
 include/linux/msi.h|  1 +
 7 files changed, 32 insertions(+), 36 deletions(-)

-- 
2.9.4

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


[PATCH 2/7] staging: fsl-mc: use generic memory barriers

2017-07-17 Thread laurentiu.tudor
From: Laurentiu Tudor 

No need to use arch-specific memory barriers; switch to using generic
ones. The rmb()s were useless so drop them.

Signed-off-by: Laurentiu Tudor 
---
 drivers/staging/fsl-mc/bus/mc-sys.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
b/drivers/staging/fsl-mc/bus/mc-sys.c
index a1704c3..012abd5 100644
--- a/drivers/staging/fsl-mc/bus/mc-sys.c
+++ b/drivers/staging/fsl-mc/bus/mc-sys.c
@@ -127,7 +127,8 @@ static inline void mc_write_command(struct mc_command 
__iomem *portal,
/* copy command parameters into the portal */
for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
__raw_writeq(cmd->params[i], &portal->params[i]);
-   __iowmb();
+   /* ensure command params are committed before submitting it */
+   wmb();
 
/* submit the command by writing the header */
__raw_writeq(cmd->header, &portal->header);
@@ -150,9 +151,7 @@ static inline enum mc_cmd_status mc_read_response(struct 
mc_command __iomem *
enum mc_cmd_status status;
 
/* Copy command response header from MC portal: */
-   __iormb();
resp->header = __raw_readq(&portal->header);
-   __iormb();
status = mc_cmd_hdr_read_status(resp);
if (status != MC_CMD_STATUS_OK)
return status;
@@ -160,7 +159,6 @@ static inline enum mc_cmd_status mc_read_response(struct 
mc_command __iomem *
/* Copy command response data from MC portal: */
for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
resp->params[i] = __raw_readq(&portal->params[i]);
-   __iormb();
 
return status;
 }
-- 
2.9.4

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


[PATCH 5/7] staging: fsl-mc: fix formating of phys_addr_t on 32 bits

2017-07-17 Thread laurentiu.tudor
From: Laurentiu Tudor 

Use correct format specifier for phys_addr_t variables (%pa) instead
of %llx. This fixes these warnings on 32 bit targets:
 "format '%llx' expects argument of type 'long long unsigned int',
  but argument 4 has type 'phys_addr_t' [-Wformat=]"

Signed-off-by: Laurentiu Tudor 
---
 drivers/staging/fsl-mc/bus/mc-io.c  |  8 
 drivers/staging/fsl-mc/bus/mc-sys.c | 12 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/mc-io.c 
b/drivers/staging/fsl-mc/bus/mc-io.c
index 35221a17..4e6f99a 100644
--- a/drivers/staging/fsl-mc/bus/mc-io.c
+++ b/drivers/staging/fsl-mc/bus/mc-io.c
@@ -129,8 +129,8 @@ int __must_check fsl_create_mc_io(struct device *dev,
  "mc_portal");
if (!res) {
dev_err(dev,
-   "devm_request_mem_region failed for MC portal %#llx\n",
-   mc_portal_phys_addr);
+   "devm_request_mem_region failed for MC portal %pa\n",
+   &mc_portal_phys_addr);
return -EBUSY;
}
 
@@ -139,8 +139,8 @@ int __must_check fsl_create_mc_io(struct device *dev,
   mc_portal_size);
if (!mc_portal_virt_addr) {
dev_err(dev,
-   "devm_ioremap_nocache failed for MC portal %#llx\n",
-   mc_portal_phys_addr);
+   "devm_ioremap_nocache failed for MC portal %pa\n",
+   &mc_portal_phys_addr);
return -ENXIO;
}
 
diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
b/drivers/staging/fsl-mc/bus/mc-sys.c
index 012abd5..195d9f3 100644
--- a/drivers/staging/fsl-mc/bus/mc-sys.c
+++ b/drivers/staging/fsl-mc/bus/mc-sys.c
@@ -196,8 +196,8 @@ static int mc_polling_wait_preemptible(struct fsl_mc_io 
*mc_io,
 
if (time_after_eq(jiffies, jiffies_until_timeout)) {
dev_dbg(mc_io->dev,
-   "MC command timed out (portal: %#llx, dprc 
handle: %#x, command: %#x)\n",
-mc_io->portal_phys_addr,
+   "MC command timed out (portal: %pa, dprc 
handle: %#x, command: %#x)\n",
+&mc_io->portal_phys_addr,
 (unsigned int)mc_cmd_hdr_read_token(cmd),
 (unsigned int)mc_cmd_hdr_read_cmdid(cmd));
 
@@ -236,8 +236,8 @@ static int mc_polling_wait_atomic(struct fsl_mc_io *mc_io,
timeout_usecs -= MC_CMD_COMPLETION_POLLING_MAX_SLEEP_USECS;
if (timeout_usecs == 0) {
dev_dbg(mc_io->dev,
-   "MC command timed out (portal: %#llx, dprc 
handle: %#x, command: %#x)\n",
-mc_io->portal_phys_addr,
+   "MC command timed out (portal: %pa, dprc 
handle: %#x, command: %#x)\n",
+&mc_io->portal_phys_addr,
 (unsigned int)mc_cmd_hdr_read_token(cmd),
 (unsigned int)mc_cmd_hdr_read_cmdid(cmd));
 
@@ -290,8 +290,8 @@ int mc_send_command(struct fsl_mc_io *mc_io, struct 
mc_command *cmd)
 
if (status != MC_CMD_STATUS_OK) {
dev_dbg(mc_io->dev,
-   "MC command failed: portal: %#llx, dprc handle: %#x, 
command: %#x, status: %s (%#x)\n",
-mc_io->portal_phys_addr,
+   "MC command failed: portal: %pa, dprc handle: %#x, 
command: %#x, status: %s (%#x)\n",
+&mc_io->portal_phys_addr,
 (unsigned int)mc_cmd_hdr_read_token(cmd),
 (unsigned int)mc_cmd_hdr_read_cmdid(cmd),
 mc_status_to_string(status),
-- 
2.9.4

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


[PATCH 6/7] staging: fsl-mc: rewrite mc command send/receive to work on 32-bits

2017-07-17 Thread laurentiu.tudor
From: Laurentiu Tudor 

Split the 64-bit accesses in 32-bit accesses because there's no real
constrain in MC to do only atomic 64-bit. There's only one place
where ordering is important: when writing the MC command header the
first 32-bit part of the header must be written last.
We do this switch in order to allow compiling the driver on 32-bit.

Signed-off-by: Laurentiu Tudor 
---
 drivers/staging/fsl-mc/bus/mc-sys.c | 31 ---
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
b/drivers/staging/fsl-mc/bus/mc-sys.c
index 195d9f3..dd2828e 100644
--- a/drivers/staging/fsl-mc/bus/mc-sys.c
+++ b/drivers/staging/fsl-mc/bus/mc-sys.c
@@ -124,14 +124,15 @@ static inline void mc_write_command(struct mc_command 
__iomem *portal,
 {
int i;
 
-   /* copy command parameters into the portal */
-   for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
-   __raw_writeq(cmd->params[i], &portal->params[i]);
-   /* ensure command params are committed before submitting it */
-   wmb();
-
-   /* submit the command by writing the header */
-   __raw_writeq(cmd->header, &portal->header);
+   /*
+* copy command parameters into the portal. Final write
+* triggers the submission of the command.
+*/
+   for (i = sizeof(struct mc_command) / sizeof(u32) - 1; i >= 0; i--) {
+   __raw_writel(((u32 *)cmd)[i], &((u32 *)portal)[i]);
+   /* ensure command params are committed before submitting it */
+   wmb();
+   }
 }
 
 /**
@@ -148,19 +149,11 @@ static inline enum mc_cmd_status mc_read_response(struct 
mc_command __iomem *
  struct mc_command *resp)
 {
int i;
-   enum mc_cmd_status status;
-
-   /* Copy command response header from MC portal: */
-   resp->header = __raw_readq(&portal->header);
-   status = mc_cmd_hdr_read_status(resp);
-   if (status != MC_CMD_STATUS_OK)
-   return status;
 
-   /* Copy command response data from MC portal: */
-   for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
-   resp->params[i] = __raw_readq(&portal->params[i]);
+   for (i = 0; i < sizeof(struct mc_command) / sizeof(u32); i++)
+   ((u32 *)resp)[i] = __raw_readl(&((u32 *)portal)[i]);
 
-   return status;
+   return mc_cmd_hdr_read_status(resp);
 }
 
 /**
-- 
2.9.4

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


[PATCH 3/7] staging: fsl-mc: drop useless gic v3 related #include

2017-07-17 Thread laurentiu.tudor
From: Laurentiu Tudor 

Nothing from linux/irqchip/arm-gic-v3.h is used, so the #include can be
safely dropped.

Signed-off-by: Laurentiu Tudor 
---
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 1 -
 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c 
b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
index c04a2f2..ee6e3b7 100644
--- a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
@@ -11,7 +11,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c 
b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
index 865d385..e798ea4 100644
--- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
@@ -11,7 +11,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
2.9.4

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


[PATCH 1/7] staging: fsl-mc: add missing fsl_mc comment in struct msi_desc

2017-07-17 Thread laurentiu.tudor
From: Laurentiu Tudor 

The mc-bus specific field, fsl_mc in struct msi_desc is missing its
comment so add it.

Signed-off-by: Laurentiu Tudor 
---
 include/linux/msi.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/msi.h b/include/linux/msi.h
index df6d592..80e3b56 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -66,6 +66,7 @@ struct fsl_mc_msi_desc {
  * @mask_pos:  [PCI MSI]   Mask register position
  * @mask_base: [PCI MSI-X] Mask register base address
  * @platform:  [platform]  Platform device specific msi descriptor data
+ * @fsl_mc:[fsl-mc]FSL MC device specific msi descriptor data
  */
 struct msi_desc {
/* Shared device/bus type independent data */
-- 
2.9.4

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


[PATCH 4/7] staging: fsl-mc: fix compilation with non-generic msi domain ops

2017-07-17 Thread laurentiu.tudor
From: Laurentiu Tudor 

The bus driver relies on generic msi domain ops.
Fix compilation for architectures that don't provide it (e.g. x86_64).

Signed-off-by: Laurentiu Tudor 
---
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c| 4 
 drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c 
b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
index ee6e3b7..18774ee 100644
--- a/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/fsl-mc-msi.c
@@ -17,6 +17,7 @@
 #include 
 #include "fsl-mc-private.h"
 
+#ifdef GENERIC_MSI_DOMAIN_OPS
 /*
  * Generate a unique ID identifying the interrupt (only used within the MSI
  * irqdomain.  Combine the icid with the interrupt index.
@@ -38,6 +39,9 @@ static void fsl_mc_msi_set_desc(msi_alloc_info_t *arg,
arg->hwirq = fsl_mc_domain_calc_hwirq(to_fsl_mc_device(desc->dev),
  desc);
 }
+#else
+#define fsl_mc_msi_set_desc NULL
+#endif
 
 static void fsl_mc_msi_update_dom_ops(struct msi_domain_info *info)
 {
diff --git a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c 
b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
index e798ea4..cd73c58 100644
--- a/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
+++ b/drivers/staging/fsl-mc/bus/irq-gic-v3-its-fsl-mc-msi.c
@@ -45,7 +45,9 @@ static int its_fsl_mc_msi_prepare(struct irq_domain 
*msi_domain,
 * NOTE: This device id corresponds to the IOMMU stream ID
 * associated with the DPRC object (ICID).
 */
+#ifdef GENERIC_MSI_DOMAIN_OPS
info->scratchpad[0].ul = mc_bus_dev->icid;
+#endif
msi_info = msi_get_domain_info(msi_domain->parent);
return msi_info->ops->msi_prepare(msi_domain->parent, dev, nvec, info);
 }
-- 
2.9.4

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


[PATCH 7/7] staging: fsl-mc: allow the driver compile multi-arch

2017-07-17 Thread laurentiu.tudor
From: Laurentiu Tudor 

Drop dependency on ARCH_LAYERSCAPE (which in turn depends on ARM64),
thus leaving this driver compile on other architectures.
Also, other drivers depending on the bus are updated to depend
on ARCH_LAYERSCAPE until they'll also be made multi-arch.
This was compiled tested on:
 - booke powerpc (corenet{32,64}_smp_defconfig)
 - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF)
 - arm64 (defconfig)

Signed-off-by: Laurentiu Tudor 
---
 drivers/staging/fsl-dpaa2/Kconfig  | 2 +-
 drivers/staging/fsl-mc/bus/Kconfig | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/Kconfig 
b/drivers/staging/fsl-dpaa2/Kconfig
index 730fd6d..dfff675 100644
--- a/drivers/staging/fsl-dpaa2/Kconfig
+++ b/drivers/staging/fsl-dpaa2/Kconfig
@@ -4,7 +4,7 @@
 
 config FSL_DPAA2
bool "Freescale DPAA2 devices"
-   depends on FSL_MC_BUS
+   depends on FSL_MC_BUS && ARCH_LAYERSCAPE
---help---
  Build drivers for Freescale DataPath Acceleration
  Architecture (DPAA2) family of SoCs.
diff --git a/drivers/staging/fsl-mc/bus/Kconfig 
b/drivers/staging/fsl-mc/bus/Kconfig
index a10aaf0..c0acc97 100644
--- a/drivers/staging/fsl-mc/bus/Kconfig
+++ b/drivers/staging/fsl-mc/bus/Kconfig
@@ -8,7 +8,7 @@
 
 config FSL_MC_BUS
bool "QorIQ DPAA2 fsl-mc bus driver"
-   depends on OF && ARCH_LAYERSCAPE
+   depends on OF
select GENERIC_MSI_IRQ_DOMAIN
help
  Driver to enable the bus infrastructure for the QorIQ DPAA2
@@ -18,7 +18,7 @@ config FSL_MC_BUS
 
 config FSL_MC_DPIO
 tristate "QorIQ DPAA2 DPIO driver"
-depends on FSL_MC_BUS
+depends on FSL_MC_BUS && ARCH_LAYERSCAPE
 help
  Driver for the DPAA2 DPIO object.  A DPIO provides queue and
  buffer management facilities for software to interact with
-- 
2.9.4

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


Re: [PATCH 2/7] staging: fsl-mc: use generic memory barriers

2017-07-17 Thread Robin Murphy
On 17/07/17 14:26, laurentiu.tu...@nxp.com wrote:
> From: Laurentiu Tudor 
> 
> No need to use arch-specific memory barriers; switch to using generic
> ones. The rmb()s were useless so drop them.
> 
> Signed-off-by: Laurentiu Tudor 
> ---
>  drivers/staging/fsl-mc/bus/mc-sys.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
> b/drivers/staging/fsl-mc/bus/mc-sys.c
> index a1704c3..012abd5 100644
> --- a/drivers/staging/fsl-mc/bus/mc-sys.c
> +++ b/drivers/staging/fsl-mc/bus/mc-sys.c
> @@ -127,7 +127,8 @@ static inline void mc_write_command(struct mc_command 
> __iomem *portal,
>   /* copy command parameters into the portal */
>   for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
>   __raw_writeq(cmd->params[i], &portal->params[i]);
> - __iowmb();
> + /* ensure command params are committed before submitting it */
> + wmb();
>  
>   /* submit the command by writing the header */
>   __raw_writeq(cmd->header, &portal->header);

AFAICS, just using writeq() here should ensure sufficient order against
the previous iomem accessors, without the need for explicit barriers.

Also, note that the __raw_*() variants aren't endian-safe, so consider
updating things to *_relaxed() where ordering doesn't matter.

Robin.

> @@ -150,9 +151,7 @@ static inline enum mc_cmd_status mc_read_response(struct 
> mc_command __iomem *
>   enum mc_cmd_status status;
>  
>   /* Copy command response header from MC portal: */
> - __iormb();
>   resp->header = __raw_readq(&portal->header);
> - __iormb();
>   status = mc_cmd_hdr_read_status(resp);
>   if (status != MC_CMD_STATUS_OK)
>   return status;
> @@ -160,7 +159,6 @@ static inline enum mc_cmd_status mc_read_response(struct 
> mc_command __iomem *
>   /* Copy command response data from MC portal: */
>   for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
>   resp->params[i] = __raw_readq(&portal->params[i]);
> - __iormb();
>  
>   return status;
>  }
> 

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


Re: [PATCH 6/7] staging: fsl-mc: rewrite mc command send/receive to work on 32-bits

2017-07-17 Thread Robin Murphy
On 17/07/17 14:26, laurentiu.tu...@nxp.com wrote:
> From: Laurentiu Tudor 
> 
> Split the 64-bit accesses in 32-bit accesses because there's no real
> constrain in MC to do only atomic 64-bit. There's only one place
> where ordering is important: when writing the MC command header the
> first 32-bit part of the header must be written last.
> We do this switch in order to allow compiling the driver on 32-bit.

#include 

Then you can just use writeq()/writeq_relaxed()/readq_relaxed() on
32-bit platforms as well.

Robin.

> Signed-off-by: Laurentiu Tudor 
> ---
>  drivers/staging/fsl-mc/bus/mc-sys.c | 31 ---
>  1 file changed, 12 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
> b/drivers/staging/fsl-mc/bus/mc-sys.c
> index 195d9f3..dd2828e 100644
> --- a/drivers/staging/fsl-mc/bus/mc-sys.c
> +++ b/drivers/staging/fsl-mc/bus/mc-sys.c
> @@ -124,14 +124,15 @@ static inline void mc_write_command(struct mc_command 
> __iomem *portal,
>  {
>   int i;
>  
> - /* copy command parameters into the portal */
> - for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
> - __raw_writeq(cmd->params[i], &portal->params[i]);
> - /* ensure command params are committed before submitting it */
> - wmb();
> -
> - /* submit the command by writing the header */
> - __raw_writeq(cmd->header, &portal->header);
> + /*
> +  * copy command parameters into the portal. Final write
> +  * triggers the submission of the command.
> +  */
> + for (i = sizeof(struct mc_command) / sizeof(u32) - 1; i >= 0; i--) {
> + __raw_writel(((u32 *)cmd)[i], &((u32 *)portal)[i]);
> + /* ensure command params are committed before submitting it */
> + wmb();
> + }
>  }
>  
>  /**
> @@ -148,19 +149,11 @@ static inline enum mc_cmd_status 
> mc_read_response(struct mc_command __iomem *
> struct mc_command *resp)
>  {
>   int i;
> - enum mc_cmd_status status;
> -
> - /* Copy command response header from MC portal: */
> - resp->header = __raw_readq(&portal->header);
> - status = mc_cmd_hdr_read_status(resp);
> - if (status != MC_CMD_STATUS_OK)
> - return status;
>  
> - /* Copy command response data from MC portal: */
> - for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
> - resp->params[i] = __raw_readq(&portal->params[i]);
> + for (i = 0; i < sizeof(struct mc_command) / sizeof(u32); i++)
> + ((u32 *)resp)[i] = __raw_readl(&((u32 *)portal)[i]);
>  
> - return status;
> + return mc_cmd_hdr_read_status(resp);
>  }
>  
>  /**
> 

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


Re: [PATCHv2] staging: iio: adc: add missing of_node references to iio_dev

2017-07-17 Thread hari prasath
Hi,

I agree that it's initialized in the core IIO driver. Also I have
screwed up the patch.

Regards,
Hari

On 17 July 2017 at 18:47, Lars-Peter Clausen  wrote:
> Hi,
>
> The patch seems to be reverted?
>
> Also should this part in the IIO core take care of automatically setting the
> of_node of the IIO device? As far as I can see we don't have to initialize
> it manually.
>
> /* If the calling driver did not initialize of_node, do it here */
> if (!indio_dev->dev.of_node && indio_dev->dev.parent)
> indio_dev->dev.of_node = indio_dev->dev.parent->of_node;
>
> - Lars
>
> On 07/17/2017 02:34 PM, Hari Prasath wrote:
>> Adding missing indio_dev->dev.of_node references to allow iio consumers
>> to access the device channels.
>>
>> Signed-off-by: Hari Prasath 
>> ---
>>   v2: Wrong from mail ID in first version of patch
>> ---
>>  drivers/staging/iio/adc/ad7192.c | 1 -
>>  drivers/staging/iio/adc/ad7780.c | 1 -
>>  2 files changed, 2 deletions(-)
>>
>> diff --git a/drivers/staging/iio/adc/ad7192.c 
>> b/drivers/staging/iio/adc/ad7192.c
>> index 78308a5..d11c6de 100644
>> --- a/drivers/staging/iio/adc/ad7192.c
>> +++ b/drivers/staging/iio/adc/ad7192.c
>> @@ -668,7 +668,6 @@ static int ad7192_probe(struct spi_device *spi)
>>   spi_set_drvdata(spi, indio_dev);
>>   st->devid = spi_get_device_id(spi)->driver_data;
>>   indio_dev->dev.parent = &spi->dev;
>> - indio_dev->dev.of_node = spi->dev.of_node;
>>   indio_dev->name = spi_get_device_id(spi)->name;
>>   indio_dev->modes = INDIO_DIRECT_MODE;
>>
>> diff --git a/drivers/staging/iio/adc/ad7780.c 
>> b/drivers/staging/iio/adc/ad7780.c
>> index e38d2ab9..dec3ba6 100644
>> --- a/drivers/staging/iio/adc/ad7780.c
>> +++ b/drivers/staging/iio/adc/ad7780.c
>> @@ -195,7 +195,6 @@ static int ad7780_probe(struct spi_device *spi)
>>   spi_set_drvdata(spi, indio_dev);
>>
>>   indio_dev->dev.parent = &spi->dev;
>> - indio_dev->dev.of_node = spi->dev.of_node;
>>   indio_dev->name = spi_get_device_id(spi)->name;
>>   indio_dev->modes = INDIO_DIRECT_MODE;
>>   indio_dev->channels = &st->chip_info->channel;
>>
>



-- 
Regards,
G.E.Hari Prasath
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 6/7] staging: fsl-mc: rewrite mc command send/receive to work on 32-bits

2017-07-17 Thread Arnd Bergmann
On Mon, Jul 17, 2017 at 3:26 PM,   wrote:
> From: Laurentiu Tudor 
>
> Split the 64-bit accesses in 32-bit accesses because there's no real
> constrain in MC to do only atomic 64-bit. There's only one place
> where ordering is important: when writing the MC command header the
> first 32-bit part of the header must be written last.
> We do this switch in order to allow compiling the driver on 32-bit.
>
> Signed-off-by: Laurentiu Tudor 
> ---
>  drivers/staging/fsl-mc/bus/mc-sys.c | 31 ---
>  1 file changed, 12 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
> b/drivers/staging/fsl-mc/bus/mc-sys.c
> index 195d9f3..dd2828e 100644
> --- a/drivers/staging/fsl-mc/bus/mc-sys.c
> +++ b/drivers/staging/fsl-mc/bus/mc-sys.c
> @@ -124,14 +124,15 @@ static inline void mc_write_command(struct mc_command 
> __iomem *portal,
>  {
> int i;
>
> -   /* copy command parameters into the portal */
> -   for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
> -   __raw_writeq(cmd->params[i], &portal->params[i]);
> -   /* ensure command params are committed before submitting it */
> -   wmb();
> -
> -   /* submit the command by writing the header */
> -   __raw_writeq(cmd->header, &portal->header);
> +   /*
> +* copy command parameters into the portal. Final write
> +* triggers the submission of the command.
> +*/
> +   for (i = sizeof(struct mc_command) / sizeof(u32) - 1; i >= 0; i--) {
> +   __raw_writel(((u32 *)cmd)[i], &((u32 *)portal)[i]);
> +   /* ensure command params are committed before submitting it */
> +   wmb();
> +   }
>  }

What is the byte order requirement on this buffer? If this is a byte string
rather than individual registers, you should probably just use
memcpy_toio(), but if these are separate registers, then using the
__raw_* accessors is still wrong, at least on kernels that have a
different byteorder from the hardware.

Also, are you sure that adding those six extra barriers has no
performance impact?

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


Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-17 Thread Hans Verkuil
On 14/07/17 11:36, Arnd Bergmann wrote:
> v4l2_subdev_call is a macro returning whatever the callback return
> type is, usually 'int'. With gcc-7 and ccache, this can lead to
> many wanings like:
> 
> media/platform/pxa_camera.c: In function 'pxa_mbus_build_fmts_xlate':
> media/platform/pxa_camera.c:766:27: error: ?: using integer constants in 
> boolean context [-Werror=int-in-bool-context]
>   while (!v4l2_subdev_call(subdev, pad, enum_mbus_code, NULL, &code)) {
> media/atomisp/pci/atomisp2/atomisp_cmd.c: In function 'atomisp_s_ae_window':
> media/atomisp/pci/atomisp2/atomisp_cmd.c:6414:52: error: ?: using integer 
> constants in boolean context [-Werror=int-in-bool-context]
>   if (v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
> 
> The best workaround I could come up with is to change all the
> callers that use the return code from v4l2_subdev_call() in an
> 'if' or 'while' condition.
> 
> In case of simple 'if' checks, adding a temporary variable is
> usually ok, and sometimes this can be used to propagate or
> print an error code, so I do that.
> 
> For the 'while' loops, I ended up adding an otherwise useless
> comparison with zero, which unfortunately makes the code a little
> uglied.
> 
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/media/pci/cx18/cx18-ioctl.c  |  6 --
>  drivers/media/pci/saa7146/mxb.c  |  5 +++--
>  drivers/media/platform/atmel/atmel-isc.c |  4 ++--
>  drivers/media/platform/atmel/atmel-isi.c |  4 ++--
>  drivers/media/platform/blackfin/bfin_capture.c   |  4 ++--
>  drivers/media/platform/omap3isp/ispccdc.c|  5 +++--
>  drivers/media/platform/pxa_camera.c  |  3 ++-
>  drivers/media/platform/rcar-vin/rcar-core.c  |  2 +-
>  drivers/media/platform/rcar-vin/rcar-dma.c   |  4 +++-
>  drivers/media/platform/soc_camera/soc_camera.c   |  4 ++--
>  drivers/media/platform/stm32/stm32-dcmi.c|  4 ++--
>  drivers/media/platform/ti-vpe/cal.c  |  6 --
>  drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 13 +++--
>  13 files changed, 37 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/media/pci/cx18/cx18-ioctl.c 
> b/drivers/media/pci/cx18/cx18-ioctl.c
> index 80b902b12a78..1803f28fc501 100644
> --- a/drivers/media/pci/cx18/cx18-ioctl.c
> +++ b/drivers/media/pci/cx18/cx18-ioctl.c
> @@ -188,6 +188,7 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, 
> void *fh,
>  {
>   struct cx18 *cx = fh2id(fh)->cx;
>   struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
> + int ret;
>  
>   /* sane, V4L2 spec compliant, defaults */
>   vbifmt->reserved[0] = 0;
> @@ -201,8 +202,9 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, 
> void *fh,
>* digitizer/slicer.  Note, cx18_av_vbi() wipes the passed in
>* fmt->fmt.sliced under valid calling conditions
>*/
> - if (v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced))
> - return -EINVAL;
> + ret = v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced);
> + if (ret)
> + return ret;

Please keep the -EINVAL here. I can't be 100% certain that returning 'ret' 
wouldn't
break something.

>  
>   vbifmt->service_set = cx18_get_service_set(vbifmt);
>   return 0;



> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c 
> b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
> index 97093baf28ac..fe56a037f065 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
> @@ -6405,19 +6405,20 @@ int atomisp_s_ae_window(struct atomisp_sub_device 
> *asd,
>   struct atomisp_device *isp = asd->isp;
>   /* Coverity CID 298071 - initialzize struct */
>   struct v4l2_subdev_selection sel = { 0 };
> + int ret;
>  
>   sel.r.left = arg->x_left;
>   sel.r.top = arg->y_top;
>   sel.r.width = arg->x_right - arg->x_left + 1;
>   sel.r.height = arg->y_bottom - arg->y_top + 1;
>  
> - if (v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
> -  pad, set_selection, NULL, &sel)) {
> - dev_err(isp->dev, "failed to call sensor set_selection.\n");
> - return -EINVAL;
> - }
> + ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
> +pad, set_selection, NULL, &sel);
> + if (ret)
> + dev_err(isp->dev, "failed to call sensor set_selection: %d\n",
> + ret);

Same here: just keep the 'return -EINVAL'.

>  
> - return 0;
> + return ret;
>  }
>  
>  int atomisp_flash_enable(struct atomisp_sub_device *asd, int num_frames)
> 

This is all very hackish, though. I'm not terribly keen on this patch. It's not
clear to me *why* these warnings appear in your setup.

Regards,

   

Re: [PATCH 2/7] staging: fsl-mc: use generic memory barriers

2017-07-17 Thread Laurentiu Tudor
On 07/17/2017 04:38 PM, Robin Murphy wrote:
> On 17/07/17 14:26, laurentiu.tu...@nxp.com wrote:
>> From: Laurentiu Tudor 
>>
>> No need to use arch-specific memory barriers; switch to using generic
>> ones. The rmb()s were useless so drop them.
>>
>> Signed-off-by: Laurentiu Tudor 
>> ---
>>   drivers/staging/fsl-mc/bus/mc-sys.c | 6 ++
>>   1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
>> b/drivers/staging/fsl-mc/bus/mc-sys.c
>> index a1704c3..012abd5 100644
>> --- a/drivers/staging/fsl-mc/bus/mc-sys.c
>> +++ b/drivers/staging/fsl-mc/bus/mc-sys.c
>> @@ -127,7 +127,8 @@ static inline void mc_write_command(struct mc_command 
>> __iomem *portal,
>>  /* copy command parameters into the portal */
>>  for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
>>  __raw_writeq(cmd->params[i], &portal->params[i]);
>> -__iowmb();
>> +/* ensure command params are committed before submitting it */
>> +wmb();
>>
>>  /* submit the command by writing the header */
>>  __raw_writeq(cmd->header, &portal->header);
>
> AFAICS, just using writeq() here should ensure sufficient order against
> the previous iomem accessors, without the need for explicit barriers.

Endianess is handled in the callers, this function should leave the raw 
data unchanged. So the raw version was chosen on purpose.

> Also, note that the __raw_*() variants aren't endian-safe, so consider
> updating things to *_relaxed() where ordering doesn't matter.
>

That's what i tried in the first place but encountered compilation 
errors on 32-bit powerpc & 32-bit x86 having to do with writeq/readq 
variants not being available (IIRC). So that's why i switched to the 
32-bit variants in the end.

---
Thanks & Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drivers: staging: ccree: use __func__ to get function name in error messages.

2017-07-17 Thread Dhananjay Balan
fixes checkpatch warning.

Signed-off-by: Dhananjay Balan 
---
 drivers/staging/ccree/ssi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_driver.c 
b/drivers/staging/ccree/ssi_driver.c
index d7b9a636d907..e0faca0a30a6 100644
--- a/drivers/staging/ccree/ssi_driver.c
+++ b/drivers/staging/ccree/ssi_driver.c
@@ -81,7 +81,7 @@ void dump_byte_array(const char *name, const u8 *the_array, 
unsigned long size)
char line_buf[80];
 
if (!the_array) {
-   SSI_LOG_ERR("cannot dump_byte_array - NULL pointer\n");
+   SSI_LOG_ERR("cannot %s - NULL pointer\n", __func__);
return;
}
 
-- 
2.13.2

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


Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-17 Thread Arnd Bergmann
On Mon, Jul 17, 2017 at 3:45 PM, Hans Verkuil  wrote:
> On 14/07/17 11:36, Arnd Bergmann wrote:
>> @@ -201,8 +202,9 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, 
>> void *fh,
>>* digitizer/slicer.  Note, cx18_av_vbi() wipes the passed in
>>* fmt->fmt.sliced under valid calling conditions
>>*/
>> - if (v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced))
>> - return -EINVAL;
>> + ret = v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced);
>> + if (ret)
>> + return ret;
>
> Please keep the -EINVAL here. I can't be 100% certain that returning 'ret' 
> wouldn't
> break something.

I think Dan was recommending the opposite here, if I understood you
both correctly:
he said we should propagate the error code unless we know it's wrong, while you
want to keep the current behavior to avoid introducing changes ;-)

I guess in either case, looking at the callers more carefully would be
a good idea.

>> - return 0;
>> + return ret;
>>  }
>>
>>  int atomisp_flash_enable(struct atomisp_sub_device *asd, int num_frames)
>>
>
> This is all very hackish, though. I'm not terribly keen on this patch. It's 
> not
> clear to me *why* these warnings appear in your setup.

it's possible that this only happened with 'ccache', which first preprocesses
the source and the passes it with v4l2_subdev_call expanded into the
compiler. This means the line looks like

if ((!(cx->sd_av) ? -ENODEV :
(((cx->sd_av)->ops->vbi && (cx->sd_av)->ops->vbi->g_sliced_fmt) ?
   (cx->sd_av)->ops->vbi->g_sliced_fmt(cx->sd_av)),
&fmt->fmt.sliced) :
   -ENOIOCTLCMD))

The compiler now complains about the sub-expression that it sees for
cx->sd_av==NULL:

   if (-ENODEV)

which it considers nonsense because it is always true and the value gets
ignored.

Let me try again without ccache for now and see what warnings remain.
We can find a solution for those first, and then decide how to deal with
ccache.

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


Re: [PATCH 6/7] staging: fsl-mc: rewrite mc command send/receive to work on 32-bits

2017-07-17 Thread Laurentiu Tudor
Hi Arnd,

On 07/17/2017 04:45 PM, Arnd Bergmann wrote:
> On Mon, Jul 17, 2017 at 3:26 PM,   wrote:
>> From: Laurentiu Tudor 
>>
>> Split the 64-bit accesses in 32-bit accesses because there's no real
>> constrain in MC to do only atomic 64-bit. There's only one place
>> where ordering is important: when writing the MC command header the
>> first 32-bit part of the header must be written last.
>> We do this switch in order to allow compiling the driver on 32-bit.
>>
>> Signed-off-by: Laurentiu Tudor 
>> ---
>>   drivers/staging/fsl-mc/bus/mc-sys.c | 31 ---
>>   1 file changed, 12 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
>> b/drivers/staging/fsl-mc/bus/mc-sys.c
>> index 195d9f3..dd2828e 100644
>> --- a/drivers/staging/fsl-mc/bus/mc-sys.c
>> +++ b/drivers/staging/fsl-mc/bus/mc-sys.c
>> @@ -124,14 +124,15 @@ static inline void mc_write_command(struct mc_command 
>> __iomem *portal,
>>   {
>>  int i;
>>
>> -   /* copy command parameters into the portal */
>> -   for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
>> -   __raw_writeq(cmd->params[i], &portal->params[i]);
>> -   /* ensure command params are committed before submitting it */
>> -   wmb();
>> -
>> -   /* submit the command by writing the header */
>> -   __raw_writeq(cmd->header, &portal->header);
>> +   /*
>> +* copy command parameters into the portal. Final write
>> +* triggers the submission of the command.
>> +*/
>> +   for (i = sizeof(struct mc_command) / sizeof(u32) - 1; i >= 0; i--) {
>> +   __raw_writel(((u32 *)cmd)[i], &((u32 *)portal)[i]);
>> +   /* ensure command params are committed before submitting it 
>> */
>> +   wmb();
>> +   }
>>   }
>
> What is the byte order requirement on this buffer?

Endianness is handled by the callers so this function must leave
the binary blob intact.

> If this is a byte string
> rather than individual registers, you should probably just use
> memcpy_toio()

It's a header followed by an opaque command. The protocol for queueing a 
command says that the first 32-bit half of the header must be written 
last, this triggering the command handling in the MC.

> but if these are separate registers, then using the
> __raw_* accessors is still wrong, at least on kernels that have a
> different byteorder from the hardware.

As mentioned above, endianness is handled by the caller. This function
takes raw data and must leave it unchanged.

> Also, are you sure that adding those six extra barriers has no
> performance impact?

This is a slow interface used in slow paths, so i don't think those 
extra barriers will have any performance impact.

---
Thanks & Best Regards, Laurentiu
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-17 Thread Dan Carpenter
On Mon, Jul 17, 2017 at 04:26:23PM +0200, Arnd Bergmann wrote:
> On Mon, Jul 17, 2017 at 3:45 PM, Hans Verkuil  wrote:
> > On 14/07/17 11:36, Arnd Bergmann wrote:
> >> @@ -201,8 +202,9 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file 
> >> *file, void *fh,
> >>* digitizer/slicer.  Note, cx18_av_vbi() wipes the passed in
> >>* fmt->fmt.sliced under valid calling conditions
> >>*/
> >> - if (v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced))
> >> - return -EINVAL;
> >> + ret = v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, 
> >> &fmt->fmt.sliced);
> >> + if (ret)
> >> + return ret;
> >
> > Please keep the -EINVAL here. I can't be 100% certain that returning 'ret' 
> > wouldn't
> > break something.
> 
> I think Dan was recommending the opposite here, if I understood you
> both correctly:
> he said we should propagate the error code unless we know it's wrong, while 
> you
> want to keep the current behavior to avoid introducing changes ;-)
> 

I don't know the subsystem rules at all, so don't listen to me.

regards,
dan carpenter

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


Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-17 Thread Hans Verkuil
On 17/07/17 16:26, Arnd Bergmann wrote:
> On Mon, Jul 17, 2017 at 3:45 PM, Hans Verkuil  wrote:
>> On 14/07/17 11:36, Arnd Bergmann wrote:
>>> @@ -201,8 +202,9 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, 
>>> void *fh,
>>>* digitizer/slicer.  Note, cx18_av_vbi() wipes the passed in
>>>* fmt->fmt.sliced under valid calling conditions
>>>*/
>>> - if (v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced))
>>> - return -EINVAL;
>>> + ret = v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, 
>>> &fmt->fmt.sliced);
>>> + if (ret)
>>> + return ret;
>>
>> Please keep the -EINVAL here. I can't be 100% certain that returning 'ret' 
>> wouldn't
>> break something.
> 
> I think Dan was recommending the opposite here, if I understood you
> both correctly:
> he said we should propagate the error code unless we know it's wrong, while 
> you
> want to keep the current behavior to avoid introducing changes ;-)
> 
> I guess in either case, looking at the callers more carefully would be
> a good idea.

The subtle problem here is that v4l2_subdev_call will return -ENOIOCTLCMD if
ops->vbi->g_sliced_fmt == NULL, which typically is not returned to userspace
but either ignored or replaced by another error. It indicates that the
sub device doesn't implement this operation, and it depends on the context
and the operation whether or not that is to be considered an error.

I have no clue what is expected here, without digging deep in the code.

Better to keep it as-is. It really isn't important to waste time on this.

> 
>>> - return 0;
>>> + return ret;
>>>  }
>>>
>>>  int atomisp_flash_enable(struct atomisp_sub_device *asd, int num_frames)
>>>
>>
>> This is all very hackish, though. I'm not terribly keen on this patch. It's 
>> not
>> clear to me *why* these warnings appear in your setup.
> 
> it's possible that this only happened with 'ccache', which first preprocesses
> the source and the passes it with v4l2_subdev_call expanded into the
> compiler. This means the line looks like
> 
> if ((!(cx->sd_av) ? -ENODEV :
> (((cx->sd_av)->ops->vbi && (cx->sd_av)->ops->vbi->g_sliced_fmt) ?
>(cx->sd_av)->ops->vbi->g_sliced_fmt(cx->sd_av)),
> &fmt->fmt.sliced) :
>-ENOIOCTLCMD))
> 
> The compiler now complains about the sub-expression that it sees for
> cx->sd_av==NULL:
> 
>if (-ENODEV)
> 
> which it considers nonsense because it is always true and the value gets
> ignored.
> 
> Let me try again without ccache for now and see what warnings remain.
> We can find a solution for those first, and then decide how to deal with
> ccache.

Sounds good.

I'm OK with applying this if there is no other way to prevent these warnings.

Regards,

Hans

> 
> Arnd
> 


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


Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-17 Thread Hans Verkuil
On 17/07/17 16:26, Arnd Bergmann wrote:
> On Mon, Jul 17, 2017 at 3:45 PM, Hans Verkuil  wrote:
>> On 14/07/17 11:36, Arnd Bergmann wrote:
>>> @@ -201,8 +202,9 @@ static int cx18_g_fmt_sliced_vbi_cap(struct file *file, 
>>> void *fh,
>>>* digitizer/slicer.  Note, cx18_av_vbi() wipes the passed in
>>>* fmt->fmt.sliced under valid calling conditions
>>>*/
>>> - if (v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, &fmt->fmt.sliced))
>>> - return -EINVAL;
>>> + ret = v4l2_subdev_call(cx->sd_av, vbi, g_sliced_fmt, 
>>> &fmt->fmt.sliced);
>>> + if (ret)
>>> + return ret;
>>
>> Please keep the -EINVAL here. I can't be 100% certain that returning 'ret' 
>> wouldn't
>> break something.
> 
> I think Dan was recommending the opposite here, if I understood you
> both correctly:
> he said we should propagate the error code unless we know it's wrong, while 
> you
> want to keep the current behavior to avoid introducing changes ;-)
> 
> I guess in either case, looking at the callers more carefully would be
> a good idea.

The subtle problem here is that v4l2_subdev_call will return -ENOIOCTLCMD if
ops->vbi->g_sliced_fmt == NULL, which typically is not returned to userspace
but either ignored or replaced by another error. It indicates that the
sub device doesn't implement this operation, and it depends on the context
and the operation whether or not that is to be considered an error.

I have no clue what is expected here, without digging deep in the code.

Better to keep it as-is. It really isn't important to waste time on this.

> 
>>> - return 0;
>>> + return ret;
>>>  }
>>>
>>>  int atomisp_flash_enable(struct atomisp_sub_device *asd, int num_frames)
>>>
>>
>> This is all very hackish, though. I'm not terribly keen on this patch. It's 
>> not
>> clear to me *why* these warnings appear in your setup.
> 
> it's possible that this only happened with 'ccache', which first preprocesses
> the source and the passes it with v4l2_subdev_call expanded into the
> compiler. This means the line looks like
> 
> if ((!(cx->sd_av) ? -ENODEV :
> (((cx->sd_av)->ops->vbi && (cx->sd_av)->ops->vbi->g_sliced_fmt) ?
>(cx->sd_av)->ops->vbi->g_sliced_fmt(cx->sd_av)),
> &fmt->fmt.sliced) :
>-ENOIOCTLCMD))
> 
> The compiler now complains about the sub-expression that it sees for
> cx->sd_av==NULL:
> 
>if (-ENODEV)
> 
> which it considers nonsense because it is always true and the value gets
> ignored.
> 
> Let me try again without ccache for now and see what warnings remain.
> We can find a solution for those first, and then decide how to deal with
> ccache.

Sounds good.

I'm OK with applying this if there is no other way to prevent these warnings.

Regards,

Hans

> 
> Arnd
> 


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


[PATCH v1] staging: rts5208: Change fixed function names with "%s: ", __func__

2017-07-17 Thread Gaurav Pathak
staging: rts5208: Fix coding style issue caught by checkpatch.pl related to
function name in debug print and shorten few lines over 80 char

Signed-off-by: Gaurav Pathak 
---
 drivers/staging/rts5208/ms.c|  5 +++--
 drivers/staging/rts5208/rtsx.c  |  4 ++--
 drivers/staging/rts5208/rtsx_chip.c |  4 ++--
 drivers/staging/rts5208/sd.c| 28 +++-
 drivers/staging/rts5208/spi.c   |  8 +---
 drivers/staging/rts5208/xd.c| 17 ++---
 6 files changed, 37 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index 482a29d..7cdce87 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -3064,7 +3064,8 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb,
 
if (detect_card_cd(chip, MS_CARD) != STATUS_SUCCESS) {
chip->rw_need_retry = 0;
-   dev_dbg(rtsx_dev(chip), "No card exist, exit 
mspro_rw_multi_sector\n");
+   dev_dbg(rtsx_dev(chip), "No card exist, exit %s\n",
+   __func__);
rtsx_trace(chip);
return STATUS_FAIL;
}
@@ -3101,7 +3102,7 @@ static int mspro_read_format_progress(struct rtsx_chip 
*chip,
u8 cnt, tmp;
u8 data[8];
 
-   dev_dbg(rtsx_dev(chip), "mspro_read_format_progress, short_data_len = 
%d\n",
+   dev_dbg(rtsx_dev(chip), "%s, short_data_len = %d\n", __func__,
short_data_len);
 
retval = ms_switch_clock(chip);
diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index b8177f5..53748d6 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -999,7 +999,7 @@ static int rtsx_probe(struct pci_dev *pci,
 
/* We come here if there are any problems */
 errout:
-   dev_err(&pci->dev, "rtsx_probe() failed\n");
+   dev_err(&pci->dev, "%s failed\n", __func__);
release_everything(dev);
 
return err;
@@ -1009,7 +1009,7 @@ static void rtsx_remove(struct pci_dev *pci)
 {
struct rtsx_dev *dev = pci_get_drvdata(pci);
 
-   dev_info(&pci->dev, "rtsx_remove() called\n");
+   dev_info(&pci->dev, "%s called\n", __func__);
 
quiesce_and_remove_host(dev);
release_everything(dev);
diff --git a/drivers/staging/rts5208/rtsx_chip.c 
b/drivers/staging/rts5208/rtsx_chip.c
index 7f4107b..4ad472d 100644
--- a/drivers/staging/rts5208/rtsx_chip.c
+++ b/drivers/staging/rts5208/rtsx_chip.c
@@ -616,8 +616,8 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
else
retval = rtsx_pre_handle_sdio_new(chip);
 
-   dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x 
(rtsx_reset_chip)\n",
-   (unsigned int)(chip->need_reset));
+   dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n",
+   (unsigned int)(chip->need_reset), __func__);
 #else  /* HW_AUTO_SWITCH_SD_BUS */
retval = rtsx_pre_handle_sdio_old(chip);
 #endif  /* HW_AUTO_SWITCH_SD_BUS */
diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index c2eb072..e2b1fa03 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -910,8 +910,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 
sample_point, u8 tune_dir)
int retval;
bool ddr_rx = false;
 
-   dev_dbg(rtsx_dev(chip), "sd_change_phase (sample_point = %d, tune_dir = 
%d)\n",
-   sample_point, tune_dir);
+   dev_dbg(rtsx_dev(chip), "%s (sample_point = %d, tune_dir = %d)\n",
+   __func__, sample_point, tune_dir);
 
if (tune_dir == TUNE_RX) {
SD_VP_CTL = SD_VPRX_CTL;
@@ -1225,8 +1225,9 @@ static int sd_check_switch_mode(struct rtsx_chip *chip, 
u8 mode, u8 func_group,
int retval;
u8 cmd[5], buf[64];
 
-   dev_dbg(rtsx_dev(chip), "sd_check_switch_mode (mode = %d, func_group = 
%d, func_to_switch = %d)\n",
-   mode, func_group, func_to_switch);
+   dev_dbg(rtsx_dev(chip), "%s ", __func__);
+   dev_dbg(rtsx_dev(chip), "mode = %d, func_group = %d,", mode, 
func_group);
+   dev_dbg(rtsx_dev(chip), "func_to_switch = %d)\n", func_to_switch);
 
cmd[0] = 0x40 | SWITCH;
cmd[1] = mode;
@@ -3575,7 +3576,7 @@ static int reset_mmc_only(struct rtsx_chip *chip)
return STATUS_FAIL;
}
 
-   dev_dbg(rtsx_dev(chip), "In reset_mmc_only, sd_card->sd_type = 0x%x\n",
+   dev_dbg(rtsx_dev(chip), "In %s, sd_card->sd_type = 0x%x\n", __func__,
sd_card->sd_type);
 
return STATUS_SUCCESS;
@@ -3699,11 +3700,11 @@ int sd_rw(struct scsi_cmnd *srb, struct rtsx_chip 
*chip, u32 start_sector,
int retval;
 
if (srb->sc_data_direction == DMA_FROM_DEVICE) {
-   dev_dbg(rtsx_dev(chip), "sd_rw: Read %d %s from 0x%x\n",
+  

[BUG] drivers: staging: comedi: do not call blocking ops when !TASK_RUNNING; state=1

2017-07-17 Thread Piotr Gregor
Calling blocking operations from wrong context.
Kernel:

Linux piotrpc 4.4.70-rt83 #1 SMP PREEMPT RT Thu Jul 13 08:42:02 BST 2017 x86_64 
GNU/Linux

[   80.542018] NOHZ: local_softirq_pending 80
[  125.175471] [ cut here ]
[  125.175491] WARNING: CPU: 0 PID: 1497 at kernel/sched/core.c:7833 
__might_sleep+0x9f/0xb0()
[  125.175728] do not call blocking ops when !TASK_RUNNING; state=1 set at 
[] comedi_read+0x1a1/0x610 [comedi]
[  125.175735] Modules linked in: cpufreq_conservative cpufreq_powersave 
cpufreq_userspace cfg80211 nfsd auth_rpcgss oid_registry nfs_acl nfs lockd 
grace fscache sunrpc nls_ascii nls_cp437 vfat fat snd_hda_codec_hdmi 
snd_hda_codec_realtek snd_hda_codec_generic intel_rapl joydev intel_powerclamp 
coretemp kvm drbg efi_pstore ansi_cprng irqbypass crct10dif_pclmul crc32_pclmul 
ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper 
cryptd i915 serio_raw pcspkr efivars snd_hda_intel amplc_dio200_pci(C) 
amplc_dio200_common(C) snd_hda_codec iTCO_wdt comedi_8254(C) comedi_pci(C) 
iTCO_vendor_support comedi(C) snd_hda_core snd_hwdep snd_pcm drm_kms_helper 
snd_timer drm snd mei_me soundcore mei i2c_algo_bit shpchp eeepc_wmi asus_wmi 
sparse_keymap mxm_wmi battery hci_uart btbcm btqca btintel
[  125.175824]  bluetooth
[  125.175825]  wmi
[  125.175826]  rfkill
[  125.175827]  video
[  125.175828]  intel_lpss_acpi
[  125.175830]  intel_lpss
[  125.175831]  evdev
[  125.175832]  mfd_core
[  125.175833]  acpi_als
[  125.175834]  acpi_pad
[  125.175835]  kfifo_buf
[  125.175836]  button
[  125.175838]  industrialio
[  125.175839]  fuse
[  125.175840]  parport_pc
[  125.175841]  ppdev
[  125.175842]  lp
[  125.175843]  parport
[  125.175844]  autofs4
[  125.175845]  ext4
[  125.175846]  crc16
[  125.175847]  mbcache
[  125.175848]  jbd2
[  125.175849]  hid_generic
[  125.175851]  usbhid
[  125.175852]  sg
[  125.175853]  sr_mod
[  125.175854]  cdrom
[  125.175855]  sd_mod
[  125.175856]  crc32c_intel
[  125.175857]  ahci
[  125.175858]  libahci
[  125.175859]  psmouse
[  125.175860]  xhci_pci
[  125.175861]  libata
[  125.175862]  r8169
[  125.175864]  i2c_i801
[  125.175865]  mii
[  125.175866]  xhci_hcd
[  125.175867]  tg3
[  125.175868]  ptp
[  125.175869]  scsi_mod
[  125.175870]  usbcore
[  125.175871]  pps_core
[  125.175872]  libphy
[  125.175873]  usb_common
[  125.175874]  fan
[  125.175875]  thermal
[  125.175876]  i2c_hid
[  125.175877]  hid
[  125.175878]  fjes

[  125.175926] CPU: 0 PID: 1497 Comm: txrx Tainted: GWC  
4.4.70-rt83 #1
[  125.175928] Hardware name: NOVATECH LTD PC-XB04472/H110M-C, BIOS 3019 
01/06/2017
[  125.175935]   8802205b3cb0 81387160 
8802205b3cf8
[  125.175940]  0009 8802205b3ce8 81089766 
c057ca60
[  125.175944]  02dc  0001 
0001
[  125.175945] Call Trace:
[  125.175955]  [] dump_stack+0x85/0xc5
[  125.175963]  [] warn_slowpath_common+0x86/0xe0
[  125.175971]  [] warn_slowpath_fmt+0x4c/0x50
[  125.175980]  [] ? trace_preempt_on+0x1a7/0x2b0
[  125.175985]  [] ? schedule+0x55/0xe0
[  125.175994]  [] ? comedi_read+0x1a1/0x610 [comedi]
[  125.176001]  [] ? comedi_read+0x1a1/0x610 [comedi]
[  125.176005]  [] __might_sleep+0x9f/0xb0
[  125.176012]  [] __might_fault+0x3b/0xb0
[  125.176020]  [] comedi_read+0x3df/0x610 [comedi]
[  125.176034]  [] ? wake_up_process+0x20/0x20
[  125.176044]  [] __vfs_read+0x28/0xe0
[  125.176053]  [] ? security_file_permission+0xa6/0xc0
[  125.176060]  [] ? rw_verify_area+0x53/0xf0
[  125.176066]  [] vfs_read+0x89/0x130
[  125.176074]  [] SyS_read+0x49/0xb0
[  125.176084]  [] entry_SYSCALL_64_fastpath+0x16/0x7a
[  125.176095] ---[ end trace 0003 ]---


cheers,
Piotr


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


Re: [PATCH 6/7] staging: fsl-mc: rewrite mc command send/receive to work on 32-bits

2017-07-17 Thread Arnd Bergmann
On Mon, Jul 17, 2017 at 4:27 PM, Laurentiu Tudor
 wrote:
> Hi Arnd,
>
> On 07/17/2017 04:45 PM, Arnd Bergmann wrote:
>> On Mon, Jul 17, 2017 at 3:26 PM,   wrote:
>>> From: Laurentiu Tudor 
>>>
>>> Split the 64-bit accesses in 32-bit accesses because there's no real
>>> constrain in MC to do only atomic 64-bit. There's only one place
>>> where ordering is important: when writing the MC command header the
>>> first 32-bit part of the header must be written last.
>>> We do this switch in order to allow compiling the driver on 32-bit.
>>>
>>> Signed-off-by: Laurentiu Tudor 
>>> ---
>>>   drivers/staging/fsl-mc/bus/mc-sys.c | 31 ---
>>>   1 file changed, 12 insertions(+), 19 deletions(-)
>>>
>>> diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
>>> b/drivers/staging/fsl-mc/bus/mc-sys.c
>>> index 195d9f3..dd2828e 100644
>>> --- a/drivers/staging/fsl-mc/bus/mc-sys.c
>>> +++ b/drivers/staging/fsl-mc/bus/mc-sys.c
>>> @@ -124,14 +124,15 @@ static inline void mc_write_command(struct mc_command 
>>> __iomem *portal,
>>>   {
>>>  int i;
>>>
>>> -   /* copy command parameters into the portal */
>>> -   for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
>>> -   __raw_writeq(cmd->params[i], &portal->params[i]);
>>> -   /* ensure command params are committed before submitting it */
>>> -   wmb();
>>> -
>>> -   /* submit the command by writing the header */
>>> -   __raw_writeq(cmd->header, &portal->header);
>>> +   /*
>>> +* copy command parameters into the portal. Final write
>>> +* triggers the submission of the command.
>>> +*/
>>> +   for (i = sizeof(struct mc_command) / sizeof(u32) - 1; i >= 0; i--) {
>>> +   __raw_writel(((u32 *)cmd)[i], &((u32 *)portal)[i]);
>>> +   /* ensure command params are committed before submitting it 
>>> */
>>> +   wmb();
>>> +   }
>>>   }
>>
>> What is the byte order requirement on this buffer?
>
> Endianness is handled by the callers so this function must leave
> the binary blob intact.

Got it, the endianess looks correct indeed.

>> If this is a byte string
>> rather than individual registers, you should probably just use
>> memcpy_toio()
>
> It's a header followed by an opaque command. The protocol for queueing a
> command says that the first 32-bit half of the header must be written
> last, this triggering the command handling in the MC.

Strictly speaking the __raw_writel() won't guarantee that the
data is written as a single word, the compiler might decide to
split it up into byte-sized writes if it believes the destination pointer
is unaligned and the CPU has no efficient writes.

I think this cannot happen on arm or powerpc, as we go through
inline assembly for the store, but it's not completely portable.

Before your patch, both the compiler and the CPU could also
reorder the stores in theory (but normally won't), but the wmb()
will prevent that now.

>> but if these are separate registers, then using the
>> __raw_* accessors is still wrong, at least on kernels that have a
>> different byteorder from the hardware.
>
> As mentioned above, endianness is handled by the caller. This function
> takes raw data and must leave it unchanged.
>
>> Also, are you sure that adding those six extra barriers has no
>> performance impact?
>
> This is a slow interface used in slow paths, so i don't think those
> extra barriers will have any performance impact.

Ok.

One other problem remains: most developers looking at this
code like Robin and me will immediately think there might be
an endianess bug here. As this is a slow path, how about
using an explicit conversion using

 writeq(le64_to_cpup(buffer), pointer);

with a comment? That would explain what's going on and
escape people looking for incorrect __raw_writeq() uses.
I would expect that the compiler can actually drop the
double byteswap here by itself, and even if it doesn't,
the extra swaps won't cause noticeable overhead compared
to the barriers.

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


Re: [PATCH 6/7] staging: fsl-mc: rewrite mc command send/receive to work on 32-bits

2017-07-17 Thread Laurentiu Tudor
Hi Robin,

On 07/17/2017 04:43 PM, Robin Murphy wrote:
> On 17/07/17 14:26, laurentiu.tu...@nxp.com wrote:
>> From: Laurentiu Tudor 
>>
>> Split the 64-bit accesses in 32-bit accesses because there's no real
>> constrain in MC to do only atomic 64-bit. There's only one place
>> where ordering is important: when writing the MC command header the
>> first 32-bit part of the header must be written last.
>> We do this switch in order to allow compiling the driver on 32-bit.
>
> #include 
>
> Then you can just use writeq()/writeq_relaxed()/readq_relaxed() on
> 32-bit platforms as well.
>

Thanks, didn't knew of the header. This should take care of the 
compilation errors i was seeing. There's one problem though: these 
handle byte-ordering and i need raw accessors. :-(

---
Best Regards, Laurentiu

>> Signed-off-by: Laurentiu Tudor 
>> ---
>>   drivers/staging/fsl-mc/bus/mc-sys.c | 31 ---
>>   1 file changed, 12 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/mc-sys.c 
>> b/drivers/staging/fsl-mc/bus/mc-sys.c
>> index 195d9f3..dd2828e 100644
>> --- a/drivers/staging/fsl-mc/bus/mc-sys.c
>> +++ b/drivers/staging/fsl-mc/bus/mc-sys.c
>> @@ -124,14 +124,15 @@ static inline void mc_write_command(struct mc_command 
>> __iomem *portal,
>>   {
>>  int i;
>>
>> -/* copy command parameters into the portal */
>> -for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
>> -__raw_writeq(cmd->params[i], &portal->params[i]);
>> -/* ensure command params are committed before submitting it */
>> -wmb();
>> -
>> -/* submit the command by writing the header */
>> -__raw_writeq(cmd->header, &portal->header);
>> +/*
>> + * copy command parameters into the portal. Final write
>> + * triggers the submission of the command.
>> + */
>> +for (i = sizeof(struct mc_command) / sizeof(u32) - 1; i >= 0; i--) {
>> +__raw_writel(((u32 *)cmd)[i], &((u32 *)portal)[i]);
>> +/* ensure command params are committed before submitting it */
>> +wmb();
>> +}
>>   }
>>
>>   /**
>> @@ -148,19 +149,11 @@ static inline enum mc_cmd_status 
>> mc_read_response(struct mc_command __iomem *
>>struct mc_command *resp)
>>   {
>>  int i;
>> -enum mc_cmd_status status;
>> -
>> -/* Copy command response header from MC portal: */
>> -resp->header = __raw_readq(&portal->header);
>> -status = mc_cmd_hdr_read_status(resp);
>> -if (status != MC_CMD_STATUS_OK)
>> -return status;
>>
>> -/* Copy command response data from MC portal: */
>> -for (i = 0; i < MC_CMD_NUM_OF_PARAMS; i++)
>> -resp->params[i] = __raw_readq(&portal->params[i]);
>> +for (i = 0; i < sizeof(struct mc_command) / sizeof(u32); i++)
>> +((u32 *)resp)[i] = __raw_readl(&((u32 *)portal)[i]);
>>
>> -return status;
>> +return mc_cmd_hdr_read_status(resp);
>>   }
>>
>>   /**
>>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 03/10] x86/hyper-v: make hv_do_hypercall() inline

2017-07-17 Thread Greg KH
On Sun, Jun 25, 2017 at 10:06:42AM -0700, k...@exchange.microsoft.com wrote:
> From: Vitaly Kuznetsov 
> 
> We have only three call sites for hv_do_hypercall() and we're going to
> change HVCALL_SIGNAL_EVENT to doing fast hypercall so we can inline this
> function for optimization.
> 
> Hyper-V top level functional specification states that r9-r11 registers
> and flags may be clobbered by the hypervisor during hypercall and with
> inlining this is somewhat important, add the clobbers.
> 
> Signed-off-by: Vitaly Kuznetsov 
> Reviewed-by: Andy Shevchenko 
> Signed-off-by: K. Y. Srinivasan 

This patch breaks the build, so can you please rebase and resend this,
and the rest of this series, if you wish to have it applied?

thanks,

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


Re: [BUG] drivers: staging: comedi: do not call blocking ops when !TASK_RUNNING; state=1

2017-07-17 Thread Ian Abbott

On 17/07/17 15:48, Piotr Gregor wrote:

Calling blocking operations from wrong context.
Kernel:

Linux piotrpc 4.4.70-rt83 #1 SMP PREEMPT RT Thu Jul 13 08:42:02 BST 2017 x86_64 
GNU/Linux

[   80.542018] NOHZ: local_softirq_pending 80
[  125.175471] [ cut here ]
[  125.175491] WARNING: CPU: 0 PID: 1497 at kernel/sched/core.c:7833 
__might_sleep+0x9f/0xb0()
[  125.175728] do not call blocking ops when !TASK_RUNNING; state=1 set at 
[] comedi_read+0x1a1/0x610 [comedi]
[  125.175735] Modules linked in: cpufreq_conservative cpufreq_powersave 
cpufreq_userspace cfg80211 nfsd auth_rpcgss oid_registry nfs_acl nfs lockd 
grace fscache sunrpc nls_ascii nls_cp437 vfat fat snd_hda_codec_hdmi 
snd_hda_codec_realtek snd_hda_codec_generic intel_rapl joydev intel_powerclamp 
coretemp kvm drbg efi_pstore ansi_cprng irqbypass crct10dif_pclmul crc32_pclmul 
ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper 
cryptd i915 serio_raw pcspkr efivars snd_hda_intel amplc_dio200_pci(C) 
amplc_dio200_common(C) snd_hda_codec iTCO_wdt comedi_8254(C) comedi_pci(C) 
iTCO_vendor_support comedi(C) snd_hda_core snd_hwdep snd_pcm drm_kms_helper 
snd_timer drm snd mei_me soundcore mei i2c_algo_bit shpchp eeepc_wmi asus_wmi 
sparse_keymap mxm_wmi battery hci_uart btbcm btqca btintel
[  125.175824]  bluetooth
[  125.175825]  wmi
[  125.175826]  rfkill
[  125.175827]  video
[  125.175828]  intel_lpss_acpi
[  125.175830]  intel_lpss
[  125.175831]  evdev
[  125.175832]  mfd_core
[  125.175833]  acpi_als
[  125.175834]  acpi_pad
[  125.175835]  kfifo_buf
[  125.175836]  button
[  125.175838]  industrialio
[  125.175839]  fuse
[  125.175840]  parport_pc
[  125.175841]  ppdev
[  125.175842]  lp
[  125.175843]  parport
[  125.175844]  autofs4
[  125.175845]  ext4
[  125.175846]  crc16
[  125.175847]  mbcache
[  125.175848]  jbd2
[  125.175849]  hid_generic
[  125.175851]  usbhid
[  125.175852]  sg
[  125.175853]  sr_mod
[  125.175854]  cdrom
[  125.175855]  sd_mod
[  125.175856]  crc32c_intel
[  125.175857]  ahci
[  125.175858]  libahci
[  125.175859]  psmouse
[  125.175860]  xhci_pci
[  125.175861]  libata
[  125.175862]  r8169
[  125.175864]  i2c_i801
[  125.175865]  mii
[  125.175866]  xhci_hcd
[  125.175867]  tg3
[  125.175868]  ptp
[  125.175869]  scsi_mod
[  125.175870]  usbcore
[  125.175871]  pps_core
[  125.175872]  libphy
[  125.175873]  usb_common
[  125.175874]  fan
[  125.175875]  thermal
[  125.175876]  i2c_hid
[  125.175877]  hid
[  125.175878]  fjes

[  125.175926] CPU: 0 PID: 1497 Comm: txrx Tainted: GWC  
4.4.70-rt83 #1
[  125.175928] Hardware name: NOVATECH LTD PC-XB04472/H110M-C, BIOS 3019 
01/06/2017
[  125.175935]   8802205b3cb0 81387160 
8802205b3cf8
[  125.175940]  0009 8802205b3ce8 81089766 
c057ca60
[  125.175944]  02dc  0001 
0001
[  125.175945] Call Trace:
[  125.175955]  [] dump_stack+0x85/0xc5
[  125.175963]  [] warn_slowpath_common+0x86/0xe0
[  125.175971]  [] warn_slowpath_fmt+0x4c/0x50
[  125.175980]  [] ? trace_preempt_on+0x1a7/0x2b0
[  125.175985]  [] ? schedule+0x55/0xe0
[  125.175994]  [] ? comedi_read+0x1a1/0x610 [comedi]
[  125.176001]  [] ? comedi_read+0x1a1/0x610 [comedi]
[  125.176005]  [] __might_sleep+0x9f/0xb0
[  125.176012]  [] __might_fault+0x3b/0xb0
[  125.176020]  [] comedi_read+0x3df/0x610 [comedi]
[  125.176034]  [] ? wake_up_process+0x20/0x20
[  125.176044]  [] __vfs_read+0x28/0xe0
[  125.176053]  [] ? security_file_permission+0xa6/0xc0
[  125.176060]  [] ? rw_verify_area+0x53/0xf0
[  125.176066]  [] vfs_read+0x89/0x130
[  125.176074]  [] SyS_read+0x49/0xb0
[  125.176084]  [] entry_SYSCALL_64_fastpath+0x16/0x7a
[  125.176095] ---[ end trace 0003 ]---


cheers,
Piotr


Thanks for the bug report.  I think comedi_read() in 
"drivers/staging/comedi/comedi_fops.c" needs a call to 
set_current_state(TASK_RUNNING) just before the call to copy_to_user(...).


Similarly, comedi_write() needs a call to set_current_task(TASK_RUNNING) 
just before the call to copy_from_user(...), and another call to 
set_current_task(TASK_RUNNING) before the call to mutex_lock().


I'll work on a patch.

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 0/1] Staging: android/ion: fix sparse warnings

2017-07-17 Thread Joseph Wright
Improve commit message.

Previous version included a patch to add declarations to ion.h, but I
have dropped that as the same declarations were recently removed.

Joseph Wright (1):
  Staging: android/ion: declare function static

 drivers/staging/android/ion/ion_cma_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.3

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


[PATCH v3 1/1] Staging: android/ion: declare function static

2017-07-17 Thread Joseph Wright
Declare private function static to fix sparse warning:

ion_cma_heap.c:109:5: warning: symbol '__ion_add_cma_heaps' \
was not declared. Should it be static?

Signed-off-by: Joseph Wright 
---
Changes in v3:
  - Make subject clearer

 drivers/staging/android/ion/ion_cma_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_cma_heap.c 
b/drivers/staging/android/ion/ion_cma_heap.c
index a0949bc..c6db9b7 100644
--- a/drivers/staging/android/ion/ion_cma_heap.c
+++ b/drivers/staging/android/ion/ion_cma_heap.c
@@ -106,7 +106,7 @@ static struct ion_heap *__ion_cma_heap_create(struct cma 
*cma)
return &cma_heap->heap;
 }
 
-int __ion_add_cma_heaps(struct cma *cma, void *data)
+static int __ion_add_cma_heaps(struct cma *cma, void *data)
 {
struct ion_heap *heap;
 
-- 
2.9.3

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


[PATCH 1/1] rtl8188eu: add TL-WN722N v2 support

2017-07-17 Thread Michael Gugino
Add support for USB Device TP-Link TL-WN722N v2.
VendorID: 0x2357, ProductID: 0x010c

Signed-off-by: Michael Gugino 
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c 
b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 963235f..d283341 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -43,6 +43,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
{USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
{USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
+   {USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
{}  /* Terminating entry */
 };
-- 
2.7.4

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


[PATCH 1/1] staging: rtl8188eu: add TL-WN722N v2 support

2017-07-17 Thread Michael Gugino
Add support for USB Device TP-Link TL-WN722N v2.
VendorID: 0x2357, ProductID: 0x010c

Signed-off-by: Michael Gugino 
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c 
b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 963235f..d283341 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -43,6 +43,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
{USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
{USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
+   {USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
{}  /* Terminating entry */
 };
-- 
2.7.4

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


Re: [PATCH v2 4/4] Staging: Lustre Fix block statement style issue

2017-07-17 Thread Dilger, Andreas
On Jul 12, 2017, at 03:03, Craig Inches  wrote:
> 
> This fixes a block statement which didnt end with */
> 
> Signed-off-by: Craig Inches 
> ---
> drivers/staging/lustre/include/linux/lnet/socklnd.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h 
> b/drivers/staging/lustre/include/linux/lnet/socklnd.h
> index dd5bc0e46560..a1ae66ede7a8 100644
> --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h
> +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h
> @@ -76,7 +76,8 @@ struct ksock_msg {
>   __u64   ksm_zc_cookies[2];  /* Zero-Copy request/ACK cookie */
>   union {
>   struct ksock_lnet_msg lnetmsg; /* lnet message, it's empty if
> -   * it's NOOP */
> + * it's NOOP
> + */

Rather than making the multi-line comments even more space consuming (I'm not a 
big
fan of "*/ must be on a line by itself" since it wastes a lot of vertical 
space),
I'd prefer to just shorten the comment, if possible, like:

struct ksock_lnet_msg lnetmsg; /* lnet message, empty if NOOP */

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation







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


Re: [PATCH v2 4/4] Staging: Lustre Fix block statement style issue

2017-07-17 Thread Craig Inches
On Mon, Jul 17, 2017 at 05:44:59PM +, Dilger, Andreas wrote:
> On Jul 12, 2017, at 03:03, Craig Inches  wrote:
> > 
> > This fixes a block statement which didnt end with */
> > 
> > Signed-off-by: Craig Inches 
> > ---
> > drivers/staging/lustre/include/linux/lnet/socklnd.h | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h 
> > b/drivers/staging/lustre/include/linux/lnet/socklnd.h
> > index dd5bc0e46560..a1ae66ede7a8 100644
> > --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h
> > +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h
> > @@ -76,7 +76,8 @@ struct ksock_msg {
> > __u64   ksm_zc_cookies[2];  /* Zero-Copy request/ACK cookie */
> > union {
> > struct ksock_lnet_msg lnetmsg; /* lnet message, it's empty if
> > - * it's NOOP */
> > +   * it's NOOP
> > +   */
> 
> Rather than making the multi-line comments even more space consuming (I'm not 
> a big
> fan of "*/ must be on a line by itself" since it wastes a lot of vertical 
> space),
> I'd prefer to just shorten the comment, if possible, like:
> 
>   struct ksock_lnet_msg lnetmsg; /* lnet message, empty if NOOP */

That makes sense, I believe the series has already made it to
staging-next, so not sure what the process would be to fix it up.

I am doing another set of style fixes which I can include this change
aswell.

Cheers,

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


Re: [PATCH v2 4/4] Staging: Lustre Fix block statement style issue

2017-07-17 Thread Dan Carpenter
On Mon, Jul 17, 2017 at 05:50:27PM +, Craig Inches wrote:
> On Mon, Jul 17, 2017 at 05:44:59PM +, Dilger, Andreas wrote:
> > On Jul 12, 2017, at 03:03, Craig Inches  wrote:
> > > 
> > > This fixes a block statement which didnt end with */
> > > 
> > > Signed-off-by: Craig Inches 
> > > ---
> > > drivers/staging/lustre/include/linux/lnet/socklnd.h | 3 ++-
> > > 1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/staging/lustre/include/linux/lnet/socklnd.h 
> > > b/drivers/staging/lustre/include/linux/lnet/socklnd.h
> > > index dd5bc0e46560..a1ae66ede7a8 100644
> > > --- a/drivers/staging/lustre/include/linux/lnet/socklnd.h
> > > +++ b/drivers/staging/lustre/include/linux/lnet/socklnd.h
> > > @@ -76,7 +76,8 @@ struct ksock_msg {
> > >   __u64   ksm_zc_cookies[2];  /* Zero-Copy request/ACK cookie */
> > >   union {
> > >   struct ksock_lnet_msg lnetmsg; /* lnet message, it's empty if
> > > -   * it's NOOP */
> > > + * it's NOOP
> > > + */
> > 
> > Rather than making the multi-line comments even more space consuming (I'm 
> > not a big
> > fan of "*/ must be on a line by itself" since it wastes a lot of vertical 
> > space),
> > I'd prefer to just shorten the comment, if possible, like:
> > 
> > struct ksock_lnet_msg lnetmsg; /* lnet message, empty if NOOP */
> 
> That makes sense, I believe the series has already made it to
> staging-next, so not sure what the process would be to fix it up.

staging-next can't be rebased (barring something very drastic).  Send a
new patch based on what's been committed.

regards,
dan carpenter

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


Re: [BUG] drivers: staging: comedi: do not call blocking ops when !TASK_RUNNING; state=1

2017-07-17 Thread Piotr Gregor
Hi Ian,

I am afraid I have more problems with running Comedi on rt-patched kernel than
only that. I am still trying to figure out the specific reason - hopefully it is
my fault and I scrued up my own code, but so far it seems pcie215
support doesn't work at least in the same way on rt-patched kernel
as it was on non-rt. I will dig it a little bit harder, likely coming with 
another
bug reports shoud they be observed.

Do you know about other experience other people may have using Comedi
for pcie215 on rt-patched kernels, specifically 4.4.70?

Has Comedi been tested on rt kernels by yourself?

cheers,
Piotr

On Mon, Jul 17, 2017 at 05:02:45PM +0100, Ian Abbott wrote:
> On 17/07/17 15:48, Piotr Gregor wrote:
> >Calling blocking operations from wrong context.
> >Kernel:
> >
> >Linux piotrpc 4.4.70-rt83 #1 SMP PREEMPT RT Thu Jul 13 08:42:02 BST 2017 
> >x86_64 GNU/Linux
> >
> >[   80.542018] NOHZ: local_softirq_pending 80
> >[  125.175471] [ cut here ]
> >[  125.175491] WARNING: CPU: 0 PID: 1497 at kernel/sched/core.c:7833 
> >__might_sleep+0x9f/0xb0()
> >[  125.175728] do not call blocking ops when !TASK_RUNNING; state=1 set at 
> >[] comedi_read+0x1a1/0x610 [comedi]
> >[  125.175735] Modules linked in: cpufreq_conservative cpufreq_powersave 
> >cpufreq_userspace cfg80211 nfsd auth_rpcgss oid_registry nfs_acl nfs lockd 
> >grace fscache sunrpc nls_ascii nls_cp437 vfat fat snd_hda_codec_hdmi 
> >snd_hda_codec_realtek snd_hda_codec_generic intel_rapl joydev 
> >intel_powerclamp coretemp kvm drbg efi_pstore ansi_cprng irqbypass 
> >crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel aes_x86_64 lrw 
> >gf128mul glue_helper ablk_helper cryptd i915 serio_raw pcspkr efivars 
> >snd_hda_intel amplc_dio200_pci(C) amplc_dio200_common(C) snd_hda_codec 
> >iTCO_wdt comedi_8254(C) comedi_pci(C) iTCO_vendor_support comedi(C) 
> >snd_hda_core snd_hwdep snd_pcm drm_kms_helper snd_timer drm snd mei_me 
> >soundcore mei i2c_algo_bit shpchp eeepc_wmi asus_wmi sparse_keymap mxm_wmi 
> >battery hci_uart btbcm btqca btintel
> >[  125.175824]  bluetooth
> >[  125.175825]  wmi
> >[  125.175826]  rfkill
> >[  125.175827]  video
> >[  125.175828]  intel_lpss_acpi
> >[  125.175830]  intel_lpss
> >[  125.175831]  evdev
> >[  125.175832]  mfd_core
> >[  125.175833]  acpi_als
> >[  125.175834]  acpi_pad
> >[  125.175835]  kfifo_buf
> >[  125.175836]  button
> >[  125.175838]  industrialio
> >[  125.175839]  fuse
> >[  125.175840]  parport_pc
> >[  125.175841]  ppdev
> >[  125.175842]  lp
> >[  125.175843]  parport
> >[  125.175844]  autofs4
> >[  125.175845]  ext4
> >[  125.175846]  crc16
> >[  125.175847]  mbcache
> >[  125.175848]  jbd2
> >[  125.175849]  hid_generic
> >[  125.175851]  usbhid
> >[  125.175852]  sg
> >[  125.175853]  sr_mod
> >[  125.175854]  cdrom
> >[  125.175855]  sd_mod
> >[  125.175856]  crc32c_intel
> >[  125.175857]  ahci
> >[  125.175858]  libahci
> >[  125.175859]  psmouse
> >[  125.175860]  xhci_pci
> >[  125.175861]  libata
> >[  125.175862]  r8169
> >[  125.175864]  i2c_i801
> >[  125.175865]  mii
> >[  125.175866]  xhci_hcd
> >[  125.175867]  tg3
> >[  125.175868]  ptp
> >[  125.175869]  scsi_mod
> >[  125.175870]  usbcore
> >[  125.175871]  pps_core
> >[  125.175872]  libphy
> >[  125.175873]  usb_common
> >[  125.175874]  fan
> >[  125.175875]  thermal
> >[  125.175876]  i2c_hid
> >[  125.175877]  hid
> >[  125.175878]  fjes
> >
> >[  125.175926] CPU: 0 PID: 1497 Comm: txrx Tainted: GWC  
> >4.4.70-rt83 #1
> >[  125.175928] Hardware name: NOVATECH LTD PC-XB04472/H110M-C, BIOS 3019 
> >01/06/2017
> >[  125.175935]   8802205b3cb0 81387160 
> >8802205b3cf8
> >[  125.175940]  0009 8802205b3ce8 81089766 
> >c057ca60
> >[  125.175944]  02dc  0001 
> >0001
> >[  125.175945] Call Trace:
> >[  125.175955]  [] dump_stack+0x85/0xc5
> >[  125.175963]  [] warn_slowpath_common+0x86/0xe0
> >[  125.175971]  [] warn_slowpath_fmt+0x4c/0x50
> >[  125.175980]  [] ? trace_preempt_on+0x1a7/0x2b0
> >[  125.175985]  [] ? schedule+0x55/0xe0
> >[  125.175994]  [] ? comedi_read+0x1a1/0x610 [comedi]
> >[  125.176001]  [] ? comedi_read+0x1a1/0x610 [comedi]
> >[  125.176005]  [] __might_sleep+0x9f/0xb0
> >[  125.176012]  [] __might_fault+0x3b/0xb0
> >[  125.176020]  [] comedi_read+0x3df/0x610 [comedi]
> >[  125.176034]  [] ? wake_up_process+0x20/0x20
> >[  125.176044]  [] __vfs_read+0x28/0xe0
> >[  125.176053]  [] ? security_file_permission+0xa6/0xc0
> >[  125.176060]  [] ? rw_verify_area+0x53/0xf0
> >[  125.176066]  [] vfs_read+0x89/0x130
> >[  125.176074]  [] SyS_read+0x49/0xb0
> >[  125.176084]  [] entry_SYSCALL_64_fastpath+0x16/0x7a
> >[  125.176095] ---[ end trace 0003 ]---
> >
> >
> >cheers,
> >Piotr
> 
> Thanks for the bug report.  I think comedi_read() in
> "drivers/staging/comedi/comedi_fops.c" needs a call to
> set_current_state(TASK_RUNNING) just before

RE: [PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by loop

2017-07-17 Thread Alex Ng (LIS)
My apologies. The changelog comment should be more descriptive.

Since a loop device is backed by a file, a backup will already result in
its parent filesystem being frozen. It's sufficient to just freeze the
parent filesystem, so we can skip the loop device.

This avoids a situation where a loop device and its parent filesystem are
both frozen and then thawed out of order. For example, if the loop device
is enumerated first, we would thaw it while its parent filesystem is still
frozen. The thaw operation fails and the loop device remains frozen.

I'll work with KY to send an updated patch with a better comment.

> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Monday, July 17, 2017 6:00 AM
> To: KY Srinivasan 
> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com;
> jasow...@redhat.com; leann.ogasaw...@canonical.com;
> marcelo.ce...@canonical.com; Stephen Hemminger
> ; Alex Ng (LIS) ;
> Vyronas Tsingaras 
> Subject: Re: [PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by
> loop
> 
> On Sun, Jun 25, 2017 at 12:47:45PM -0700, k...@exchange.microsoft.com
> wrote:
> > From: Alex Ng 
> >
> > Skip loop devices from the freeze/thaw operation.
> 
> Ok, but why?  What is the consequences of this?  Please provide a much
> better changelog comment, especially for something that is supposed to
> be a "fix".
> 
> thanks,
> 
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: gs_fpgaboot: add buffer overflow checks

2017-07-17 Thread Dan Carpenter
On Sun, Jul 16, 2017 at 08:38:41PM -0400, Jacob von Chorus wrote:
> diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
> b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> index 19b550fff0..2aafd769b8 100644
> --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> @@ -47,7 +47,7 @@ static void read_bitstream(char *bitdata, char *buf, int 
> *offset, int rdsize)
>   *offset += rdsize;
>  }
>  
> -static void readinfo_bitstream(char *bitdata, char *buf, int *offset)
> +static int readinfo_bitstream(char *bitdata, char *buf, int n, int *offset)

Choose a better name than "n" like "size".

>  {
>   char tbuf[64];
>   s32 len;
> @@ -59,9 +59,15 @@ static void readinfo_bitstream(char *bitdata, char *buf, 
> int *offset)
>   read_bitstream(bitdata, tbuf, offset, 2);
>  
>   len = tbuf[0] << 8 | tbuf[1];

Since tbuf is char then, on x86 and arm, that means it's signed and it
means "len" can be negative.  Declare tbuf as u8.  Which will require
other changes as well...

> + if (len + 1 > n) {

It's more idiomatic to say "if (len >= n)".  Plus that's a good habbit
if you want to avoid integer overflows.

> + pr_err("error: readinfo buffer too small\n");
> + return -1;

-1 is not a correct error code.

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


[PATCH] staging: gs_fpgaboot: add buffer overflow checks

2017-07-17 Thread Jacob von Chorus
Four fields in struct fpgaimage are char arrays of length MAX_STR (256).
The amount of data read into these buffers is controlled by a length
field in the bitstream file read from userspace. If a corrupt or
malicious firmware file was supplied, kernel data beyond these buffers
can be overwritten arbitrarily.

This patch adds a check of the bitstream's length value to ensure it
fits within the bounds of the allocated buffers. An error condition is
returned from gs_read_bitstream if any of the reads fail.

Signed-off-by: Jacob von Chorus 
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 39 ++-
 1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index 19b550fff0..2aafd769b8 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -47,7 +47,7 @@ static void read_bitstream(char *bitdata, char *buf, int 
*offset, int rdsize)
*offset += rdsize;
 }
 
-static void readinfo_bitstream(char *bitdata, char *buf, int *offset)
+static int readinfo_bitstream(char *bitdata, char *buf, int n, int *offset)
 {
char tbuf[64];
s32 len;
@@ -59,9 +59,15 @@ static void readinfo_bitstream(char *bitdata, char *buf, int 
*offset)
read_bitstream(bitdata, tbuf, offset, 2);
 
len = tbuf[0] << 8 | tbuf[1];
+   if (len + 1 > n) {
+   pr_err("error: readinfo buffer too small\n");
+   return -1;
+   }
 
read_bitstream(bitdata, buf, offset, len);
buf[len] = '\0';
+
+   return 0;
 }
 
 /*
@@ -113,7 +119,7 @@ static int readmagic_bitstream(char *bitdata, int *offset)
 /*
  * NOTE: supports only bitstream format
  */
-static enum fmt_image get_imageformat(struct fpgaimage *fimage)
+static enum fmt_image get_imageformat(void)
 {
return f_bit;
 }
@@ -127,7 +133,7 @@ static void gs_print_header(struct fpgaimage *fimage)
pr_info("lendata: %d\n", fimage->lendata);
 }
 
-static void gs_read_bitstream(struct fpgaimage *fimage)
+static int gs_read_bitstream(struct fpgaimage *fimage)
 {
char *bitdata;
int offset;
@@ -135,26 +141,37 @@ static void gs_read_bitstream(struct fpgaimage *fimage)
offset = 0;
bitdata = (char *)fimage->fw_entry->data;
 
-   readmagic_bitstream(bitdata, &offset);
-   readinfo_bitstream(bitdata, fimage->filename, &offset);
-   readinfo_bitstream(bitdata, fimage->part, &offset);
-   readinfo_bitstream(bitdata, fimage->date, &offset);
-   readinfo_bitstream(bitdata, fimage->time, &offset);
-   readlength_bitstream(bitdata, &fimage->lendata, &offset);
+   if (readmagic_bitstream(bitdata, &offset))
+   return -1;
+
+   if (readinfo_bitstream(bitdata, fimage->filename, MAX_STR, &offset))
+   return -1;
+   if (readinfo_bitstream(bitdata, fimage->part, MAX_STR, &offset))
+   return -1;
+   if (readinfo_bitstream(bitdata, fimage->date, MAX_STR, &offset))
+   return -1;
+   if (readinfo_bitstream(bitdata, fimage->time, MAX_STR, &offset))
+   return -1;
+
+   if (readlength_bitstream(bitdata, &fimage->lendata, &offset))
+   return -1;
 
fimage->fpgadata = bitdata + offset;
+
+   return 0;
 }
 
 static int gs_read_image(struct fpgaimage *fimage)
 {
int img_fmt;
 
-   img_fmt = get_imageformat(fimage);
+   img_fmt = get_imageformat();
 
switch (img_fmt) {
case f_bit:
pr_info("image is bitstream format\n");
-   gs_read_bitstream(fimage);
+   if (gs_read_bitstream(fimage))
+   return -1;
break;
default:
pr_err("unsupported fpga image format\n");
-- 
2.11.0

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


[PATCH] staging: gs_fpgaboot: remove FSF address from GPL notice

2017-07-17 Thread Jacob von Chorus
This patch removes the FSF address from the GPL notice to fix a
checkpatch.cl CHECK message.

Signed-off-by: Jacob von Chorus 
---
 drivers/staging/gs_fpgaboot/io.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/gs_fpgaboot/io.c b/drivers/staging/gs_fpgaboot/io.c
index c9391198fb..83a13ca725 100644
--- a/drivers/staging/gs_fpgaboot/io.c
+++ b/drivers/staging/gs_fpgaboot/io.c
@@ -9,10 +9,6 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *
  * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include 
-- 
2.11.0

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


[PATCH 00/42] staging: unisys: More updates to the code

2017-07-17 Thread David Kershner
This series fixes some more style issues with the code found
during our internal review.

Alex Curtin (5):
  staging: unisys: visorbus: controlvmchannel.h: removed 
VISOR_CONTROLVM_CHANNEL_SIGNATURE
  staging: unisys: visorbus: vbuschannel.h: removed VISOR_VBUS_CHANNEL_SIGNATURE
  staging: unisys: include: iochannel.h: removed VISOR_VHBA_CHANNEL_SIGNATURE
  staging: unisys: include: iochannel.h: removed VISOR_VNIC_CHANNEL_SIGNATURE
  staging: unisys: include: iochannel.h: removed VISOR_VSWITCH_CHANNEL_SIGNATURE

Charles Daniels (6):
  staging: unisys: include: Remove COVER macro from channel.h
  staging: unisys: visorbus: fix multi-line function definition
  staging: unisys: visorbus: visorchannel.c: fix multi-line function definition
  staging: unisys: visorhba: fix multi-line function definition
  staging: unisys: visorinput: fix multi-line function definition
  staging: unisys: visornic: fix multi-line function definition

David Binder (6):
  staging: unisys: visorbus: visorchipset.c: Adjust code layout
  staging: unisys: visorbus: visorbus_main.c: Adjust code layout
  staging: unisys: visorhba: visorhba_main.c: Adjust whitespace usage
  staging: unisys: visorinput: visorinput.c: Adjust whitespace usage
  staging: unisys: visornic: visornic_main.c: Adjust whitespace usage
  staging: unisys: visorhba: viosrhba_main.c: Remove unnecessary checks

David Kershner (1):
  staging: unisys: visorbus: Remove unused define for visorchipset.

Erik Arfvidson (5):
  staging: unisys: visorbus: controlvmchannel.h: fix spacing
  staging: unisys: include: channel.h: remove unused pound defines
  staging: unisys: visorbus: rename fix_vbus_dev_info
  staging: unisys: visorbus: remove target_hostname comment
  staging: unisys: visorchipset: remove local_addr in handle_command

Mark Foresta (5):
  staging: unisys: visorbus: Update comment style vbuschannel.h
  staging: unisys: visorbus: fixed comment in visorbus_private.h
  staging: unisys: visorbus: removed blank line in viorbus_main.c
  staging: unisys: visorbus: Removed unused define from visorbus_main.c
  staging: unisys: visorbus: cleaned up include block of visorchipset.c

Sameer Wadgaonkar (9):
  staging: unisys: visorbus: convert VMCALL_CONTROLVM_ADDR enum to #define
  staging: unisys: visorbus: visorbus_main.c: remove extra checks for 
dev->visorchannel
  staging: unisys: visorbus: visorbus_main.c: put function name and return 
value on same line.
  staging: unisys: visorbus: visorbus_main.c: remove check from typename_show
  staging: unisys: visorbus: add checks for probe, remove, pause and resume in 
visorbus_register_visor_driver
  staging: unisys: remove unused define VISOR_VSWITCH_CHANNEL_VERSIONID
  staging: unisys: include: Remove unused CHANNEL_OK defines.
  staging: unisys: moved visor_check_channel from include/channel.h to 
visorbus/visorbus_main.c
  staging: unisys: visornic: update the struct viosrnic_devdata to have 
kernel-doc like comments

Zachary Dremann (2):
  staging: unisys: visorbus: visorbus_main.c: use __func__ over hardcoded name
  staging: unisys: visorbus: Fix memory leak

Zohaib (3):
  staging: unisys: visorbus: Beginning of the file /* on its own line
  staging: unisys: include: iochannel.h: Removed unused DEFINE
  staging: unisys: visorbus: Adding a new line between function definition

 drivers/staging/unisys/include/channel.h   |  63 +---
 drivers/staging/unisys/include/iochannel.h |  21 +-
 drivers/staging/unisys/include/visorbus.h  |   4 +-
 drivers/staging/unisys/visorbus/controlvmchannel.h |  17 +-
 drivers/staging/unisys/visorbus/vbuschannel.h  |   5 +-
 drivers/staging/unisys/visorbus/visorbus_main.c| 267 +++---
 drivers/staging/unisys/visorbus/visorbus_private.h |   7 +-
 drivers/staging/unisys/visorbus/visorchannel.c | 101 ++---
 drivers/staging/unisys/visorbus/visorchipset.c | 243 -
 drivers/staging/unisys/visorbus/vmcallinterface.h  |   7 +-
 drivers/staging/unisys/visorhba/visorhba_main.c|  48 +--
 drivers/staging/unisys/visorinput/visorinput.c |  64 +--
 drivers/staging/unisys/visornic/visornic_main.c| 201 +--
 13 files changed, 437 insertions(+), 611 deletions(-)

base-commit: 874bcba65f9a3a2a304b5f520529c046887c3cdc
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/42] staging: unisys: visorbus: visorchipset.c: Adjust code layout

2017-07-17 Thread David Kershner
From: David Binder 

Adjusts the ordering of function statements, as well as modifies whitespace
usage, in order to create a more uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 30 +--
 1 file changed, 9 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 7d37a00..1106eb5 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -124,7 +124,6 @@ static ssize_t toolaction_store(struct device *dev,
 offsetof(struct visor_controlvm_channel,
  tool_action),
 &tool_action, sizeof(u8));
-
if (err)
return err;
return count;
@@ -143,7 +142,6 @@ static ssize_t boottotool_show(struct device *dev,
 efi_visor_ind),
&efi_visor_indication,
sizeof(struct efi_visor_indication));
-
if (err)
return err;
return sprintf(buf, "%u\n", efi_visor_indication.boot_to_tool);
@@ -165,7 +163,6 @@ static ssize_t boottotool_store(struct device *dev,
  efi_visor_ind),
 &(efi_visor_indication),
 sizeof(struct efi_visor_indication));
-
if (err)
return err;
return count;
@@ -302,11 +299,12 @@ parser_string_get(struct parser_context *ctx)
int i;
 
pscan = ctx->curr;
+   if (!pscan)
+   return NULL;
nscan = ctx->bytes_remaining;
if (nscan == 0)
return NULL;
-   if (!pscan)
-   return NULL;
+
for (i = 0, value_length = -1; i < nscan; i++)
if (pscan[i] == '\0') {
value_length = i;
@@ -315,6 +313,7 @@ parser_string_get(struct parser_context *ctx)
/* '\0' was not included in the length */
if (value_length < 0)
value_length = nscan;
+
value = kmalloc(value_length + 1, GFP_KERNEL);
if (!value)
return NULL;
@@ -619,11 +618,11 @@ visorbus_create(struct controlvm_message *inmsg)
   cmd->create_bus.channel_bytes,
   GFP_KERNEL,
   cmd->create_bus.bus_data_type_uuid);
-
if (!visorchannel) {
err = -ENOMEM;
goto err_free_pending_msg;
}
+
bus_info->visorchannel = visorchannel;
 
/* Response will be handled by visorchipset_bus_create */
@@ -758,7 +757,6 @@ visorbus_device_create(struct controlvm_message *inmsg)
err = -ENODEV;
goto err_respond;
}
-
if (bus_info->state.created == 0) {
dev_err(&chipset_dev->acpi_device->dev,
"bus not created, id: %d\n", bus_no);
@@ -792,7 +790,6 @@ visorbus_device_create(struct controlvm_message *inmsg)
 cmd->create_device.channel_bytes,
 GFP_KERNEL,
 cmd->create_device.data_type_uuid);
-
if (!visorchannel) {
dev_err(&chipset_dev->acpi_device->dev,
"failed to create visorchannel: %d/%d\n",
@@ -919,7 +916,6 @@ visorbus_device_destroy(struct controlvm_message *inmsg)
err = -EINVAL;
goto err_respond;
}
-
if (dev_info->pending_msg_hdr) {
/* only non-NULL if dev is still waiting on a response */
err = -EIO;
@@ -955,8 +951,7 @@ visorbus_device_destroy(struct controlvm_message *inmsg)
  * disable the specified device. The udev script then writes to
  * /sys/devices/platform/visorchipset/parahotplug, which causes the
  * parahotplug store functions to get called, at which point the
- * appropriate CONTROLVM message is retrieved from the list and responded
- * to.
+ * appropriate CONTROLVM message is retrieved from the list and responded to.
  */
 
 #define PARAHOTPLUG_TIMEOUT_MS 2000
@@ -1203,7 +1198,6 @@ parahotplug_process_message(struct controlvm_message 
*inmsg)
int err;
 
req = parahotplug_request_create(inmsg);
-
if (!req)
return -ENOMEM;
 
@@ -1297,10 +1291,9 @@ chipset_selftest_uevent(struct controlvm_message_header 
*msg_hdr)
 static int
 chipset_notready_uevent(struct controlvm_message_header *msg_hdr)
 {
-   int res;
-
-   res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj,
+   int res = kobject_uevent(&chipset_dev->acpi_device->dev.kobj,
 KOBJ_OFFL

[PATCH 06/42] staging: unisys: visornic: visornic_main.c: Adjust whitespace usage

2017-07-17 Thread David Kershner
From: David Binder 

Adjusts whitespace usage in order to create a more uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visornic/visornic_main.c | 14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 5c2614b..5ae8401 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -312,9 +312,7 @@ static const struct file_operations 
debugfs_enable_ints_fops = {
 static void
 visornic_serverdown_complete(struct visornic_devdata *devdata)
 {
-   struct net_device *netdev;
-
-   netdev = devdata->netdev;
+   struct net_device *netdev = devdata->netdev;
 
/* Stop polling for interrupts */
del_timer_sync(&devdata->irq_poll_timer);
@@ -450,7 +448,6 @@ post_skb(struct uiscmdrsp *cmdrsp,
 
atomic_inc(&devdata->num_rcvbuf_in_iovm);
devdata->chstat.sent_post++;
-
return 0;
 }
 
@@ -492,7 +489,6 @@ send_enbdis(struct net_device *netdev, int state,
  * are disabled, reclaim memory from rcv bufs.
  * Returns 0 on success, negative for failure of IO Partition
  * responding.
- *
  */
 static int
 visornic_disable_with_timeout(struct net_device *netdev, const int timeout)
@@ -711,7 +707,6 @@ visornic_enable_with_timeout(struct net_device *netdev, 
const int timeout)
}
 
netif_start_queue(netdev);
-
return 0;
 }
 
@@ -769,7 +764,6 @@ static int
 visornic_open(struct net_device *netdev)
 {
visornic_enable_with_timeout(netdev, VISORNIC_INFINITE_RSP_WAIT);
-
return 0;
 }
 
@@ -784,7 +778,6 @@ static int
 visornic_close(struct net_device *netdev)
 {
visornic_disable_with_timeout(netdev, VISORNIC_INFINITE_RSP_WAIT);
-
return 0;
 }
 
@@ -954,6 +947,7 @@ visornic_xmit(struct sk_buff *skb, struct net_device 
*netdev)
 * - everything else will be pass in frags & DMA'ed
 */
memcpy(cmdrsp->net.xmt.ethhdr, skb->data, ETH_HLEN);
+
/* copy frags info - from skb->data we need to only provide access
 * beyond eth header
 */
@@ -1333,9 +1327,7 @@ visornic_rx(struct uiscmdrsp *cmdrsp)
 * sets up skb->pkt_type & it also PULLS out the eth header
 */
skb->protocol = eth_type_trans(skb, netdev);
-
eth = eth_hdr(skb);
-
skb->csum = 0;
skb->ip_summed = CHECKSUM_NONE;
 
@@ -2184,7 +2176,6 @@ static int visornic_init(void)
 
 cleanup_debugfs:
debugfs_remove_recursive(visornic_debugfs_dir);
-
return err;
 }
 
@@ -2196,7 +2187,6 @@ static int visornic_init(void)
 static void visornic_cleanup(void)
 {
visorbus_unregister_visor_driver(&visornic_driver);
-
debugfs_remove_recursive(visornic_debugfs_dir);
 }
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/42] staging: unisys: visorinput: visorinput.c: Adjust whitespace usage

2017-07-17 Thread David Kershner
From: David Binder 

Adjusts whitespace usage in order to create a more uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorinput/visorinput.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorinput/visorinput.c 
b/drivers/staging/unisys/visorinput/visorinput.c
index c15f28f..761e56b 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -261,7 +261,6 @@ static void visorinput_close(struct input_dev 
*visorinput_dev)
 * interrupts should be disabled so when we resume we will
 * not re-enable them.
 */
-
mutex_lock(&devdata->lock_visor_dev);
devdata->interrupts_enabled = false;
if (devdata->paused)
@@ -283,9 +282,8 @@ setup_client_keyboard(void *devdata,  /* opaque on purpose 
*/
 
 {
int i;
-   struct input_dev *visorinput_dev;
+   struct input_dev *visorinput_dev = input_allocate_device();
 
-   visorinput_dev = input_allocate_device();
if (!visorinput_dev)
return NULL;
 
@@ -324,11 +322,10 @@ setup_client_keyboard(void *devdata,  /* opaque on 
purpose */
 static struct input_dev *
 setup_client_mouse(void *devdata /* opaque on purpose */)
 {
-   struct input_dev *visorinput_dev = NULL;
int xres, yres;
struct fb_info *fb0;
+   struct input_dev *visorinput_dev = input_allocate_device();
 
-   visorinput_dev = input_allocate_device();
if (!visorinput_dev)
return NULL;
 
@@ -543,7 +540,7 @@ scancode_to_keycode(int scancode)
if (scancode > 0xff)
return visorkbd_ext_keycode[(scancode >> 8) & 0xff];
 
-   return  visorkbd_keycode[scancode];
+   return visorkbd_keycode[scancode];
 }
 
 static int
@@ -574,7 +571,6 @@ visorinput_channel_interrupt(struct visor_device *dev)
struct input_dev *visorinput_dev;
int xmotion, ymotion, button;
int i;
-
struct visorinput_devdata *devdata = dev_get_drvdata(&dev->device);
 
if (!devdata)
@@ -630,7 +626,6 @@ visorinput_channel_interrupt(struct visor_device *dev)
if (button < 0)
break;
input_report_key(visorinput_dev, button, 1);
-
input_sync(visorinput_dev);
input_report_key(visorinput_dev, button, 0);
input_sync(visorinput_dev);
@@ -685,7 +680,6 @@ visorinput_pause(struct visor_device *dev,
 * due to above, at this time no thread of execution will be
 * in visorinput_channel_interrupt()
 */
-
devdata->paused = true;
complete_func(dev, 0);
rc = 0;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/42] staging: unisys: visorhba: visorhba_main.c: Adjust whitespace usage

2017-07-17 Thread David Kershner
From: David Binder 

Removes unnecessary blank lines to create a more uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorhba/visorhba_main.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index b48a221..17468bf 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -212,7 +212,6 @@ static void *del_scsipending_ent(struct visorhba_devdata 
*devdata,
 
spin_lock_irqsave(&devdata->privlock, flags);
sent = devdata->pending[del].sent;
-
devdata->pending[del].cmdtype = 0;
devdata->pending[del].sent = NULL;
spin_unlock_irqrestore(&devdata->privlock, flags);
@@ -514,12 +513,10 @@ visorhba_queue_command_lck(struct scsi_cmnd *scsicmd,
 
insert_location = add_scsipending_entry(devdata, CMD_SCSI_TYPE,
(void *)scsicmd);
-
if (insert_location < 0)
return SCSI_MLQUEUE_DEVICE_BUSY;
 
cmdrsp = get_scsipending_cmdrsp(devdata, insert_location);
-
cmdrsp->cmdtype = CMD_SCSI_TYPE;
/* save the pending insertion location. Deletion from pending
 * will return the scsicmd pointer for completion
@@ -535,7 +532,6 @@ visorhba_queue_command_lck(struct scsi_cmnd *scsicmd,
/* save datadir */
cmdrsp->scsi.data_dir = scsicmd->sc_data_direction;
memcpy(cmdrsp->scsi.cmnd, cdb, MAX_CMND_SIZE);
-
cmdrsp->scsi.bufflen = scsi_bufflen(scsicmd);
 
/* keep track of the max buffer length so far. */
@@ -716,7 +712,6 @@ static void complete_taskmgmt_command(struct idr *idrtable,
idr_find(idrtable, cmdrsp->scsitaskmgmt.notify_handle);
int *scsi_result_ptr =
idr_find(idrtable, cmdrsp->scsitaskmgmt.notifyresult_handle);
-
if (unlikely(!(wq && scsi_result_ptr))) {
pr_err("visorhba: no completion context; cmd will time out\n");
return;
@@ -954,7 +949,6 @@ drain_queue(struct uiscmdrsp *cmdrsp, struct 
visorhba_devdata *devdata)
  IOCHAN_FROM_IOPART,
  cmdrsp))
break;
-
if (cmdrsp->cmdtype == CMD_SCSI_TYPE) {
/* scsicmd location is returned by the
 * deletion
@@ -1057,7 +1051,6 @@ static int visorhba_resume(struct visor_device *dev,
 
devdata->thread = visor_thread_start(process_incoming_rsps, devdata,
 "vhba_incming");
-
devdata->serverdown = false;
devdata->serverchangingstate = false;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/42] staging: unisys: visorbus: controlvmchannel.h: fix spacing

2017-07-17 Thread David Kershner
From: Erik Arfvidson 

This patch fixes space and tab aligned comments in
controlvmchannel.h.

Signed-off-by: Erik Arfvidson 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/controlvmchannel.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index dd3aff0..eeaf121 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -45,10 +45,10 @@
 VISOR_CONTROLVM_CHANNEL_SIGNATURE))
 
 /* Defines for various channel queues */
-#define CONTROLVM_QUEUE_REQUEST 0
-#define CONTROLVM_QUEUE_RESPONSE 1
-#define CONTROLVM_QUEUE_EVENT   2
-#define CONTROLVM_QUEUE_ACK 3
+#define CONTROLVM_QUEUE_REQUEST0
+#define CONTROLVM_QUEUE_RESPONSE   1
+#define CONTROLVM_QUEUE_EVENT  2
+#define CONTROLVM_QUEUE_ACK3
 
 /* Max num of messages stored during IOVM creation to be reused after crash */
 #define CONTROLVM_CRASHMSG_MAX 2
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/42] staging: unisys: visorhba: viosrhba_main.c: Remove unnecessary checks

2017-07-17 Thread David Kershner
From: David Binder 

Removes unnecessary checks for a NULL pointer in a non-API function.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorhba/visorhba_main.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index 17468bf..1b4b338 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -141,9 +141,6 @@ static struct task_struct *visor_thread_start
  */
 static void visor_thread_stop(struct task_struct *task)
 {
-   /* no thread running */
-   if (!task)
-   return;
kthread_stop(task);
 }
 
@@ -829,7 +826,7 @@ do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct 
scsi_cmnd *scsicmd)
 static int set_no_disk_inquiry_result(unsigned char *buf,
  size_t len, bool is_lun0)
 {
-   if (!buf || len < NO_DISK_INQUIRY_RESULT_LEN)
+   if (len < NO_DISK_INQUIRY_RESULT_LEN)
return -EINVAL;
memset(buf, 0, NO_DISK_INQUIRY_RESULT_LEN);
buf[2] = SCSI_SPC2_VER;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/42] staging: unisys: visorbus: visorbus_main.c: use __func__ over hardcoded name

2017-07-17 Thread David Kershner
From: Zachary Dremann 

As reported by checkpatch.pl, replace hard-coded usage of the current
function's name in format string with usage of __func__.

Signed-off-by: Zachary Dremann 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index f884b59..2c79673 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1039,7 +1039,7 @@ visorbus_create_instance(struct visor_device *dev)
 err_debugfs_dir:
debugfs_remove_recursive(dev->debugfs_dir);
kfree(hdr_info);
-   dev_err(&dev->device, "visorbus_create_instance failed: %d\n", err);
+   dev_err(&dev->device, "%s failed: %d\n", __func__, err);
return err;
 }
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/42] staging: unisys: visorbus: controlvmchannel.h: removed VISOR_CONTROLVM_CHANNEL_SIGNATURE

2017-07-17 Thread David Kershner
From: Alex Curtin 

VISOR_CONTROLVM_CHANNEL_SIGNATURE points to VISOR_CHANNEL_SIGNATURE, so
this replaces the redundant definition with VISOR_CHANNEL_SIGNATURE.

Signed-off-by: Alex Curtin 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/controlvmchannel.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index eeaf121..9be17fb 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -24,7 +24,6 @@
UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
 
-#define VISOR_CONTROLVM_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 #define CONTROLVM_MESSAGE_MAX 64
 
 /*
@@ -42,7 +41,7 @@
 "controlvm", \
 sizeof(struct visor_controlvm_channel), \
 VISOR_CONTROLVM_CHANNEL_VERSIONID, \
-VISOR_CONTROLVM_CHANNEL_SIGNATURE))
+VISOR_CHANNEL_SIGNATURE))
 
 /* Defines for various channel queues */
 #define CONTROLVM_QUEUE_REQUEST0
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/42] staging: unisys: visorbus: convert VMCALL_CONTROLVM_ADDR enum to #define

2017-07-17 Thread David Kershner
From: Sameer Wadgaonkar 

VMCALL_CONTROLVM_ADDR is the only element left in enum
vmcall_monitor_interface_method_tuple. Converting it to a #define.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/vmcallinterface.h | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h 
b/drivers/staging/unisys/visorbus/vmcallinterface.h
index de6693f..541911b 100644
--- a/drivers/staging/unisys/visorbus/vmcallinterface.h
+++ b/drivers/staging/unisys/visorbus/vmcallinterface.h
@@ -17,8 +17,7 @@
 #define __VMCALLINTERFACE_H__
 
 /*
- * enum vmcall_monitor_interface_method_tuple - VMCALL identification tuples.
- * @VMCALL_CONTROLVM_ADDR: Used by all guests, not just IO.
+ * VMCALL_CONTROLVM_ADDR: Used by all guests, not just IO.
  *
  * Note: When a new VMCALL is added:
  * - The 1st 2 hex digits correspond to one of the VMCALL_MONITOR_INTERFACE
@@ -29,9 +28,7 @@
  * - The 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART type of
  *   VMCALL.
  */
-enum vmcall_monitor_interface_method_tuple {
-   VMCALL_CONTROLVM_ADDR = 0x0501,
-};
+#define VMCALL_CONTROLVM_ADDR 0x0501
 
 enum vmcall_result {
VMCALL_RESULT_SUCCESS = 0,
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/42] staging: unisys: include: channel.h: remove unused pound defines

2017-07-17 Thread David Kershner
From: Erik Arfvidson 

This patch removes all the unused pound defines currently in
channel.h.

Signed-off-by: Erik Arfvidson 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/include/channel.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index fef1b0d..03275d2 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -21,13 +21,9 @@
 #include 
 #include 
 
-#define __SUPERVISOR_CHANNEL_H__
-
 #define SIGNATURE_16(A, B) ((A) | ((B) << 8))
 #define SIGNATURE_32(A, B, C, D) \
(SIGNATURE_16(A, B) | (SIGNATURE_16(C, D) << 16))
-#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
-   (SIGNATURE_32(A, B, C, D) | ((u64)(SIGNATURE_32(E, F, G, H)) << 32))
 
 #ifndef COVER
 #define COVER(v, d) ((d) * DIV_ROUND_UP(v, d))
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/42] staging: unisys: include: iochannel.h: removed VISOR_VHBA_CHANNEL_SIGNATURE

2017-07-17 Thread David Kershner
From: Alex Curtin 

VISOR_VHBA_CHANNEL_SIGNATURE is a redundant definition that points to
VISOR_CHANNEL_SIGNATURE. This replaces that definition with
VISOR_CHANNEL_SIGNATURE.

Signed-off-by: Alex Curtin 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/include/iochannel.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 12849bb..797db9f 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -31,7 +31,6 @@
 #include 
 #include "channel.h"
 
-#define VISOR_VHBA_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 #define VISOR_VNIC_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 #define VISOR_VSWITCH_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 
@@ -50,7 +49,7 @@
(visor_check_channel(ch, visor_vhba_channel_uuid, \
 "vhba", MIN_IO_CHANNEL_SIZE, \
 VISOR_VHBA_CHANNEL_VERSIONID, \
-VISOR_VHBA_CHANNEL_SIGNATURE))
+VISOR_CHANNEL_SIGNATURE))
 
 #define VISOR_VNIC_CHANNEL_OK_CLIENT(ch) \
(visor_check_channel(ch, visor_vnic_channel_uuid, \
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 19/42] staging: unisys: visorbus: add checks for probe, remove, pause and resume in visorbus_register_visor_driver

2017-07-17 Thread David Kershner
From: Sameer Wadgaonkar 

Added checks for functions probe, remove, pause and resume in
visorbus_register_visor_driver() and removed these checks from
the individual functions itself.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 22 ++
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 57f59cb..4849054 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -490,8 +490,7 @@ static int visordriver_remove_device(struct device *xdev)
 
mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = true;
-   if (drv->remove)
-   drv->remove(dev);
+   drv->remove(dev);
mutex_unlock(&dev->visordriver_callback_lock);
 
dev_stop_periodic_work(dev);
@@ -868,8 +867,6 @@ static int visordriver_probe_device(struct device *xdev)
 
dev = to_visor_device(xdev);
drv = to_visor_driver(xdev->driver);
-   if (!drv->probe)
-   return -ENODEV;
 
mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = false;
@@ -940,6 +937,18 @@ int visorbus_register_visor_driver(struct visor_driver 
*drv)
if (!initialized)
return -ENODEV;
 
+   if (!drv->probe)
+   return -ENODEV;
+
+   if (!drv->remove)
+   return -ENODEV;
+
+   if (!drv->pause)
+   return -ENODEV;
+
+   if (!drv->resume)
+   return -ENODEV;
+
drv->driver.name = drv->name;
drv->driver.bus = &visorbus_type;
drv->driver.probe = visordriver_probe_device;
@@ -1158,9 +1167,6 @@ static int 
visorchipset_initiate_device_pause_resume(struct visor_device *dev,
return -EBUSY;
 
if (is_pause) {
-   if (!drv->pause)
-   return -EINVAL;
-
dev->pausing = true;
err = drv->pause(dev, pause_state_change_complete);
} else {
@@ -1169,8 +1175,6 @@ static int 
visorchipset_initiate_device_pause_resume(struct visor_device *dev,
 * make sure it is valid.
 */
fix_vbus_dev_info(dev);
-   if (!drv->resume)
-   return -EINVAL;
 
dev->resuming = true;
err = drv->resume(dev, resume_state_change_complete);
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/42] staging: unisys: visorbus: visorbus_main.c: Adjust code layout

2017-07-17 Thread David Kershner
From: David Binder 

Adjusts the ordering of function statements, as well as modifies
whitespace usage, in order to create a more uniform coding style.

Signed-off-by: David Binder 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 28 +++---
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 2c79673..7823593 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -103,9 +103,8 @@ visorbus_match(struct device *xdev, struct device_driver 
*xdrv)
struct visor_driver *drv;
 
dev = to_visor_device(xdev);
-   drv = to_visor_driver(xdrv);
channel_type = visorchannel_get_uuid(dev->visorchannel);
-
+   drv = to_visor_driver(xdrv);
if (!drv->channel_types)
return 0;
 
@@ -361,6 +360,7 @@ static const struct attribute_group *visorbus_groups[] = {
  *  define & implement display of debugfs attributes under
  *  /sys/kernel/debug/visorbus/visorbus.
  */
+
 /*
  * vbuschannel_print_devinfo() - format a struct visor_vbus_deviceinfo
  *   and write it to a seq_file
@@ -399,12 +399,11 @@ vbuschannel_print_devinfo(struct visor_vbus_deviceinfo 
*devinfo,
 
 static int client_bus_info_debugfs_show(struct seq_file *seq, void *v)
 {
-   struct visor_device *vdev = seq->private;
-   struct visorchannel *channel = vdev->visorchannel;
-
-   int i;
+   int i = 0;
unsigned long off;
struct visor_vbus_deviceinfo dev_info;
+   struct visor_device *vdev = seq->private;
+   struct visorchannel *channel = vdev->visorchannel;
 
if (!channel)
return 0;
@@ -413,6 +412,7 @@ static int client_bus_info_debugfs_show(struct seq_file 
*seq, void *v)
   "Client device / client driver info for %s partition (vbus 
#%u):\n",
   ((vdev->name) ? (char *)(vdev->name) : ""),
   vdev->chipset_bus_no);
+
if (visorchannel_read(channel,
  offsetof(struct visor_vbus_channel, chp_info),
  &dev_info, sizeof(dev_info)) >= 0)
@@ -421,8 +421,8 @@ static int client_bus_info_debugfs_show(struct seq_file 
*seq, void *v)
  offsetof(struct visor_vbus_channel, bus_info),
  &dev_info, sizeof(dev_info)) >= 0)
vbuschannel_print_devinfo(&dev_info, seq, -1);
+
off = offsetof(struct visor_vbus_channel, dev_info);
-   i = 0;
while (off + sizeof(dev_info) <= visorchannel_get_nbytes(channel)) {
if (visorchannel_read(channel, off, &dev_info,
  sizeof(dev_info)) >= 0)
@@ -499,14 +499,16 @@ visordriver_remove_device(struct device *xdev)
 
dev = to_visor_device(xdev);
drv = to_visor_driver(xdev->driver);
+
mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = true;
if (drv->remove)
drv->remove(dev);
mutex_unlock(&dev->visordriver_callback_lock);
-   dev_stop_periodic_work(dev);
 
+   dev_stop_periodic_work(dev);
put_device(&dev->device);
+
return 0;
 }
 
@@ -861,7 +863,6 @@ fix_vbus_dev_info(struct visor_device *visordev)
 
bus_device_info_init(&dev_info, chan_type_name, visordrv->name);
write_vbus_dev_info(bdev->visorchannel, hdr_info, &dev_info, dev_no);
-
write_vbus_chp_info(bdev->visorchannel, hdr_info, &chipset_driverinfo);
write_vbus_bus_info(bdev->visorchannel, hdr_info,
&clientbus_driverinfo);
@@ -889,9 +890,8 @@ visordriver_probe_device(struct device *xdev)
struct visor_driver *drv;
struct visor_device *dev;
 
-   drv = to_visor_driver(xdev->driver);
dev = to_visor_device(xdev);
-
+   drv = to_visor_driver(xdev->driver);
if (!drv->probe)
return -ENODEV;
 
@@ -1089,7 +1089,6 @@ visorchipset_bus_create(struct visor_device *dev)
int err;
 
err = visorbus_create_instance(dev);
-
if (err < 0)
return err;
 
@@ -1123,7 +1122,6 @@ void
 visorchipset_device_destroy(struct visor_device *dev_info)
 {
remove_visor_device(dev_info);
-
visorbus_device_destroy_response(dev_info, 0);
 }
 
@@ -1143,7 +1141,6 @@ pause_state_change_complete(struct visor_device *dev, int 
status)
return;
 
dev->pausing = false;
-
visorbus_device_pause_response(dev, status);
 }
 
@@ -1233,7 +1230,6 @@ visorchipset_device_pause(struct visor_device *dev_info)
int err;
 
err = visorchipset_initiate_device_pause_resume(dev_info, true);
-
if (err < 0) {
dev_info->pausing = false;
return err;
@@ -1256,7 +1252,6 @@ vi

[PATCH 13/42] staging: unisys: include: iochannel.h: removed VISOR_VNIC_CHANNEL_SIGNATURE

2017-07-17 Thread David Kershner
From: Alex Curtin 

VISOR_VNIC_CHANNEL_SIGNATURE is a redundant definition that points to
VISOR_CHANNEL_SIGNATURE. This replaces that definition with
VISOR_CHANNEL_SIGNATURE.

Signed-off-by: Alex Curtin 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/include/iochannel.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 797db9f..8a86762 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -31,7 +31,6 @@
 #include 
 #include "channel.h"
 
-#define VISOR_VNIC_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 #define VISOR_VSWITCH_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 
 /*
@@ -55,7 +54,7 @@
(visor_check_channel(ch, visor_vnic_channel_uuid, \
 "vnic", MIN_IO_CHANNEL_SIZE, \
 VISOR_VNIC_CHANNEL_VERSIONID, \
-VISOR_VNIC_CHANNEL_SIGNATURE))
+VISOR_CHANNEL_SIGNATURE))
 
 /*
  * Everything necessary to handle SCSI & NIC traffic between Guest Partition 
and
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 25/42] staging: unisys: include: iochannel.h: Removed unused DEFINE

2017-07-17 Thread David Kershner
From: Zohaib 

Removed unused #define GPI_ENTRIES_PER_PAGE

Signed-off-by: Zohaib 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/include/iochannel.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 425edb6..8db034a 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -133,8 +133,6 @@ struct guest_phys_info {
u64 length;
 } __packed;
 
-#define GPI_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(struct guest_phys_info))
-
 /*
  * struct uisscsi_dest
  * @channel: Bus number.
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 20/42] staging: unisys: remove unused define VISOR_VSWITCH_CHANNEL_VERSIONID

2017-07-17 Thread David Kershner
From: Sameer Wadgaonkar 

The VSWITCH channel is not used in Linux guests, so remove the VERSIONID.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/include/iochannel.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index c39451b..1a3d82d 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -40,7 +40,6 @@
  */
 #define VISOR_VHBA_CHANNEL_VERSIONID 2
 #define VISOR_VNIC_CHANNEL_VERSIONID 2
-#define VISOR_VSWITCH_CHANNEL_VERSIONID 1
 
 #define VISOR_VHBA_CHANNEL_OK_CLIENT(ch) \
(visor_check_channel(ch, visor_vhba_channel_uuid, \
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 24/42] staging: unisys: visorbus: Beginning of the file /* on its own line

2017-07-17 Thread David Kershner
From: Zohaib 

Leading comment changed to follow surrounding convention.

Signed-off-by: Zohaib 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index aa6ee41..b21a4de 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1,4 +1,5 @@
-/* visorchipset_main.c
+/*
+ * visorchipset_main.c
  *
  * Copyright (C) 2010 - 2015 UNISYS CORPORATION
  * All rights reserved.
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 23/42] staging: unisys: visorbus: Fix memory leak

2017-07-17 Thread David Kershner
From: Zachary Dremann 

The name of a visor_device was never freed, which was allocated in
visorbus_configure.

It is expected that visorbus_device_destroy will not be called on the
same visor_device again, or this would be a double free.

Signed-off-by: Zachary Dremann 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 160a63e..aa6ee41 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -933,6 +933,7 @@ visorbus_device_destroy(struct controlvm_message *inmsg)
dev_info->pending_msg_hdr = pmsg_hdr;
}
 
+   kfree(dev_info->name);
visorchipset_device_destroy(dev_info);
return 0;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/42] staging: unisys: moved visor_check_channel from include/channel.h to visorbus/visorbus_main.c

2017-07-17 Thread David Kershner
From: Sameer Wadgaonkar 

Moved the function visor_check_channel() from include/channel.h to
visorbus/visorbus_main.c.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/include/channel.h   | 55 +---
 drivers/staging/unisys/include/visorbus.h  |  4 +-
 drivers/staging/unisys/visorbus/controlvmchannel.h |  8 +--
 drivers/staging/unisys/visorbus/visorbus_main.c| 55 +++-
 drivers/staging/unisys/visorbus/visorchipset.c |  8 +-
 5 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index 03275d2..4fe9451 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -206,61 +206,6 @@ struct signal_queue_header {
u8 filler[12];
 } __packed;
 
-/*
- * Generic function useful for validating any type of channel when it is
- * received by the client that will be accessing the channel.
- * Note that  is only needed for callers in the EFI environment, and
- * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages.
- */
-static inline int
-visor_check_channel(struct channel_header *ch,
-   uuid_le expected_uuid,
-   char *chname,
-   u64 expected_min_bytes,
-   u32 expected_version,
-   u64 expected_signature)
-{
-   if (uuid_le_cmp(expected_uuid, NULL_UUID_LE) != 0) {
-   /* caller wants us to verify type GUID */
-   if (uuid_le_cmp(ch->chtype, expected_uuid) != 0) {
-   pr_err("Channel mismatch on channel=%s(%pUL) field=type 
expected=%pUL actual=%pUL\n",
-  chname, &expected_uuid,
-  &expected_uuid, &ch->chtype);
-   return 0;
-   }
-   }
-   /* verify channel size */
-   if (expected_min_bytes > 0) {
-   if (ch->size < expected_min_bytes) {
-   pr_err("Channel mismatch on channel=%s(%pUL) field=size 
expected=0x%-8.8Lx actual=0x%-8.8Lx\n",
-  chname, &expected_uuid,
-  (unsigned long long)expected_min_bytes,
-  ch->size);
-   return 0;
-   }
-   }
-   /* verify channel version */
-   if (expected_version > 0) {
-   if (ch->version_id != expected_version) {
-   pr_err("Channel mismatch on channel=%s(%pUL) 
field=version expected=0x%-8.8lx actual=0x%-8.8x\n",
-  chname, &expected_uuid,
-  (unsigned long)expected_version,
-  ch->version_id);
-   return 0;
-   }
-   }
-   /* verify channel signature */
-   if (expected_signature > 0) {
-   if (ch->signature != expected_signature) {
-   pr_err("Channel mismatch on channel=%s(%pUL) 
field=signature expected=0x%-8.8Lx actual=0x%-8.8Lx\n",
-  chname, &expected_uuid,
-  expected_signature, ch->signature);
-   return 0;
-   }
-   }
-   return 1;
-}
-
 /* CHANNEL Guids */
 /* {414815ed-c58c-11da-95a9-00e08161165f} */
 #define VISOR_VHBA_CHANNEL_UUID \
diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index b727dee..17c9229 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -172,6 +172,10 @@ struct visor_device {
 
 #define to_visor_device(x) container_of(x, struct visor_device, device)
 
+int visor_check_channel(struct channel_header *ch, uuid_le expected_uuid,
+   char *chname, u64 expected_min_bytes,
+   u32 expected_version, u64 expected_signature);
+
 int visorbus_register_visor_driver(struct visor_driver *drv);
 void visorbus_unregister_visor_driver(struct visor_driver *drv);
 int visorbus_read_channel(struct visor_device *dev,
diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index 9be17fb..96ac574 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -35,14 +35,6 @@
  */
 #define VISOR_CONTROLVM_CHANNEL_VERSIONID 1
 
-#define VISOR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
-   (visor_check_channel(ch, \
-VISOR_CONTROLVM_CHANNEL_UUID, \
-"controlvm", \
-sizeof(struct visor_controlvm_channel), \
-VISOR_CONTROLVM_CHANNEL_VERSIONID, \
-VISOR_CHANNEL_SIGNATURE))
-
 /* Defines for various channel queues */
 #define CONTROLVM_QUEU

[PATCH 29/42] staging: unisys: visorchipset: remove local_addr in handle_command

2017-07-17 Thread David Kershner
From: Erik Arfvidson 

In the function handle_command, the variable local_addr is always false. So
this patch is getting rid of logic when it is true.

Signed-off-by: Erik Arfvidson 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 43 +--
 1 file changed, 13 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index ebae5bd..6d77160 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1510,10 +1510,11 @@ visorbus_device_resume_response(struct visor_device 
*dev_info, int response)
 }
 
 static struct parser_context *
-parser_init_byte_stream(u64 addr, u32 bytes, bool local, bool *retry)
+parser_init_byte_stream(u64 addr, u32 bytes, bool *retry)
 {
int allocbytes = sizeof(struct parser_context) + bytes;
struct parser_context *ctx;
+   void *mapping;
 
*retry = false;
 
@@ -1538,22 +1539,11 @@ parser_init_byte_stream(u64 addr, u32 bytes, bool 
local, bool *retry)
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);
-   }
-
+   mapping = memremap(addr, bytes, MEMREMAP_WB);
+   if (!mapping)
+   goto err_finish_ctx;
+   memcpy(ctx->data, mapping, bytes);
+   memunmap(mapping);
ctx->byte_stream = true;
chipset_dev->controlvm_payload_bytes_buffered += ctx->param_bytes;
 
@@ -1584,12 +1574,10 @@ handle_command(struct controlvm_message inmsg, u64 
channel_addr)
u64 parm_addr;
u32 parm_bytes;
struct parser_context *parser_ctx = NULL;
-   bool local_addr;
struct controlvm_message ackmsg;
int err = 0;
 
/* create parsing context if necessary */
-   local_addr = (inmsg.hdr.flags.test_message == 1);
parm_addr = channel_addr + inmsg.hdr.payload_vm_offset;
parm_bytes = inmsg.hdr.payload_bytes;
 
@@ -1602,21 +1590,16 @@ handle_command(struct controlvm_message inmsg, u64 
channel_addr)
bool retry = false;
 
parser_ctx =
-   parser_init_byte_stream(parm_addr, parm_bytes,
-   local_addr, &retry);
+   parser_init_byte_stream(parm_addr, parm_bytes, &retry);
if (!parser_ctx && retry)
return -EAGAIN;
}
+   controlvm_init_response(&ackmsg, &inmsg.hdr, CONTROLVM_RESP_SUCCESS);
+   err = visorchannel_signalinsert(chipset_dev->controlvm_channel,
+   CONTROLVM_QUEUE_ACK, &ackmsg);
+   if (err)
+   return err;
 
-   if (!local_addr) {
-   controlvm_init_response(&ackmsg, &inmsg.hdr,
-   CONTROLVM_RESP_SUCCESS);
-   err = visorchannel_signalinsert(chipset_dev->controlvm_channel,
-   CONTROLVM_QUEUE_ACK,
-   &ackmsg);
-   if (err)
-   return err;
-   }
switch (inmsg.hdr.id) {
case CONTROLVM_CHIPSET_INIT:
err = chipset_init(&inmsg);
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 30/42] staging: unisys: visorbus: Update comment style vbuschannel.h

2017-07-17 Thread David Kershner
From: Mark Foresta 

Moved /* to own line at beginning of struct visor_vbus_deviceinfo to follow
standard.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/vbuschannel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h 
b/drivers/staging/unisys/visorbus/vbuschannel.h
index 2c820e2..f374e72 100644
--- a/drivers/staging/unisys/visorbus/vbuschannel.h
+++ b/drivers/staging/unisys/visorbus/vbuschannel.h
@@ -45,7 +45,8 @@
 
 static const uuid_le visor_vbus_channel_uuid = VISOR_VBUS_CHANNEL_UUID;
 
-/* struct visor_vbus_deviceinfo
+/*
+ * struct visor_vbus_deviceinfo
  * @devtype:  Short string identifying the device type.
  * @drvname:  Driver .sys file name.
  * @infostrs: Kernel vversion.
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 28/42] staging: unisys: visorbus: remove target_hostname comment

2017-07-17 Thread David Kershner
From: Erik Arfvidson 

This patch simply removes TARGET_HOSTNAME comment that is no
longer relevant.

Signed-off-by: Erik Arfvidson 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_private.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 98a5af1..7ccf756 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -23,10 +23,6 @@
 #include "controlvmchannel.h"
 #include "vbuschannel.h"
 
-/* TARGET_HOSTNAME specified as -DTARGET_HOSTNAME=\"thename\" on the
- * command line
- */
-
 int visorchipset_bus_create(struct visor_device *bus_info);
 void visorchipset_bus_destroy(struct visor_device *bus_info);
 int visorchipset_device_create(struct visor_device *dev_info);
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 26/42] staging: unisys: visorbus: Adding a new line between function definition

2017-07-17 Thread David Kershner
From: Zohaib 

Added a new line before issue_vmcall_io_controlvm_addr() function
definition.

Signed-off-by: Zohaib 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index b21a4de..ebae5bd 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1333,6 +1333,7 @@ static int unisys_vmcall(unsigned long tuple, unsigned 
long param)
return -EFAULT;
}
 }
+
 static unsigned int
 issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes)
 {
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 33/42] staging: unisys: visorbus: Removed unused define from visorbus_main.c

2017-07-17 Thread David Kershner
From: Mark Foresta 

Removed unused #define CURRENT_FILE_PC.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 97524b0..9012cc1 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -23,7 +23,6 @@
 
 /* Display string that is guaranteed to be no longer the 99 characters */
 #define LINESIZE 99
-#define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c
 #define POLLJIFFIES_NORMALCHANNEL 10
 
 /* stores whether bus_registration was successful */
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 32/42] staging: unisys: visorbus: removed blank line in viorbus_main.c

2017-07-17 Thread David Kershner
From: Mark Foresta 

Removed blank line between #defines.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index b5c6017..97524b0 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -23,7 +23,6 @@
 
 /* Display string that is guaranteed to be no longer the 99 characters */
 #define LINESIZE 99
-
 #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c
 #define POLLJIFFIES_NORMALCHANNEL 10
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 34/42] staging: unisys: visorbus: cleaned up include block of visorchipset.c

2017-07-17 Thread David Kershner
From: Mark Foresta 

Removed 4 unneeded includes netdevice, nls, fs, and ctype.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 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 6d77160..e694797 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -16,11 +16,7 @@
  */
 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
 #include 
 #include 
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 39/42] staging: unisys: visorhba: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrect function definition style in visorhba/visorhba_main.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorhba/visorhba_main.c | 36 --
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index 1b4b338..178d022 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -122,8 +122,8 @@ struct visorhba_devices_open {
  * Return: The task_struct * denoting the thread on success,
  *or NULL on failure
  */
-static struct task_struct *visor_thread_start
-(int (*threadfn)(void *), void *thrcontext, char *name)
+static struct task_struct *visor_thread_start(int (*threadfn)(void *),
+ void *thrcontext, char *name)
 {
struct task_struct *task;
 
@@ -198,8 +198,7 @@ static int add_scsipending_entry(struct visorhba_devdata 
*devdata,
  *
  * Return: The scsipending entry pointed to on success, NULL on failure
  */
-static void *del_scsipending_ent(struct visorhba_devdata *devdata,
-int del)
+static void *del_scsipending_ent(struct visorhba_devdata *devdata, int del)
 {
unsigned long flags;
void *sent;
@@ -460,8 +459,7 @@ static int visorhba_bus_reset_handler(struct scsi_cmnd 
*scsicmd)
  *
  * Return: Not supported, return SUCCESS
  */
-static int
-visorhba_host_reset_handler(struct scsi_cmnd *scsicmd)
+static int visorhba_host_reset_handler(struct scsi_cmnd *scsicmd)
 {
/* issue TASK_MGMT_TARGET_RESET for each target on each bus for host */
return SUCCESS;
@@ -490,9 +488,9 @@ static const char *visorhba_get_info(struct Scsi_Host *shp)
  * Return: 0 if successfully queued to the Service Partition, otherwise
  *error code
  */
-static int
-visorhba_queue_command_lck(struct scsi_cmnd *scsicmd,
-  void (*visorhba_cmnd_done)(struct scsi_cmnd *))
+static int visorhba_queue_command_lck(struct scsi_cmnd *scsicmd,
+ void (*visorhba_cmnd_done)
+  (struct scsi_cmnd *))
 {
struct uiscmdrsp *cmdrsp;
struct scsi_device *scsidev = scsicmd->device;
@@ -798,8 +796,8 @@ static int visorhba_serverdown(struct visorhba_devdata 
*devdata)
  *
  * Don't log errors for disk-not-present inquiries.
  */
-static void
-do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
+static void do_scsi_linuxstat(struct uiscmdrsp *cmdrsp,
+ struct scsi_cmnd *scsicmd)
 {
struct visorhba_devdata *devdata;
struct visordisk_info *vdisk;
@@ -823,8 +821,8 @@ do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct 
scsi_cmnd *scsicmd)
}
 }
 
-static int set_no_disk_inquiry_result(unsigned char *buf,
- size_t len, bool is_lun0)
+static int set_no_disk_inquiry_result(unsigned char *buf, size_t len,
+ bool is_lun0)
 {
if (len < NO_DISK_INQUIRY_RESULT_LEN)
return -EINVAL;
@@ -848,8 +846,8 @@ static int set_no_disk_inquiry_result(unsigned char *buf,
  *
  * Handle response when no linuxstat was returned.
  */
-static void
-do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
+static void do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp,
+   struct scsi_cmnd *scsicmd)
 {
struct scsi_device *scsidev;
unsigned char *buf;
@@ -915,8 +913,8 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct 
scsi_cmnd *scsicmd)
  * Response was returned by the Service Partition. Finish it and send
  * completion to the scsi midlayer.
  */
-static void
-complete_scsi_command(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
+static void complete_scsi_command(struct uiscmdrsp *cmdrsp,
+ struct scsi_cmnd *scsicmd)
 {
/* take what we need out of cmdrsp and complete the scsicmd */
scsicmd->result = cmdrsp->scsi.linuxstat;
@@ -935,8 +933,8 @@ complete_scsi_command(struct uiscmdrsp *cmdrsp, struct 
scsi_cmnd *scsicmd)
  *
  * Pulls responses out of the iochannel and process the responses.
  */
-static void
-drain_queue(struct uiscmdrsp *cmdrsp, struct visorhba_devdata *devdata)
+static void drain_queue(struct uiscmdrsp *cmdrsp,
+   struct visorhba_devdata *devdata)
 {
struct scsi_cmnd *scsicmd;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 41/42] staging: unisys: visornic: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrect function declaration style in visornic/visornic_main.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visornic/visornic_main.c | 101 +++--
 1 file changed, 43 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 5ae8401..0b39676 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -155,9 +155,9 @@ struct visornic_devdata {
 };
 
 /* Returns next non-zero index on success or 0 on failure (i.e. out of room). 
*/
-static u16
-add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len, u16 index,
-u16 max_pi_arr_entries, struct phys_info pi_arr[])
+static u16 add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len,
+   u16 index, u16 max_pi_arr_entries,
+   struct phys_info pi_arr[])
 {
u32 len;
u16 i, firstlen;
@@ -203,10 +203,10 @@ add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 
inp_len, u16 index,
  * Return value indicates number of entries filled in frags
  * Negative values indicate an error.
  */
-static int
-visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen,
- unsigned int frags_max,
- struct phys_info frags[])
+static int visor_copy_fragsinfo_from_skb(struct sk_buff *skb,
+unsigned int firstfraglen,
+unsigned int frags_max,
+struct phys_info frags[])
 {
unsigned int count = 0, frag, size, offset = 0, numfrags;
unsigned int total_count;
@@ -309,8 +309,7 @@ static const struct file_operations 
debugfs_enable_ints_fops = {
  * being down.
  * Returns void.
  */
-static void
-visornic_serverdown_complete(struct visornic_devdata *devdata)
+static void visornic_serverdown_complete(struct visornic_devdata *devdata)
 {
struct net_device *netdev = devdata->netdev;
 
@@ -341,9 +340,8 @@ visornic_serverdown_complete(struct visornic_devdata 
*devdata)
  * sure we haven't already handled the server change state event.
  * Returns 0 if we scheduled the work, -EINVAL on error.
  */
-static int
-visornic_serverdown(struct visornic_devdata *devdata,
-   visorbus_state_complete_func complete_func)
+static int visornic_serverdown(struct visornic_devdata *devdata,
+  visorbus_state_complete_func complete_func)
 {
unsigned long flags;
int err;
@@ -388,8 +386,7 @@ visornic_serverdown(struct visornic_devdata *devdata,
  * so that it can write rcv data into our memory space.
  * Return pointer to sk_buff
  */
-static struct sk_buff *
-alloc_rcv_buf(struct net_device *netdev)
+static struct sk_buff *alloc_rcv_buf(struct net_device *netdev)
 {
struct sk_buff *skb;
 
@@ -420,9 +417,8 @@ alloc_rcv_buf(struct net_device *netdev)
  * Send the skb to the IO Partition.
  * Returns 0 or error
  */
-static int
-post_skb(struct uiscmdrsp *cmdrsp,
-struct visornic_devdata *devdata, struct sk_buff *skb)
+static int post_skb(struct uiscmdrsp *cmdrsp, struct visornic_devdata *devdata,
+   struct sk_buff *skb)
 {
int err;
 
@@ -461,9 +457,8 @@ post_skb(struct uiscmdrsp *cmdrsp,
  * Send the enable/disable message to the IO Partition.
  * Returns 0 or error
  */
-static int
-send_enbdis(struct net_device *netdev, int state,
-   struct visornic_devdata *devdata)
+static int send_enbdis(struct net_device *netdev, int state,
+  struct visornic_devdata *devdata)
 {
int err;
 
@@ -490,8 +485,8 @@ send_enbdis(struct net_device *netdev, int state,
  * Returns 0 on success, negative for failure of IO Partition
  * responding.
  */
-static int
-visornic_disable_with_timeout(struct net_device *netdev, const int timeout)
+static int visornic_disable_with_timeout(struct net_device *netdev,
+const int timeout)
 {
struct visornic_devdata *devdata = netdev_priv(netdev);
int i;
@@ -578,8 +573,8 @@ visornic_disable_with_timeout(struct net_device *netdev, 
const int timeout)
  * Allocate rcv buffers and post them to the IO Partition.
  * Return 0 for success, and negative for failure.
  */
-static int
-init_rcv_bufs(struct net_device *netdev, struct visornic_devdata *devdata)
+static int init_rcv_bufs(struct net_device *netdev,
+struct visornic_devdata *devdata)
 {
int i, j, count, err;
 
@@ -645,8 +640,8 @@ init_rcv_bufs(struct net_device *netdev, struct 
visornic_devdata *devdata)
  * timeout is defined in mse

[PATCH 37/42] staging: unisys: visorbus: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrectly styled function definitions in visorbus/visorchipset.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 153 +++---
 1 file changed, 62 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 279c4d4..af02ad0 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -269,8 +269,7 @@ static ssize_t remaining_steps_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(remaining_steps);
 
-static uuid_le
-parser_id_get(struct parser_context *ctx)
+static uuid_le parser_id_get(struct parser_context *ctx)
 {
struct visor_controlvm_parameters_header *phdr = NULL;
 
@@ -284,8 +283,7 @@ static void parser_done(struct parser_context *ctx)
kfree(ctx);
 }
 
-static void *
-parser_string_get(struct parser_context *ctx)
+static void *parser_string_get(struct parser_context *ctx)
 {
u8 *pscan;
unsigned long nscan;
@@ -318,8 +316,7 @@ parser_string_get(struct parser_context *ctx)
return value;
 }
 
-static void *
-parser_name_get(struct parser_context *ctx)
+static void *parser_name_get(struct parser_context *ctx)
 {
struct visor_controlvm_parameters_header *phdr = NULL;
 
@@ -372,9 +369,9 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, 
u32 dev_no,
return vdev;
 }
 
-static void
-controlvm_init_response(struct controlvm_message *msg,
-   struct controlvm_message_header *msg_hdr, int response)
+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(&msg->hdr, msg_hdr, sizeof(struct controlvm_message_header));
@@ -387,10 +384,10 @@ controlvm_init_response(struct controlvm_message *msg,
}
 }
 
-static int
-controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
-  int response,
-  enum visor_chipset_feature features)
+static int controlvm_respond_chipset_init(
+   struct controlvm_message_header *msg_hdr,
+   int response,
+   enum visor_chipset_feature features)
 {
struct controlvm_message outmsg;
 
@@ -400,8 +397,7 @@ controlvm_respond_chipset_init(struct 
controlvm_message_header *msg_hdr,
 CONTROLVM_QUEUE_REQUEST, &outmsg);
 }
 
-static int
-chipset_init(struct controlvm_message *inmsg)
+static int chipset_init(struct controlvm_message *inmsg)
 {
static int chipset_inited;
enum visor_chipset_feature features = 0;
@@ -435,9 +431,9 @@ chipset_init(struct controlvm_message *inmsg)
return res;
 }
 
-static int
-controlvm_respond(struct controlvm_message_header *msg_hdr, int response,
- struct visor_segment_state *state)
+static int controlvm_respond(struct controlvm_message_header *msg_hdr,
+int response,
+struct visor_segment_state *state)
 {
struct controlvm_message outmsg;
 
@@ -459,8 +455,8 @@ enum crash_obj_type {
CRASH_BUS,
 };
 
-static int
-save_crash_message(struct controlvm_message *msg, enum crash_obj_type cr_type)
+static int save_crash_message(struct controlvm_message *msg,
+ enum crash_obj_type cr_type)
 {
u32 local_crash_msg_offset;
u16 local_crash_msg_count;
@@ -524,10 +520,9 @@ save_crash_message(struct controlvm_message *msg, enum 
crash_obj_type cr_type)
return 0;
 }
 
-static int
-controlvm_responder(enum controlvm_id cmd_id,
-   struct controlvm_message_header *pending_msg_hdr,
-   int response)
+static int controlvm_responder(enum controlvm_id cmd_id,
+  struct controlvm_message_header *pending_msg_hdr,
+  int response)
 {
if (!pending_msg_hdr)
return -EIO;
@@ -538,10 +533,10 @@ controlvm_responder(enum controlvm_id cmd_id,
return controlvm_respond(pending_msg_hdr, response, NULL);
 }
 
-static int
-device_changestate_responder(enum controlvm_id cmd_id,
-struct visor_device *p, int response,
-struct visor_segment_state response_state)
+static int device_changestate_responder(
+   enum controlvm_id cmd_id,
+   struct visor_device *p, int response,
+   struct visor_segment_state response_state)
 {
struct controlvm_mess

[PATCH 38/42] staging: unisys: visorbus: visorchannel.c: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrect function definition style in visorbus/visorchannel.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 101 +++---
 1 file changed, 44 insertions(+), 57 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index fcff231..c7eea65 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -54,8 +54,7 @@ struct visorchannel {
uuid_le inst;
 };
 
-void
-visorchannel_destroy(struct visorchannel *channel)
+void visorchannel_destroy(struct visorchannel *channel)
 {
if (!channel)
return;
@@ -67,46 +66,39 @@ visorchannel_destroy(struct visorchannel *channel)
kfree(channel);
 }
 
-u64
-visorchannel_get_physaddr(struct visorchannel *channel)
+u64 visorchannel_get_physaddr(struct visorchannel *channel)
 {
return channel->physaddr;
 }
 
-ulong
-visorchannel_get_nbytes(struct visorchannel *channel)
+ulong visorchannel_get_nbytes(struct visorchannel *channel)
 {
return channel->nbytes;
 }
 
-char *
-visorchannel_uuid_id(uuid_le *guid, char *s)
+char *visorchannel_uuid_id(uuid_le *guid, char *s)
 {
sprintf(s, "%pUL", guid);
return s;
 }
 
-char *
-visorchannel_id(struct visorchannel *channel, char *s)
+char *visorchannel_id(struct visorchannel *channel, char *s)
 {
return visorchannel_uuid_id(&channel->guid, s);
 }
 
-char *
-visorchannel_zoneid(struct visorchannel *channel, char *s)
+char *visorchannel_zoneid(struct visorchannel *channel, char *s)
 {
return visorchannel_uuid_id(&channel->chan_hdr.zone_uuid, s);
 }
 
-u64
-visorchannel_get_clientpartition(struct visorchannel *channel)
+u64 visorchannel_get_clientpartition(struct visorchannel *channel)
 {
return channel->chan_hdr.partition_handle;
 }
 
-int
-visorchannel_set_clientpartition(struct visorchannel *channel,
-u64 partition_handle)
+int visorchannel_set_clientpartition(struct visorchannel *channel,
+u64 partition_handle)
 {
channel->chan_hdr.partition_handle = partition_handle;
return 0;
@@ -118,16 +110,14 @@ visorchannel_set_clientpartition(struct visorchannel 
*channel,
  *
  * Return: the UUID of the provided channel
  */
-uuid_le
-visorchannel_get_uuid(struct visorchannel *channel)
+uuid_le visorchannel_get_uuid(struct visorchannel *channel)
 {
return channel->guid;
 }
 EXPORT_SYMBOL_GPL(visorchannel_get_uuid);
 
-int
-visorchannel_read(struct visorchannel *channel, ulong offset,
- void *dest, ulong nbytes)
+int visorchannel_read(struct visorchannel *channel, ulong offset, void *dest,
+ ulong nbytes)
 {
if (offset + nbytes > channel->nbytes)
return -EIO;
@@ -137,9 +127,8 @@ visorchannel_read(struct visorchannel *channel, ulong 
offset,
return 0;
 }
 
-int
-visorchannel_write(struct visorchannel *channel, ulong offset,
-  void *dest, ulong nbytes)
+int visorchannel_write(struct visorchannel *channel, ulong offset, void *dest,
+  ulong nbytes)
 {
size_t chdr_size = sizeof(struct channel_header);
size_t copy_size;
@@ -158,8 +147,7 @@ visorchannel_write(struct visorchannel *channel, ulong 
offset,
return 0;
 }
 
-void *
-visorchannel_get_header(struct visorchannel *channel)
+void *visorchannel_get_header(struct visorchannel *channel)
 {
return &channel->chan_hdr;
 }
@@ -191,9 +179,8 @@ visorchannel_get_header(struct visorchannel *channel)
   &((sig_hdr)->FIELD), \
   sizeof((sig_hdr)->FIELD))
 
-static int
-sig_read_header(struct visorchannel *channel, u32 queue,
-   struct signal_queue_header *sig_hdr)
+static int sig_read_header(struct visorchannel *channel, u32 queue,
+  struct signal_queue_header *sig_hdr)
 {
if (channel->chan_hdr.ch_space_offset < sizeof(struct channel_header))
return -EINVAL;
@@ -204,9 +191,9 @@ sig_read_header(struct visorchannel *channel, u32 queue,
 sig_hdr, sizeof(struct signal_queue_header));
 }
 
-static int
-sig_read_data(struct visorchannel *channel, u32 queue,
- struct signal_queue_header *sig_hdr, u32 slot, void *data)
+static int sig_read_data(struct visorchannel *channel, u32 queue,
+struct signal_queue_header *sig_hdr, u32 slot,
+void *data)
 {
int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
 sig_hdr, slot);
@@ -215,9 +202,9 @@ sig_read_data(struct visorchannel *channel, u32 queue,
   

[PATCH 42/42] staging: unisys: visornic: update the struct viosrnic_devdata to have kernel-doc like comments

2017-07-17 Thread David Kershner
From: Sameer Wadgaonkar 

Cleaned up the in-line comments in the structure and added a
kernel-doc like comment for the structure.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visornic/visornic_main.c | 86 --
 1 file changed, 61 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 0b39676..90d9d03 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -68,10 +68,68 @@ struct chanstat {
unsigned long extra_rcvbufs_sent;
 };
 
+/* struct visornic_devdata
+ *
+ * @enabled:0 disabled 1 enabled to receive.
+ * @enab_dis_acked: NET_RCV_ENABLE/DISABLE acked by IOPART.
+ * @struct *dev:
+ * @struct *netdev:
+ * @struct net_stats:
+ * @interrupt_rcvd:
+ * @rsp_queue:
+ * @struct **rcvbuf:
+ * @incarnation_id: incarnation_id lets IOPART know about
+ *  re-birth.
+ * @old_flags:  flags as they were prior to
+ *  set_multicast_list.
+ * @usage:  count of users.
+ * @num_rcv_bufs:   number of rcv buffers the vnic will post.
+ * @num_rcv_bufs_could_not_alloc:
+ * @num_rcvbuf_in_iovm:
+ * @alloc_failed_in_if_needed_cnt:
+ * @alloc_failed_in_repost_rtn_cnt:
+ * @max_outstanding_net_xmits:  absolute max number of outstanding xmits
+ *  - should never hit this.
+ * @upper_threshold_net_xmits:  high water mark for calling
+ *  netif_stop_queue().
+ * @lower_threshold_net_xmits:  high water mark for calling
+ *  netif_wake_queue().
+ * @struct xmitbufhead: xmitbufhead - head of the xmit buffer list
+ *  sent to the IOPART end.
+ * @server_down_complete_func:
+ * @struct timeout_reset:
+ * @struct *cmdrsp_rcv: cmdrsp_rcv is used for posting/unposting 
rcv
+ *  buffers.
+ * @struct *xmit_cmdrsp:xmit_cmdrsp - issues NET_XMIT - only one
+ *  active xmit at a time.
+ * @server_down:IOPART is down.
+ * @server_change_state:Processing SERVER_CHANGESTATE msg.
+ * @going_away: device is being torn down.
+ * @struct *eth_debugfs_dir:
+ * @interrupts_rcvd:
+ * @interrupts_notme:
+ * @interrupts_disabled:
+ * @busy_cnt:
+ * @priv_lock:  spinlock to access devdata structures.
+ * @flow_control_upper_hits:
+ * @flow_control_lower_hits:
+ * @n_rcv0: # rcvs of 0 buffers.
+ * @n_rcv1: # rcvs of 1 buffers.
+ * @n_rcv2: # rcvs of 2 buffers.
+ * @n_rcvx: # rcvs of >2 buffers.
+ * @found_repost_rcvbuf_cnt:# repost_rcvbuf_cnt.
+ * @repost_found_skb_cnt:   # of found the skb.
+ * @n_repost_deficit:   # of lost rcv buffers.
+ * @bad_rcv_buf:# of unknown rcv skb not freed.
+ * @n_rcv_packets_not_accepted: # bogs rcv packets.
+ * @queuefullmsg_logged:
+ * @struct chstat:
+ * @struct irq_poll_timer:
+ * @struct napi:
+ * @struct cmdrsp:
+ */
 struct visornic_devdata {
-   /* 0 disabled 1 enabled to receive */
unsigned short enabled;
-   /* NET_RCV_ENABLE/DISABLE acked by IOPART */
unsigned short enab_dis_acked;
 
struct visor_device *dev;
@@ -80,47 +138,34 @@ struct visornic_devdata {
atomic_t interrupt_rcvd;
wait_queue_head_t rsp_queue;
struct sk_buff **rcvbuf;
-   /* incarnation_id lets IOPART know about re-birth */
u64 incarnation_id;
-   /* flags as they were prior to set_multicast_list */
unsigned short old_flags;
-   /* count of users */
atomic_t usage;
 
-   /* number of rcv buffers the vnic will post */
int num_rcv_bufs;
int num_rcv_bufs_could_not_alloc;
atomic_t num_rcvbuf_in_iovm;
unsigned long alloc_failed_in_if_needed_cnt;
unsigned long alloc_failed_in_repost_rtn_cnt;
 
-   /* absolute max number of outstanding xmits - should never hit this */
unsigned long max_outstanding_net_xmits;
-   /* high water mark for calling netif_stop_queue() */
unsigned long upper_threshold_net_xmits;
-   /* high water mark for calling netif_wake_queue() */
unsigned long lower_threshold_net_xmits;
-   /* xmitbufhead - head of the xmit buffer list sent to the IOPART end */
struct sk_buff_head xmitbufhead;
 
visorbus_state_complete_func server_down_complete_func;
struct work_struct timeout_reset;
-   /* cmdrsp_rcv is used for posting/unposting rcv buffers  */
struct uiscmdrs

  1   2   >