[PATCH v2] staging: iio: light: Replace symbolic permissions as per coding style

2017-05-19 Thread surenderpolsani
From: Surender Polsani 

Fixed the following checkpatch.pl warnings:
octal permissions are more preferable than symbolic permissions

Replaced DEVICE_ATTR family macros with DEVICE_ATTR_RW family
as suggested by Greg K-H. Changed attributes and function
names where ever required to satisfy internal macro definitions
like __ATTR__RW().

Signed-off-by: Surender Polsani 
---
Changes for v2:

- Made few changes as suggested by Greg K-H and modified
  description accordingly.
---
 drivers/staging/iio/light/tsl2x7x_core.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x_core.c 
b/drivers/staging/iio/light/tsl2x7x_core.c
index af3910b..c63fe6a 100644
--- a/drivers/staging/iio/light/tsl2x7x_core.c
+++ b/drivers/staging/iio/light/tsl2x7x_core.c
@@ -1498,34 +1498,34 @@ static int tsl2x7x_write_raw(struct iio_dev *indio_dev,
return 0;
 }
 
-static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(power_state, 0644,
tsl2x7x_power_state_show, tsl2x7x_power_state_store);
 
-static DEVICE_ATTR(in_proximity0_calibscale_available, S_IRUGO,
+static DEVICE_ATTR(in_proximity0_calibscale_available, 0444,
tsl2x7x_prox_gain_available_show, NULL);
 
-static DEVICE_ATTR(in_illuminance0_calibscale_available, S_IRUGO,
+static DEVICE_ATTR(in_illuminance0_calibscale_available, 0444,
tsl2x7x_gain_available_show, NULL);
 
-static DEVICE_ATTR(in_illuminance0_integration_time, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_illuminance0_integration_time, 0644,
tsl2x7x_als_time_show, tsl2x7x_als_time_store);
 
-static DEVICE_ATTR(in_illuminance0_target_input, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_illuminance0_target_input, 0644,
tsl2x7x_als_cal_target_show, tsl2x7x_als_cal_target_store);
 
-static DEVICE_ATTR(in_illuminance0_calibrate, S_IWUSR, NULL,
+static DEVICE_ATTR(in_illuminance0_calibrate, 0200, NULL,
tsl2x7x_do_calibrate);
 
-static DEVICE_ATTR(in_proximity0_calibrate, S_IWUSR, NULL,
+static DEVICE_ATTR(in_proximity0_calibrate, 0200, NULL,
tsl2x7x_do_prox_calibrate);
 
-static DEVICE_ATTR(in_illuminance0_lux_table, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_illuminance0_lux_table, 0644,
tsl2x7x_luxtable_show, tsl2x7x_luxtable_store);
 
-static DEVICE_ATTR(in_intensity0_thresh_period, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_intensity0_thresh_period, 0644,
tsl2x7x_als_persistence_show, tsl2x7x_als_persistence_store);
 
-static DEVICE_ATTR(in_proximity0_thresh_period, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(in_proximity0_thresh_period, 0644,
tsl2x7x_prox_persistence_show, tsl2x7x_prox_persistence_store);
 
 /* Use the default register values to identify the Taos device */
-- 
1.9.1

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


Re: [PATCH v2] staging: iio: light: Replace symbolic permissions as per coding style

2017-05-19 Thread Greg KH
On Fri, May 19, 2017 at 12:33:11PM +0530, surenderpols...@gmail.com wrote:
> From: Surender Polsani 
> 
> Fixed the following checkpatch.pl warnings:
> octal permissions are more preferable than symbolic permissions
> 
> Replaced DEVICE_ATTR family macros with DEVICE_ATTR_RW family
> as suggested by Greg K-H. Changed attributes and function
> names where ever required to satisfy internal macro definitions
> like __ATTR__RW().

No you did not:

> -static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
> +static DEVICE_ATTR(power_state, 0644,
>   tsl2x7x_power_state_show, tsl2x7x_power_state_store);

???

Wrong patch?

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


Re: [PATCH v2] staging: iio: light: Replace symbolic permissions as per coding style

2017-05-19 Thread suri

On Friday 19 May 2017 12:45 PM, Greg KH wrote:

On Fri, May 19, 2017 at 12:33:11PM +0530, surenderpols...@gmail.com wrote:

From: Surender Polsani 

Fixed the following checkpatch.pl warnings:
octal permissions are more preferable than symbolic permissions

Replaced DEVICE_ATTR family macros with DEVICE_ATTR_RW family
as suggested by Greg K-H. Changed attributes and function
names where ever required to satisfy internal macro definitions
like __ATTR__RW().


No you did not:


-static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(power_state, 0644,
tsl2x7x_power_state_show, tsl2x7x_power_state_store);


???

Wrong patch?



Sorry i sent wrong patch by mistake. I will send correct patch shortly.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ccree: add CRYPTO dependency

2017-05-19 Thread Arnd Bergmann
A rare randconfig build error shows up when we have CONFIG_CRYPTO=m
in combination with a built-in CCREE driver:

crypto/hmac.o: In function `hmac_update':
hmac.c:(.text.hmac_update+0x28): undefined reference to `crypto_shash_update'
crypto/hmac.o: In function `hmac_setkey':
hmac.c:(.text.hmac_setkey+0x90): undefined reference to `crypto_shash_digest'
hmac.c:(.text.hmac_setkey+0x154): undefined reference to `crypto_shash_update'
drivers/staging/ccree/ssi_cipher.o: In function `ssi_blkcipher_setkey':
ssi_cipher.c:(.text.ssi_blkcipher_setkey+0x350): undefined reference to 
`crypto_shash_digest'
drivers/staging/ccree/ssi_cipher.o: In function `ssi_blkcipher_exit':
ssi_cipher.c:(.text.ssi_blkcipher_exit+0xd4): undefined reference to 
`crypto_destroy_tfm'
drivers/staging/ccree/ssi_cipher.o: In function `ssi_blkcipher_init':
ssi_cipher.c:(.text.ssi_blkcipher_init+0x1b0): undefined reference to 
`crypto_alloc_shash'
drivers/staging/ccree/ssi_cipher.o: In function `ssi_ablkcipher_free':
ssi_cipher.c:(.text.ssi_ablkcipher_free+0x48): undefined reference to 
`crypto_unregister_alg'
drivers/staging/ccree/ssi_cipher.o: In function `ssi_ablkcipher_alloc':
ssi_cipher.c:(.text.ssi_ablkcipher_alloc+0x138): undefined reference to 
`crypto_register_alg'
ssi_cipher.c:(.text.ssi_ablkcipher_alloc+0x274): undefined reference to 
`crypto_blkcipher_type'

We actually need to depend on both CRYPTO and CRYPTO_HW here to avoid the
problem, since CRYPTO_HW is a bool symbol and by itself that does not
force CCREE to be a loadable module when the core cryto support is modular.

Fixes: 50cfbbb7e627 ("staging: ccree: add ahash support")
Signed-off-by: Arnd Bergmann 
---
 drivers/staging/ccree/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/Kconfig b/drivers/staging/ccree/Kconfig
index ae627049c499..4be87f503e3b 100644
--- a/drivers/staging/ccree/Kconfig
+++ b/drivers/staging/ccree/Kconfig
@@ -1,6 +1,6 @@
 config CRYPTO_DEV_CCREE
tristate "Support for ARM TrustZone CryptoCell C7XX family of Crypto 
accelerators"
-   depends on CRYPTO_HW && OF && HAS_DMA
+   depends on CRYPTO && CRYPTO_HW && OF && HAS_DMA
default n
select CRYPTO_HASH
select CRYPTO_BLKCIPHER
-- 
2.9.0

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


[PATCH v2] staging: iio: light: Replace symbolic permissions as per coding style

2017-05-19 Thread surenderpolsani
From: Surender Polsani 

Fixed the following checkpatch.pl warnings:
octal permissions are more preferable than symbolic permissions

Replaced DEVICE_ATTR family macros with DEVICE_ATTR_RW family
as suggested by Greg K-H. Changed attributes and function
names where ever required to satisfy internal macro definitions
like __ATTR__RW().

Signed-off-by: Surender Polsani 
---
Changes for v2:

- Made few changes as suggested by Greg K-H and modified
  description accordingly.
---
 drivers/staging/iio/light/tsl2x7x_core.c | 94 ++--
 1 file changed, 42 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x_core.c 
b/drivers/staging/iio/light/tsl2x7x_core.c
index af3910b..48768bd 100644
--- a/drivers/staging/iio/light/tsl2x7x_core.c
+++ b/drivers/staging/iio/light/tsl2x7x_core.c
@@ -1140,7 +1140,7 @@ static ssize_t tsl2x7x_prox_persistence_store(struct 
device *dev,
return IIO_VAL_INT_PLUS_MICRO;
 }
 
-static ssize_t tsl2x7x_do_calibrate(struct device *dev,
+static ssize_t tsl2x7x_do_calibrate_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
 {
@@ -1226,7 +1226,7 @@ static ssize_t tsl2x7x_luxtable_store(struct device *dev,
return len;
 }
 
-static ssize_t tsl2x7x_do_prox_calibrate(struct device *dev,
+static ssize_t tsl2x7x_do_prox_calibrate_store(struct device *dev,
 struct device_attribute *attr,
 const char *buf, size_t len)
 {
@@ -1498,35 +1498,25 @@ static int tsl2x7x_write_raw(struct iio_dev *indio_dev,
return 0;
 }
 
-static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
-   tsl2x7x_power_state_show, tsl2x7x_power_state_store);
+static DEVICE_ATTR_RW(tsl2x7x_power_state);
 
-static DEVICE_ATTR(in_proximity0_calibscale_available, S_IRUGO,
-   tsl2x7x_prox_gain_available_show, NULL);
+static DEVICE_ATTR_RO(tsl2x7x_prox_gain_available);
 
-static DEVICE_ATTR(in_illuminance0_calibscale_available, S_IRUGO,
-   tsl2x7x_gain_available_show, NULL);
+static DEVICE_ATTR_RO(tsl2x7x_gain_available);
 
-static DEVICE_ATTR(in_illuminance0_integration_time, S_IRUGO | S_IWUSR,
-   tsl2x7x_als_time_show, tsl2x7x_als_time_store);
+static DEVICE_ATTR_RW(tsl2x7x_als_time);
 
-static DEVICE_ATTR(in_illuminance0_target_input, S_IRUGO | S_IWUSR,
-   tsl2x7x_als_cal_target_show, tsl2x7x_als_cal_target_store);
+static DEVICE_ATTR_RW(tsl2x7x_als_cal_target);
 
-static DEVICE_ATTR(in_illuminance0_calibrate, S_IWUSR, NULL,
-   tsl2x7x_do_calibrate);
+static DEVICE_ATTR_WO(tsl2x7x_do_calibrate);
 
-static DEVICE_ATTR(in_proximity0_calibrate, S_IWUSR, NULL,
-   tsl2x7x_do_prox_calibrate);
+static DEVICE_ATTR_WO(tsl2x7x_do_prox_calibrate);
 
-static DEVICE_ATTR(in_illuminance0_lux_table, S_IRUGO | S_IWUSR,
-   tsl2x7x_luxtable_show, tsl2x7x_luxtable_store);
+static DEVICE_ATTR_RW(tsl2x7x_luxtable);
 
-static DEVICE_ATTR(in_intensity0_thresh_period, S_IRUGO | S_IWUSR,
-   tsl2x7x_als_persistence_show, tsl2x7x_als_persistence_store);
+static DEVICE_ATTR_RW(tsl2x7x_als_persistence);
 
-static DEVICE_ATTR(in_proximity0_thresh_period, S_IRUGO | S_IWUSR,
-   tsl2x7x_prox_persistence_show, tsl2x7x_prox_persistence_store);
+static DEVICE_ATTR_RW(tsl2x7x_prox_persistence);
 
 /* Use the default register values to identify the Taos device */
 static int tsl2x7x_device_id(unsigned char *id, int target)
@@ -1594,67 +1584,67 @@ static irqreturn_t tsl2x7x_event_handler(int irq, void 
*private)
 }
 
 static struct attribute *tsl2x7x_ALS_device_attrs[] = {
-   &dev_attr_power_state.attr,
-   &dev_attr_in_illuminance0_calibscale_available.attr,
-   &dev_attr_in_illuminance0_integration_time.attr,
+   &dev_attr_tsl2x7x_power_state.attr,
+   &dev_attr_tsl2x7x_gain_available.attr,
+   &dev_attr_tsl2x7x_als_time.attr,

&iio_const_attr_in_illuminance0_integration_time_available.dev_attr.attr,
-   &dev_attr_in_illuminance0_target_input.attr,
-   &dev_attr_in_illuminance0_calibrate.attr,
-   &dev_attr_in_illuminance0_lux_table.attr,
+   &dev_attr_tsl2x7x_als_cal_target.attr,
+   &dev_attr_tsl2x7x_do_calibrate.attr,
+   &dev_attr_tsl2x7x_luxtable.attr,
NULL
 };
 
 static struct attribute *tsl2x7x_PRX_device_attrs[] = {
-   &dev_attr_power_state.attr,
-   &dev_attr_in_proximity0_calibrate.attr,
+   &dev_attr_tsl2x7x_power_state.attr,
+   &dev_attr_tsl2x7x_do_prox_calibrate.attr,
NULL
 };
 
 static struct attribute *tsl2x7x_ALSPRX_device_attrs[] = {
-   &dev_attr_power_state.attr,
-   &dev_attr_in_illuminance0_calibscale_available.attr,
-   &dev_attr_in_illuminance0_integration_time.attr,
+   &dev_attr_tsl2x7x_power_state.attr,
+   &dev_attr_tsl2x7x_gain_available.attr,
+   &dev_

Re: [PATCH v2] staging: iio: light: Replace symbolic permissions as per coding style

2017-05-19 Thread Greg KH
On Fri, May 19, 2017 at 01:42:55PM +0530, surenderpols...@gmail.com wrote:
> -static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
> - tsl2x7x_power_state_show, tsl2x7x_power_state_store);
> +static DEVICE_ATTR_RW(tsl2x7x_power_state);

You do realize you just renamed the sysfs file, changing the user/kernel
api?  That's generally not a good thing to ever do :(

thanks,

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


[PATCH v3] staging: iio: light: Replace symbolic permissions as per coding style

2017-05-19 Thread surenderpolsani
From: Surender Polsani 

Fixed the following checkpatch.pl warnings:
octal permissions are more preferable than symbolic permissions

Replaced DEVICE_ATTR family macros with DEVICE_ATTR_RW family
as suggested by Greg K-H. Changed attributes and function
names where ever required to satisfy internal macro definitions
like __ATTR__RW().

Signed-off-by: Surender Polsani 
---
Changes for v3:

- Reverted some changes from previous version and made
  changes as suggested by Greg K-H.

Changes for v2:

- Made few changes as suggested by Greg K-H and modified
  description accordingly.
---
 drivers/staging/iio/light/tsl2x7x_core.c | 62 ++--
 1 file changed, 26 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x_core.c 
b/drivers/staging/iio/light/tsl2x7x_core.c
index af3910b..4de1408 100644
--- a/drivers/staging/iio/light/tsl2x7x_core.c
+++ b/drivers/staging/iio/light/tsl2x7x_core.c
@@ -919,7 +919,7 @@ static void tsl2x7x_prox_cal(struct iio_dev *indio_dev)
tsl2x7x_chip_on(indio_dev);
 }
 
-static ssize_t tsl2x7x_power_state_show(struct device *dev,
+static ssize_t power_state_show(struct device *dev,
struct device_attribute *attr,
char *buf)
 {
@@ -928,7 +928,7 @@ static ssize_t tsl2x7x_power_state_show(struct device *dev,
return snprintf(buf, PAGE_SIZE, "%d\n", chip->tsl2x7x_chip_status);
 }
 
-static ssize_t tsl2x7x_power_state_store(struct device *dev,
+static ssize_t power_state_store(struct device *dev,
 struct device_attribute *attr,
 const char *buf, size_t len)
 {
@@ -946,7 +946,7 @@ static ssize_t tsl2x7x_power_state_store(struct device *dev,
return len;
 }
 
-static ssize_t tsl2x7x_gain_available_show(struct device *dev,
+static ssize_t in_illuminance0_calibscale_available_show(struct device *dev,
   struct device_attribute *attr,
   char *buf)
 {
@@ -964,14 +964,14 @@ static ssize_t tsl2x7x_gain_available_show(struct device 
*dev,
return snprintf(buf, PAGE_SIZE, "%s\n", "1 8 16 120");
 }
 
-static ssize_t tsl2x7x_prox_gain_available_show(struct device *dev,
+static ssize_t in_proximity0_calibscale_available_show(struct device *dev,
struct device_attribute *attr,
char *buf)
 {
return snprintf(buf, PAGE_SIZE, "%s\n", "1 2 4 8");
 }
 
-static ssize_t tsl2x7x_als_time_show(struct device *dev,
+static ssize_t in_illuminance0_integration_time_show(struct device *dev,
 struct device_attribute *attr,
 char *buf)
 {
@@ -986,7 +986,7 @@ static ssize_t tsl2x7x_als_time_show(struct device *dev,
return snprintf(buf, PAGE_SIZE, "%d.%03d\n", y, z);
 }
 
-static ssize_t tsl2x7x_als_time_store(struct device *dev,
+static ssize_t in_illuminance0_integration_time_store(struct device *dev,
  struct device_attribute *attr,
  const char *buf, size_t len)
 {
@@ -1014,7 +1014,7 @@ static ssize_t tsl2x7x_als_time_store(struct device *dev,
 static IIO_CONST_ATTR(in_illuminance0_integration_time_available,
".00272 - .696");
 
-static ssize_t tsl2x7x_als_cal_target_show(struct device *dev,
+static ssize_t in_illuminance0_target_input_show(struct device *dev,
   struct device_attribute *attr,
   char *buf)
 {
@@ -1024,7 +1024,7 @@ static ssize_t tsl2x7x_als_cal_target_show(struct device 
*dev,
chip->tsl2x7x_settings.als_cal_target);
 }
 
-static ssize_t tsl2x7x_als_cal_target_store(struct device *dev,
+static ssize_t in_illuminance0_target_input_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
 {
@@ -1044,7 +1044,7 @@ static ssize_t tsl2x7x_als_cal_target_store(struct device 
*dev,
 }
 
 /* persistence settings */
-static ssize_t tsl2x7x_als_persistence_show(struct device *dev,
+static ssize_t in_intensity0_thresh_period_show(struct device *dev,
struct device_attribute *attr,
char *buf)
 {
@@ -1061,7 +1061,7 @@ static ssize_t tsl2x7x_als_persistence_show(struct device 
*dev,
return snprintf(buf, PAGE_SIZE, "%d.%03d\n", y, z);
 }
 
-static ssize_t tsl2x7x_als_persistence_store(struct device *dev,
+static ssize_t in_intensity0_thresh_period_store(struct device *dev,
 struct device_attribute *attr,
 const char *buf, size_t le

Re: [PATCH 4/4] Hyper-V vPCI: use vPCI protocol version 1.2

2017-05-19 Thread Vitaly Kuznetsov
Jork Loeser  writes:

> From: Jork Loeser 
>
> Update the Hyper-V vPCI driver to use the Server-2016 version
> of the vPCI protocol, fixing MSI creation and retargeting issues.
>
> Signed-off-by: Jork Loeser 
> ---
>  arch/x86/include/uapi/asm/hyperv.h |6 +
>  drivers/pci/host/pci-hyperv.c  |  297 
> ++--
>  2 files changed, 255 insertions(+), 48 deletions(-)
>
> diff --git a/arch/x86/include/uapi/asm/hyperv.h 
> b/arch/x86/include/uapi/asm/hyperv.h
> index 432df4b..237ec6c 100644
> --- a/arch/x86/include/uapi/asm/hyperv.h
> +++ b/arch/x86/include/uapi/asm/hyperv.h
> @@ -153,6 +153,12 @@
>  #define HV_X64_DEPRECATING_AEOI_RECOMMENDED  (1 << 9)
>
>  /*
> + * HV_VP_SET available
> + */
> +#define HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED(1 << 11)
> +
> +
> +/*
>   * Crash notification flag.
>   */
>  #define HV_CRASH_CTL_CRASH_NOTIFY (1ULL << 63)
> diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
> index 5f4e136..9780050 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -70,6 +70,7 @@
>
>  enum pci_protocol_version_t {
>   PCI_PROTOCOL_VERSION_1_1 = PCI_MAKE_VERSION(1, 1),  /* Win10 */
> + PCI_PROTOCOL_VERSION_1_2 = PCI_MAKE_VERSION(1, 2),  /* RS1 */
>  };
>
>  #define CPU_AFFINITY_ALL -1ULL
> @@ -79,6 +80,7 @@ enum pci_protocol_version_t {
>   * first.
>   */
>  static enum pci_protocol_version_t pci_protocol_versions[] = {
> + PCI_PROTOCOL_VERSION_1_2,
>   PCI_PROTOCOL_VERSION_1_1,
>  };
>
> @@ -124,6 +126,9 @@ enum pci_message_type {
>   PCI_QUERY_PROTOCOL_VERSION  = PCI_MESSAGE_BASE + 0x13,
>   PCI_CREATE_INTERRUPT_MESSAGE= PCI_MESSAGE_BASE + 0x14,
>   PCI_DELETE_INTERRUPT_MESSAGE= PCI_MESSAGE_BASE + 0x15,
> + PCI_RESOURCES_ASSIGNED2 = PCI_MESSAGE_BASE + 0x16,
> + PCI_CREATE_INTERRUPT_MESSAGE2   = PCI_MESSAGE_BASE + 0x17,
> + PCI_DELETE_INTERRUPT_MESSAGE2   = PCI_MESSAGE_BASE + 0x18, /* unused */
>   PCI_MESSAGE_MAXIMUM
>  };
>
> @@ -194,6 +199,30 @@ struct hv_msi_desc {
>  } __packed;
>
>  /**
> + * struct hv_msi_desc2 - 1.2 version of hv_msi_desc
> + * @vector:  IDT entry
> + * @delivery_mode:   As defined in Intel's Programmer's
> + *   Reference Manual, Volume 3, Chapter 8.
> + * @vector_count:Number of contiguous entries in the
> + *   Interrupt Descriptor Table that are
> + *   occupied by this Message-Signaled
> + *   Interrupt. For "MSI", as first defined
> + *   in PCI 2.2, this can be between 1 and
> + *   32. For "MSI-X," as first defined in PCI
> + *   3.0, this must be 1, as each MSI-X table
> + *   entry would have its own descriptor.
> + * @processor_count: number of bits enabled in array.
> + * @processor_array: All the target virtual processors.
> + */
> +struct hv_msi_desc2 {
> + u8  vector;
> + u8  delivery_mode;
> + u16 vector_count;
> + u16 processor_count;
> + u16 processor_array[32];
> +} __packed;
> +
> +/**
>   * struct tran_int_desc
>   * @reserved:unused, padding
>   * @vector_count:same as in hv_msi_desc
> @@ -309,6 +338,14 @@ struct pci_resources_assigned {
>   u32 reserved[4];
>  } __packed;
>
> +struct pci_resources_assigned2 {
> + struct pci_message message_type;
> + union win_slot_encoding wslot;
> + u8 memory_range[0x14][6];   /* not used here */
> + u32 msi_descriptor_count;
> + u8 reserved[70];
> +} __packed;
> +
>  struct pci_create_interrupt {
>   struct pci_message message_type;
>   union win_slot_encoding wslot;
> @@ -321,6 +358,12 @@ struct pci_create_int_response {
>   struct tran_int_desc int_desc;
>  } __packed;
>
> +struct pci_create_interrupt2 {
> + struct pci_message message_type;
> + union win_slot_encoding wslot;
> + struct hv_msi_desc2 int_desc;
> +} __packed;
> +
>  struct pci_delete_interrupt {
>   struct pci_message message_type;
>   union win_slot_encoding wslot;
> @@ -346,17 +389,42 @@ struct pci_eject_response {
>  #define HV_PARTITION_ID_SELF ((u64)-1)
>  #define HVCALL_RETARGET_INTERRUPT0x7e
>
> -struct retarget_msi_interrupt {
> - u64 partition_id;   /* use "self" */
> - u64 device_id;
> +struct hv_interrupt_entry {
>   u32 source; /* 1 for MSI(-X) */
>   u32 reserved1;
>   u32 address;
>   u32 data;
> - u64 reserved2;
> +};
> +
> +#define HV_VP_SET_BANK_COUNT_MAX 5 /* current implementation limit */
> +
> +struct hv_vp_set {
> + u64 format; /* 0 (HvGenericSetSparse4k) */
> + u64 valid_banks;
> + u64 masks[HV_VP_SET_BANK_COUNT_MAX];
> +};
> +
> +/*
> + * flags for hv_device_interrupt_target.flags
> + */
> +#define HV_DEVICE_INTERRUPT_TARGET_MULTICAST 1
> +#define HV_DEV

Re: [PATCH 4/4] Hyper-V vPCI: use vPCI protocol version 1.2

2017-05-19 Thread Vitaly Kuznetsov
Jork Loeser  writes:

>> -Original Message-
>> From: Stephen Hemminger [mailto:step...@networkplumber.org]
>> Sent: Thursday, May 18, 2017 16:59
>> 
>> > From: Jork Loeser 
>> >
>> > Update the Hyper-V vPCI driver to use the Server-2016 version of the
>> > vPCI protocol, fixing MSI creation and retargeting issues.
>> >
>> > Signed-off-by: Jork Loeser 
>> 
>> This patch conflicts with already submitted patch that removes
>> vmbus_cpu_number_to_vp_number()
>> 
>> commit 4b28e5c28cc32652d200a31795e38ee6c819a4a2
>> Author: Vitaly Kuznetsov 
>> Date:   Mon May 15 13:38:26 2017 -0700
>> 
>> hyper-v: globalize vp_index
>> 
>> To support implementing remote TLB flushing on Hyper-V with a hypercall
>> we need to make vp_index available outside of vmbus module. Rename and
>> globalize.
>
> Thank you Stephen, easy enough to adapt. 
>
> Bjorn, Greg, Vitaly: Do you have an ETA on when Vitaly's patch will be in the 
> PCI or linux-next branch so I can rev?
>

I was a bit surprised to see that these patches missed 4.12, K. Y. ACKed
them:

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2017-May/105466.html

and no other concerns were expressed.

To my understanding these patches should go through Greg's char-misc
tree. K. Y., Greg, please let me know if I need to rebase/resend.

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


[PATCH] [media] atomisp: disable several warnings when W=1

2017-05-19 Thread Mauro Carvalho Chehab
The atomisp currently produce hundreds of warnings when W=1.

It is a known fact that this driver is currently in bad
shape, and there are lot of things to be done here.

We don't want to be bothered by those "minor" stuff for now,
while the driver doesn't receive a major cleanup. So,
disable those warnings.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/staging/media/atomisp/i2c/Makefile  | 4 
 drivers/staging/media/atomisp/i2c/imx/Makefile  | 5 +
 drivers/staging/media/atomisp/i2c/ov5693/Makefile   | 5 +
 drivers/staging/media/atomisp/pci/atomisp2/Makefile | 5 +
 4 files changed, 19 insertions(+)

diff --git a/drivers/staging/media/atomisp/i2c/Makefile 
b/drivers/staging/media/atomisp/i2c/Makefile
index 466517c7c8e6..a1afca6ec31f 100644
--- a/drivers/staging/media/atomisp/i2c/Makefile
+++ b/drivers/staging/media/atomisp/i2c/Makefile
@@ -19,3 +19,7 @@ obj-$(CONFIG_VIDEO_AP1302) += ap1302.o
 
 obj-$(CONFIG_VIDEO_LM3554) += lm3554.o
 
+# HACK! While this driver is in bad shape, don't enable several warnings
+#   that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+-Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/i2c/imx/Makefile 
b/drivers/staging/media/atomisp/i2c/imx/Makefile
index 6b13a3a66e49..0eceb7374bec 100644
--- a/drivers/staging/media/atomisp/i2c/imx/Makefile
+++ b/drivers/staging/media/atomisp/i2c/imx/Makefile
@@ -4,3 +4,8 @@ imx1x5-objs := imx.o drv201.o ad5816g.o dw9714.o dw9719.o 
dw9718.o vcm.o otp.o o
 
 ov8858_driver-objs := ../ov8858.o dw9718.o vcm.o
 obj-$(CONFIG_VIDEO_OV8858) += ov8858_driver.o
+
+# HACK! While this driver is in bad shape, don't enable several warnings
+#   that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+ -Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/Makefile 
b/drivers/staging/media/atomisp/i2c/ov5693/Makefile
index c9c0e1245858..fd2ef2e3c31e 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/Makefile
+++ b/drivers/staging/media/atomisp/i2c/ov5693/Makefile
@@ -1 +1,6 @@
 obj-$(CONFIG_VIDEO_OV5693) += ov5693.o
+
+# HACK! While this driver is in bad shape, don't enable several warnings
+#   that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+ -Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/Makefile 
b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
index f126a89a08e9..8ccb5f29f2c1 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/Makefile
+++ b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
@@ -353,3 +353,8 @@ DEFINES += -DSYSTEM_hive_isp_css_2400_system -DISP2400
 
 ccflags-y += $(INCLUDES) $(DEFINES) -fno-common
 
+# HACK! While this driver is in bad shape, don't enable several warnings
+#   that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-const-variable -Wno-missing-prototypes \
+-Wno-unused-but-set-variable -Wno-missing-declarations \
+-Wno-suggest-attribute=format -Wno-missing-prototypes
-- 
2.9.3

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


Re: [PATCH 00/13] staging: media: atomisp queued up patches

2017-05-19 Thread Mauro Carvalho Chehab
Em Thu, 18 May 2017 17:40:27 +0100
Alan Cox  escreveu:

> On Thu, 2017-05-18 at 11:10 -0300, Mauro Carvalho Chehab wrote:
> > Em Thu, 18 May 2017 15:50:09 +0200
> > Greg Kroah-Hartman  escreveu:
> >   
> > > 
> > > Hi Mauro,
> > > 
> > > Here's the set of accumulated atomisp staging patches that I had in
> > > my
> > > to-review mailbox.  After this, my queue is empty, the driver is
> > > all
> > > yours!  
> > 
> > Thanks!
> > 
> > Alan, please let me know if you prefer if I don't apply any of
> > such patches, otherwise I should be merging them tomorrow ;)  
> 
> I will assume you've merged them and resync the internal patch queue I
> have here to that. 

Merged, thanks! I'll also merge a patch I just sent with disables
several warnings that W=1 would otherwise turn on. They indicate
real issues there, but, as you pointed, there are much more
important tasks to to than to try fixing those warnings.

> At the moment I'm still slowly trying to unthread
> some of the fascinating layers of indirection without actually breaking
> anything.

I don't envy you trying to get some sense out of it ;-)

Good luck!

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


Re: [PATCH 3/4] Hyper-V vPCI: Add vPCI version protocol negotiation

2017-05-19 Thread Dan Carpenter
On Thu, May 18, 2017 at 12:14:29PM -0700, Jork Loeser wrote:
>  static int hv_pci_protocol_negotiation(struct hv_device *hdev)
>  {
> + size_t i;

Could you just use "int i".  I know some static checkers complain but
those tools are dumb.  I just fixed a couple bugs two days ago where
people were like, "If i is declared as a u32 that means it's safe" and
it turns out, nope.  No need to get fancy.

And could you put the i at the end of the declaration block in reverse
Christmas tree order?  It matches the others in this function.

lng var;
meeedium var;
int ret;
int i;

>   struct pci_version_request *version_req;
>   struct hv_pci_compl comp_pkt;
>   struct pci_packet *pkt;
> @@ -1816,28 +1832,44 @@ static int hv_pci_protocol_negotiation(struct 
> hv_device *hdev)
>   pkt->compl_ctxt = &comp_pkt;
>   version_req = (struct pci_version_request *)&pkt->message;
>   version_req->message_type.type = PCI_QUERY_PROTOCOL_VERSION;
> - version_req->protocol_version = PCI_PROTOCOL_VERSION_CURRENT;
>  
> - ret = vmbus_sendpacket(hdev->channel, version_req,
> -sizeof(struct pci_version_request),
> -(unsigned long)pkt, VM_PKT_DATA_INBAND,
> -VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
> - if (ret)
> - goto exit;
> + for (i = 0; i < ARRAY_SIZE(pci_protocol_versions); i++) {
> + version_req->protocol_version = pci_protocol_versions[i];
> + ret = vmbus_sendpacket(
> + hdev->channel, version_req,
> + sizeof(struct pci_version_request),
> + (unsigned long)pkt, VM_PKT_DATA_INBAND,
> + VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);

The indenting is messed up because VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED
is really long.  http://new_words.enacademic.com/2023/noun-banging
NOUN_NOUN_NOUN_NOUN_NOUN_ADJECTIVE.  I guess do this:

ret = vmbus_sendpacket(hdev->channel, version_req,
sizeof(*version_req), (unsigned long)pkt,
VM_PKT_DATA_INBAND,
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);

> + if (ret)
> + goto exit;

This "goto exit;" prints a successful message, but it's a failure path.
We also print a message on every iteration through this function.  Since
we only go through the function once in the current code it's works but
let's fix it.

regards,
dan carpenter

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


Re: [PATCH 4/4] Hyper-V vPCI: use vPCI protocol version 1.2

2017-05-19 Thread Dan Carpenter
Minor nits only.

On Thu, May 18, 2017 at 12:14:30PM -0700, Jork Loeser wrote:
> From: Jork Loeser 
> 
> Update the Hyper-V vPCI driver to use the Server-2016 version
> of the vPCI protocol, fixing MSI creation and retargeting issues.
> 
> Signed-off-by: Jork Loeser 
> ---
>  arch/x86/include/uapi/asm/hyperv.h |6 +
>  drivers/pci/host/pci-hyperv.c  |  297 
> ++--
>  2 files changed, 255 insertions(+), 48 deletions(-)
> 
> diff --git a/arch/x86/include/uapi/asm/hyperv.h 
> b/arch/x86/include/uapi/asm/hyperv.h
> index 432df4b..237ec6c 100644
> --- a/arch/x86/include/uapi/asm/hyperv.h
> +++ b/arch/x86/include/uapi/asm/hyperv.h
> @@ -153,6 +153,12 @@
>  #define HV_X64_DEPRECATING_AEOI_RECOMMENDED  (1 << 9)
>  
>  /*
> + * HV_VP_SET available
> + */
> +#define HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED(1 << 11)

Use BIT(11).  I thought checkpatch.pl complains about this but I guess
that's only with the --strict option.

> +
> +
> +/*
>   * Crash notification flag.
>   */
>  #define HV_CRASH_CTL_CRASH_NOTIFY (1ULL << 63)
> diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
> index 5f4e136..9780050 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -70,6 +70,7 @@
>  
>  enum pci_protocol_version_t {
>   PCI_PROTOCOL_VERSION_1_1 = PCI_MAKE_VERSION(1, 1),  /* Win10 */
> + PCI_PROTOCOL_VERSION_1_2 = PCI_MAKE_VERSION(1, 2),  /* RS1 */
>  };
>  
>  #define CPU_AFFINITY_ALL -1ULL
> @@ -79,6 +80,7 @@ enum pci_protocol_version_t {
>   * first.
>   */
>  static enum pci_protocol_version_t pci_protocol_versions[] = {
> + PCI_PROTOCOL_VERSION_1_2,
>   PCI_PROTOCOL_VERSION_1_1,
>  };
>  
> @@ -124,6 +126,9 @@ enum pci_message_type {
>   PCI_QUERY_PROTOCOL_VERSION  = PCI_MESSAGE_BASE + 0x13,
>   PCI_CREATE_INTERRUPT_MESSAGE= PCI_MESSAGE_BASE + 0x14,
>   PCI_DELETE_INTERRUPT_MESSAGE= PCI_MESSAGE_BASE + 0x15,
> + PCI_RESOURCES_ASSIGNED2 = PCI_MESSAGE_BASE + 0x16,
> + PCI_CREATE_INTERRUPT_MESSAGE2   = PCI_MESSAGE_BASE + 0x17,
> + PCI_DELETE_INTERRUPT_MESSAGE2   = PCI_MESSAGE_BASE + 0x18, /* unused */
>   PCI_MESSAGE_MAXIMUM
>  };
>  
> @@ -194,6 +199,30 @@ struct hv_msi_desc {
>  } __packed;
>  
>  /**
> + * struct hv_msi_desc2 - 1.2 version of hv_msi_desc
> + * @vector:  IDT entry
> + * @delivery_mode:   As defined in Intel's Programmer's
> + *   Reference Manual, Volume 3, Chapter 8.
> + * @vector_count:Number of contiguous entries in the
> + *   Interrupt Descriptor Table that are
> + *   occupied by this Message-Signaled
> + *   Interrupt. For "MSI", as first defined
> + *   in PCI 2.2, this can be between 1 and
> + *   32. For "MSI-X," as first defined in PCI
> + *   3.0, this must be 1, as each MSI-X table
> + *   entry would have its own descriptor.
> + * @processor_count: number of bits enabled in array.
> + * @processor_array: All the target virtual processors.
> + */
> +struct hv_msi_desc2 {
> + u8  vector;
> + u8  delivery_mode;
> + u16 vector_count;
> + u16 processor_count;
> + u16 processor_array[32];
> +} __packed;
> +
> +/**
>   * struct tran_int_desc
>   * @reserved:unused, padding
>   * @vector_count:same as in hv_msi_desc
> @@ -309,6 +338,14 @@ struct pci_resources_assigned {
>   u32 reserved[4];
>  } __packed;
>  
> +struct pci_resources_assigned2 {
> + struct pci_message message_type;
> + union win_slot_encoding wslot;
> + u8 memory_range[0x14][6];   /* not used here */
> + u32 msi_descriptor_count;
> + u8 reserved[70];
> +} __packed;
> +
>  struct pci_create_interrupt {
>   struct pci_message message_type;
>   union win_slot_encoding wslot;
> @@ -321,6 +358,12 @@ struct pci_create_int_response {
>   struct tran_int_desc int_desc;
>  } __packed;
>  
> +struct pci_create_interrupt2 {
> + struct pci_message message_type;
> + union win_slot_encoding wslot;
> + struct hv_msi_desc2 int_desc;
> +} __packed;
> +
>  struct pci_delete_interrupt {
>   struct pci_message message_type;
>   union win_slot_encoding wslot;
> @@ -346,17 +389,42 @@ struct pci_eject_response {
>  #define HV_PARTITION_ID_SELF ((u64)-1)
>  #define HVCALL_RETARGET_INTERRUPT0x7e
>  
> -struct retarget_msi_interrupt {
> - u64 partition_id;   /* use "self" */
> - u64 device_id;
> +struct hv_interrupt_entry {
>   u32 source; /* 1 for MSI(-X) */
>   u32 reserved1;
>   u32 address;
>   u32 data;
> - u64 reserved2;
> +};
> +
> +#define HV_VP_SET_BANK_COUNT_MAX 5 /* current implementation limit */
> +
> +struct hv_vp_set {
> + u64 format; /* 0 (HvGenericSetSparse4k) */
> + u64 valid_banks;
> +

[PATCH v2 1/6] [media] atomisp: disable several warnings when W=1

2017-05-19 Thread Mauro Carvalho Chehab
The atomisp currently produce hundreds of warnings when W=1.

It is a known fact that this driver is currently in bad
shape, and there are lot of things to be done here.

We don't want to be bothered by those "minor" stuff for now,
while the driver doesn't receive a major cleanup. So,
disable those warnings.

Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/staging/media/atomisp/i2c/Makefile  | 4 
 drivers/staging/media/atomisp/i2c/imx/Makefile  | 5 +
 drivers/staging/media/atomisp/i2c/ov5693/Makefile   | 5 +
 drivers/staging/media/atomisp/pci/atomisp2/Makefile | 6 ++
 4 files changed, 20 insertions(+)

diff --git a/drivers/staging/media/atomisp/i2c/Makefile 
b/drivers/staging/media/atomisp/i2c/Makefile
index 466517c7c8e6..a1afca6ec31f 100644
--- a/drivers/staging/media/atomisp/i2c/Makefile
+++ b/drivers/staging/media/atomisp/i2c/Makefile
@@ -19,3 +19,7 @@ obj-$(CONFIG_VIDEO_AP1302) += ap1302.o
 
 obj-$(CONFIG_VIDEO_LM3554) += lm3554.o
 
+# HACK! While this driver is in bad shape, don't enable several warnings
+#   that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+-Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/i2c/imx/Makefile 
b/drivers/staging/media/atomisp/i2c/imx/Makefile
index 6b13a3a66e49..0eceb7374bec 100644
--- a/drivers/staging/media/atomisp/i2c/imx/Makefile
+++ b/drivers/staging/media/atomisp/i2c/imx/Makefile
@@ -4,3 +4,8 @@ imx1x5-objs := imx.o drv201.o ad5816g.o dw9714.o dw9719.o 
dw9718.o vcm.o otp.o o
 
 ov8858_driver-objs := ../ov8858.o dw9718.o vcm.o
 obj-$(CONFIG_VIDEO_OV8858) += ov8858_driver.o
+
+# HACK! While this driver is in bad shape, don't enable several warnings
+#   that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+ -Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/Makefile 
b/drivers/staging/media/atomisp/i2c/ov5693/Makefile
index c9c0e1245858..fd2ef2e3c31e 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/Makefile
+++ b/drivers/staging/media/atomisp/i2c/ov5693/Makefile
@@ -1 +1,6 @@
 obj-$(CONFIG_VIDEO_OV5693) += ov5693.o
+
+# HACK! While this driver is in bad shape, don't enable several warnings
+#   that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-but-set-variable -Wno-missing-prototypes \
+ -Wno-unused-const-variable -Wno-missing-declarations
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/Makefile 
b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
index f126a89a08e9..68a9ab1c3b61 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/Makefile
+++ b/drivers/staging/media/atomisp/pci/atomisp2/Makefile
@@ -353,3 +353,9 @@ DEFINES += -DSYSTEM_hive_isp_css_2400_system -DISP2400
 
 ccflags-y += $(INCLUDES) $(DEFINES) -fno-common
 
+# HACK! While this driver is in bad shape, don't enable several warnings
+#   that would be otherwise enabled with W=1
+ccflags-y += -Wno-unused-const-variable -Wno-missing-prototypes \
+-Wno-unused-but-set-variable -Wno-missing-declarations \
+-Wno-suggest-attribute=format -Wno-missing-prototypes \
+-Wno-implicit-fallthrough
-- 
2.9.3


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


[PATCH 1/3] staging: fsl-mc: fix several checkpath.pl warnings

2017-05-19 Thread laurentiu.tudor
From: Laurentiu Tudor 

Remove several unneeded #includes, forward
declarations and fix several issues reported
by checkpatch.pl --strict, such as:
 - kfree(NULL) is safe and check is not required
 - macro argument reuse may cause possible side effects
 - enclose macro params in parens to avoid precedence issues
 - coding style

Signed-off-by: Laurentiu Tudor 
---
 drivers/staging/fsl-mc/bus/dpbp-cmd.h |  2 +-
 drivers/staging/fsl-mc/bus/dpmcp-cmd.h|  2 +-
 drivers/staging/fsl-mc/bus/dpmng-cmd.h|  2 +-
 drivers/staging/fsl-mc/bus/dprc-cmd.h |  2 +-
 drivers/staging/fsl-mc/bus/dprc-driver.c  | 10 +++---
 drivers/staging/fsl-mc/bus/fsl-mc-allocator.c | 11 +++
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c   | 12 +++-
 drivers/staging/fsl-mc/bus/fsl-mc-msi.c   |  1 +
 drivers/staging/fsl-mc/bus/fsl-mc-private.h   |  1 -
 drivers/staging/fsl-mc/include/dprc.h |  3 ---
 drivers/staging/fsl-mc/include/mc-sys.h   |  1 -
 11 files changed, 22 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h 
b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
index 8aa6545..5904836 100644
--- a/drivers/staging/fsl-mc/bus/dpbp-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
@@ -40,7 +40,7 @@
 #define DPBP_CMD_BASE_VERSION  1
 #define DPBP_CMD_ID_OFFSET 4
 
-#define DPBP_CMD(id)   ((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
+#define DPBP_CMD(id)   (((id) << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
 
 /* Command IDs */
 #define DPBP_CMDID_CLOSE   DPBP_CMD(0x800)
diff --git a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h 
b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
index 384a13d..861b2a7 100644
--- a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
@@ -40,7 +40,7 @@
 #define DPMCP_CMD_BASE_VERSION 1
 #define DPMCP_CMD_ID_OFFSET4
 
-#define DPMCP_CMD(id)  ((id << DPMCP_CMD_ID_OFFSET) | DPMCP_CMD_BASE_VERSION)
+#define DPMCP_CMD(id)  (((id) << DPMCP_CMD_ID_OFFSET) | DPMCP_CMD_BASE_VERSION)
 
 /* Command IDs */
 #define DPMCP_CMDID_CLOSE  DPMCP_CMD(0x800)
diff --git a/drivers/staging/fsl-mc/bus/dpmng-cmd.h 
b/drivers/staging/fsl-mc/bus/dpmng-cmd.h
index cdddfb8..d1f04ac 100644
--- a/drivers/staging/fsl-mc/bus/dpmng-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dpmng-cmd.h
@@ -44,7 +44,7 @@
 #define DPMNG_CMD_BASE_VERSION 1
 #define DPMNG_CMD_ID_OFFSET4
 
-#define DPMNG_CMD(id)  ((id << DPMNG_CMD_ID_OFFSET) | DPMNG_CMD_BASE_VERSION)
+#define DPMNG_CMD(id)  (((id) << DPMNG_CMD_ID_OFFSET) | DPMNG_CMD_BASE_VERSION)
 
 /* Command IDs */
 #define DPMNG_CMDID_GET_VERSIONDPMNG_CMD(0x831)
diff --git a/drivers/staging/fsl-mc/bus/dprc-cmd.h 
b/drivers/staging/fsl-mc/bus/dprc-cmd.h
index e9fdca4..d9b2dcd 100644
--- a/drivers/staging/fsl-mc/bus/dprc-cmd.h
+++ b/drivers/staging/fsl-mc/bus/dprc-cmd.h
@@ -48,7 +48,7 @@
 #define DPRC_CMD_BASE_VERSION  1
 #define DPRC_CMD_ID_OFFSET 4
 
-#define DPRC_CMD(id)   ((id << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION)
+#define DPRC_CMD(id)   (((id) << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION)
 
 /* Command IDs */
 #define DPRC_CMDID_CLOSEDPRC_CMD(0x800)
diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c 
b/drivers/staging/fsl-mc/bus/dprc-driver.c
index d723c69..39c9a3b 100644
--- a/drivers/staging/fsl-mc/bus/dprc-driver.c
+++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
@@ -21,9 +21,13 @@
 
 #define FSL_MC_DPRC_DRIVER_NAME"fsl_mc_dprc"
 
-#define FSL_MC_DEVICE_MATCH(_mc_dev, _obj_desc) \
-   (strcmp((_mc_dev)->obj_desc.type, (_obj_desc)->type) == 0 && \
-(_mc_dev)->obj_desc.id == (_obj_desc)->id)
+#define FSL_MC_DEVICE_MATCH(_mc_dev, _obj_desc)
\
+({ \
+   struct fsl_mc_device *__mc_dev = _mc_dev;   \
+   struct dprc_obj_desc *__obj_desc = _obj_desc;   \
+   (strcmp(__mc_dev->obj_desc.type, __obj_desc->type) == 0 &&  \
+   __mc_dev->obj_desc.id == __obj_desc->id);   \
+})
 
 struct dprc_child_objs {
int child_count;
diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c 
b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
index ce07096..d3def40 100644
--- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
+++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
@@ -17,10 +17,13 @@
 #include "dpcon-cmd.h"
 #include "fsl-mc-private.h"
 
-#define FSL_MC_IS_ALLOCATABLE(_obj_type) \
-   (strcmp(_obj_type, "dpbp") == 0 || \
-strcmp(_obj_type, "dpmcp") == 0 || \
-strcmp(_obj_type, "dpcon") == 0)
+#define FSL_MC_IS_ALLOCATABLE(_obj_type)   \
+({ \
+   const char *__obj_type = _obj_type; \
+   (strcmp(__obj_type, "dpbp") == 0 || \
+strcmp(__ob

[PATCH 0/3][v4] staging: fsl-mc: move bus driver out of staging

2017-05-19 Thread laurentiu.tudor
From: Laurentiu Tudor 

Now that there is a functional ethernet driver probed on the
mc bus this patch series requests that the fsl-mc bus driver
be moved out of staging.

The proposed destination for the bus driver is drivers/bus.
Proposed location for global header files for fsl-mc and dpaa2
is the already existing include/linux/fsl.

First couple of patches fix several checkpatch.pl issues and
the last patch moves the bus out of staging, updating all
the users (e.g. #include paths).

Based on:
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git, staging-next

Link to previous version:
https://lkml.org/lkml/2016/12/1/758

Link to last round of driver model fixes & cleanups:
https://lkml.org/lkml/2017/2/1/235

version 4 changes
 - rebased on latest staging-next
 - dpio was submitted separately so dropped from the series
 - several checkpatch.pl --strict fixes (first 2 patches)
 - update existing dpaa2 drivers to match the new fsl-mc bus location

version 3 changes
   -zero memory allocated for a dpio store
   -replace hardcoded dequeue token with a #define and look for
that token when checking for a new result

version 2 changes (mostly feedback from Ioana Radulescu)
   -removed unused structs and defines in dpio command definitions
   -added setter/getter for the FD ctrl field
   -corrected comment for SG format_offset field description
   -added support for short length field in FD
   -fix bug in buffer release command, by setting bpid field
   -handle error (NULL) return value from qbman_swp_mc_complete()
   -fix bug in sending management commands where the verb was
properly initialized
   -use service_select_by_cpu() for re-arming DPIO interrupts
   -replace use of NR_CPUS with num_possible_cpus()
   -handle error case where number of DPIOs exceeds number of possible
CPUs
   -error message cleanup
   -updated MAINTAINERS file with proper location for both fsl-mc bus
driver and dpio driver

Laurentiu Tudor (2):
  staging: fsl-mc: fix several checkpath.pl warnings
  staging: fsl-mc: add binding path to MAINTAINERS

Stuart Yoder (1):
  staging: fsl-mc: move bus driver out of staging

 .../README.txt => Documentation/dpaa2/overview.txt|  0
 MAINTAINERS   |  3 ++-
 drivers/bus/Kconfig   |  2 ++
 drivers/bus/Makefile  |  3 +++
 drivers/bus/fsl-mc/Kconfig| 17 +
 drivers/bus/fsl-mc/Makefile   | 19 +++
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp-cmd.h |  2 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c |  6 +++---
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp-cmd.h|  2 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.c|  4 ++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.h|  0
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dpmng-cmd.h|  2 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng.c|  6 +++---
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-cmd.h |  2 +-
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dprc-driver.c  |  6 +++---
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc.c |  6 +++---
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-allocator.c  | 17 ++---
 .../{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-bus.c   | 18 ++
 .../{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-msi.c   |  4 +++-
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-private.h|  5 +++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-io.c|  5 +++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-sys.c   |  6 +++---
 drivers/irqchip/Makefile  |  1 +
 .../bus => irqchip}/irq-gic-v3-its-fsl-mc-msi.c   |  3 +--
 drivers/staging/fsl-dpaa2/ethernet/README |  2 +-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c|  4 ++--
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h|  2 +-
 drivers/staging/fsl-dpaa2/ethernet/dpni.c |  4 ++--
 drivers/staging/fsl-mc/TODO   | 18 --
 drivers/staging/fsl-mc/bus/Kconfig| 10 --
 drivers/staging/fsl-mc/bus/Makefile   | 15 +--
 drivers/staging/fsl-mc/bus/dpcon.c|  8 
 drivers/staging/fsl-mc/bus/dpio/dpio-driver.c |  2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio-service.c|  2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio.c|  4 ++--
 .../fsl-mc/include => include/linux/fsl}/dpbp.h   |  0
 .../fsl-mc/bus => include/linux/fsl}/dpcon-cmd.h  |  0
 .../fsl-mc/include => include/linux/fsl}/dpmng.h  |  0
 .../fsl-mc/include => include/linux/fsl}/dprc.h   |  4 
 .../fsl-mc/include => include/linux/fsl}/mc-bus.h |  2 +-
 .../fsl-mc/include => include/linux/fsl}/mc-cmd.h |  0
 .../fsl-mc/include => include/linux/fsl}/mc-sys.h |  1 -
 .../staging/fsl-mc/include => include/linux/fsl}/mc.h |  2 +-
 43 files c

[PATCH 3/3][v4] staging: fsl-mc: move bus driver out of staging

2017-05-19 Thread laurentiu.tudor
From: Stuart Yoder 

Move the source files out of staging into their final locations:
  -include files in drivers/staging/fsl-mc/include go to include/linux/fsl
  -irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip
  -source in drivers/staging/fsl-mc/bus goes to drivers/bus/fsl-mc
  -README.txt, providing and overview of DPAA goes to
   Documentation/dpaa2/overview.txt

Update or delete other remaining staging files-- Makefile, Kconfig, TODO.
Update dpaa2_eth and dpio staging drivers.

Signed-off-by: Stuart Yoder 
Signed-off-by: Laurentiu Tudor 
[Laurentiu: rebased, add dpaa2_eth and dpio #include updates]
Cc: Thomas Gleixner 
Cc: Jason Cooper 
Cc: Marc Zyngier 
---

Notes:
-v4
  -rebased
  -update existing dpaa2 drivers to work with the bus out of staging
-v3
  -no changes
-v2
  -updated MAINTAINERS with new location

 .../README.txt => Documentation/dpaa2/overview.txt|  0
 MAINTAINERS   |  2 +-
 drivers/bus/Kconfig   |  2 ++
 drivers/bus/Makefile  |  3 +++
 drivers/bus/fsl-mc/Kconfig| 17 +
 drivers/bus/fsl-mc/Makefile   | 19 +++
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp-cmd.h |  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c |  6 +++---
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp-cmd.h|  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.c|  4 ++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.h|  0
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dpmng-cmd.h|  0
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng.c|  6 +++---
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-cmd.h |  0
 .../{staging/fsl-mc/bus => bus/fsl-mc}/dprc-driver.c  |  4 ++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc.c |  6 +++---
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-allocator.c  |  6 +++---
 .../{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-bus.c   |  6 +++---
 .../{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-msi.c   |  5 +++--
 .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-private.h|  2 +-
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-io.c|  5 +++--
 drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-sys.c   |  6 +++---
 drivers/irqchip/Makefile  |  1 +
 .../bus => irqchip}/irq-gic-v3-its-fsl-mc-msi.c   |  3 +--
 drivers/staging/fsl-dpaa2/ethernet/README |  2 +-
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c|  4 ++--
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h|  2 +-
 drivers/staging/fsl-dpaa2/ethernet/dpni.c |  4 ++--
 drivers/staging/fsl-mc/TODO   | 18 --
 drivers/staging/fsl-mc/bus/Kconfig| 10 --
 drivers/staging/fsl-mc/bus/Makefile   | 15 +--
 drivers/staging/fsl-mc/bus/dpcon.c|  8 
 drivers/staging/fsl-mc/bus/dpio/dpio-driver.c |  2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio-service.c|  2 +-
 drivers/staging/fsl-mc/bus/dpio/dpio.c|  4 ++--
 .../fsl-mc/include => include/linux/fsl}/dpbp.h   |  0
 .../fsl-mc/bus => include/linux/fsl}/dpcon-cmd.h  |  0
 .../fsl-mc/include => include/linux/fsl}/dpmng.h  |  0
 .../fsl-mc/include => include/linux/fsl}/dprc.h   |  1 -
 .../fsl-mc/include => include/linux/fsl}/mc-bus.h |  2 +-
 .../fsl-mc/include => include/linux/fsl}/mc-cmd.h |  0
 .../fsl-mc/include => include/linux/fsl}/mc-sys.h |  0
 .../staging/fsl-mc/include => include/linux/fsl}/mc.h |  2 +-
 43 files changed, 90 insertions(+), 89 deletions(-)
 rename drivers/staging/fsl-mc/README.txt => Documentation/dpaa2/overview.txt 
(100%)
 create mode 100644 drivers/bus/fsl-mc/Kconfig
 create mode 100644 drivers/bus/fsl-mc/Makefile
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (98%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.c (98%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng.c (96%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-cmd.h (100%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-driver.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-allocator.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-bus.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-msi.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-private.h (98%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-io.c (99%)
 rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-sys.c (99%)
 rename drivers/{sta

[PATCH 2/3] staging: fsl-mc: add binding path to MAINTAINERS

2017-05-19 Thread laurentiu.tudor
From: Laurentiu Tudor 

Signed-off-by: Laurentiu Tudor 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f7d568b..50b3c36 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10542,6 +10542,7 @@ M:  Laurentiu Tudor 
 L: linux-ker...@vger.kernel.org
 S: Maintained
 F: drivers/staging/fsl-mc/
+F: Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt
 
 QT1010 MEDIA DRIVER
 M: Antti Palosaari 
-- 
2.9.4

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


Re: [PATCH 3/3][v4] staging: fsl-mc: move bus driver out of staging

2017-05-19 Thread Matthias Brugger



On 19/05/17 15:13, laurentiu.tu...@nxp.com wrote:

From: Stuart Yoder 

Move the source files out of staging into their final locations:
   -include files in drivers/staging/fsl-mc/include go to include/linux/fsl
   -irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip


This driver has as compatible "arm,gic-v3-its". I wonder if this is 
correct and if it should be moved like this out of staging.


Regards,
Matthias


   -source in drivers/staging/fsl-mc/bus goes to drivers/bus/fsl-mc
   -README.txt, providing and overview of DPAA goes to
Documentation/dpaa2/overview.txt

Update or delete other remaining staging files-- Makefile, Kconfig, TODO.
Update dpaa2_eth and dpio staging drivers.

Signed-off-by: Stuart Yoder 
Signed-off-by: Laurentiu Tudor 
[Laurentiu: rebased, add dpaa2_eth and dpio #include updates]
Cc: Thomas Gleixner 
Cc: Jason Cooper 
Cc: Marc Zyngier 
---

Notes:
 -v4
   -rebased
   -update existing dpaa2 drivers to work with the bus out of staging
 -v3
   -no changes
 -v2
   -updated MAINTAINERS with new location

  .../README.txt => Documentation/dpaa2/overview.txt|  0
  MAINTAINERS   |  2 +-
  drivers/bus/Kconfig   |  2 ++
  drivers/bus/Makefile  |  3 +++
  drivers/bus/fsl-mc/Kconfig| 17 +
  drivers/bus/fsl-mc/Makefile   | 19 +++
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp-cmd.h |  0
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c |  6 +++---
  .../{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp-cmd.h|  0
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.c|  4 ++--
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.h|  0
  .../{staging/fsl-mc/bus => bus/fsl-mc}/dpmng-cmd.h|  0
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng.c|  6 +++---
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-cmd.h |  0
  .../{staging/fsl-mc/bus => bus/fsl-mc}/dprc-driver.c  |  4 ++--
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc.c |  6 +++---
  .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-allocator.c  |  6 +++---
  .../{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-bus.c   |  6 +++---
  .../{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-msi.c   |  5 +++--
  .../fsl-mc/bus => bus/fsl-mc}/fsl-mc-private.h|  2 +-
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-io.c|  5 +++--
  drivers/{staging/fsl-mc/bus => bus/fsl-mc}/mc-sys.c   |  6 +++---
  drivers/irqchip/Makefile  |  1 +
  .../bus => irqchip}/irq-gic-v3-its-fsl-mc-msi.c   |  3 +--
  drivers/staging/fsl-dpaa2/ethernet/README |  2 +-
  drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c|  4 ++--
  drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h|  2 +-
  drivers/staging/fsl-dpaa2/ethernet/dpni.c |  4 ++--
  drivers/staging/fsl-mc/TODO   | 18 --
  drivers/staging/fsl-mc/bus/Kconfig| 10 --
  drivers/staging/fsl-mc/bus/Makefile   | 15 +--
  drivers/staging/fsl-mc/bus/dpcon.c|  8 
  drivers/staging/fsl-mc/bus/dpio/dpio-driver.c |  2 +-
  drivers/staging/fsl-mc/bus/dpio/dpio-service.c|  2 +-
  drivers/staging/fsl-mc/bus/dpio/dpio.c|  4 ++--
  .../fsl-mc/include => include/linux/fsl}/dpbp.h   |  0
  .../fsl-mc/bus => include/linux/fsl}/dpcon-cmd.h  |  0
  .../fsl-mc/include => include/linux/fsl}/dpmng.h  |  0
  .../fsl-mc/include => include/linux/fsl}/dprc.h   |  1 -
  .../fsl-mc/include => include/linux/fsl}/mc-bus.h |  2 +-
  .../fsl-mc/include => include/linux/fsl}/mc-cmd.h |  0
  .../fsl-mc/include => include/linux/fsl}/mc-sys.h |  0
  .../staging/fsl-mc/include => include/linux/fsl}/mc.h |  2 +-
  43 files changed, 90 insertions(+), 89 deletions(-)
  rename drivers/staging/fsl-mc/README.txt => Documentation/dpaa2/overview.txt 
(100%)
  create mode 100644 drivers/bus/fsl-mc/Kconfig
  create mode 100644 drivers/bus/fsl-mc/Makefile
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp-cmd.h (100%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpbp.c (98%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp-cmd.h (100%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.c (98%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmcp.h (100%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng-cmd.h (100%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dpmng.c (96%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-cmd.h (100%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc-driver.c (99%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/dprc.c (99%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-allocator.c (99%)
  rename drivers/{staging/fsl-mc/bus => bus/fsl-mc}/fsl-mc-bus.c (99%)
  rename drivers/

RE: [PATCH 4/4] Hyper-V vPCI: use vPCI protocol version 1.2

2017-05-19 Thread KY Srinivasan


> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Friday, May 19, 2017 3:03 AM
> To: Jork Loeser ; KY Srinivasan
> 
> Cc: Stephen Hemminger ; Greg Kroah-
> Hartman ; helg...@kernel.org;
> o...@aepfle.de; Stephen Hemminger ; linux-
> p...@vger.kernel.org; jasow...@redhat.com; linux-ker...@vger.kernel.org;
> marcelo.ce...@canonical.com; a...@canonical.com;
> de...@linuxdriverproject.org; leann.ogasaw...@canonical.com
> Subject: Re: [PATCH 4/4] Hyper-V vPCI: use vPCI protocol version 1.2
> 
> Jork Loeser  writes:
> 
> >> -Original Message-
> >> From: Stephen Hemminger [mailto:step...@networkplumber.org]
> >> Sent: Thursday, May 18, 2017 16:59
> >>
> >> > From: Jork Loeser 
> >> >
> >> > Update the Hyper-V vPCI driver to use the Server-2016 version of the
> >> > vPCI protocol, fixing MSI creation and retargeting issues.
> >> >
> >> > Signed-off-by: Jork Loeser 
> >>
> >> This patch conflicts with already submitted patch that removes
> >> vmbus_cpu_number_to_vp_number()
> >>
> >> commit 4b28e5c28cc32652d200a31795e38ee6c819a4a2
> >> Author: Vitaly Kuznetsov 
> >> Date:   Mon May 15 13:38:26 2017 -0700
> >>
> >> hyper-v: globalize vp_index
> >>
> >> To support implementing remote TLB flushing on Hyper-V with a
> hypercall
> >> we need to make vp_index available outside of vmbus module.
> Rename and
> >> globalize.
> >
> > Thank you Stephen, easy enough to adapt.
> >
> > Bjorn, Greg, Vitaly: Do you have an ETA on when Vitaly's patch will be in 
> > the
> PCI or linux-next branch so I can rev?
> >
> 
> I was a bit surprised to see that these patches missed 4.12, K. Y. ACKed
> them:
> 
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdriverd
> ev.linuxdriverproject.org%2Fpipermail%2Fdriverdev-devel%2F2017-
> May%2F105466.html&data=02%7C01%7Ckys%40microsoft.com%7Ce1b07306
> cc1d433acb3108d49e9e412b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7
> C0%7C636307849924808831&sdata=0JsGx0Ax1DN6Zak8%2BHjLNiaVZBcq%2F
> O2%2F7DrlUtUz1%2BU%3D&reserved=0
> 
> and no other concerns were expressed.
> 
> To my understanding these patches should go through Greg's char-misc
> tree. K. Y., Greg, please let me know if I need to rebase/resend.

My mistake; I was thinking perhaps they will go through x86 tree. Please 
resend, I will take it
through Greg's tree.

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


[PATCH v3 00/10] Hyper-V: praravirtualized remote TLB flushing and hypercall improvements

2017-05-19 Thread Vitaly Kuznetsov
Changes since v2:
- Rebased to the latest char-misc-next tree.
- Added Acked-By and Tested-By tags.

Original descriptions:

Hyper-V supports hypercalls for doing local and remote TLB flushing and
gives its guests hints when using hypercall is preferred. While doing
hypercalls for local TLB flushes is probably not practical (and is not
being suggested by modern Hyper-V versions) remote TLB flush with a
hypercall brings significant improvement.

To test the series I wrote a special 'TLB trasher': on a 16 vCPU guest I
was creating 32 threads which were doing 10 mmap/munmaps each on some
big file. Here are the results:

Before:
# time ./pthread_mmap ./randfile 
real3m44.994s
user0m3.829s
sys 3m36.323s

After:
# time ./pthread_mmap ./randfile 
real2m57.145s
user0m3.797s
sys 2m34.812s

This series brings a number of small improvements along the way: fast
hypercall implementation and using it for event signaling, rep hypercalls
implementation, hyperv tracing subsystem (which only traces the newly added
remote TLB flush for now).

Vitaly Kuznetsov (10):
  x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set
  x86/hyper-v: stash the max number of virtual/logical processor
  x86/hyper-v: make hv_do_hypercall() inline
  x86/hyper-v: fast hypercall implementation
  hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT
  x86/hyper-v: implement rep hypercalls
  hyper-v: globalize vp_index
  x86/hyper-v: use hypercall for remote TLB flush
  x86/hyper-v: support extended CPU ranges for TLB flush hypercalls
  tracing/hyper-v: trace hyperv_mmu_flush_tlb_others()

 MAINTAINERS |   1 +
 arch/x86/Kbuild |   4 +-
 arch/x86/hyperv/Makefile|   2 +-
 arch/x86/hyperv/hv_init.c   |  90 ++--
 arch/x86/hyperv/mmu.c   | 270 
 arch/x86/include/asm/mshyperv.h | 149 +++-
 arch/x86/include/asm/trace/hyperv.h |  34 +
 arch/x86/include/uapi/asm/hyperv.h  |  36 +
 arch/x86/kernel/cpu/mshyperv.c  |  14 +-
 drivers/hv/channel_mgmt.c   |  22 ++-
 drivers/hv/connection.c |   8 +-
 drivers/hv/hv.c |   9 --
 drivers/hv/hyperv_vmbus.h   |  11 --
 drivers/hv/vmbus_drv.c  |  17 ---
 drivers/pci/host/pci-hyperv.c   |   4 +-
 include/linux/hyperv.h  |  21 ++-
 16 files changed, 568 insertions(+), 124 deletions(-)
 create mode 100644 arch/x86/hyperv/mmu.c
 create mode 100644 arch/x86/include/asm/trace/hyperv.h

-- 
2.9.3

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


[PATCH v3 02/10] x86/hyper-v: stash the max number of virtual/logical processor

2017-05-19 Thread Vitaly Kuznetsov
Max virtual processor will be needed for 'extended' hypercalls supporting
more than 64 vCPUs. While on it, unify on 'Hyper-V' in mshyperv.c as we
currently have a mix, report acquired misc features as well.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 arch/x86/include/asm/mshyperv.h |  2 ++
 arch/x86/kernel/cpu/mshyperv.c  | 13 ++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 91acec7..d42b6eb 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -29,6 +29,8 @@ struct ms_hyperv_info {
u32 features;
u32 misc_features;
u32 hints;
+   u32 max_vp_index;
+   u32 max_lp_index;
 };
 
 extern struct ms_hyperv_info ms_hyperv;
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 04cb8d3..a8b4765 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -175,9 +175,16 @@ static void __init ms_hyperv_init_platform(void)
ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES);
ms_hyperv.hints= cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
 
-   pr_info("HyperV: features 0x%x, hints 0x%x\n",
+   pr_info("Hyper-V: features 0x%x, hints 0x%x\n",
ms_hyperv.features, ms_hyperv.hints);
 
+   ms_hyperv.max_vp_index = cpuid_eax(HVCPUID_IMPLEMENTATION_LIMITS);
+   ms_hyperv.max_lp_index = cpuid_ebx(HVCPUID_IMPLEMENTATION_LIMITS);
+
+   pr_info("Hyper-V: max %d virtual processors, %d logical processors\n",
+   ms_hyperv.max_vp_index, ms_hyperv.max_lp_index);
+
+
/*
 * Extract host information.
 */
@@ -203,7 +210,7 @@ static void __init ms_hyperv_init_platform(void)
rdmsrl(HV_X64_MSR_APIC_FREQUENCY, hv_lapic_frequency);
hv_lapic_frequency = div_u64(hv_lapic_frequency, HZ);
lapic_timer_frequency = hv_lapic_frequency;
-   pr_info("HyperV: LAPIC Timer Frequency: %#x\n",
+   pr_info("Hyper-V: LAPIC Timer Frequency: %#x\n",
lapic_timer_frequency);
}
 
@@ -237,7 +244,7 @@ static void __init ms_hyperv_init_platform(void)
 }
 
 const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
-   .name   = "Microsoft HyperV",
+   .name   = "Microsoft Hyper-V",
.detect = ms_hyperv_platform,
.init_platform  = ms_hyperv_init_platform,
 };
-- 
2.9.3

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


[PATCH v3 01/10] x86/hyper-v: include hyperv/ only when CONFIG_HYPERV is set

2017-05-19 Thread Vitaly Kuznetsov
Code is arch/x86/hyperv/ is only needed when CONFIG_HYPERV is set, the
'basic' support and detection lives in arch/x86/kernel/cpu/mshyperv.c
which is included when CONFIG_HYPERVISOR_GUEST is set.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 arch/x86/Kbuild |  4 +++-
 arch/x86/include/asm/mshyperv.h | 10 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild
index 586b786..3fa0a3c 100644
--- a/arch/x86/Kbuild
+++ b/arch/x86/Kbuild
@@ -8,7 +8,9 @@ obj-$(CONFIG_KVM) += kvm/
 obj-$(CONFIG_XEN) += xen/
 
 # Hyper-V paravirtualization support
-obj-$(CONFIG_HYPERVISOR_GUEST) += hyperv/
+ifdef CONFIG_HYPERV
+obj-y += hyperv/
+endif
 
 # lguest paravirtualization support
 obj-$(CONFIG_LGUEST_GUEST) += lguest/
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index fba1007..91acec7 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -175,7 +175,15 @@ void hyperv_init(void);
 void hyperv_report_panic(struct pt_regs *regs);
 bool hv_is_hypercall_page_setup(void);
 void hyperv_cleanup(void);
-#endif
+#else /* CONFIG_HYPERV */
+static inline void hyperv_init(void) {}
+static inline bool hv_is_hypercall_page_setup(void)
+{
+   return false;
+}
+static inline hyperv_cleanup(void) {}
+#endif /* CONFIG_HYPERV */
+
 #ifdef CONFIG_HYPERV_TSCPAGE
 struct ms_hyperv_tsc_page *hv_get_tsc_page(void);
 static inline u64 hv_read_tsc_page(const struct ms_hyperv_tsc_page *tsc_pg)
-- 
2.9.3

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


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

2017-05-19 Thread 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 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 arch/x86/hyperv/hv_init.c   | 54 -
 arch/x86/include/asm/mshyperv.h | 43 
 drivers/hv/connection.c |  2 ++
 include/linux/hyperv.h  |  1 -
 4 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 5b882cc..691603e 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -75,7 +75,8 @@ static struct clocksource hyperv_cs_msr = {
.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-static void *hypercall_pg;
+void *hv_hypercall_pg;
+EXPORT_SYMBOL_GPL(hv_hypercall_pg);
 struct clocksource *hyperv_cs;
 EXPORT_SYMBOL_GPL(hyperv_cs);
 
@@ -102,15 +103,15 @@ void hyperv_init(void)
guest_id = generate_guest_id(0, LINUX_VERSION_CODE, 0);
wrmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id);
 
-   hypercall_pg  = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_RX);
-   if (hypercall_pg == NULL) {
+   hv_hypercall_pg  = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_RX);
+   if (hv_hypercall_pg == NULL) {
wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0);
return;
}
 
rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
hypercall_msr.enable = 1;
-   hypercall_msr.guest_physical_address = vmalloc_to_pfn(hypercall_pg);
+   hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
 
/*
@@ -170,51 +171,6 @@ void hyperv_cleanup(void)
 }
 EXPORT_SYMBOL_GPL(hyperv_cleanup);
 
-/*
- * hv_do_hypercall- Invoke the specified hypercall
- */
-u64 hv_do_hypercall(u64 control, void *input, void *output)
-{
-   u64 input_address = (input) ? virt_to_phys(input) : 0;
-   u64 output_address = (output) ? virt_to_phys(output) : 0;
-#ifdef CONFIG_X86_64
-   u64 hv_status = 0;
-
-   if (!hypercall_pg)
-   return (u64)ULLONG_MAX;
-
-   __asm__ __volatile__("mov %0, %%r8" : : "r" (output_address) : "r8");
-   __asm__ __volatile__("call *%3" : "=a" (hv_status) :
-"c" (control), "d" (input_address),
-"m" (hypercall_pg));
-
-   return hv_status;
-
-#else
-
-   u32 control_hi = control >> 32;
-   u32 control_lo = control & 0x;
-   u32 hv_status_hi = 1;
-   u32 hv_status_lo = 1;
-   u32 input_address_hi = input_address >> 32;
-   u32 input_address_lo = input_address & 0x;
-   u32 output_address_hi = output_address >> 32;
-   u32 output_address_lo = output_address & 0x;
-
-   if (!hypercall_pg)
-   return (u64)ULLONG_MAX;
-
-   __asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
- "=a"(hv_status_lo) : "d" (control_hi),
- "a" (control_lo), "b" (input_address_hi),
- "c" (input_address_lo), "D"(output_address_hi),
- "S"(output_address_lo), "m" (hypercall_pg));
-
-   return hv_status_lo | ((u64)hv_status_hi << 32);
-#endif /* !x86_64 */
-}
-EXPORT_SYMBOL_GPL(hv_do_hypercall);
-
 void hyperv_report_panic(struct pt_regs *regs)
 {
static bool panic_reported;
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index d42b6eb..e293937 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -172,6 +172,49 @@ void hv_remove_crash_handler(void);
 
 #if IS_ENABLED(CONFIG_HYPERV)
 extern struct clocksource *hyperv_cs;
+extern void *hv_hypercall_pg;
+
+static inline u64 hv_do_hypercall(u64 control, void *input, void *output)
+{
+   u64 input_address = (input) ? virt_to_phys(input) : 0;
+   u64 output_address = (output) ? virt_to_phys(output) : 0;
+#ifdef CONFIG_X86_64
+   u64 hv_status;
+
+   if (!hv_hypercall_pg)
+   return (u64)ULLONG_MAX;
+
+   __asm__ __volatile__("mov %3, %%r8\n"
+"call *%4"
+: "=a" (hv_status),
+  "+c" (control), "+d" (input_address)
+:  "r" (output_address), "m" (hv_hypercall_pg)
+: "cc", "memory", "r8", "r9", "r10", "r11");
+
+   return hv_status;
+
+#else
+   u32 control_hi = control >> 32;
+   u32 control_lo = control & 0x;
+   u32 input_address_hi = input_address >> 32;
+   u32 input_

[PATCH v3 06/10] x86/hyper-v: implement rep hypercalls

2017-05-19 Thread Vitaly Kuznetsov
Rep hypercalls are normal hypercalls which perform multiple actions at
once. Hyper-V guarantees to return exectution to the caller in not more
than 50us and the caller needs to use hypercall continuation. Touch NMI
watchdog between hypercall invocations.

This is going to be used for HvFlushVirtualAddressList hypercall for
remote TLB flushing.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 arch/x86/include/asm/mshyperv.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 028e29b..74fe788 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -4,6 +4,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /*
@@ -255,6 +256,31 @@ static inline u64 hv_do_fast_hypercall8(u16 code, u64 
input1)
 #endif
 }
 
+/*
+ * Rep hypercalls. Callers of this functions are supposed to ensure that
+ * rep_count and vahead_size comply with union hv_hypercall_input definition.
+ */
+static inline u64 hv_do_rep_hypercall(u16 code, u16 rep_count, u16 
varhead_size,
+ void *input, void *output)
+{
+   union hv_hypercall_input hc_input = { .code = code,
+ .varhead_size = varhead_size,
+ .rep_count = rep_count};
+   u64 status;
+
+   do {
+   status = hv_do_hypercall(hc_input.as_uint64, input, output);
+   if ((status & 0x) != HV_STATUS_SUCCESS)
+   return status;
+
+   hc_input.rep_start = (status >> 32) & 0xfff;
+
+   touch_nmi_watchdog();
+   } while (hc_input.rep_start < hc_input.rep_count);
+
+   return status;
+}
+
 void hyperv_init(void);
 void hyperv_report_panic(struct pt_regs *regs);
 bool hv_is_hypercall_page_setup(void);
-- 
2.9.3

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


[PATCH v3 04/10] x86/hyper-v: fast hypercall implementation

2017-05-19 Thread Vitaly Kuznetsov
Hyper-V supports 'fast' hypercalls when all parameters are passed through
registers. Implement an inline version of a simpliest of these calls:
hypercall with one 8-byte input and no output.

Proper hypercall input interface (struct hv_hypercall_input) definition is
added as well.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 arch/x86/include/asm/mshyperv.h| 39 ++
 arch/x86/include/uapi/asm/hyperv.h | 19 +++
 2 files changed, 58 insertions(+)

diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index e293937..028e29b 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -216,6 +216,45 @@ static inline u64 hv_do_hypercall(u64 control, void 
*input, void *output)
 #endif /* !x86_64 */
 }
 
+/* Fast hypercall with 8 bytes of input and no output */
+static inline u64 hv_do_fast_hypercall8(u16 code, u64 input1)
+{
+   union hv_hypercall_input control = {0};
+
+   control.code = code;
+   control.fast = 1;
+#ifdef CONFIG_X86_64
+   {
+   u64 hv_status;
+
+   __asm__ __volatile__("call *%3"
+: "=a" (hv_status),
+  "+c" (control.as_uint64), "+d" (input1)
+: "m" (hv_hypercall_pg)
+: "cc", "r8", "r9", "r10", "r11");
+   return hv_status;
+   }
+#else
+   {
+   u32 hv_status_hi, hv_status_lo;
+   u32 input1_hi = (u32)(input1 >> 32);
+   u32 input1_lo = (u32)input1;
+
+   __asm__ __volatile__ ("call *%6"
+ : "=d"(hv_status_hi),
+   "=a"(hv_status_lo),
+   "+c"(input1_lo)
+ : "d" (control.as_uint32_hi),
+   "a" (control.as_uint32_lo),
+   "b" (input1_hi),
+   "m" (hv_hypercall_pg)
+ : "cc", "edi", "esi");
+
+   return hv_status_lo | ((u64)hv_status_hi << 32);
+   }
+#endif
+}
+
 void hyperv_init(void);
 void hyperv_report_panic(struct pt_regs *regs);
 bool hv_is_hypercall_page_setup(void);
diff --git a/arch/x86/include/uapi/asm/hyperv.h 
b/arch/x86/include/uapi/asm/hyperv.h
index 432df4b..c87e900 100644
--- a/arch/x86/include/uapi/asm/hyperv.h
+++ b/arch/x86/include/uapi/asm/hyperv.h
@@ -256,6 +256,25 @@
 #define HV_PROCESSOR_POWER_STATE_C22
 #define HV_PROCESSOR_POWER_STATE_C33
 
+/* Hypercall interface */
+union hv_hypercall_input {
+   u64 as_uint64;
+   struct {
+   __u32 as_uint32_lo;
+   __u32 as_uint32_hi;
+   };
+   struct {
+   __u64 code:16;
+   __u64 fast:1;
+   __u64 varhead_size:10;
+   __u64 reserved1:5;
+   __u64 rep_count:12;
+   __u64 reserved2:4;
+   __u64 rep_start:12;
+   __u64 reserved3:4;
+   };
+};
+
 /* hypercall status code */
 #define HV_STATUS_SUCCESS  0
 #define HV_STATUS_INVALID_HYPERCALL_CODE   2
-- 
2.9.3

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


[PATCH v3 08/10] x86/hyper-v: use hypercall for remote TLB flush

2017-05-19 Thread Vitaly Kuznetsov
Hyper-V host can suggest us to use hypercall for doing remote TLB flush,
this is supposed to work faster than IPIs.

Implementation details: to do HvFlushVirtualAddress{Space,List} hypercalls
we need to put the input somewhere in memory and we don't really want to
have memory allocation on each call so we pre-allocate per cpu memory areas
on boot. These areas are of fixes size, limit them with an arbitrary number
of 16 (16 gvas are able to specify 16 * 4096 pages).

pv_ops patching is happening very early so we need to separate
hyperv_setup_mmu_ops() and hyper_alloc_mmu().

It is possible and easy to implement local TLB flushing too and there is
even a hint for that. However, I don't see a room for optimization on the
host side as both hypercall and native tlb flush will result in vmexit. The
hint is also not set on modern Hyper-V versions.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 arch/x86/hyperv/Makefile   |   2 +-
 arch/x86/hyperv/hv_init.c  |   2 +
 arch/x86/hyperv/mmu.c  | 117 +
 arch/x86/include/asm/mshyperv.h|   3 +
 arch/x86/include/uapi/asm/hyperv.h |   7 +++
 arch/x86/kernel/cpu/mshyperv.c |   1 +
 6 files changed, 131 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/hyperv/mmu.c

diff --git a/arch/x86/hyperv/Makefile b/arch/x86/hyperv/Makefile
index 171ae09..367a820 100644
--- a/arch/x86/hyperv/Makefile
+++ b/arch/x86/hyperv/Makefile
@@ -1 +1 @@
-obj-y  := hv_init.o
+obj-y  := hv_init.o mmu.o
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 7fd9cd3..df3252f 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -140,6 +140,8 @@ void hyperv_init(void)
hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg);
wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
 
+   hyper_alloc_mmu();
+
/*
 * Register Hyper-V specific clocksource.
 */
diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c
new file mode 100644
index 000..e3ab9b9
--- /dev/null
+++ b/arch/x86/hyperv/mmu.c
@@ -0,0 +1,117 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* HvFlushVirtualAddressSpace, HvFlushVirtualAddressList hypercalls */
+struct hv_flush_pcpu {
+   __u64 address_space;
+   __u64 flags;
+   __u64 processor_mask;
+   __u64 gva_list[];
+};
+
+static struct hv_flush_pcpu __percpu *pcpu_flush;
+
+static void hyperv_flush_tlb_others(const struct cpumask *cpus,
+   struct mm_struct *mm, unsigned long start,
+   unsigned long end)
+{
+   struct hv_flush_pcpu *flush;
+   unsigned long cur, flags;
+   u64 status = -1ULL;
+   int cpu, vcpu, gva_n, max_gvas;
+
+   if (!pcpu_flush || !hv_hypercall_pg)
+   goto do_native;
+
+   if (cpumask_empty(cpus))
+   return;
+
+   local_irq_save(flags);
+
+   flush = this_cpu_ptr(pcpu_flush);
+
+   if (mm) {
+   flush->address_space = virt_to_phys(mm->pgd);
+   flush->flags = 0;
+   } else {
+   flush->address_space = 0;
+   flush->flags = HV_FLUSH_ALL_VIRTUAL_ADDRESS_SPACES;
+   }
+
+   flush->processor_mask = 0;
+   if (cpumask_equal(cpus, cpu_present_mask)) {
+   flush->flags |= HV_FLUSH_ALL_PROCESSORS;
+   } else {
+   for_each_cpu(cpu, cpus) {
+   vcpu = hv_cpu_number_to_vp_number(cpu);
+   if (vcpu != -1 && vcpu < 64)
+   flush->processor_mask |= 1 << vcpu;
+   else
+   goto do_native;
+   }
+   }
+
+   /*
+* We can flush not more than max_gvas with one hypercall. Flush the
+* whole address space if we were asked to do more.
+*/
+   max_gvas = (PAGE_SIZE - sizeof(*flush)) / 8;
+
+   if (end == TLB_FLUSH_ALL ||
+   (end && ((end - start)/(PAGE_SIZE*PAGE_SIZE)) > max_gvas)) {
+   if (end == TLB_FLUSH_ALL)
+   flush->flags |= HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY;
+   status = hv_do_hypercall(HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE,
+flush, NULL);
+   } else {
+   cur = start;
+   gva_n = 0;
+   do {
+   flush->gva_list[gva_n] = cur & PAGE_MASK;
+   /*
+* Lower 12 bits encode the number of additional
+* pages to flush (in addition to the 'cur' page).
+*/
+   if (end >= cur + PAGE_SIZE * PAGE_SIZE)
+   flush->gva_list[gva_n] |= ~PAGE_MASK;
+   else if (end > cur)
+

[PATCH v3 05/10] hyper-v: use fast hypercall for HVCALL_SIGNAL_EVENT

2017-05-19 Thread Vitaly Kuznetsov
We need to pass only 8 bytes of input for HvSignalEvent which makes it a
perfect fit for fast hypercall. hv_input_signal_event_buffer is not needed
any more and hv_input_signal_event is converted to union for convenience.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 drivers/hv/channel_mgmt.c | 15 +--
 drivers/hv/connection.c   |  3 ++-
 include/linux/hyperv.h| 19 ---
 3 files changed, 15 insertions(+), 22 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 0fabd41..ee2a8dd 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -806,20 +806,15 @@ static void vmbus_onoffer(struct 
vmbus_channel_message_header *hdr)
/*
 * Setup state for signalling the host.
 */
-   newchannel->sig_event = (struct hv_input_signal_event *)
-   (ALIGN((unsigned long)
-   &newchannel->sig_buf,
-   HV_HYPERCALL_PARAM_ALIGN));
-
-   newchannel->sig_event->connectionid.asu32 = 0;
-   newchannel->sig_event->connectionid.u.id = VMBUS_EVENT_CONNECTION_ID;
-   newchannel->sig_event->flag_number = 0;
-   newchannel->sig_event->rsvdz = 0;
+   newchannel->sig_event.connectionid.asu32 = 0;
+   newchannel->sig_event.connectionid.u.id = VMBUS_EVENT_CONNECTION_ID;
+   newchannel->sig_event.flag_number = 0;
+   newchannel->sig_event.rsvdz = 0;
 
if (vmbus_proto_version != VERSION_WS2008) {
newchannel->is_dedicated_interrupt =
(offer->is_dedicated_interrupt != 0);
-   newchannel->sig_event->connectionid.u.id =
+   newchannel->sig_event.connectionid.u.id =
offer->connection_id;
}
 
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 4a0a9f6..51f8cb2 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -408,6 +408,7 @@ void vmbus_set_event(struct vmbus_channel *channel)
if (!channel->is_dedicated_interrupt)
vmbus_send_interrupt(child_relid);
 
-   hv_do_hypercall(HVCALL_SIGNAL_EVENT, channel->sig_event, NULL);
+   hv_do_fast_hypercall8(HVCALL_SIGNAL_EVENT,
+ channel->sig_event.as_uint64);
 }
 EXPORT_SYMBOL_GPL(vmbus_set_event);
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index d1ae02d..68a5772 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -678,15 +678,13 @@ union hv_connection_id {
 };
 
 /* Definition of the hv_signal_event hypercall input structure. */
-struct hv_input_signal_event {
-   union hv_connection_id connectionid;
-   u16 flag_number;
-   u16 rsvdz;
-};
-
-struct hv_input_signal_event_buffer {
-   u64 align8;
-   struct hv_input_signal_event event;
+union hv_input_signal_event {
+   u64 as_uint64;
+   struct {
+   union hv_connection_id connectionid;
+   u16 flag_number;
+   u16 rsvdz;
+   };
 };
 
 enum hv_numa_policy {
@@ -771,8 +769,7 @@ struct vmbus_channel {
} callback_mode;
 
bool is_dedicated_interrupt;
-   struct hv_input_signal_event_buffer sig_buf;
-   struct hv_input_signal_event *sig_event;
+   union hv_input_signal_event sig_event;
 
/*
 * Starting with win8, this field will be used to specify
-- 
2.9.3

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


[PATCH v3 09/10] x86/hyper-v: support extended CPU ranges for TLB flush hypercalls

2017-05-19 Thread Vitaly Kuznetsov
Hyper-V hosts may support more than 64 vCPUs, we need to use
HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX/LIST_EX hypercalls in this
case.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 arch/x86/hyperv/mmu.c  | 149 -
 arch/x86/include/uapi/asm/hyperv.h |  10 +++
 2 files changed, 157 insertions(+), 2 deletions(-)

diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c
index e3ab9b9..c9cecb3 100644
--- a/arch/x86/hyperv/mmu.c
+++ b/arch/x86/hyperv/mmu.c
@@ -15,8 +15,57 @@ struct hv_flush_pcpu {
__u64 gva_list[];
 };
 
+/* HvFlushVirtualAddressSpaceEx, HvFlushVirtualAddressListEx hypercalls */
+struct hv_flush_pcpu_ex {
+   __u64 address_space;
+   __u64 flags;
+   struct {
+   __u64 format;
+   __u64 valid_bank_mask;
+   __u64 bank_contents[];
+   } hv_vp_set;
+   __u64 gva_list[];
+};
+
 static struct hv_flush_pcpu __percpu *pcpu_flush;
 
+static struct hv_flush_pcpu_ex __percpu *pcpu_flush_ex;
+
+static inline int cpumask_to_vp_set(struct hv_flush_pcpu_ex *flush,
+   const struct cpumask *cpus)
+{
+   int cur_bank, cpu, vcpu, nr_bank = 0;
+   bool has_cpus;
+
+   /*
+* We can't be sure that translated vcpu numbers will always be
+* in ascending order, so iterate over all possible banks and
+* check all vcpus in it instead.
+*/
+   for (cur_bank = 0; cur_bank < ms_hyperv.max_vp_index/64; cur_bank++) {
+   has_cpus = false;
+   for_each_cpu(cpu, cpus) {
+   vcpu = hv_cpu_number_to_vp_number(cpu);
+   if (vcpu/64 != cur_bank)
+   continue;
+   if (!has_cpus) {
+   flush->hv_vp_set.valid_bank_mask |=
+   1 << vcpu / 64;
+   flush->hv_vp_set.bank_contents[nr_bank] =
+   1 << vcpu % 64;
+   has_cpus = true;
+   } else {
+   flush->hv_vp_set.bank_contents[nr_bank] |=
+   1 << vcpu % 64;
+   }
+   }
+   if (has_cpus)
+   nr_bank++;
+   }
+
+   return nr_bank;
+}
+
 static void hyperv_flush_tlb_others(const struct cpumask *cpus,
struct mm_struct *mm, unsigned long start,
unsigned long end)
@@ -102,16 +151,112 @@ static void hyperv_flush_tlb_others(const struct cpumask 
*cpus,
native_flush_tlb_others(cpus, mm, start, end);
 }
 
+static void hyperv_flush_tlb_others_ex(const struct cpumask *cpus,
+  struct mm_struct *mm,
+  unsigned long start,
+  unsigned long end)
+{
+   struct hv_flush_pcpu_ex *flush;
+   unsigned long cur, flags;
+   u64 status = -1ULL;
+   int nr_bank = 0, max_gvas, gva_n;
+
+   if (!pcpu_flush_ex || !hv_hypercall_pg)
+   goto do_native;
+
+   if (cpumask_empty(cpus))
+   return;
+
+   local_irq_save(flags);
+
+   flush = this_cpu_ptr(pcpu_flush_ex);
+
+   if (mm) {
+   flush->address_space = virt_to_phys(mm->pgd);
+   flush->flags = 0;
+   } else {
+   flush->address_space = 0;
+   flush->flags = HV_FLUSH_ALL_VIRTUAL_ADDRESS_SPACES;
+   }
+
+   flush->hv_vp_set.valid_bank_mask = 0;
+
+   if (cpumask_equal(cpus, cpu_present_mask)) {
+   flush->hv_vp_set.format = HV_GENERIC_SET_ALL;
+   flush->flags |= HV_FLUSH_ALL_PROCESSORS;
+   } else {
+   flush->hv_vp_set.format = HV_GENERIC_SET_SPARCE_4K;
+   nr_bank = cpumask_to_vp_set(flush, cpus);
+   }
+
+   /*
+* We can flush not more than max_gvas with one hypercall. Flush the
+* whole address space if we were asked to do more.
+*/
+   max_gvas = (PAGE_SIZE - sizeof(*flush) - nr_bank*8) / 8;
+
+   if (end == TLB_FLUSH_ALL ||
+   (end && ((end - start)/(PAGE_SIZE*PAGE_SIZE)) > max_gvas)) {
+   if (end == TLB_FLUSH_ALL)
+   flush->flags |= HV_FLUSH_NON_GLOBAL_MAPPINGS_ONLY;
+
+   status = hv_do_rep_hypercall(
+   HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX,
+   0, nr_bank + 2, flush, NULL);
+   } else {
+   cur = start;
+   gva_n = nr_bank;
+   do {
+   flush->gva_list[gva_n] = cur & PAGE_MASK;
+   /*
+* Lower 12 bits encode the number of additional
+* pages to flush (in addit

[PATCH v3 07/10] hyper-v: globalize vp_index

2017-05-19 Thread Vitaly Kuznetsov
To support implementing remote TLB flushing on Hyper-V with a hypercall
we need to make vp_index available outside of vmbus module. Rename and
globalize.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 arch/x86/hyperv/hv_init.c   | 34 +-
 arch/x86/include/asm/mshyperv.h | 26 ++
 drivers/hv/channel_mgmt.c   |  7 +++
 drivers/hv/connection.c |  3 ++-
 drivers/hv/hv.c |  9 -
 drivers/hv/hyperv_vmbus.h   | 11 ---
 drivers/hv/vmbus_drv.c  | 17 -
 drivers/pci/host/pci-hyperv.c   |  4 ++--
 include/linux/hyperv.h  |  1 -
 9 files changed, 66 insertions(+), 46 deletions(-)

diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 691603e..7fd9cd3 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -26,6 +26,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #ifdef CONFIG_HYPERV_TSCPAGE
 
@@ -80,6 +82,20 @@ EXPORT_SYMBOL_GPL(hv_hypercall_pg);
 struct clocksource *hyperv_cs;
 EXPORT_SYMBOL_GPL(hyperv_cs);
 
+u32 *hv_vp_index;
+EXPORT_SYMBOL_GPL(hv_vp_index);
+
+static int hv_cpu_init(unsigned int cpu)
+{
+   u64 msr_vp_index;
+
+   hv_get_vp_index(msr_vp_index);
+
+   hv_vp_index[smp_processor_id()] = (u32)msr_vp_index;
+
+   return 0;
+}
+
 /*
  * This function is to be invoked early in the boot sequence after the
  * hypervisor has been detected.
@@ -95,6 +111,16 @@ void hyperv_init(void)
if (x86_hyper != &x86_hyper_ms_hyperv)
return;
 
+   /* Allocate percpu VP index */
+   hv_vp_index = kcalloc(num_possible_cpus(), sizeof(*hv_vp_index),
+ GFP_KERNEL);
+   if (!hv_vp_index)
+   return;
+
+   if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/hyperv_init:online",
+ hv_cpu_init, NULL) < 0)
+   goto free_vp_index;
+
/*
 * Setup the hypercall page and enable hypercalls.
 * 1. Register the guest ID
@@ -106,7 +132,7 @@ void hyperv_init(void)
hv_hypercall_pg  = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_RX);
if (hv_hypercall_pg == NULL) {
wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0);
-   return;
+   goto free_vp_index;
}
 
rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
@@ -149,6 +175,12 @@ void hyperv_init(void)
hyperv_cs = &hyperv_cs_msr;
if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
clocksource_register_hz(&hyperv_cs_msr, NSEC_PER_SEC/100);
+
+   return;
+
+free_vp_index:
+   kfree(hv_vp_index);
+   hv_vp_index = NULL;
 }
 
 /*
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index 74fe788..eb38da3 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -281,6 +281,32 @@ static inline u64 hv_do_rep_hypercall(u16 code, u16 
rep_count, u16 varhead_size,
return status;
 }
 
+/*
+ * Hypervisor's notion of virtual processor ID is different from
+ * Linux' notion of CPU ID. This information can only be retrieved
+ * in the context of the calling CPU. Setup a map for easy access
+ * to this information.
+ */
+extern u32 __percpu *hv_vp_index;
+
+/**
+ * hv_cpu_number_to_vp_number() - Map CPU to VP.
+ * @cpu_number: CPU number in Linux terms
+ *
+ * This function returns the mapping between the Linux processor
+ * number and the hypervisor's virtual processor number, useful
+ * in making hypercalls and such that talk about specific
+ * processors.
+ *
+ * Return: Virtual processor number in Hyper-V terms
+ */
+static inline int hv_cpu_number_to_vp_number(int cpu_number)
+{
+   WARN_ON(hv_vp_index[cpu_number] == -1);
+
+   return hv_vp_index[cpu_number];
+}
+
 void hyperv_init(void);
 void hyperv_report_panic(struct pt_regs *regs);
 bool hv_is_hypercall_page_setup(void);
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index ee2a8dd..a3e4dba 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -600,7 +600,7 @@ static void init_vp_index(struct vmbus_channel *channel, 
u16 dev_type)
 */
channel->numa_node = 0;
channel->target_cpu = 0;
-   channel->target_vp = hv_context.vp_index[0];
+   channel->target_vp = hv_cpu_number_to_vp_number(0);
return;
}
 
@@ -684,7 +684,7 @@ static void init_vp_index(struct vmbus_channel *channel, 
u16 dev_type)
}
 
channel->target_cpu = cur_cpu;
-   channel->target_vp = hv_context.vp_index[cur_cpu];
+   channel->target_vp = hv_cpu_number_to_vp_number(cur_cpu);
 }
 
 static void vmbus_wait_for_unload(void)
@@ -1224,8 +1224,7 @@ struct vmbus_channel *vmbus_get_outgoing_channel(struct 
vmbus_channel *primary)
return

[PATCH v3 10/10] tracing/hyper-v: trace hyperv_mmu_flush_tlb_others()

2017-05-19 Thread Vitaly Kuznetsov
Add Hyper-V tracing subsystem and trace hyperv_mmu_flush_tlb_others().
Tracing is done the same way we do xen_mmu_flush_tlb_others().

Signed-off-by: Vitaly Kuznetsov 
Acked-by: K. Y. Srinivasan 
Tested-by: Simon Xiao 
Tested-by: Srikanth Myakam 
---
 MAINTAINERS |  1 +
 arch/x86/hyperv/mmu.c   |  8 
 arch/x86/include/asm/trace/hyperv.h | 34 ++
 3 files changed, 43 insertions(+)
 create mode 100644 arch/x86/include/asm/trace/hyperv.h

diff --git a/MAINTAINERS b/MAINTAINERS
index f7d568b..0ee55dc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6161,6 +6161,7 @@ M:Stephen Hemminger 
 L: de...@linuxdriverproject.org
 S: Maintained
 F: arch/x86/include/asm/mshyperv.h
+F: arch/x86/include/asm/trace/hyperv.h
 F: arch/x86/include/uapi/asm/hyperv.h
 F: arch/x86/kernel/cpu/mshyperv.c
 F: arch/x86/hyperv
diff --git a/arch/x86/hyperv/mmu.c b/arch/x86/hyperv/mmu.c
index c9cecb3..f6b5211 100644
--- a/arch/x86/hyperv/mmu.c
+++ b/arch/x86/hyperv/mmu.c
@@ -6,6 +6,10 @@
 #include 
 #include 
 #include 
+#include 
+
+#define CREATE_TRACE_POINTS
+DEFINE_TRACE(hyperv_mmu_flush_tlb_others);
 
 /* HvFlushVirtualAddressSpace, HvFlushVirtualAddressList hypercalls */
 struct hv_flush_pcpu {
@@ -75,6 +79,8 @@ static void hyperv_flush_tlb_others(const struct cpumask 
*cpus,
u64 status = -1ULL;
int cpu, vcpu, gva_n, max_gvas;
 
+   trace_hyperv_mmu_flush_tlb_others(cpus, mm, start, end);
+
if (!pcpu_flush || !hv_hypercall_pg)
goto do_native;
 
@@ -161,6 +167,8 @@ static void hyperv_flush_tlb_others_ex(const struct cpumask 
*cpus,
u64 status = -1ULL;
int nr_bank = 0, max_gvas, gva_n;
 
+   trace_hyperv_mmu_flush_tlb_others(cpus, mm, start, end);
+
if (!pcpu_flush_ex || !hv_hypercall_pg)
goto do_native;
 
diff --git a/arch/x86/include/asm/trace/hyperv.h 
b/arch/x86/include/asm/trace/hyperv.h
new file mode 100644
index 000..e46a351
--- /dev/null
+++ b/arch/x86/include/asm/trace/hyperv.h
@@ -0,0 +1,34 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM hyperv
+
+#if !defined(_TRACE_HYPERV_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_HYPERV_H
+
+#include 
+
+#if IS_ENABLED(CONFIG_HYPERV)
+
+TRACE_EVENT(hyperv_mmu_flush_tlb_others,
+   TP_PROTO(const struct cpumask *cpus, struct mm_struct *mm,
+unsigned long addr, unsigned long end),
+   TP_ARGS(cpus, mm, addr, end),
+   TP_STRUCT__entry(
+   __field(unsigned int, ncpus)
+   __field(struct mm_struct *, mm)
+   __field(unsigned long, addr)
+   __field(unsigned long, end)
+   ),
+   TP_fast_assign(__entry->ncpus = cpumask_weight(cpus);
+  __entry->mm = mm;
+  __entry->addr = addr,
+  __entry->end = end),
+   TP_printk("ncpus %d mm %p addr %lx, end %lx",
+ __entry->ncpus, __entry->mm, __entry->addr, __entry->end)
+   );
+
+#endif /* CONFIG_HYPERV */
+
+#endif /* _TRACE_HYPERV_H */
+
+/* This part must be outside protection */
+#include 
-- 
2.9.3

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


Re: [PATCH 4/4] Hyper-V vPCI: use vPCI protocol version 1.2

2017-05-19 Thread Stephen Hemminger
On Fri, 19 May 2017 14:27:01 +0300
Dan Carpenter  wrote:

> >  /*
> > + * HV_VP_SET available
> > + */
> > +#define HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED  (1 << 11)  
> 
> Use BIT(11).  I thought checkpatch.pl complains about this but I guess
> that's only with the --strict option.

Since all the other field values are encoded as shifts, doing something
different for this field stands out.  Therefore just use (1 << 11)
or change all the previous values using BIT() macro
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vme: Use BIT macro for bit definitions

2017-05-19 Thread Martyn Welch
On Mon, May 15, 2017 at 10:18:14AM +0100, Ricardo Silva wrote:
> Use the BIT(n) macro instead of '(1 << n)' in definitions where the bit
> semantics clearly applies.
> 
> Fixes true positive "Prefer using the BIT macro" checks reported by
> checkpatch.
> 
> Some of these checks are still triggering on definitions using
> '(1 << n)', namely for PIO2_CNTR_SC_DEV1, PIO2_CNTR_RW_LSB and
> PIO2_CNTR_MODE1. Leave them be, as the context there is more of a
> "multi-bit field value" ((val << n), where for some cases 'val' happens
> to be 1) rather than a "single bit" (1 << n), so keeping the value as is
> in the code makes it more readable that using a combination of BIT
> macros.
> 
> Signed-off-by: Ricardo Silva 

Acked-by: Martyn Welch 

> ---
>  drivers/staging/vme/devices/vme_pio2.h | 80 
> +-
>  1 file changed, 40 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/staging/vme/devices/vme_pio2.h 
> b/drivers/staging/vme/devices/vme_pio2.h
> index 5577df3199e7..ac4a4bad4091 100644
> --- a/drivers/staging/vme/devices/vme_pio2.h
> +++ b/drivers/staging/vme/devices/vme_pio2.h
> @@ -68,38 +68,38 @@ static const int PIO2_CHANNEL_BANK[32] = { 0, 0, 0, 0, 0, 
> 0, 0, 0,
>   2, 2, 2, 2, 2, 2, 2, 2,
>   3, 3, 3, 3, 3, 3, 3, 3 };
>  
> -#define PIO2_CHANNEL0_BIT(1 << 0)
> -#define PIO2_CHANNEL1_BIT(1 << 1)
> -#define PIO2_CHANNEL2_BIT(1 << 2)
> -#define PIO2_CHANNEL3_BIT(1 << 3)
> -#define PIO2_CHANNEL4_BIT(1 << 4)
> -#define PIO2_CHANNEL5_BIT(1 << 5)
> -#define PIO2_CHANNEL6_BIT(1 << 6)
> -#define PIO2_CHANNEL7_BIT(1 << 7)
> -#define PIO2_CHANNEL8_BIT(1 << 0)
> -#define PIO2_CHANNEL9_BIT(1 << 1)
> -#define PIO2_CHANNEL10_BIT   (1 << 2)
> -#define PIO2_CHANNEL11_BIT   (1 << 3)
> -#define PIO2_CHANNEL12_BIT   (1 << 4)
> -#define PIO2_CHANNEL13_BIT   (1 << 5)
> -#define PIO2_CHANNEL14_BIT   (1 << 6)
> -#define PIO2_CHANNEL15_BIT   (1 << 7)
> -#define PIO2_CHANNEL16_BIT   (1 << 0)
> -#define PIO2_CHANNEL17_BIT   (1 << 1)
> -#define PIO2_CHANNEL18_BIT   (1 << 2)
> -#define PIO2_CHANNEL19_BIT   (1 << 3)
> -#define PIO2_CHANNEL20_BIT   (1 << 4)
> -#define PIO2_CHANNEL21_BIT   (1 << 5)
> -#define PIO2_CHANNEL22_BIT   (1 << 6)
> -#define PIO2_CHANNEL23_BIT   (1 << 7)
> -#define PIO2_CHANNEL24_BIT   (1 << 0)
> -#define PIO2_CHANNEL25_BIT   (1 << 1)
> -#define PIO2_CHANNEL26_BIT   (1 << 2)
> -#define PIO2_CHANNEL27_BIT   (1 << 3)
> -#define PIO2_CHANNEL28_BIT   (1 << 4)
> -#define PIO2_CHANNEL29_BIT   (1 << 5)
> -#define PIO2_CHANNEL30_BIT   (1 << 6)
> -#define PIO2_CHANNEL31_BIT   (1 << 7)
> +#define PIO2_CHANNEL0_BITBIT(0)
> +#define PIO2_CHANNEL1_BITBIT(1)
> +#define PIO2_CHANNEL2_BITBIT(2)
> +#define PIO2_CHANNEL3_BITBIT(3)
> +#define PIO2_CHANNEL4_BITBIT(4)
> +#define PIO2_CHANNEL5_BITBIT(5)
> +#define PIO2_CHANNEL6_BITBIT(6)
> +#define PIO2_CHANNEL7_BITBIT(7)
> +#define PIO2_CHANNEL8_BITBIT(0)
> +#define PIO2_CHANNEL9_BITBIT(1)
> +#define PIO2_CHANNEL10_BIT   BIT(2)
> +#define PIO2_CHANNEL11_BIT   BIT(3)
> +#define PIO2_CHANNEL12_BIT   BIT(4)
> +#define PIO2_CHANNEL13_BIT   BIT(5)
> +#define PIO2_CHANNEL14_BIT   BIT(6)
> +#define PIO2_CHANNEL15_BIT   BIT(7)
> +#define PIO2_CHANNEL16_BIT   BIT(0)
> +#define PIO2_CHANNEL17_BIT   BIT(1)
> +#define PIO2_CHANNEL18_BIT   BIT(2)
> +#define PIO2_CHANNEL19_BIT   BIT(3)
> +#define PIO2_CHANNEL20_BIT   BIT(4)
> +#define PIO2_CHANNEL21_BIT   BIT(5)
> +#define PIO2_CHANNEL22_BIT   BIT(6)
> +#define PIO2_CHANNEL23_BIT   BIT(7)
> +#define PIO2_CHANNEL24_BIT   BIT(0)
> +#define PIO2_CHANNEL25_BIT   BIT(1)
> +#define PIO2_CHANNEL26_BIT   BIT(2)
> +#define PIO2_CHANNEL27_BIT   BIT(3)
> +#define PIO2_CHANNEL28_BIT   BIT(4)
> +#define PIO2_CHANNEL29_BIT   BIT(5)
> +#define PIO2_CHANNEL30_BIT   BIT(6)
> +#define PIO2_CHANNEL31_BIT   BIT(7)
>  
>  static const int PIO2_CHANNEL_BIT[32] = { PIO2_CHANNEL0_BIT, 
> PIO2_CHANNEL1_BIT,
>   PIO2_CHANNEL2_BIT, PIO2_CHANNEL3_BIT,
> @@ -120,12 +120,12 @@ static const int PIO2_CHANNEL_BIT[32] = { 
> PIO2_CHANNEL0_BIT, PIO2_CHANNEL1_BIT,
>   };
>  
>  /* PIO2_REGS_INT_STAT_CNTR (0xc) */
> -#define PIO2_COUNTER0(1 << 0)
> -#define PIO2_COUNTER1(1 << 1)
> -#define PIO2_COUNTER2(1 << 2)
> -#define PIO2_COUNTER3 

Re: [PATCH] Staging: bcm2835-audio: bcm2835_ctl.c: Fixed a comment coding style issue

2017-05-19 Thread srishti sharma
Was the format of this patch acceptable ,the "from" matches the
"signed-off-by" right , so this should be correct , were there any
errors in this ? Should I resend it ?

Regards,
Srishti

On Thu, May 18, 2017 at 7:28 PM, Greg KH  wrote:
> On Thu, May 18, 2017 at 04:20:15PM +0530, srishti wrote:
>> From: srishti sharma 
>>
>> Fixed a trailing */ issue.
>>
>> Signed-off-by: srishti sharma 
>> ---
>>  drivers/staging/bcm2835-audio/bcm2835-ctl.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> You sent two copies of this, which am I supposed to apply?  And what
> changed from the last version?
>
> I'm dropping this, please fix and only send _one_ copy of the patch.
>
> thanks,
>
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: bcm2835-audio: bcm2835_ctl.c: Fixed a comment coding style issue

2017-05-19 Thread Dan Carpenter
On Sat, May 20, 2017 at 01:00:17AM +0530, srishti sharma wrote:
> Was the format of this patch acceptable ,the "from" matches the
> "signed-off-by" right , so this should be correct , were there any
> errors in this ? Should I resend it ?
> 
> Regards,
> Srishti
> 

You should capitalize your name in both since you're doing that here.

Also I really think you can figure out how to fix your email headers so
you don't need to use a From header.  Lots of people use gmail and they
were able to figure it out.

But yeah, the way you sent it is also fine.

regards,
dan carpenter

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


Re: [PATCH] Staging: bcm2835-audio: bcm2835_ctl.c: Fixed a comment coding style issue

2017-05-19 Thread srishti sharma
On Sat, May 20, 2017 at 1:03 AM, Dan Carpenter  wrote:
> On Sat, May 20, 2017 at 01:00:17AM +0530, srishti sharma wrote:
>> Was the format of this patch acceptable ,the "from" matches the
>> "signed-off-by" right , so this should be correct , were there any
>> errors in this ? Should I resend it ?
>>
>> Regards,
>> Srishti
>>
>
> You should capitalize your name in both since you're doing that here.
>
> Also I really think you can figure out how to fix your email headers so
> you don't need to use a From header.  Lots of people use gmail and they
> were able to figure it out.
>
> But yeah, the way you sent it is also fine.
>
> regards,
> dan carpenter
>


Okay , Thanks a lot !
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/25] staging: unisys: visorbus: Change function names to be consistent with namespace

2017-05-19 Thread David Kershner
The s-Par visorbus driver had several functions with extremely generic
names. This series attempts to clean up the names by making them more
unique.

This series also addresses other miscellaneous feedback.

Jon Frisch (1):
  staging: unisys: visorbus: rename typ to cr_type

Sameer Wadgaonkar (24):
  staging: unisys: visorbus: renamed functions bus_create, bus_destroy and 
bus_configure to match driver namespace
  staging: unisys: visorbus: renamed functions like bus_*_response to match 
driver namespace
  staging: unisys: visorbus: renamed functions like device_*_response to match 
driver namespace
  staging: unisys: visorbus: renamed functions like *_bus_instance to match 
driver namespace
  staging: unisys: visorbus: renamed functions like chipset_bus_* to match 
driver namespace
  staging: unisys: visorbus: renamed functions like chipset_device_* to match 
driver namespace
  staging: unisys: visorbus: renamed function 
initiate_chipset_device_pause_resume to match driver namespace
  staging: unisys: visorbus: renamed functions like my_device_* to match driver 
namespace
  staging: unisys: visorbus: renamed #defines in vbuschannel.h to match driver 
namespace
  staging: unisys: visorbus: renamed structures in vbuschannel.h to match 
driver namespace
  staging: unisys: visorbus: renamed #define in visorchannel.c to match driver 
namespace
  staging: unisys: visorbus: renamed #defines in visorchipset.c to match driver 
namespace
  staging: unisys: visorbus: renamed #defines in controlvmchannel.h to match 
driver namespace
  staging: unisys: visorbus: renamed structures in controlvmchannel.h to match 
driver namespace
  staging: unisys: visorbus: renamed enum in controlvmchannel.h to match driver 
namespace
  staging: unisys: visorinput: renamed #defines in visorinput.c to match driver 
namespace
  staging: unisys: visorinput: renamed structures in ultrainputreport.h to 
match driver namespace
  staging: unisys: visorinput: removed enum in ultrainputreport.h to match 
driver namespace
  staging: unisys: include: renamed function spar_check_channel in channel.h to 
match driver namespace
  staging: unisys: include: renamed #defines in channel.h to match driver 
namespace
  staging: unisys: include: renamed #defines in iochannel.h to match driver 
namespace
  staging: unisys: include: renamed structure spar_io_channel_protocol in 
iochannel.h to match driver namespace
  staging: unisys: visorbus: add comment to explain polling logic in 
controlvm_periodic_work
  staging: unisys: visorbus: remove channel_addr check in handle_command

 drivers/staging/unisys/Documentation/overview.txt|  14 +-
 drivers/staging/unisys/include/channel.h |  60 +--
 drivers/staging/unisys/include/iochannel.h   |  39 +--
 drivers/staging/unisys/visorbus/controlvmchannel.h   |  56 +--
 drivers/staging/unisys/visorbus/vbuschannel.h|  25 +-
 drivers/staging/unisys/visorbus/visorbus_main.c  | 125 +++
 drivers/staging/unisys/visorbus/visorbus_private.h   |  24 +-
 drivers/staging/unisys/visorbus/visorchannel.c   |   8 +-
 drivers/staging/unisys/visorbus/visorchipset.c   | 226 +---
 drivers/staging/unisys/visorhba/visorhba_main.c  |  15 +-
 drivers/staging/unisys/visorinput/ultrainputreport.h |  49 +--
 drivers/staging/unisys/visorinput/visorinput.c   |  51 +--
 drivers/staging/unisys/visornic/visornic_main.c  |  23 +-
 13 files changed, 346 insertions(+), 369 deletions(-)

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


[PATCH 02/25] staging: unisys: visorbus: renamed functions bus_create, bus_destroy and bus_configure to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed the functions bus_create() to visorbus_create(),
bus_destroy() to visorbus_destroy() and bus_configure() to
visorbus_configure

Signed-off-by: Sameer Wadgaonkar 
Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 20 +--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 951e009..68c2221 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -573,7 +573,7 @@ device_changestate_responder(enum controlvm_id cmd_id,
 }
 
 static int
-bus_create(struct controlvm_message *inmsg)
+visorbus_create(struct controlvm_message *inmsg)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -585,7 +585,7 @@ bus_create(struct controlvm_message *inmsg)
bus_info = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL);
if (bus_info && (bus_info->state.created == 1)) {
dev_err(&chipset_dev->acpi_device->dev,
-   "failed bus_create: already exists\n");
+   "failed visorbus_create: already exists\n");
err = -EEXIST;
goto err_respond;
}
@@ -654,7 +654,7 @@ bus_create(struct controlvm_message *inmsg)
 }
 
 static int
-bus_destroy(struct controlvm_message *inmsg)
+visorbus_destroy(struct controlvm_message *inmsg)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -699,8 +699,8 @@ bus_destroy(struct controlvm_message *inmsg)
 }
 
 static int
-bus_configure(struct controlvm_message *inmsg,
- struct parser_context *parser_ctx)
+visorbus_configure(struct controlvm_message *inmsg,
+  struct parser_context *parser_ctx)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
u32 bus_no;
@@ -737,7 +737,7 @@ bus_configure(struct controlvm_message *inmsg,
 
 err_respond:
dev_err(&chipset_dev->acpi_device->dev,
-   "bus_configured exited with err: %d\n", err);
+   "visorbus_configure exited with err: %d\n", err);
if (inmsg->hdr.flags.response_expected == 1)
controlvm_responder(inmsg->hdr.id, &inmsg->hdr, err);
return err;
@@ -1438,7 +1438,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
"no valid create_bus message\n");
return;
}
-   bus_create(&local_crash_bus_msg);
+   visorbus_create(&local_crash_bus_msg);
 
/* reuse create device message for storage device */
if (!local_crash_dev_msg.cmd.create_device.channel_addr) {
@@ -1634,13 +1634,13 @@ handle_command(struct controlvm_message inmsg, u64 
channel_addr)
err = chipset_init(&inmsg);
break;
case CONTROLVM_BUS_CREATE:
-   err = bus_create(&inmsg);
+   err = visorbus_create(&inmsg);
break;
case CONTROLVM_BUS_DESTROY:
-   err = bus_destroy(&inmsg);
+   err = visorbus_destroy(&inmsg);
break;
case CONTROLVM_BUS_CONFIGURE:
-   err = bus_configure(&inmsg, parser_ctx);
+   err = visorbus_configure(&inmsg, parser_ctx);
break;
case CONTROLVM_DEVICE_CREATE:
err = my_device_create(&inmsg);
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/25] staging: unisys: visorbus: renamed functions like *_bus_instance to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed functions
* create_bus_instance() to visorbus_create_instance()
* remove_bus_instance() to visorbus_remove_instance()

Signed-off-by: Sameer Wadgaonkar 
Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index c122ce6..03e29b5 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -981,14 +981,14 @@ int visorbus_register_visor_driver(struct visor_driver 
*drv)
 EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);
 
 /*
- * create_bus_instance() - create a device instance for the visor bus itself
+ * visorbus_create_instance() - create a device instance for the visorbus 
itself
  * @dev: struct visor_device indicating the bus instance
  *
  * Return: 0 for success, otherwise negative errno value indicating reason for
  * failure
  */
 static int
-create_bus_instance(struct visor_device *dev)
+visorbus_create_instance(struct visor_device *dev)
 {
int id = dev->chipset_bus_no;
int err;
@@ -1032,16 +1032,16 @@ create_bus_instance(struct visor_device *dev)
 err_debugfs_dir:
debugfs_remove_recursive(dev->debugfs_dir);
kfree(hdr_info);
-   dev_err(&dev->device, "create_bus_instance failed: %d\n", err);
+   dev_err(&dev->device, "visorbus_create_instance failed: %d\n", err);
return err;
 }
 
 /*
- * remove_bus_instance() - remove a device instance for the visor bus itself
+ * visorbus_remove_instance() - remove a device instance for the visorbus 
itself
  * @dev: struct visor_device indentifying the bus to remove
  */
 static void
-remove_bus_instance(struct visor_device *dev)
+visorbus_remove_instance(struct visor_device *dev)
 {
/*
 * Note that this will result in the release method for
@@ -1061,7 +1061,7 @@ remove_bus_instance(struct visor_device *dev)
 }
 
 /*
- * remove_all_visor_devices() - remove all child visor bus device instances
+ * remove_all_visor_devices() - remove all child visorbus device instances
  */
 static void
 remove_all_visor_devices(void)
@@ -1081,7 +1081,7 @@ chipset_bus_create(struct visor_device *dev)
 {
int err;
 
-   err = create_bus_instance(dev);
+   err = visorbus_create_instance(dev);
 
if (err < 0)
return err;
@@ -1094,7 +1094,7 @@ chipset_bus_create(struct visor_device *dev)
 void
 chipset_bus_destroy(struct visor_device *dev)
 {
-   remove_bus_instance(dev);
+   visorbus_remove_instance(dev);
visorbus_destroy_response(dev, 0);
 }
 
@@ -1289,7 +1289,7 @@ visorbus_exit(void)
struct visor_device *dev = list_entry(listentry,
  struct visor_device,
  list_all);
-   remove_bus_instance(dev);
+   visorbus_remove_instance(dev);
}
 
bus_unregister(&visorbus_type);
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/25] staging: unisys: visorbus: renamed functions like bus_*_response to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed functions bus_create_response() to visorbus_create_response()
and bus_destroy_response() to visorbus_destroy_response().

Signed-off-by: Sameer Wadgaonkar 
Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c| 4 ++--
 drivers/staging/unisys/visorbus/visorbus_private.h | 4 ++--
 drivers/staging/unisys/visorbus/visorchipset.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index a692561..f02dfa7 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1086,7 +1086,7 @@ chipset_bus_create(struct visor_device *dev)
if (err < 0)
return err;
 
-   bus_create_response(dev, err);
+   visorbus_create_response(dev, err);
 
return 0;
 }
@@ -1095,7 +1095,7 @@ void
 chipset_bus_destroy(struct visor_device *dev)
 {
remove_bus_instance(dev);
-   bus_destroy_response(dev, 0);
+   visorbus_destroy_response(dev, 0);
 }
 
 int
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 9f030b1..b09268c 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -34,8 +34,8 @@ void chipset_device_destroy(struct visor_device *dev_info);
 int chipset_device_pause(struct visor_device *dev_info);
 int chipset_device_resume(struct visor_device *dev_info);
 
-void bus_create_response(struct visor_device *p, int response);
-void bus_destroy_response(struct visor_device *p, int response);
+void visorbus_create_response(struct visor_device *p, int response);
+void visorbus_destroy_response(struct visor_device *p, int response);
 void device_create_response(struct visor_device *p, int response);
 void device_destroy_response(struct visor_device *p, int response);
 void device_resume_response(struct visor_device *p, int response);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 68c2221..a3ece14 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1450,7 +1450,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
 }
 
 void
-bus_create_response(struct visor_device *bus_info, int response)
+visorbus_create_response(struct visor_device *bus_info, int response)
 {
if (response >= 0)
bus_info->state.created = 1;
@@ -1463,7 +1463,7 @@ bus_create_response(struct visor_device *bus_info, int 
response)
 }
 
 void
-bus_destroy_response(struct visor_device *bus_info, int response)
+visorbus_destroy_response(struct visor_device *bus_info, int response)
 {
controlvm_responder(CONTROLVM_BUS_DESTROY, bus_info->pending_msg_hdr,
response);
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/25] staging: unisys: visorbus: renamed #defines in visorchipset.c to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed #defines
* UNISYS_SPAR_LEAF_ID to UNISYS_VISOR_LEAF_ID
* UNISYS_SPAR_ID_EBX to UNISYS_VISOR_ID_EBX
* UNISYS_SPAR_ID_ECX to UNISYS_VISOR_ID_ECX
* UNISYS_SPAR_ID_EDX to UNISYS_VISOR_ID_EDX

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 630dd05..971ad9a 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -34,12 +34,12 @@
 
 #define MAX_CONTROLVM_PAYLOAD_BYTES (1024 * 128)
 
-#define UNISYS_SPAR_LEAF_ID 0x4000
+#define UNISYS_VISOR_LEAF_ID 0x4000
 
 /* The s-Par leaf ID returns "UnisysSpar64" encoded across ebx, ecx, edx */
-#define UNISYS_SPAR_ID_EBX 0x73696e55
-#define UNISYS_SPAR_ID_ECX 0x70537379
-#define UNISYS_SPAR_ID_EDX 0x34367261
+#define UNISYS_VISOR_ID_EBX 0x73696e55
+#define UNISYS_VISOR_ID_ECX 0x70537379
+#define UNISYS_VISOR_ID_EDX 0x34367261
 
 /*
  * When the controlvm channel is idle for at least MIN_IDLE_SECONDS,
@@ -1927,10 +1927,10 @@ static __init int visorutil_spar_detect(void)
 
if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
/* check the ID */
-   cpuid(UNISYS_SPAR_LEAF_ID, &eax, &ebx, &ecx, &edx);
-   return  (ebx == UNISYS_SPAR_ID_EBX) &&
-   (ecx == UNISYS_SPAR_ID_ECX) &&
-   (edx == UNISYS_SPAR_ID_EDX);
+   cpuid(UNISYS_VISOR_LEAF_ID, &eax, &ebx, &ecx, &edx);
+   return  (ebx == UNISYS_VISOR_ID_EBX) &&
+   (ecx == UNISYS_VISOR_ID_ECX) &&
+   (edx == UNISYS_VISOR_ID_EDX);
} else {
return 0;
}
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/25] staging: unisys: visorbus: renamed structures in vbuschannel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed structures
* ultra_vbus_deviceinfo to visor_vbus_deviceinfo
* spar_vbus_headerinfo to visor_vbus_headerinfo
* spar_vbus_channel_protocol to visor_vbus_channel

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/vbuschannel.h   | 16 ++---
 drivers/staging/unisys/visorbus/visorbus_main.c | 58 --
 2 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h 
b/drivers/staging/unisys/visorbus/vbuschannel.h
index c87b190..ee5c7b9 100644
--- a/drivers/staging/unisys/visorbus/vbuschannel.h
+++ b/drivers/staging/unisys/visorbus/vbuschannel.h
@@ -48,16 +48,16 @@ static const uuid_le visor_vbus_channel_uuid = 
VISOR_VBUS_CHANNEL_UUID;
  * It is filled in by the client side to provide info about the device
  * and driver from the client's perspective.
  */
-struct ultra_vbus_deviceinfo {
+struct visor_vbus_deviceinfo {
u8 devtype[16]; /* short string identifying the device type */
u8 drvname[16]; /* driver .sys file name */
u8 infostrs[96];/* kernel version */
u8 reserved[128];   /* pad size to 256 bytes */
 } __packed;
 
-struct spar_vbus_headerinfo {
+struct visor_vbus_headerinfo {
u32 struct_bytes;   /* size of this struct in bytes */
-   u32 device_info_struct_bytes;   /* sizeof(ULTRA_VBUS_DEVICEINFO) */
+   u32 device_info_struct_bytes;   /* sizeof(VISOR_VBUS_DEVICEINFO) */
u32 dev_info_count; /* num of items in DevInfo member */
/* (this is the allocated size) */
u32 chp_info_offset;/* byte offset from beginning of this struct */
@@ -69,15 +69,15 @@ struct spar_vbus_headerinfo {
u8 reserved[104];
 } __packed;
 
-struct spar_vbus_channel_protocol {
+struct visor_vbus_channel {
struct channel_header channel_header;   /* initialized by server */
-   struct spar_vbus_headerinfo hdr_info;   /* initialized by server */
+   struct visor_vbus_headerinfo hdr_info;  /* initialized by server */
/* the remainder of this channel is filled in by the client */
-   struct ultra_vbus_deviceinfo chp_info;
+   struct visor_vbus_deviceinfo chp_info;
/* describes client chipset device and driver */
-   struct ultra_vbus_deviceinfo bus_info;
+   struct visor_vbus_deviceinfo bus_info;
/* describes client bus device and driver */
-   struct ultra_vbus_deviceinfo dev_info[0];
+   struct visor_vbus_deviceinfo dev_info[0];
/* describes client device and driver for each device on the bus */
 } __packed;
 
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index f72ccd9..e2631f5 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -64,9 +64,9 @@ static const struct attribute_group *visorbus_dev_groups[] = {
 };
 
 /* filled in with info about parent chipset driver when we register with it */
-static struct ultra_vbus_deviceinfo chipset_driverinfo;
+static struct visor_vbus_deviceinfo chipset_driverinfo;
 /* filled in with info about this driver, wrt it servicing client busses */
-static struct ultra_vbus_deviceinfo clientbus_driverinfo;
+static struct visor_vbus_deviceinfo clientbus_driverinfo;
 
 /* list of visor_device structs, linked via .list_all */
 static LIST_HEAD(list_all_bus_instances);
@@ -356,9 +356,9 @@ static const struct attribute_group *visorbus_groups[] = {
  *  /sys/kernel/debug/visorbus/visorbus.
  */
 /*
- * vbuschannel_print_devinfo() - format a struct ultra_vbus_deviceinfo
+ * vbuschannel_print_devinfo() - format a struct visor_vbus_deviceinfo
  *   and write it to a seq_file
- * @devinfo: the struct ultra_vbus_deviceinfo to format
+ * @devinfo: the struct visor_vbus_deviceinfo to format
  * @seq: seq_file to write to
  * @devix: the device index to be included in the output data, or -1 if no
  * device index is to be included
@@ -366,7 +366,7 @@ static const struct attribute_group *visorbus_groups[] = {
  * Reads @devInfo, and writes it in human-readable notation to @seq.
  */
 static void
-vbuschannel_print_devinfo(struct ultra_vbus_deviceinfo *devinfo,
+vbuschannel_print_devinfo(struct visor_vbus_deviceinfo *devinfo,
  struct seq_file *seq, int devix)
 {
if (!isprint(devinfo->devtype[0]))
@@ -397,7 +397,7 @@ static int client_bus_info_debugfs_show(struct seq_file 
*seq, void *v)
 
int i;
unsigned long off;
-   struct ultra_vbus_deviceinfo dev_info;
+   struct visor_vbus_deviceinfo dev_info;
 
if (!channel)
return 0;
@@ -407,16 +407,14 @@ static int client_bus_info_debugfs_show(struct seq_file 
*seq, void *v)
   ((vdev->name) ? (char *)(vdev->name) : ""),
   vdev->chipset_bus_no);
if (visorchannel_read(c

[PATCH 16/25] staging: unisys: visorbus: renamed enum in controlvmchannel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed enum and its members
* ultra_chipset_feature to visor_chipset_feature
* ULTRA_CHIPSET_FEATURE_REPLY to VISOR_CHIPSET_FEATURE_REPLY
* ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG to
VISOR_CHIPSET_FEATURE_PARA_HOTPLUG

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/controlvmchannel.h | 8 
 drivers/staging/unisys/visorbus/visorchipset.c | 8 
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index 1adc16a..e8716ca 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -157,9 +157,9 @@ struct efi_visor_indication  {
u64 reserved:60;/* Natural alignment */
 } __packed;
 
-enum ultra_chipset_feature {
-   ULTRA_CHIPSET_FEATURE_REPLY = 0x0001,
-   ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG = 0x0002,
+enum visor_chipset_feature {
+   VISOR_CHIPSET_FEATURE_REPLY = 0x0001,
+   VISOR_CHIPSET_FEATURE_PARA_HOTPLUG = 0x0002,
 };
 
 /* This is the common structure that is at the beginning of every
@@ -325,7 +325,7 @@ struct controlvm_message_packet  {
u32 bus_count;
/* indicates the max number of switches */
u32 switch_count;
-   enum ultra_chipset_feature features;
+   enum visor_chipset_feature features;
u32 platform_number;/* Platform Number */
} __packed init_chipset;/* for CONTROLVM_CHIPSET_INIT */
struct  {
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 54e8343..9d140ac 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -395,7 +395,7 @@ controlvm_init_response(struct controlvm_message *msg,
 static int
 controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
   int response,
-  enum ultra_chipset_feature features)
+  enum visor_chipset_feature features)
 {
struct controlvm_message outmsg;
 
@@ -409,7 +409,7 @@ static int
 chipset_init(struct controlvm_message *inmsg)
 {
static int chipset_inited;
-   enum ultra_chipset_feature features = 0;
+   enum visor_chipset_feature features = 0;
int rc = CONTROLVM_RESP_SUCCESS;
int res = 0;
 
@@ -425,13 +425,13 @@ chipset_init(struct controlvm_message *inmsg)
 * also supports it).
 */
features = inmsg->cmd.init_chipset.features &
-  ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG;
+  VISOR_CHIPSET_FEATURE_PARA_HOTPLUG;
 
/*
 * Set the "reply" bit so Command knows this is a
 * features-aware driver.
 */
-   features |= ULTRA_CHIPSET_FEATURE_REPLY;
+   features |= VISOR_CHIPSET_FEATURE_REPLY;
 
 out_respond:
if (inmsg->hdr.flags.response_expected)
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/25] staging: unisys: visorbus: renamed #defines in vbuschannel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed #defines:
* SPAR_VBUS_CHANNEL_PROTOCOL_UUID to VISOR_VBUS_CHANNEL_UUID
* SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE to
VISOR_VBUS_CHANNEL_SIGNATURE
* SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID to
VISOR_VBUS_CHANNEL_VERSIONID

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/vbuschannel.h   |  9 -
 drivers/staging/unisys/visorbus/visorbus_main.c |  6 +++---
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/vbuschannel.h 
b/drivers/staging/unisys/visorbus/vbuschannel.h
index f0ef5ec..c87b190 100644
--- a/drivers/staging/unisys/visorbus/vbuschannel.h
+++ b/drivers/staging/unisys/visorbus/vbuschannel.h
@@ -27,13 +27,12 @@
 #include "channel.h"
 
 /* {193b331b-c58f-11da-95a9-00e08161165f} */
-#define SPAR_VBUS_CHANNEL_PROTOCOL_UUID \
+#define VISOR_VBUS_CHANNEL_UUID \
UUID_LE(0x193b331b, 0xc58f, 0x11da, \
0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
-static const uuid_le spar_vbus_channel_protocol_uuid =
-   SPAR_VBUS_CHANNEL_PROTOCOL_UUID;
+static const uuid_le visor_vbus_channel_uuid = VISOR_VBUS_CHANNEL_UUID;
 
-#define SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
+#define VISOR_VBUS_CHANNEL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
 
 /* Must increment this whenever you insert or delete fields within this channel
  * struct.  Also increment whenever you change the meaning of fields within 
this
@@ -41,7 +40,7 @@ static const uuid_le spar_vbus_channel_protocol_uuid =
  * usually add fields to the END of the channel struct withOUT needing to
  * increment this.
  */
-#define SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID 1
+#define VISOR_VBUS_CHANNEL_VERSIONID 1
 
 /*
  * An array of this struct is present in the channel area for each vbus.
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 984d4d1..f72ccd9 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -689,11 +689,11 @@ get_vbus_header_info(struct visorchannel *chan,
int err;
 
if (!spar_check_channel(visorchannel_get_header(chan),
-   spar_vbus_channel_protocol_uuid,
+   visor_vbus_channel_uuid,
"vbus",
sizeof(struct spar_vbus_channel_protocol),
-   SPAR_VBUS_CHANNEL_PROTOCOL_VERSIONID,
-   SPAR_VBUS_CHANNEL_PROTOCOL_SIGNATURE))
+   VISOR_VBUS_CHANNEL_VERSIONID,
+   VISOR_VBUS_CHANNEL_SIGNATURE))
return -EINVAL;
 
err = visorchannel_read(chan, sizeof(struct channel_header), hdr_info,
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/25] staging: unisys: visorbus: renamed functions like my_device_* to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed functions
* my_device_create() to visorbus_device_create()
* my_device_changestate() to visorbus_device_changestate()
* my_device_destroy() to visorbus_device_destroy()

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index f9ef864..630dd05 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -744,7 +744,7 @@ visorbus_configure(struct controlvm_message *inmsg,
 }
 
 static int
-my_device_create(struct controlvm_message *inmsg)
+visorbus_device_create(struct controlvm_message *inmsg)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -844,7 +844,7 @@ my_device_create(struct controlvm_message *inmsg)
 }
 
 static int
-my_device_changestate(struct controlvm_message *inmsg)
+visorbus_device_changestate(struct controlvm_message *inmsg)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -905,7 +905,7 @@ my_device_changestate(struct controlvm_message *inmsg)
 }
 
 static int
-my_device_destroy(struct controlvm_message *inmsg)
+visorbus_device_destroy(struct controlvm_message *inmsg)
 {
struct controlvm_message_packet *cmd = &inmsg->cmd;
struct controlvm_message_header *pmsg_hdr = NULL;
@@ -1446,7 +1446,7 @@ setup_crash_devices_work_queue(struct work_struct *work)
"no valid create_device message\n");
return;
}
-   my_device_create(&local_crash_dev_msg);
+   visorbus_device_create(&local_crash_dev_msg);
 }
 
 void
@@ -1642,7 +1642,7 @@ handle_command(struct controlvm_message inmsg, u64 
channel_addr)
err = visorbus_configure(&inmsg, parser_ctx);
break;
case CONTROLVM_DEVICE_CREATE:
-   err = my_device_create(&inmsg);
+   err = visorbus_device_create(&inmsg);
break;
case CONTROLVM_DEVICE_CHANGESTATE:
if (cmd->device_change_state.flags.phys_device) {
@@ -1652,12 +1652,12 @@ handle_command(struct controlvm_message inmsg, u64 
channel_addr)
 * save the hdr and cmd structures for later use
 * when sending back the response to Command
 */
-   err = my_device_changestate(&inmsg);
+   err = visorbus_device_changestate(&inmsg);
break;
}
break;
case CONTROLVM_DEVICE_DESTROY:
-   err = my_device_destroy(&inmsg);
+   err = visorbus_device_destroy(&inmsg);
break;
case CONTROLVM_DEVICE_CONFIGURE:
/* no op just send a respond that we passed */
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/25] staging: unisys: visorbus: renamed #define in visorchannel.c to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID to
VISOR_CONSOLEVIDEO_CHANNEL_GUID and renamed const
spar_video_guid to visor_video_guid

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 9e1cea2..6885c2c 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -28,11 +28,11 @@
 
 #define MYDRVNAME "visorchannel"
 
-#define SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID \
+#define VISOR_CONSOLEVIDEO_CHANNEL_GUID \
UUID_LE(0x3cd6e705, 0xd6a2, 0x4aa5, \
0xad, 0x5c, 0x7b, 0x8, 0x88, 0x9d, 0xff, 0xe2)
 
-static const uuid_le spar_video_guid = SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID;
+static const uuid_le visor_video_guid = VISOR_CONSOLEVIDEO_CHANNEL_GUID;
 
 struct visorchannel {
u64 physaddr;
@@ -415,7 +415,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long 
channel_bytes,
 * release later on.
 */
channel->requested = request_mem_region(physaddr, size, MYDRVNAME);
-   if (!channel->requested && uuid_le_cmp(guid, spar_video_guid))
+   if (!channel->requested && uuid_le_cmp(guid, visor_video_guid))
/* we only care about errors if this is not the video channel */
goto err_destroy_channel;
 
@@ -445,7 +445,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long 
channel_bytes,
channel->mapped = NULL;
channel->requested = request_mem_region(channel->physaddr,
channel_bytes, MYDRVNAME);
-   if (!channel->requested && uuid_le_cmp(guid, spar_video_guid))
+   if (!channel->requested && uuid_le_cmp(guid, visor_video_guid))
/* we only care about errors if this is not the video channel */
goto err_destroy_channel;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/25] staging: unisys: visorbus: renamed functions like device_*_response to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed functions
* device_create_response() to visorbus_device_create_response()
* device_destroy_response() to visorbus_device_destroy_response()
* device_pause_response() to visorbus_device_pause_response()
* device_resume_response() to visorbus_device_resume_response()

Signed-off-by: Sameer Wadgaonkar 
Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c|  8 
 drivers/staging/unisys/visorbus/visorbus_private.h |  8 
 drivers/staging/unisys/visorbus/visorchipset.c |  9 -
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index f02dfa7..c122ce6 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1107,7 +1107,7 @@ chipset_device_create(struct visor_device *dev_info)
if (err < 0)
return err;
 
-   device_create_response(dev_info, err);
+   visorbus_device_create_response(dev_info, err);
 
return 0;
 }
@@ -1117,7 +1117,7 @@ chipset_device_destroy(struct visor_device *dev_info)
 {
remove_visor_device(dev_info);
 
-   device_destroy_response(dev_info, 0);
+   visorbus_device_destroy_response(dev_info, 0);
 }
 
 /*
@@ -1137,7 +1137,7 @@ pause_state_change_complete(struct visor_device *dev, int 
status)
 
dev->pausing = false;
 
-   device_pause_response(dev, status);
+   visorbus_device_pause_response(dev, status);
 }
 
 /*
@@ -1162,7 +1162,7 @@ resume_state_change_complete(struct visor_device *dev, 
int status)
 * which will presumably want to send some sort of response to
 * the initiator.
 */
-   device_resume_response(dev, status);
+   visorbus_device_resume_response(dev, status);
 }
 
 /*
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index b09268c..4ecfd7b 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -36,10 +36,10 @@ int chipset_device_resume(struct visor_device *dev_info);
 
 void visorbus_create_response(struct visor_device *p, int response);
 void visorbus_destroy_response(struct visor_device *p, int response);
-void device_create_response(struct visor_device *p, int response);
-void device_destroy_response(struct visor_device *p, int response);
-void device_resume_response(struct visor_device *p, int response);
-void device_pause_response(struct visor_device *p, int response);
+void visorbus_device_create_response(struct visor_device *p, int response);
+void visorbus_device_destroy_response(struct visor_device *p, int response);
+void visorbus_device_resume_response(struct visor_device *p, int response);
+void visorbus_device_pause_response(struct visor_device *p, int response);
 
 int visorbus_init(void);
 void visorbus_exit(void);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index a3ece14..3076b77 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1473,7 +1473,7 @@ visorbus_destroy_response(struct visor_device *bus_info, 
int response)
 }
 
 void
-device_create_response(struct visor_device *dev_info, int response)
+visorbus_device_create_response(struct visor_device *dev_info, int response)
 {
if (response >= 0)
dev_info->state.created = 1;
@@ -1486,7 +1486,7 @@ device_create_response(struct visor_device *dev_info, int 
response)
 }
 
 void
-device_destroy_response(struct visor_device *dev_info, int response)
+visorbus_device_destroy_response(struct visor_device *dev_info, int response)
 {
controlvm_responder(CONTROLVM_DEVICE_DESTROY, dev_info->pending_msg_hdr,
response);
@@ -1496,8 +1496,7 @@ device_destroy_response(struct visor_device *dev_info, 
int response)
 }
 
 void
-device_pause_response(struct visor_device *dev_info,
- int response)
+visorbus_device_pause_response(struct visor_device *dev_info, int response)
 {
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
 dev_info, response,
@@ -1508,7 +1507,7 @@ device_pause_response(struct visor_device *dev_info,
 }
 
 void
-device_resume_response(struct visor_device *dev_info, int response)
+visorbus_device_resume_response(struct visor_device *dev_info, int response)
 {
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
 dev_info, response,
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/25] staging: unisys: visorbus: renamed #defines in controlvmchannel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed #defines
* SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID to
VISOR_CONTROLVM_CHANNEL_UUID
* ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE to
VISOR_CONTROLVM_CHANNEL_SIGNATURE
* ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID to
VISOR_CONTROLVM_CHANNEL_VERSIONID
* SPAR_CONTROLVM_CHANNEL_OK_CLIENT to
VISOR_CONTROLVM_CHANNEL_OK_CLIENT

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/controlvmchannel.h | 19 +++
 drivers/staging/unisys/visorbus/visorchipset.c | 16 ++---
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index 274f724..8cd2147 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -19,12 +19,11 @@
 #include "channel.h"
 
 /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
-#define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID \
+#define VISOR_CONTROLVM_CHANNEL_UUID \
UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
 
-#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
-   ULTRA_CHANNEL_PROTOCOL_SIGNATURE
+#define VISOR_CONTROLVM_CHANNEL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
 #define CONTROLVM_MESSAGE_MAX 64
 
 /* Must increment this whenever you insert or delete fields within
@@ -33,15 +32,15 @@
  * software.  Note that you can usually add fields to the END of the
  * channel struct withOUT needing to increment this.
  */
-#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1
+#define VISOR_CONTROLVM_CHANNEL_VERSIONID 1
 
-#define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
+#define VISOR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
(spar_check_channel(ch, \
-   SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID, \
+   VISOR_CONTROLVM_CHANNEL_UUID, \
"controlvm", \
sizeof(struct spar_controlvm_channel_protocol), \
-   ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
-   ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE))
+   VISOR_CONTROLVM_CHANNEL_VERSIONID, \
+   VISOR_CONTROLVM_CHANNEL_SIGNATURE))
 
 /* Defines for various channel queues */
 #define CONTROLVM_QUEUE_REQUEST 0
@@ -371,7 +370,7 @@ struct spar_controlvm_channel_protocol {
u32 message_count;  /* CONTROLVM_MESSAGE_MAX */
u64 gp_smbios_table;/* guest phys addr of SMBIOS tables */
u64 gp_physical_smbios_table;   /* guest phys addr of SMBIOS table  */
-   /* ULTRA_MAX_GUESTS_PER_SERVICE */
+   /* VISOR_MAX_GUESTS_PER_SERVICE */
char gp_reserved[2688];
 
/* guest physical address of EFI firmware image base  */
@@ -402,7 +401,7 @@ struct spar_controlvm_channel_protocol {
u32 installation_text_id;   /* Id of string to display */
/* Number of remaining installation  steps (for progress bars) */
u16 installation_remaining_steps;
-   /* ULTRA_TOOL_ACTIONS Installation Action field */
+   /* VISOR_TOOL_ACTIONS Installation Action field */
u8 tool_action;
u8 reserved;/* alignment */
struct efi_spar_indication efi_spar_ind;
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 971ad9a..1a175df 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1179,15 +1179,15 @@ parahotplug_request_kickoff(struct parahotplug_request 
*req)
env_cmd, env_id, env_state, env_bus, env_dev, env_func, NULL
};
 
-   sprintf(env_cmd, "SPAR_PARAHOTPLUG=1");
-   sprintf(env_id, "SPAR_PARAHOTPLUG_ID=%d", req->id);
-   sprintf(env_state, "SPAR_PARAHOTPLUG_STATE=%d",
+   sprintf(env_cmd, "VISOR_PARAHOTPLUG=1");
+   sprintf(env_id, "VISOR_PARAHOTPLUG_ID=%d", req->id);
+   sprintf(env_state, "VISOR_PARAHOTPLUG_STATE=%d",
cmd->device_change_state.state.active);
-   sprintf(env_bus, "SPAR_PARAHOTPLUG_BUS=%d",
+   sprintf(env_bus, "VISOR_PARAHOTPLUG_BUS=%d",
cmd->device_change_state.bus_no);
-   sprintf(env_dev, "SPAR_PARAHOTPLUG_DEVICE=%d",
+   sprintf(env_dev, "VISOR_PARAHOTPLUG_DEVICE=%d",
cmd->device_change_state.dev_no >> 3);
-   sprintf(env_func, "SPAR_PARAHOTPLUG_FUNCTION=%d",
+   sprintf(env_func, "VISOR_PARAHOTPLUG_FUNCTION=%d",
cmd->device_change_state.dev_no & 0x7);
 
return kobject_uevent_env(&chipset_dev->acpi_device->dev.kobj,
@@ -1820,7 +1820,7 @@ visorchipset_init(struct acpi_device *acpi_device)
 {
int err = -ENODEV;
u64 addr;
-   uuid_le uuid = SPAR_CONTROLVM_CHANN

[PATCH 01/25] staging: unisys: visorbus: rename typ to cr_type

2017-05-19 Thread David Kershner
From: Jon Frisch 

This patch renames enum crash_obj_type typ to cr_type.

Signed-off-by: Jon Frisch 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 4cfd0fa..951e009 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -470,7 +470,7 @@ enum crash_obj_type {
 };
 
 static int
-save_crash_message(struct controlvm_message *msg, enum crash_obj_type typ)
+save_crash_message(struct controlvm_message *msg, enum crash_obj_type cr_type)
 {
u32 local_crash_msg_offset;
u16 local_crash_msg_count;
@@ -502,7 +502,7 @@ save_crash_message(struct controlvm_message *msg, enum 
crash_obj_type typ)
return err;
}
 
-   switch (typ) {
+   switch (cr_type) {
case CRASH_DEV:
local_crash_msg_offset += sizeof(struct controlvm_message);
err = visorchannel_write(chipset_dev->controlvm_channel,
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/25] staging: unisys: visorbus: renamed functions like chipset_bus_* to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed functions
* chipset_bus_create() to visorchipset_bus_create()
* chipset_bus_destroy() to visorchipset_bus_destroy()

Signed-off-by: Sameer Wadgaonkar 
Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c|  4 ++--
 drivers/staging/unisys/visorbus/visorbus_private.h |  4 ++--
 drivers/staging/unisys/visorbus/visorchipset.c | 10 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 03e29b5..5ba807c 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1077,7 +1077,7 @@ remove_all_visor_devices(void)
 }
 
 int
-chipset_bus_create(struct visor_device *dev)
+visorchipset_bus_create(struct visor_device *dev)
 {
int err;
 
@@ -1092,7 +1092,7 @@ chipset_bus_create(struct visor_device *dev)
 }
 
 void
-chipset_bus_destroy(struct visor_device *dev)
+visorchipset_bus_destroy(struct visor_device *dev)
 {
visorbus_remove_instance(dev);
visorbus_destroy_response(dev, 0);
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 4ecfd7b..3c89935 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -27,8 +27,8 @@
  * command line
  */
 
-int chipset_bus_create(struct visor_device *bus_info);
-void chipset_bus_destroy(struct visor_device *bus_info);
+int visorchipset_bus_create(struct visor_device *bus_info);
+void visorchipset_bus_destroy(struct visor_device *bus_info);
 int chipset_device_create(struct visor_device *dev_info);
 void chipset_device_destroy(struct visor_device *dev_info);
 int chipset_device_pause(struct visor_device *dev_info);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 3076b77..eea70f4 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -630,9 +630,9 @@ visorbus_create(struct controlvm_message *inmsg)
}
bus_info->visorchannel = visorchannel;
 
-   /* Response will be handled by chipset_bus_create */
-   err = chipset_bus_create(bus_info);
-   /* If error chipset_bus_create didn't respond, need to respond here */
+   /* Response will be handled by visorchipset_bus_create */
+   err = visorchipset_bus_create(bus_info);
+   /* If visorchipset_bus_create didn't respond, need to respond here */
if (err)
goto err_destroy_channel;
 
@@ -688,8 +688,8 @@ visorbus_destroy(struct controlvm_message *inmsg)
bus_info->pending_msg_hdr = pmsg_hdr;
}
 
-   /* Response will be handled by chipset_bus_destroy */
-   chipset_bus_destroy(bus_info);
+   /* Response will be handled by visorchipset_bus_destroy */
+   visorchipset_bus_destroy(bus_info);
return 0;
 
 err_respond:
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/25] staging: unisys: visorbus: renamed function initiate_chipset_device_pause_resume to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed function initiate_chipset_device_pause_resume() to
visorchipset_initiate_device_pause_resume().

Signed-off-by: Sameer Wadgaonkar 
Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index f0b08d1..984d4d1 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1166,8 +1166,8 @@ resume_state_change_complete(struct visor_device *dev, 
int status)
 }
 
 /*
- * initiate_chipset_device_pause_resume() - start a pause or resume operation
- *  for a visor device
+ * visorchipset_initiate_device_pause_resume() - start a pause or resume
+ *   operation for a visor device
  * @dev: struct visor_device identifying the device being paused or resumed
  * @is_pause: true to indicate pause operation, false to indicate resume
  *
@@ -1177,7 +1177,8 @@ resume_state_change_complete(struct visor_device *dev, 
int status)
  * resume_state_change_complete().
  */
 static int
-initiate_chipset_device_pause_resume(struct visor_device *dev, bool is_pause)
+visorchipset_initiate_device_pause_resume(struct visor_device *dev,
+ bool is_pause)
 {
int err;
struct visor_driver *drv = NULL;
@@ -1223,7 +1224,7 @@ visorchipset_device_pause(struct visor_device *dev_info)
 {
int err;
 
-   err = initiate_chipset_device_pause_resume(dev_info, true);
+   err = visorchipset_initiate_device_pause_resume(dev_info, true);
 
if (err < 0) {
dev_info->pausing = false;
@@ -1246,7 +1247,7 @@ visorchipset_device_resume(struct visor_device *dev_info)
 {
int err;
 
-   err = initiate_chipset_device_pause_resume(dev_info, false);
+   err = visorchipset_initiate_device_pause_resume(dev_info, false);
 
if (err < 0) {
dev_info->resuming = false;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/25] staging: unisys: visorbus: renamed functions like chipset_device_* to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed functions
* chipset_device_create() to visorchipset_device_create()
* chipset_device_destroy() to visorchipset_device_destroy()
* chipset_device_pause() to visorchipset_device_pause()
* chipset_device_resume() to visorchipset_device_resume()

Signed-off-by: Sameer Wadgaonkar 
Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorbus_main.c| 12 ++--
 drivers/staging/unisys/visorbus/visorbus_private.h |  8 
 drivers/staging/unisys/visorbus/visorchipset.c | 14 +++---
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 5ba807c..f0b08d1 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1099,7 +1099,7 @@ visorchipset_bus_destroy(struct visor_device *dev)
 }
 
 int
-chipset_device_create(struct visor_device *dev_info)
+visorchipset_device_create(struct visor_device *dev_info)
 {
int err;
 
@@ -1113,7 +1113,7 @@ chipset_device_create(struct visor_device *dev_info)
 }
 
 void
-chipset_device_destroy(struct visor_device *dev_info)
+visorchipset_device_destroy(struct visor_device *dev_info)
 {
remove_visor_device(dev_info);
 
@@ -1211,7 +1211,7 @@ initiate_chipset_device_pause_resume(struct visor_device 
*dev, bool is_pause)
 }
 
 /**
- * chipset_device_pause() - start a pause operation for a visor device
+ * visorchipset_device_pause() - start a pause operation for a visor device
  * @dev_info: struct visor_device identifying the device being paused
  *
  * Tell the subordinate function driver for a specific device to pause
@@ -1219,7 +1219,7 @@ initiate_chipset_device_pause_resume(struct visor_device 
*dev, bool is_pause)
  * via a callback function; see pause_state_change_complete().
  */
 int
-chipset_device_pause(struct visor_device *dev_info)
+visorchipset_device_pause(struct visor_device *dev_info)
 {
int err;
 
@@ -1234,7 +1234,7 @@ chipset_device_pause(struct visor_device *dev_info)
 }
 
 /**
- * chipset_device_resume() - start a resume operation for a visor device
+ * visorchipset_device_resume() - start a resume operation for a visor device
  * @dev_info: struct visor_device identifying the device being resumed
  *
  * Tell the subordinate function driver for a specific device to resume
@@ -1242,7 +1242,7 @@ chipset_device_pause(struct visor_device *dev_info)
  * via a callback function; see resume_state_change_complete().
  */
 int
-chipset_device_resume(struct visor_device *dev_info)
+visorchipset_device_resume(struct visor_device *dev_info)
 {
int err;
 
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h 
b/drivers/staging/unisys/visorbus/visorbus_private.h
index 3c89935..98a5af1 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -29,10 +29,10 @@
 
 int visorchipset_bus_create(struct visor_device *bus_info);
 void visorchipset_bus_destroy(struct visor_device *bus_info);
-int chipset_device_create(struct visor_device *dev_info);
-void chipset_device_destroy(struct visor_device *dev_info);
-int chipset_device_pause(struct visor_device *dev_info);
-int chipset_device_resume(struct visor_device *dev_info);
+int visorchipset_device_create(struct visor_device *dev_info);
+void visorchipset_device_destroy(struct visor_device *dev_info);
+int visorchipset_device_pause(struct visor_device *dev_info);
+int visorchipset_device_resume(struct visor_device *dev_info);
 
 void visorbus_create_response(struct visor_device *p, int response);
 void visorbus_destroy_response(struct visor_device *p, int response);
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index eea70f4..f9ef864 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -824,8 +824,8 @@ my_device_create(struct controlvm_message *inmsg)
   sizeof(struct controlvm_message_header));
dev_info->pending_msg_hdr = pmsg_hdr;
}
-   /* Chipset_device_create will send response */
-   err = chipset_device_create(dev_info);
+   /* visorchipset_device_create will send response */
+   err = visorchipset_device_create(dev_info);
if (err)
goto err_destroy_visorchannel;
 
@@ -882,16 +882,16 @@ my_device_changestate(struct controlvm_message *inmsg)
 
if (state.alive == segment_state_running.alive &&
state.operating == segment_state_running.operating)
-   /* Response will be sent from chipset_device_resume */
-   err = chipset_device_resume(dev_info);
+   /* Response will be sent from visorchipset_device_resume */
+   err = visorchipset_device_resume(dev_info);
/* ServerNotReady / 

[PATCH 20/25] staging: unisys: include: renamed function spar_check_channel in channel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed function spar_check_channel() to visor_check_channel().

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/channel.h   | 12 ++--
 drivers/staging/unisys/include/iochannel.h |  4 ++--
 drivers/staging/unisys/visorbus/controlvmchannel.h | 12 ++--
 drivers/staging/unisys/visorbus/visorbus_main.c| 12 ++--
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index 057421e..e22a151 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -204,12 +204,12 @@ struct signal_queue_header {
  * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages.
  */
 static inline int
-spar_check_channel(struct channel_header *ch,
-  uuid_le expected_uuid,
-  char *chname,
-  u64 expected_min_bytes,
-  u32 expected_version,
-  u64 expected_signature)
+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 */
diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 9bde848..ce0e2e2 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -51,13 +51,13 @@
 #define ULTRA_VSWITCH_CHANNEL_PROTOCOL_VERSIONID 1
 
 #define SPAR_VHBA_CHANNEL_OK_CLIENT(ch) \
-   (spar_check_channel(ch, spar_vhba_channel_protocol_uuid, \
+   (visor_check_channel(ch, spar_vhba_channel_protocol_uuid, \
"vhba", MIN_IO_CHANNEL_SIZE,\
ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID, \
ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE))
 
 #define SPAR_VNIC_CHANNEL_OK_CLIENT(ch) \
-   (spar_check_channel(ch, spar_vnic_channel_protocol_uuid, \
+   (visor_check_channel(ch, spar_vnic_channel_protocol_uuid, \
"vnic", MIN_IO_CHANNEL_SIZE,\
ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID, \
ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE))
diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index e8716ca..506ed0d 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -35,12 +35,12 @@
 #define VISOR_CONTROLVM_CHANNEL_VERSIONID 1
 
 #define VISOR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
-   (spar_check_channel(ch, \
-   VISOR_CONTROLVM_CHANNEL_UUID, \
-   "controlvm", \
-   sizeof(struct visor_controlvm_channel), \
-   VISOR_CONTROLVM_CHANNEL_VERSIONID, \
-   VISOR_CONTROLVM_CHANNEL_SIGNATURE))
+   (visor_check_channel(ch, \
+VISOR_CONTROLVM_CHANNEL_UUID, \
+"controlvm", \
+sizeof(struct visor_controlvm_channel), \
+VISOR_CONTROLVM_CHANNEL_VERSIONID, \
+VISOR_CONTROLVM_CHANNEL_SIGNATURE))
 
 /* Defines for various channel queues */
 #define CONTROLVM_QUEUE_REQUEST 0
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index e2631f5..1c785dd 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -686,12 +686,12 @@ get_vbus_header_info(struct visorchannel *chan,
 {
int err;
 
-   if (!spar_check_channel(visorchannel_get_header(chan),
-   visor_vbus_channel_uuid,
-   "vbus",
-   sizeof(struct visor_vbus_channel),
-   VISOR_VBUS_CHANNEL_VERSIONID,
-   VISOR_VBUS_CHANNEL_SIGNATURE))
+   if (!visor_check_channel(visorchannel_get_header(chan),
+visor_vbus_channel_uuid,
+"vbus",
+sizeof(struct visor_vbus_channel),
+VISOR_VBUS_CHANNEL_VERSIONID,
+VISOR_VBUS_CHANNEL_SIGNATURE))
return -EINVAL;
 
err = visorchannel_read(chan, sizeof(struct channel_header), hdr_info,
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdr

[PATCH 25/25] staging: unisys: visorbus: remove channel_addr check in handle_command

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Removed a check for physaddr=0 in handle_command() function in
visorchipset.c.

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

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 8438b71..2215056 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1593,9 +1593,6 @@ handle_command(struct controlvm_message inmsg, u64 
channel_addr)
 
/* create parsing context if necessary */
local_addr = (inmsg.hdr.flags.test_message == 1);
-   if (channel_addr == 0)
-   return -EINVAL;
-
parm_addr = channel_addr + inmsg.hdr.payload_vm_offset;
parm_bytes = inmsg.hdr.payload_bytes;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/25] staging: unisys: visorinput: renamed structures in ultrainputreport.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed structures
* ultra_inputactivity to visor_inputactivity
* ultra_inputreport to visor_inputreport


Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorinput/ultrainputreport.h | 6 +++---
 drivers/staging/unisys/visorinput/visorinput.c   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/visorinput/ultrainputreport.h 
b/drivers/staging/unisys/visorinput/ultrainputreport.h
index 53dde7c..b57f868 100644
--- a/drivers/staging/unisys/visorinput/ultrainputreport.h
+++ b/drivers/staging/unisys/visorinput/ultrainputreport.h
@@ -64,16 +64,16 @@ enum ultra_inputaction {
inputaction_last
 };
 
-struct ultra_inputactivity {
+struct visor_inputactivity {
u16 action;
u16 arg1;
u16 arg2;
u16 arg3;
 } __packed;
 
-struct ultra_inputreport {
+struct visor_inputreport {
u64 seq_no;
-   struct ultra_inputactivity activity;
+   struct visor_inputactivity activity;
 } __packed;
 
 #endif
diff --git a/drivers/staging/unisys/visorinput/visorinput.c 
b/drivers/staging/unisys/visorinput/visorinput.c
index 2fc9ea1..4eaaa76 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -565,7 +565,7 @@ calc_button(int x)
 static void
 visorinput_channel_interrupt(struct visor_device *dev)
 {
-   struct ultra_inputreport r;
+   struct visor_inputreport r;
int scancode, keycode;
struct input_dev *visorinput_dev;
int xmotion, ymotion, button;
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 19/25] staging: unisys: visorinput: removed enum in ultrainputreport.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Removed enum ultra_inputaction in ultrainputreport.h and changed
elements to #defnes.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorinput/ultrainputreport.h | 43 +
 drivers/staging/unisys/visorinput/visorinput.c   | 22 +++
 2 files changed, 30 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/unisys/visorinput/ultrainputreport.h 
b/drivers/staging/unisys/visorinput/ultrainputreport.h
index b57f868..a4baea5 100644
--- a/drivers/staging/unisys/visorinput/ultrainputreport.h
+++ b/drivers/staging/unisys/visorinput/ultrainputreport.h
@@ -17,26 +17,23 @@
 
 #include 
 
-/* Identifies mouse and keyboard activity which is specified by the firmware to
- *  the host using the cmsimpleinput protocol.  @ingroup coretypes
+/* These defines identify mouse and keyboard activity which is specified by the
+ * firmware to the host using the cmsimpleinput protocol.  @ingroup coretypes
  */
-enum ultra_inputaction {
-   inputaction_none = 0,
-   inputaction_xy_motion = 1,  /* only motion; arg1=x, arg2=y */
-   inputaction_mouse_button_down = 2, /* arg1: 1=left,2=center,3=right */
-   inputaction_mouse_button_up = 3, /* arg1: 1=left,2=center,3=right */
-   inputaction_mouse_button_click = 4, /* arg1: 1=left,2=center,3=right */
-   inputaction_mouse_button_dclick = 5, /* arg1: 1=left,2=center,
- * 3=right
- */
-   inputaction_wheel_rotate_away = 6, /* arg1: wheel rotation away from
-   * user
-   */
-   inputaction_wheel_rotate_toward = 7, /* arg1: wheel rotation toward
- * user
- */
-   inputaction_set_max_xy = 8, /* set screen maxXY; arg1=x, arg2=y */
-   inputaction_key_down = 64,  /* arg1: scancode, as follows:
+#define INPUTACTION_XY_MOTION 1/* only motion; arg1=x, arg2=y 
*/
+#define INPUTACTION_MOUSE_BUTTON_DOWN 2 /* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_UP 3  /* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_CLICK 4 /* arg1: 1=left,2=center,3=right */
+#define INPUTACTION_MOUSE_BUTTON_DCLICK 5 /* arg1: 1=left,2=center,
+  * 3=right
+  */
+#define INPUTACTION_WHEEL_ROTATE_AWAY 6  /* arg1: wheel rotation away from
+ * user
+ */
+#define INPUTACTION_WHEEL_ROTATE_TOWARD 7 /* arg1: wheel rotation toward
+  * user
+  */
+#define INPUTACTION_KEY_DOWN 64/* arg1: scancode, as follows:
 * If arg1 <= 0xff, it's a 1-byte
 * scancode and arg1 is that scancode.
 * If arg1 > 0xff, it's a 2-byte
@@ -45,10 +42,10 @@ enum ultra_inputaction {
 * high 8 bits.  E.g., the right ALT key
 * would appear as x'38e0'.
 */
-   inputaction_key_up = 65,/* arg1: scancode (in same format as
+#define INPUTACTION_KEY_UP 65  /* arg1: scancode (in same format as
 * inputaction_keyDown)
 */
-   inputaction_set_locking_key_state = 66,
+#define INPUTACTION_SET_LOCKING_KEY_STATE 66
/* arg1: scancode (in same format
 *   as inputaction_keyDown);
 *   MUST refer to one of the
@@ -58,11 +55,9 @@ enum ultra_inputaction {
 *   in the LOCKED position
 *   (e.g., light is ON)
 */
-   inputaction_key_down_up = 67,   /* arg1: scancode (in same format
+#define INPUTACTION_KEY_DOWN_UP 67 /* arg1: scancode (in same format
 *   as inputaction_keyDown)
 */
-   inputaction_last
-};
 
 struct visor_inputactivity {
u16 action;
diff --git a/drivers/staging/unisys/visorinput/visorinput.c 
b/drivers/staging/unisys/visorinput/visorinput.c
index 4eaaa76..45bc340 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -582,46 +582,46 @@ visorinput_channel_interrupt(struct visor_device *dev)
scancode = r.activity.arg1;
keycode = scancode_to_keycode(scancode);
sw

[PATCH 21/25] staging: unisys: include: renamed #defines in channel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed #defines
* ULTRA_CHANNEL_PROTOCOL_SIGNATURE to
VISOR_CHANNEL_SIGNATURE
* SPAR_CHANNEL_SERVER_READY to
VISOR_CHANNEL_SERVER_READY
* ULTRA_VALID_CHANNELCLI_TRANSITION
VISOR_VALID_CHANNELCLI_TRANSITION
* ULTRA_CLIERRORBOOT_THROTTLEMSG_DISABLED to
VISOR_CLIERRORBOOT_THROTTLEMSG_DISABLED
* ULTRA_CLIERRORBOOT_THROTTLEMSG_NOTATTACHED to
VISOR_CLIERRORBOOT_THROTTLEMSG_NOTATTACHED
* ULTRA_CLIERRORBOOT_THROTTLEMSG_BUSY to
VISOR_CLIERRORBOOT_THROTTLEMSG_BUSY
* ULTRA_IO_DRIVER_ENABLES_INTS to
VISOR_DRIVER_ENABLES_INTS
* ULTRA_IO_CHANNEL_IS_POLLING to
VISOR_CHANNEL_IS_POLLING
* ULTRA_IO_IOVM_IS_OK_WITH_DRIVER_DISABLING_INTS to
VISOR_IOVM_OK_DRIVER_DISABLING_INTS
* ULTRA_IO_DRIVER_DISABLES_INTS to
VISOR_DRIVER_DISABLES_INTS
* ULTRA_IO_DRIVER_SUPPORTS_ENHANCED_RCVBUF_CHECKING to
VISOR_DRIVER_ENHANCED_RCVBUF_CHECKING
* ULTRA_CHANNEL_ENABLE_INTS to
VISOR_CHANNEL_ENABLE_INTS
* SPAR_VHBA_CHANNEL_PROTOCOL_UUID to VISOR_VHBA_CHANNEL_UUID
* SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR to
VISOR_VHBA_CHANNEL_UUID_STR
* SPAR_VNIC_CHANNEL_PROTOCOL_UUID to VISOR_VNIC_CHANNEL_UUID
* SPAR_VNIC_CHANNEL_PROTOCOL_UUID_STR to
VISOR_VNIC_CHANNEL_UUID_STR
* SPAR_SIOVM_UUID to VISOR_SIOVM_UUID

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/Documentation/overview.txt  |  8 +--
 drivers/staging/unisys/include/channel.h   | 48 +++
 drivers/staging/unisys/include/iochannel.h | 11 +--
 drivers/staging/unisys/visorbus/controlvmchannel.h |  2 +-
 drivers/staging/unisys/visorbus/vbuschannel.h  |  2 +-
 drivers/staging/unisys/visorbus/visorchipset.c |  4 +-
 drivers/staging/unisys/visorhba/visorhba_main.c|  8 +--
 drivers/staging/unisys/visornic/visornic_main.c| 10 +--
 8 files changed, 45 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/unisys/Documentation/overview.txt 
b/drivers/staging/unisys/Documentation/overview.txt
index 990315b..e0466bf 100644
--- a/drivers/staging/unisys/Documentation/overview.txt
+++ b/drivers/staging/unisys/Documentation/overview.txt
@@ -221,7 +221,7 @@ The following files exist under 
/sys/devices/visorbus/vbus:dev:
 
 The visorhba driver registers with visorbus as the function driver to
 handle virtual scsi disk devices, specified using the
-SPAR_VHBA_CHANNEL_PROTOCOL_UUID type in the visorbus_register_visor_driver()
+VISOR_VHBA_CHANNEL_UUID type in the visorbus_register_visor_driver()
 call. visorhba uses scsi_add_host() to expose a Linux block device
 (e.g., /sys/block/) in the guest environment for each s-Par virtual device.
 
@@ -240,7 +240,7 @@ When compiled as a module, visorhba can be autoloaded by 
visorbus in
 standard udev/systemd environments, as it includes the modules.alias
 definition:
 
-"visorbus:"+SPAR_VHBA_CHANNEL_PROTOCOL_UUID_STR
+"visorbus:"+VISOR_VHBA_CHANNEL_UUID_STR
 
 i.e.:
 
@@ -252,7 +252,7 @@ i.e.:
 
 The visornic driver registers with visorbus as the function driver to
 handle virtual network devices, specified using the
-SPAR_VNIC_CHANNEL_PROTOCOL_UUID type in the visorbus_register_visor_driver()
+VISOR_VNIC_CHANNEL_UUID type in the visorbus_register_visor_driver()
 call. visornic uses register_netdev() to expose a Linux device of class net
 (e.g., /sys/class/net/) in the guest environment for each s-Par virtual
 device.
@@ -270,7 +270,7 @@ When compiled as a module, visornic can be autoloaded by 
visorbus in
 standard udev/systemd environments, as it includes the modules.alias
 definition:
 
-"visorbus:"+SPAR_VNIC_CHANNEL_PROTOCOL_UUID_STR
+"visorbus:"+VISOR_VNIC_CHANNEL_UUID_STR
 
 i.e.:
 
diff --git a/drivers/staging/unisys/include/channel.h 
b/drivers/staging/unisys/include/channel.h
index e22a151..692efcb 100644
--- a/drivers/staging/unisys/include/channel.h
+++ b/drivers/staging/unisys/include/channel.h
@@ -32,7 +32,7 @@
 #define COVER(v, d) ((d) * DIV_ROUND_UP(v, d))
 #endif
 
-#define ULTRA_CHANNEL_PROTOCOL_SIGNATURE SIGNATURE_32('E', 'C', 'N', 'L')
+#define VISOR_CHANNEL_SIGNATURE SIGNATURE_32('E', 'C', 'N', 'L')
 
 enum channel_serverstate {
CHANNELSRV_UNINITIALIZED = 0,   /* channel is in an undefined state */
@@ -59,10 +59,10 @@ enum channel_clientstate {
/* access channel anytime */
 };
 
-#define SPAR_CHANNEL_SERVER_READY(ch) \
+#define VISOR_CHANNEL_SERVER_READY(ch) \
(readl(&(ch)->srv_state) == CHANNELSRV_READY)
 
-#define ULTRA_VALID_CHANNELCLI_TRANSITION(o, n) \
+#define VISOR_VALID_CHANNELCLI_TRANSITION(o, n) \
(o) == CHANNELCLI_DETACHED) && ((n) == CHANNELCLI_DISABLED)) || \
  (((o) == CHANNELCLI_ATTACHING) && ((n) == CHANNELCLI_DISABLED)) || \
  (((o) == CHANNELCLI_ATTACHED) && ((n) == CHANNELCLI_DISABLED)) || \
@@ -80,33 +80,33 @@ en

[PATCH 23/25] staging: unisys: include: renamed structure spar_io_channel_protocol in iochannel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed structure spar_io_channel_protocol to visor_io_channel and
changed "visor bus" to "visorbus" in a comment in visornic_main.c
and visorhba_main.c.


Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/iochannel.h  |  2 +-
 drivers/staging/unisys/visorhba/visorhba_main.c |  7 +++
 drivers/staging/unisys/visornic/visornic_main.c | 13 +
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 1365cb4..c7cb3fb 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -529,7 +529,7 @@ struct iochannel_vnic {
  * this header there is a large region of memory which contains the command and
  * response queues as specified in cmd_q and rsp_q SIGNAL_QUEUE_HEADERS.
  */
-struct spar_io_channel_protocol {
+struct visor_io_channel {
struct channel_header channel_header;
struct signal_queue_header cmd_q;
struct signal_queue_header rsp_q;
diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index dcb10ac..2fd31c9 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -1060,8 +1060,7 @@ static int visorhba_probe(struct visor_device *dev)
if (!scsihost)
return -ENODEV;
 
-   channel_offset = offsetof(struct spar_io_channel_protocol,
- vhba.max);
+   channel_offset = offsetof(struct visor_io_channel, vhba.max);
err = visorbus_read_channel(dev, channel_offset, &max,
sizeof(struct vhba_config_max));
if (err < 0)
@@ -1105,7 +1104,7 @@ static int visorhba_probe(struct visor_device *dev)
devdata->serverchangingstate = false;
devdata->scsihost = scsihost;
 
-   channel_offset = offsetof(struct spar_io_channel_protocol,
+   channel_offset = offsetof(struct visor_io_channel,
  channel_header.features);
err = visorbus_read_channel(dev, channel_offset, &features, 8);
if (err)
@@ -1166,7 +1165,7 @@ static void visorhba_remove(struct visor_device *dev)
debugfs_remove_recursive(devdata->debugfs_dir);
 }
 
-/* This is used to tell the visor bus driver which types of visor devices
+/* This is used to tell the visorbus driver which types of visor devices
  * we support, and what functions to call when a visor device that we support
  * is attached or removed.
  */
diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 9b9af9e..2891622 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -1807,8 +1807,7 @@ static int visornic_probe(struct visor_device *dev)
 
/* Get MAC address from channel and read it into the device. */
netdev->addr_len = ETH_ALEN;
-   channel_offset = offsetof(struct spar_io_channel_protocol,
- vnic.macaddr);
+   channel_offset = offsetof(struct visor_io_channel, vnic.macaddr);
err = visorbus_read_channel(dev, channel_offset, netdev->dev_addr,
ETH_ALEN);
if (err < 0) {
@@ -1836,8 +1835,7 @@ static int visornic_probe(struct visor_device *dev)
atomic_set(&devdata->usage, 1);
 
/* Setup rcv bufs */
-   channel_offset = offsetof(struct spar_io_channel_protocol,
- vnic.num_rcv_bufs);
+   channel_offset = offsetof(struct visor_io_channel, vnic.num_rcv_bufs);
err = visorbus_read_channel(dev, channel_offset,
&devdata->num_rcv_bufs, 4);
if (err) {
@@ -1884,8 +1882,7 @@ static int visornic_probe(struct visor_device *dev)
devdata->server_change_state = false;
 
/*set the default mtu */
-   channel_offset = offsetof(struct spar_io_channel_protocol,
- vnic.mtu);
+   channel_offset = offsetof(struct visor_io_channel, vnic.mtu);
err = visorbus_read_channel(dev, channel_offset, &netdev->mtu, 4);
if (err) {
dev_err(&dev->device,
@@ -1906,7 +1903,7 @@ static int visornic_probe(struct visor_device *dev)
 */
mod_timer(&devdata->irq_poll_timer, msecs_to_jiffies(2));
 
-   channel_offset = offsetof(struct spar_io_channel_protocol,
+   channel_offset = offsetof(struct visor_io_channel,
  channel_header.features);
err = visorbus_read_channel(dev, channel_offset, &features, 8);
if (err) {
@@ -2115,7 +2112,7 @@ static int visornic_resume(struct visor_device *dev,
return 0;
 }
 
-/* This is used to tell the visor bus driver which types of visor devices
+/* Th

[PATCH 24/25] staging: unisys: visorbus: add comment to explain polling logic in controlvm_periodic_work

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Added a comment to explain polling frequency variation logic in
controlvm_periodic_logic() in visorchipset.c.

Signed-off-by: Sameer Wadgaonkar 
Reported-by: Greg Kroah-Hartman 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index c40a370..8438b71 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1787,6 +1787,11 @@ controlvm_periodic_work(struct work_struct *work)
/* parahotplug_worker */
parahotplug_process_list();
 
+/*
+ * The controlvm messages are sent in a bulk. If we start receiving messages, 
we
+ * want the polling to be fast. If we do not receive any message for
+ * MIN_IDLE_SECONDS, we can slow down the polling.
+ */
 schedule_out:
if (time_after(jiffies, chipset_dev->most_recent_message_jiffies +
(HZ * MIN_IDLE_SECONDS))) {
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 15/25] staging: unisys: visorbus: renamed structures in controlvmchannel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed structures
* spar_segment_state to visor_segment_state
* efi_spar_indication to efi_visor_indication
* spar_controlvm_channel_protocol to visor_controlvm_channel
* spar_controlvm_parameters_header to
visor_controlvm_parameters_header

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/visorbus/controlvmchannel.h |  25 +---
 drivers/staging/unisys/visorbus/visorchipset.c |  99 ++
 2 files changed, 59 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/controlvmchannel.h 
b/drivers/staging/unisys/visorbus/controlvmchannel.h
index 8cd2147..1adc16a 100644
--- a/drivers/staging/unisys/visorbus/controlvmchannel.h
+++ b/drivers/staging/unisys/visorbus/controlvmchannel.h
@@ -38,7 +38,7 @@
(spar_check_channel(ch, \
VISOR_CONTROLVM_CHANNEL_UUID, \
"controlvm", \
-   sizeof(struct spar_controlvm_channel_protocol), \
+   sizeof(struct visor_controlvm_channel), \
VISOR_CONTROLVM_CHANNEL_VERSIONID, \
VISOR_CONTROLVM_CHANNEL_SIGNATURE))
 
@@ -51,7 +51,7 @@
 /* Max num of messages stored during IOVM creation to be reused after crash */
 #define CONTROLVM_CRASHMSG_MAX 2
 
-struct spar_segment_state  {
+struct visor_segment_state  {
/* Bit 0: May enter other states */
u16 enabled:1;
/* Bit 1: Assigned to active partition */
@@ -75,15 +75,15 @@ struct spar_segment_state  {
  */
 } __packed;
 
-static const struct spar_segment_state segment_state_running = {
+static const struct visor_segment_state segment_state_running = {
1, 1, 1, 0, 1, 1, 1, 1
 };
 
-static const struct spar_segment_state segment_state_paused = {
+static const struct visor_segment_state segment_state_paused = {
1, 1, 1, 0, 1, 1, 1, 0
 };
 
-static const struct spar_segment_state segment_state_standby = {
+static const struct visor_segment_state segment_state_standby = {
1, 1, 0, 0, 1, 1, 1, 0
 };
 
@@ -148,7 +148,7 @@ struct irq_info {
u8 reserved[3]; /* Natural alignment purposes */
 } __packed;
 
-struct efi_spar_indication  {
+struct efi_visor_indication  {
u64 boot_to_fw_ui:1;/* Bit 0: Stop in uefi ui */
u64 clear_nvram:1;  /* Bit 1: Clear NVRAM */
u64 clear_cmos:1;   /* Bit 2: Clear CMOS */
@@ -297,13 +297,13 @@ struct controlvm_message_packet  {
/* for CONTROLVM_DEVICE_RECONFIGURE */
struct  {
u32 bus_no;
-   struct spar_segment_state state;
+   struct visor_segment_state state;
u8 reserved[2]; /* Natural alignment purposes */
} __packed bus_change_state; /* for CONTROLVM_BUS_CHANGESTATE */
struct  {
u32 bus_no;
u32 dev_no;
-   struct spar_segment_state state;
+   struct visor_segment_state state;
struct  {
/* =1 if message is for a physical device */
u32 phys_device:1;
@@ -316,7 +316,7 @@ struct controlvm_message_packet  {
struct  {
u32 bus_no;
u32 dev_no;
-   struct spar_segment_state state;
+   struct visor_segment_state state;
u8 reserved[6]; /* Natural alignment purposes */
} __packed device_change_state_event;
/* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
@@ -348,7 +348,7 @@ struct controlvm_message {
struct controlvm_message_packet cmd;
 } __packed;
 
-struct spar_controlvm_channel_protocol {
+struct visor_controlvm_channel {
struct channel_header header;
u64 gp_controlvm;   /* guest phys addr of this channel */
u64 gp_partition_tables;/* guest phys addr of partition tables */
@@ -404,8 +404,7 @@ struct spar_controlvm_channel_protocol {
/* VISOR_TOOL_ACTIONS Installation Action field */
u8 tool_action;
u8 reserved;/* alignment */
-   struct efi_spar_indication efi_spar_ind;
-   struct efi_spar_indication efi_spar_ind_supported;
+   struct efi_visor_indication efi_visor_ind;
u32 sp_reserved;
/* Force signals to begin on 128-byte cache line */
u8 reserved2[28];
@@ -443,7 +442,7 @@ struct spar_controlvm_channel_protocol {
  * of total_length should equal PayloadBytes. The format of the strings at
  * PayloadVmOffset will take different forms depending on the message.
  */
-struct spar_controlvm_parameters_header {
+struct visor_controlvm_parameters_header {
u32 total_length;
u32 header_length;
u32 connection_offset

[PATCH 22/25] staging: unisys: include: renamed #defines in iochannel.h to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed #defines
* ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE to
VISOR_VHBA_CHANNEL_SIGNATURE
* ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE to
VISOR_VNIC_CHANNEL_SIGNATURE
* ULTRA_VSWITCH_CHANNEL_PROTOCOL_SIGNATURE to
VISOR_VSWITCH_CHANNEL_SIGNATURE
* ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID to
VISOR_VHBA_CHANNEL_VERSIONID
* ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID to
VISOR_VNIC_CHANNEL_VERSIONID
* ULTRA_VSWITCH_CHANNEL_PROTOCOL_VERSIONID to
VISOR_VSWITCH_CHANNEL_VERSIONID
* SPAR_VHBA_CHANNEL_OK_CLIENT to VISOR_VHBA_CHANNEL_OK_CLIENT
* SPAR_VNIC_CHANNEL_OK_CLIENT to VISOR_VNIC_CHANNEL_OK_CLIENT


Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/include/iochannel.h | 28 +++
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index d57b180..1365cb4 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -34,9 +34,9 @@
 #include 
 #include "channel.h"
 
-#define ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE VISOR_CHANNEL_SIGNATURE
-#define ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE VISOR_CHANNEL_SIGNATURE
-#define ULTRA_VSWITCH_CHANNEL_PROTOCOL_SIGNATURE VISOR_CHANNEL_SIGNATURE
+#define VISOR_VHBA_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
+#define VISOR_VNIC_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
+#define VISOR_VSWITCH_CHANNEL_SIGNATURE VISOR_CHANNEL_SIGNATURE
 
 /*
  * Must increment these whenever you insert or delete fields within this 
channel
@@ -45,21 +45,21 @@
  * usually add fields to the END of the channel struct without needing to
  * increment this.
  */
-#define ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID 2
-#define ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID 2
-#define ULTRA_VSWITCH_CHANNEL_PROTOCOL_VERSIONID 1
+#define VISOR_VHBA_CHANNEL_VERSIONID 2
+#define VISOR_VNIC_CHANNEL_VERSIONID 2
+#define VISOR_VSWITCH_CHANNEL_VERSIONID 1
 
-#define SPAR_VHBA_CHANNEL_OK_CLIENT(ch) \
+#define VISOR_VHBA_CHANNEL_OK_CLIENT(ch) \
(visor_check_channel(ch, visor_vhba_channel_uuid, \
-   "vhba", MIN_IO_CHANNEL_SIZE,\
-   ULTRA_VHBA_CHANNEL_PROTOCOL_VERSIONID, \
-   ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE))
+"vhba", MIN_IO_CHANNEL_SIZE, \
+VISOR_VHBA_CHANNEL_VERSIONID, \
+VISOR_VHBA_CHANNEL_SIGNATURE))
 
-#define SPAR_VNIC_CHANNEL_OK_CLIENT(ch) \
+#define VISOR_VNIC_CHANNEL_OK_CLIENT(ch) \
(visor_check_channel(ch, visor_vnic_channel_uuid, \
-   "vnic", MIN_IO_CHANNEL_SIZE,\
-   ULTRA_VNIC_CHANNEL_PROTOCOL_VERSIONID, \
-   ULTRA_VNIC_CHANNEL_PROTOCOL_SIGNATURE))
+"vnic", MIN_IO_CHANNEL_SIZE, \
+VISOR_VNIC_CHANNEL_VERSIONID, \
+VISOR_VNIC_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 17/25] staging: unisys: visorinput: renamed #defines in visorinput.c to match driver namespace

2017-05-19 Thread David Kershner
From: Sameer Wadgaonkar 

Renamed #defines
* SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID to
VISOR_KEYBOARD_CHANNEL_UUID
* SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR to
VISOR_KEYBOARD_CHANNEL_UUID_STR
* SPAR_MOUSE_CHANNEL_PROTOCOL_UUID to
VISOR_MOUSE_CHANNEL_UUID
* SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR to
VISOR_MOUSE_CHANNEL_UUID_STR

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
---
 drivers/staging/unisys/Documentation/overview.txt |  6 ++--
 drivers/staging/unisys/visorinput/visorinput.c| 27 +++-
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/unisys/Documentation/overview.txt 
b/drivers/staging/unisys/Documentation/overview.txt
index 1146c1c..990315b 100644
--- a/drivers/staging/unisys/Documentation/overview.txt
+++ b/drivers/staging/unisys/Documentation/overview.txt
@@ -282,7 +282,7 @@ i.e.:
 
 The visorinput driver registers with visorbus as the function driver to
 handle human input devices, specified using the
-SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID and SPAR_MOUSE_CHANNEL_PROTOCOL_UUID
+VISOR_KEYBOARD_CHANNEL_UUID and VISOR_MOUSE_CHANNEL_UUID
 types in the visorbus_register_visor_driver() call. visorinput uses
 input_register_device() to expose devices of class input
 (e.g., /sys/class/input/) for virtual keyboard and virtual mouse devices.
@@ -307,8 +307,8 @@ When compiled as a module, visorinput can be autoloaded by 
visorbus in
 standard udev/systemd environments, as it includes the modules.alias
 definition:
 
-"visorbus:"+SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR
-"visorbus:"+SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR
+"visorbus:"+VISOR_MOUSE_CHANNEL_UUID_STR
+"visorbus:"+VISOR_KEYBOARD_CHANNEL_UUID_STR
 
 i.e.:
 
diff --git a/drivers/staging/unisys/visorinput/visorinput.c 
b/drivers/staging/unisys/visorinput/visorinput.c
index cdd3543..2fc9ea1 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -33,17 +33,16 @@
 #include "ultrainputreport.h"
 
 /* Keyboard channel {c73416d0-b0b8-44af-b304-9d2ae99f1b3d} */
-#define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID \
+#define VISOR_KEYBOARD_CHANNEL_UUID \
UUID_LE(0xc73416d0, 0xb0b8, 0x44af, \
0xb3, 0x4, 0x9d, 0x2a, 0xe9, 0x9f, 0x1b, 0x3d)
-#define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR 
"c73416d0-b0b8-44af-b304-9d2ae99f1b3d"
+#define VISOR_KEYBOARD_CHANNEL_UUID_STR "c73416d0-b0b8-44af-b304-9d2ae99f1b3d"
 
 /* Mouse channel {addf07d4-94a9-46e2-81c3-61abcdbdbd87} */
-#define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID \
+#define VISOR_MOUSE_CHANNEL_UUID \
UUID_LE(0xaddf07d4, 0x94a9, 0x46e2, \
0x81, 0xc3, 0x61, 0xab, 0xcd, 0xbd, 0xbd, 0x87)
-#define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR \
-   "addf07d4-94a9-46e2-81c3-61abcdbdbd87"
+#define VISOR_MOUSE_CHANNEL_UUID_STR "addf07d4-94a9-46e2-81c3-61abcdbdbd87"
 
 #define PIXELS_ACROSS_DEFAULT 800
 #define PIXELS_DOWN_DEFAULT   600
@@ -70,10 +69,8 @@ struct visorinput_devdata {
unsigned char keycode_table[0];
 };
 
-static const uuid_le spar_keyboard_channel_protocol_uuid =
-   SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID;
-static const uuid_le spar_mouse_channel_protocol_uuid =
-   SPAR_MOUSE_CHANNEL_PROTOCOL_UUID;
+static const uuid_le visor_keyboard_channel_uuid = VISOR_KEYBOARD_CHANNEL_UUID;
+static const uuid_le visor_mouse_channel_uuid = VISOR_MOUSE_CHANNEL_UUID;
 
 /*
  * Borrowed from drivers/input/keyboard/atakbd.c
@@ -456,9 +453,9 @@ visorinput_probe(struct visor_device *dev)
enum visorinput_device_type devtype;
 
guid = visorchannel_get_uuid(dev->visorchannel);
-   if (uuid_le_cmp(guid, spar_mouse_channel_protocol_uuid) == 0)
+   if (uuid_le_cmp(guid, visor_mouse_channel_uuid) == 0)
devtype = visorinput_mouse;
-   else if (uuid_le_cmp(guid, spar_keyboard_channel_protocol_uuid) == 0)
+   else if (uuid_le_cmp(guid, visor_keyboard_channel_uuid) == 0)
devtype = visorinput_keyboard;
else
return -ENODEV;
@@ -730,8 +727,8 @@ visorinput_resume(struct visor_device *dev,
 
 /* GUIDS for all channel types supported by this driver. */
 static struct visor_channeltype_descriptor visorinput_channel_types[] = {
-   { SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID, "keyboard"},
-   { SPAR_MOUSE_CHANNEL_PROTOCOL_UUID, "mouse"},
+   { VISOR_KEYBOARD_CHANNEL_UUID, "keyboard"},
+   { VISOR_MOUSE_CHANNEL_UUID, "mouse"},
{ NULL_UUID_LE, NULL }
 };
 
@@ -767,5 +764,5 @@ MODULE_AUTHOR("Unisys");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("s-Par human input driver for virtual keyboard/mouse");
 
-MODULE_ALIAS("visorbus:" SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR);
-MODULE_ALIAS("visorbus:" SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR);
+MODULE_ALIAS("visorbus:" VISOR_MOUSE_CHANNEL_UUID_STR);
+MODULE_ALIAS("visorbus:" VISOR_KEYBOARD_CHANNEL_UUID_STR);
-- 
git-series 0.9.1

[PATCH] Staging: bcm2835-audio: bcm2835_ctl.c: Fixed a comment coding style issue.

2017-05-19 Thread srishti sharma
fixed a trailing */ issue .

Signed-off-by: srishti sharma 
---
 drivers/staging/bcm2835-audio/bcm2835-ctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-ctl.c 
b/drivers/staging/bcm2835-audio/bcm2835-ctl.c
index a4ffa1b..38fabab 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-ctl.c
@@ -247,8 +247,8 @@ static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol 
*kcontrol,
struct snd_ctl_elem_value *ucontrol)
 {
/* bcm2835 supports only consumer mode and sets all other format flags
-* automatically. So the only thing left is signalling non-audio
-* content */
+* automatically. So the only thing left is signalling non-audio content
+*/
ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO;
return 0;
 }
2.7.4

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


[PATCH] staging: speakup: signedness bug in spk_ttyio_in_nowait()

2017-05-19 Thread Dan Carpenter
On most of the common arches char is signed so it can't ever == 0xff.
Let's fix this by making it a u8.

Fixes: 6b9ad1c742bf ("staging: speakup: add send_xchar, tiocmset and input 
functionality for tty")
Signed-off-by: Dan Carpenter 

diff --git a/drivers/staging/speakup/spk_ttyio.c 
b/drivers/staging/speakup/spk_ttyio.c
index 6e0f042f6a44..8ed7c71c712f 100644
--- a/drivers/staging/speakup/spk_ttyio.c
+++ b/drivers/staging/speakup/spk_ttyio.c
@@ -220,7 +220,7 @@ static unsigned char spk_ttyio_in(void)
 
 static unsigned char spk_ttyio_in_nowait(void)
 {
-   char rv = ttyio_in(0);
+   u8 rv = ttyio_in(0);
 
return (rv == 0xff) ? 0 : rv;
 }
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: speakup: signedness bug in spk_ttyio_in_nowait()

2017-05-19 Thread Samuel Thibault
Dan Carpenter, on sam. 20 mai 2017 00:27:18 +0300, wrote:
> On most of the common arches char is signed so it can't ever == 0xff.
> Let's fix this by making it a u8.
> 
> Fixes: 6b9ad1c742bf ("staging: speakup: add send_xchar, tiocmset and input 
> functionality for tty")
> Signed-off-by: Dan Carpenter 

Reviewed-by: Samuel Thibault 

> diff --git a/drivers/staging/speakup/spk_ttyio.c 
> b/drivers/staging/speakup/spk_ttyio.c
> index 6e0f042f6a44..8ed7c71c712f 100644
> --- a/drivers/staging/speakup/spk_ttyio.c
> +++ b/drivers/staging/speakup/spk_ttyio.c
> @@ -220,7 +220,7 @@ static unsigned char spk_ttyio_in(void)
>  
>  static unsigned char spk_ttyio_in_nowait(void)
>  {
> - char rv = ttyio_in(0);
> + u8 rv = ttyio_in(0);
>  
>   return (rv == 0xff) ? 0 : rv;
>  }
> 

-- 
Samuel
Now, it we had this sort of thing:
  yield -a for yield to all traffic
  yield -t for yield to trucks
  yield -f for yield to people walking (yield foot)
  yield -d t*  for yield on days starting with t
...you'd have a lot of dead people at intersections, and traffic jams you
wouldn't believe...
(Discussion in comp.os.linux.misc on the intuitiveness of commands.)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/3][v4] staging: fsl-mc: move bus driver out of staging

2017-05-19 Thread Stuart Yoder
On Fri, May 19, 2017 at 8:41 AM, Matthias Brugger
 wrote:
>
>
> On 19/05/17 15:13, laurentiu.tu...@nxp.com wrote:
>>
>> From: Stuart Yoder 
>>
>> Move the source files out of staging into their final locations:
>>-include files in drivers/staging/fsl-mc/include go to
>> include/linux/fsl
>>-irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip
>
>
> This driver has as compatible "arm,gic-v3-its". I wonder if this is correct
> and if it should be moved like this out of staging.

Matthias, can you be more specific as to what your concern is?

The fsl-mc bus needs to implement bus specific gic-v3 MSI support just
like the other
bus types.  See:
   drivers/irqchip/irq-gic-v3-its-pci-msi.c
   drivers/irqchip/irq-gic-v3-its-platform-msi.c

You will see that the PCI and platform bus types also find the gic-v3 node by
compatible string.

The bus specific gic-v3 support for fsl-mc is implemented in a
completely standard way.

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


[PATCH 1/1] fbtft:Fix to avoid precedence issues

2017-05-19 Thread Rishiraj Manwatkar
Parentheses added to avoid operator precedence issues.

Signed-off-by: Rishiraj Manwatkar 
---
 drivers/staging/fbtft/fb_hx8340bn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fb_hx8340bn.c 
b/drivers/staging/fbtft/fb_hx8340bn.c
index 1ca1fcd..fbd5ef5 100755
--- a/drivers/staging/fbtft/fb_hx8340bn.c
+++ b/drivers/staging/fbtft/fb_hx8340bn.c
@@ -157,7 +157,7 @@ static int set_var(struct fbtft_par *par)
  *   OP0 OP1 CP0 CP1 CP2 CP3 CP4 MP0 MP1 MP2 MP3 MP4 MP5 CGM0 CGM1
  *   ON0 ON1 CN0 CN1 CN2 CN3 CN4 MN0 MN1 MN2 MN3 MN4 MN5   GC
  */
-#define CURVE(num, idx)  curves[num * par->gamma.num_values + idx]
+#define CURVE(num, idx)  curves[(num) * par->gamma.num_values + (idx)]
 static int set_gamma(struct fbtft_par *par, u32 *curves)
 {
unsigned long mask[] = {
-- 
2.1.4

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


Re: [PATCH 3/3][v4] staging: fsl-mc: move bus driver out of staging

2017-05-19 Thread Marc Zyngier
On Fri, May 19 2017 at 02:41:43 PM, Matthias Brugger  
wrote:
> On 19/05/17 15:13, laurentiu.tu...@nxp.com wrote:
>> From: Stuart Yoder 
>>
>> Move the source files out of staging into their final locations:
>>-include files in drivers/staging/fsl-mc/include go to include/linux/fsl
>>-irq-gic-v3-its-fsl-mc-msi.c goes to drivers/irqchip
>
> This driver has as compatible "arm,gic-v3-its". I wonder if this is
> correct and if it should be moved like this out of staging.

This is no different from the way we handle *any* bus that uses the
GICv3 ITS as an MSI controller. Each bus provides its glue code that
latches onto the ITS node, and calls into the generic code.

Now, when it comes to moving this out of staging, here is my concern:
There is mention of a userspace tool (restool) used to control the
HW. Where is this tool? Where is the user ABI documented?

Thanks,

M.
-- 
Jazz is not dead. It just smells funny.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel