Re: [PATCH] fix some coding style in drivers/staging/iio

2014-03-21 Thread Lars-Peter Clausen

[...]

diff --git a/drivers/staging/iio/accel/adis16220_core.c 
b/drivers/staging/iio/accel/adis16220_core.c
index 6f38ca9..31c7a9d 100644
--- a/drivers/staging/iio/accel/adis16220_core.c
+++ b/drivers/staging/iio/accel/adis16220_core.c
@@ -392,7 +392,8 @@ static const struct iio_info adis16220_info = {
  };

  static const char * const adis16220_status_error_msgs[] = {
-   [ADIS16220_DIAG_STAT_VIOLATION_BIT] = "Capture period 
violation/interruption",
+   [ADIS16220_DIAG_STAT_VIOLATION_BIT] =
+   "Capture period violation/interruption",


This does not improve legibility. The 80 chars per line rule is to improve 
legibility, if it doesn't it's better to ignore it.



[ADIS16220_DIAG_STAT_SPI_FAIL_BIT] = "SPI failure",
[ADIS16220_DIAG_STAT_FLASH_UPT_BIT] = "Flash update failed",
[ADIS16220_DIAG_STAT_POWER_HIGH_BIT] = "Power supply above 3.625V",

[...]

diff --git a/drivers/staging/iio/resolver/ad2s1200.c 
b/drivers/staging/iio/resolver/ad2s1200.c
index 36eedd8..d38df2e 100644
--- a/drivers/staging/iio/resolver/ad2s1200.c
+++ b/drivers/staging/iio/resolver/ad2s1200.c
@@ -70,6 +70,7 @@ static int ad2s1200_read_raw(struct iio_dev *indio_dev,
vel = (((s16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4);
vel = (vel << 4) >> 4;
*val = vel;
+   /* fall through */


This not a coding style issue, here is actually a break missing.


default:
mutex_unlock(&st->lock);
return -EINVAL;



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


[PATCH 1/3] staging: gdm72xx: Coding style fixes

2014-03-21 Thread Michalis Pappas

Minor white-space fixes as suggested by checkpatch.pl.

Signed-off-by: Michalis Pappas 
---
 drivers/staging/gdm72xx/gdm_qos.c   | 2 +-
 drivers/staging/gdm72xx/gdm_wimax.c | 2 ++
 drivers/staging/gdm72xx/usb_boot.c  | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/gdm72xx/gdm_qos.c 
b/drivers/staging/gdm72xx/gdm_qos.c
index 50d43ad..245109e 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -377,7 +377,7 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int 
size)
index = get_csr(qcb, SFID, 1);
if (index == -1) {
netdev_err(nic->netdev,
-  "QoS ERROR: csr Update Error / Wrong index (%d) \n",
+  "QoS ERROR: csr Update Error / Wrong index (%d)\n",
   index);
return;
}
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c 
b/drivers/staging/gdm72xx/gdm_wimax.c
index 05ce2a2..5d05cdb 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -199,6 +199,7 @@ static void gdm_wimax_event_rcv(struct net_device *dev, u16 
type, void *msg,
u8 *buf = (u8 *) msg;
u16 hci_cmd =  (buf[0]<<8) | buf[1];
u16 hci_len = (buf[2]<<8) | buf[3];
+
netdev_dbg(dev, "H=>D: 0x%04x(%d)\n", hci_cmd, hci_len);
gdm_wimax_send(nic, msg, len);
@@ -310,6 +311,7 @@ static int gdm_wimax_event_send(struct net_device *dev, 
char *buf, int size)
u16 hci_cmd =  ((u8)buf[0]<<8) | (u8)buf[1];
u16 hci_len = ((u8)buf[2]<<8) | (u8)buf[3];
+
netdev_dbg(dev, "D=>H: 0x%04x(%d)\n", hci_cmd, hci_len);
spin_lock_irqsave(&wm_event.evt_lock, flags);
diff --git a/drivers/staging/gdm72xx/usb_boot.c 
b/drivers/staging/gdm72xx/usb_boot.c
index 0d45eb6..4d7c61c 100644
--- a/drivers/staging/gdm72xx/usb_boot.c
+++ b/drivers/staging/gdm72xx/usb_boot.c
@@ -67,6 +67,7 @@ struct fw_info {
 static void array_le32_to_cpu(u32 *arr, int num)
 {
int i;
+
for (i = 0; i < num; i++, arr++)
*arr = __le32_to_cpu(*arr);
 }
-- 
1.7.12.1


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


[PATCH 0/3] staging: gdm72xx: Minor cleanup

2014-03-21 Thread Michalis Pappas
The following patches perform various cleanups on the gdm72xx driver.

PATCH 1/3 fixes some small coding style issues
PATCH 2/3 removes an already completed item from the TODO list
PATCH 3/3 replaces some jiffies comparisons with wrap-safe functions

After all patches have been applied, the only remaining issue on the
TODO list is to conform to the coding standards. The remaining issues
reported by checkpatch.pl are probably pedantic, so if agreed, that task
can be removed from the list too.

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


[PATCH v3] staging: cxt1e1: replace OS_kmalloc/OS_kfree with kmalloc/kfree

2014-03-21 Thread Daeseok Youn

Replace OS_kmalloc/OS_kfree with kmalloc/kfree.
And also some allocation doesn't need to use GFP_DMA
so just use GFP_KERNEL.

c4_new() function is never called, remove it.

Signed-off-by: Daeseok Youn 
---
v3: replace kzalloc with kmalloc.
v2: fix subject and comment correctly.

I'm not sure what GFP_DMA use correctly for km{,z}alloc().
Please review this. 
And this patch has coding style issues. coding style issues will be
fixed with another one. 

 drivers/staging/cxt1e1/hwprobe.c |2 +-
 drivers/staging/cxt1e1/linux.c   |   21 +--
 drivers/staging/cxt1e1/musycc.c  |   12 ---
 drivers/staging/cxt1e1/pmcc4_drv.c   |   47 +-
 drivers/staging/cxt1e1/sbecom_inline_linux.h |   23 +
 drivers/staging/cxt1e1/sbecrc.c  |5 ++-
 drivers/staging/cxt1e1/sbeproc.c |2 +-
 7 files changed, 32 insertions(+), 80 deletions(-)

diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 9b4198b..6e207f5 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -205,7 +205,7 @@ cleanup_devs(void)
 #ifdef CONFIG_SBE_PMCC4_NCOMM
free_irq(hi->pdev[1]->irq, hi->ndev);
 #endif
-   OS_kfree(hi->ndev);
+   kfree(hi->ndev);
}
 }
 
diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c
index b02f5ade..4b4609d 100644
--- a/drivers/staging/cxt1e1/linux.c
+++ b/drivers/staging/cxt1e1/linux.c
@@ -60,7 +60,6 @@ status_tc4_chan_work_init(mpi_t *, mch_t *);
 voidmusycc_wq_chan_restart(void *);
 status_t __init c4_init(ci_t *, u_char *, u_char *);
 status_t __init c4_init2(ci_t *);
-ci_t   *__init c4_new(void *);
 int __init  c4hw_attach_all(void);
 void __init hdw_sn_get(hdw_info_t *, int);
 
@@ -418,7 +417,7 @@ create_chan(struct net_device *ndev, ci_t *ci,
struct c4_priv *priv;
 
/* allocate then fill in private data structure */
-   priv = OS_kmalloc(sizeof(struct c4_priv));
+   priv = kzalloc(sizeof(struct c4_priv), GFP_KERNEL);
if (!priv) {
pr_warning("%s: no memory for net_device !\n",
   ci->devname);
@@ -428,7 +427,7 @@ create_chan(struct net_device *ndev, ci_t *ci,
if (!dev) {
pr_warning("%s: no memory for hdlc_device !\n",
   ci->devname);
-   OS_kfree(priv);
+   kfree(priv);
return NULL;
}
priv->ci = ci;
@@ -972,8 +971,8 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
 
if (register_netdev(ndev) ||
(c4_init(ci, (u_char *) f0, (u_char *) f1) != 
SBE_DRVR_SUCCESS)) {
-   OS_kfree(netdev_priv(ndev));
-   OS_kfree(ndev);
+   kfree(netdev_priv(ndev));
+   kfree(ndev);
error_flag = -ENODEV;
return NULL;
}
@@ -998,8 +997,8 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
pr_warning("%s: MUSYCC could not get irq: %d\n",
   ndev->name, irq0);
unregister_netdev(ndev);
-   OS_kfree(netdev_priv(ndev));
-   OS_kfree(ndev);
+   kfree(netdev_priv(ndev));
+   kfree(ndev);
error_flag = -EIO;
return NULL;
}
@@ -1008,8 +1007,8 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
pr_warning("%s: EBUS could not get irq: %d\n", hi->devname, 
irq1);
unregister_netdev(ndev);
free_irq(irq0, ndev);
-   OS_kfree(netdev_priv(ndev));
-   OS_kfree(ndev);
+   kfree(netdev_priv(ndev));
+   kfree(ndev);
error_flag = -EIO;
return NULL;
}
@@ -1068,8 +1067,8 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, 
unsigned long f1,
unregister_netdev(ndev);
free_irq(irq1, ndev);
free_irq(irq0, ndev);
-   OS_kfree(netdev_priv(ndev));
-   OS_kfree(ndev);
+   kfree(netdev_priv(ndev));
+   kfree(ndev);
/* failure, error_flag is set */
return NULL;
}
diff --git a/drivers/staging/cxt1e1/musycc.c b/drivers/staging/cxt1e1/musycc.c
index 7b4f6f2..872cdae 100644
--- a/drivers/staging/cxt1e1/musycc.c
+++ b/drivers/staging/cxt1e1/musycc.c
@@ -744,7 +744,8 @@ musycc_init(ci_t *ci)
 
 #define INT_QUEUE_BOUNDARY  4
 
-regaddr = OS_kmalloc((INT_QUEUE_SIZE + 1) * sizeof(u_int32_t));
+   regaddr = kzalloc((INT_QUEUE_SIZE + 1) * sizeof(u_int32_t),
+ GFP_KERNEL | GFP_DMA);
 if (!regaddr)
   

[PATCH 2/3] staging: gdm72xx: Removed task from TODO list

2014-03-21 Thread Michalis Pappas

Removed task related to replacement of kernel_thread with kthread,
as issue was fixed on ff5e4a1d2702582614996f6f6d005e9b5caadeb8.

Signed-off-by: Michalis Pappas 
---
 drivers/staging/gdm72xx/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/gdm72xx/TODO b/drivers/staging/gdm72xx/TODO
index 5ab27fb..62d0cd6 100644
--- a/drivers/staging/gdm72xx/TODO
+++ b/drivers/staging/gdm72xx/TODO
@@ -1,3 +1,2 @@
 TODO:
-- Replace kernel_thread with kthread in gdm_usb.c
 - Clean up coding style to meet kernel standard.
-- 
1.7.12.1

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


[PATCH 3/3] staging: gdm72xx: Removed direct comparisons on jiffies

2014-03-21 Thread Michalis Pappas

Replaced comparisons on jiffies values with wrap-safe functions.

Signed-off-by: Michalis Pappas 
---
 drivers/staging/gdm72xx/gdm_usb.c   | 2 +-
 drivers/staging/gdm72xx/sdio_boot.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_usb.c 
b/drivers/staging/gdm72xx/gdm_usb.c
index 20539d8..9ddf8f5 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -730,7 +730,7 @@ static int k_mode_thread(void *arg)
spin_unlock_irqrestore(&k_lock, flags2);
expire = jiffies + K_WAIT_TIME;
-   while (jiffies < expire)
+   while (time_before(jiffies, expire))
schedule_timeout(K_WAIT_TIME);
spin_lock_irqsave(&rx->lock, flags);
diff --git a/drivers/staging/gdm72xx/sdio_boot.c 
b/drivers/staging/gdm72xx/sdio_boot.c
index cbe5dcf..2c02842 100644
--- a/drivers/staging/gdm72xx/sdio_boot.c
+++ b/drivers/staging/gdm72xx/sdio_boot.c
@@ -41,11 +41,11 @@ static u8 *tx_buf;
  static int ack_ready(struct sdio_func *func)
 {
-   unsigned long start = jiffies;
+   unsigned long wait = jiffies + HZ;
u8 val;
int ret;
 -  while ((jiffies - start) < HZ) {
+   while (time_before(jiffies, wait)) {
val = sdio_readb(func, 0x13, &ret);
if (val & 0x01)
return 1;
-- 
1.7.12.1


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


Re: [PATCH] staging: cxt1e1: hwprobe: Fix sparse warning

2014-03-21 Thread Matei Oprea
I did it against your master branch of staging.git. I guess that's why
doesn't apply at all. I switched branches to staging-next after your
e-mail.

Thanks and sorry !

On Wed, Mar 19, 2014 at 1:14 AM, Greg KH  wrote:
> On Wed, Mar 19, 2014 at 12:33:19AM +0200, Matei Oprea wrote:
>> This fixes the following sparse warning:
>> * drivers/staging/cxt1e1/hwprobe.c:43:19:
>> warning: symbol 'hdw_info' was not declared. Should it be static?
>> * drivers/staging/cxt1e1/hwprobe.c:47:1:
>> warning: symbol 'show_two' was not declared. Should it be static?
>> * drivers/staging/cxt1e1/hwprobe.c:99:1:
>> warning: symbol 'hdw_sn_get' was not declared. Should it be static?
>> *drivers/staging/cxt1e1/hwprobe.c:149:1:
>> warning: symbol 'prep_hdw_info' was not declared. Should it be static?
>> * drivers/staging/cxt1e1/hwprobe.c:169:1:
>> warning: symbol 'cleanup_ioremap' was not declared. Should it be static?
>> * drivers/staging/cxt1e1/hwprobe.c:195:1:
>> warning: symbol 'cleanup_devs' was not declared. Should it be static?
>> drivers/staging/cxt1e1/hwprobe.c:293:1:
>> * warning: symbol 'c4hw_attach_all' was not declared. Should it be static?
>>
>> Signed-off-by: Matei Oprea 
>> Cc: ROSEdu Kernel Community 
>> ---
>>  drivers/staging/cxt1e1/hwprobe.c |   14 +++---
>>  1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/staging/cxt1e1/hwprobe.c 
>> b/drivers/staging/cxt1e1/hwprobe.c
>> index 02b4f8f..694047a 100644
>> --- a/drivers/staging/cxt1e1/hwprobe.c
>> +++ b/drivers/staging/cxt1e1/hwprobe.c
>> @@ -40,10 +40,10 @@ voidc4_stopwd (ci_t *);
>>  struct net_device * __init c4_add_dev (hdw_info_t *, int, unsigned long, 
>> unsigned long, int, int);
>>
>>
>> -struct s_hdw_info hdw_info[MAX_BOARDS];
>> +static struct s_hdw_info hdw_info[MAX_BOARDS];
>>
>>
>> -void__init
>> +static void__init
>>  show_two (hdw_info_t *hi, int brdno)
>>  {
>>  ci_t   *ci;
>> @@ -95,7 +95,7 @@ show_two (hdw_info_t *hi, int brdno)
>
>
> This patch doesn't apply at all, did you do it against my staging-next
> branch of staging.git or linux-next?  Or did you do it against Linus's
> tree?  If Linus's tree, that's quite "old" for development stuff, always
> work against linux-next to avoid making the same changes others already
> have in the past.
>
> greg k-h



-- 
Oprea Matei

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


Re: [PATCH] staging: octeon-usb: prevent memory corruption

2014-03-21 Thread Thomas Pugliese


On Thu, 20 Mar 2014, Aaro Koskinen wrote:

> octeon-hcd will crash the kernel when SLOB is used. This usually happens
> after the 18-byte control transfer when a device descriptor is read.
> The DMA engine is always transfering full 32-bit words and if the
> transfer is shorter, some random garbage appears after the buffer.
> The problem is not visible with SLUB since it rounds up the allocations
> to word boundary, and the extra bytes will go undetected.
> 
> Fix by providing quirk functions for DMA map/unmap that allocate a bigger
> temporary buffer when necessary. Tested by booting EdgeRouter Lite
> to USB stick root file system with SLAB, SLOB and SLUB kernels.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=72121
> Reported-by: Sergey Popov 
> Signed-off-by: Aaro Koskinen 
> ---
>  drivers/staging/octeon-usb/octeon-hcd.c | 108 
> 
>  1 file changed, 108 insertions(+)
> 
> diff --git a/drivers/staging/octeon-usb/octeon-hcd.c 
> b/drivers/staging/octeon-usb/octeon-hcd.c
> index 5a001d9..9c152f9 100644
> --- a/drivers/staging/octeon-usb/octeon-hcd.c
> +++ b/drivers/staging/octeon-usb/octeon-hcd.c
> @@ -465,6 +465,112 @@ struct octeon_hcd {
>  #define USB_FIFO_ADDRESS(channel, usb_index) (CVMX_USBCX_GOTGCTL(usb_index) 
> + ((channel)+1)*0x1000)
>  
>  /**
> + * struct octeon_temp_buffer - a bounce buffer for USB transfers
> + * @temp_buffer: the newly allocated temporary buffer (including meta-data)
> + * @orig_buffer: the original buffer passed by the USB stack
> + * @data: the newly allocated temporary buffer (excluding meta-data)
> + *
> + * Both the DMA engine and FIFO mode will always transfer full 32-bit words. 
> If
> + * the buffer is too short, we need to allocate a temporary one, and this 
> struct
> + * represents it.
> + */
> +struct octeon_temp_buffer {
> + void *temp_buffer;
> + void *orig_buffer;
> + u8 data[0];
> +};
> +
> +/**
> + * octeon_alloc_temp_buffer - allocate a temporary buffer for USB transfer
> + *(if needed)
> + * @urb: URB.
> + * @mem_flags:   Memory allocation flags.
> + *
> + * This function allocates a temporary bounce buffer whenever it's needed
> + * due to HW limitations.
> + */
> +static int octeon_alloc_temp_buffer(struct urb *urb, gfp_t mem_flags)
> +{
> + struct octeon_temp_buffer *temp;
> +
> + if (urb->num_sgs || urb->sg ||
> + (urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP) ||
> + !(urb->transfer_buffer_length % sizeof(u32)))
> + return 0;
> +
> + temp = kmalloc(ALIGN(urb->transfer_buffer_length, sizeof(u32)) +
> +sizeof(*temp), mem_flags);
> + if (!temp)
> + return -ENOMEM;
> +
> + temp->temp_buffer = temp;
> + temp->orig_buffer = urb->transfer_buffer;
> + if (usb_urb_dir_out(urb))
> + memcpy(temp->data, urb->transfer_buffer,
> +urb->transfer_buffer_length);
> + urb->transfer_buffer = temp->data;
> + urb->transfer_flags |= URB_ALIGNED_TEMP_BUFFER;
> +
> + return 0;
> +}
> +
> 

I don't think you need the temp_buffer in struct octeon_temp_buffer.  
Once you have temp in octeon_free_temp_buffer via container_of, just free 
temp.  There is no need to look at temp_buffer to get its address.

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


[PATCH 2/2] staging: xillybus: XILLYBUS_PCIE depends on PCI_MSI

2014-03-21 Thread Eli Billauer
xillybus_pcie.c will compile and load properly on PCI only, but will do
nothing useful without PCI_MSI.

PCI_MSI depends on PCI, so depending on PCI_MSI covers both.

Signed-off-by: Eli Billauer 
---
 drivers/staging/xillybus/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/xillybus/Kconfig b/drivers/staging/xillybus/Kconfig
index 1b88330..b53bdf1 100644
--- a/drivers/staging/xillybus/Kconfig
+++ b/drivers/staging/xillybus/Kconfig
@@ -17,7 +17,7 @@ if XILLYBUS
 
 config XILLYBUS_PCIE
tristate "Xillybus over PCIe"
-   depends on PCI
+   depends on PCI_MSI
help
  Set to M if you want Xillybus to use PCI Express for communicating
  with the FPGA.
-- 
1.7.2.3

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


[PATCH 1/2] staging: xillybus: Added "select CRC32" for XILLYBUS in Kconfig

2014-03-21 Thread Eli Billauer
Reason: xillybus_core.c uses crc32_le()

Reported-by: Fengguang Wu 
Signed-off-by: Eli Billauer 
---
 drivers/staging/xillybus/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/xillybus/Kconfig b/drivers/staging/xillybus/Kconfig
index 75c38c8..1b88330 100644
--- a/drivers/staging/xillybus/Kconfig
+++ b/drivers/staging/xillybus/Kconfig
@@ -5,6 +5,7 @@
 config XILLYBUS
tristate "Xillybus generic FPGA interface"
depends on PCI || (OF_ADDRESS && OF_IRQ)
+   select CRC32
help
  Xillybus is a generic interface for peripherals designed on
  programmable logic (FPGA). The driver probes the hardware for
-- 
1.7.2.3

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


Re: [PATCH RFC 26/46] drivers/base: provide an infrastructure for componentised subsystems

2014-03-21 Thread Russell King - ARM Linux
On Fri, Mar 07, 2014 at 12:24:33AM +0100, Laurent Pinchart wrote:
> However, we (as in the V4L2 community, and me personally) would have 
> appreciated to be CC'ed on the proposal. As you might know we already had a 
> solution for this problem, albeit V4L2-specific, in drivers/media/v4l2-
> core/v4l2-async.c.

There's a lot of people who would have liked to be on the Cc, but there's
two problems: 1. the Cc list would be too big for mailing lists to accept
the message, and 2. finding everyone who should be on the Cc list is quite
an impossible task.

> The topic is particularly hot given that a similar solution was also
> proposed as part of the now defunct (or at least hibernating) common
> display framework. 

Yes, I am aware of CDF.  However, the annoying thing is that it's another
case of the bigger picture not being looked at - which is that we don't
need yet another subsystem specific solution to a problem which is not
subsystem specific.

The fact of the matter is that /anyone/ has the opportunity to come up
with a generic solution to this problem, and no one did... instead,
more solutions were generated - the proof is "we solved this in CDF
with a CDF specific solution". :p

> If I had replied to this mail thread without sleeping on it first I
> might not have known better and have got half-paranoid, wondereding
> whether there had been a deliberate attempt to fast-track this API
> before the V4L2 developers noticed. To be perfectly clear, there is
> *NO* implicit or explicit such accusation here, as I know better.

What would have happened is that CDF would have been raised, and there
would be a big long discussion with no real resolution.  The problem
would not have been solved (even partially).  We'd be sitting here right
now still without any kind of solution that anyone can use.

Instead, what we have right now is the opportunity for people to start
making use of this and solving the real problems they have with driver
initialisation.

For example, the IPU on iMX locks up after a number of mode changes, and
it's useful to be able to unload the driver, poke about in the hardware,
and reload it.  Without this problem fixed, that's impossible without
rebooting the kernel, because removing the driver oopses the kernel due
to the broken work-arounds that it has to do - and it has to do those
because this problem has not been solved, despite it being known about
for /years/.

> Accordingly, I would like to comment on the component API, despite the fact 
> that it has been merged in mainline already. The first thing that I believe 
> is 
> missing is documentation. Do you have any pending patch for that, either as 
> kerneldoc or as a text file for Documentation/ ? As I've read the code to 
> understand it I might have missed so design goals, so please bear with the 
> stupid questions that may follow.

There's lots of things in the kernel which you just have to read the code
for - and this is one of them at the moment. :)  (Another is PM domains...)

What I know is that this will not satisfy all your requirements - I don't
want it to initially satisfy everyone's requirements, because that's just
far too big a job, but it satisfies the common problem that most people
are suffering from and have already implemented many badly written driver
specific solutions.

In other words - this is designed to _improve_ the current situation where
we have lots of buggy implementions trying to work around this problem,
factor that code out, and fix up those problems.

Briefly, the idea is:

- there is a master device - lots of these subsystems doing this already
  have that, whether that be ALSA or DRM based stuff.
- then there are the individual component devices and their drivers.

Subsystems like ALSA and DRM are not component based subsystems.  These
subsystems have two states - either they're initialised and the entire
"card system" is known about, or they're not initialised.  There is no
possibility of a piecemeal approach, where they partially come up and
additional stuff gets added later.  With DRM, that's especially true
because of how the userspace API works - to change that probably means
changing stuff all the way through things like the X server and its
xrandr application interface.  This is probably the reason why David said
at KS that DRM isn't going to do the hotplugging of components.

The master device has a privileged position - it gets to make the decision
about which component devices are relevant to it, and when the "card system"
is fully known.  As far as DT goes, we've had a long discussion about this
approach in the past, and we've accepted this approach - we have the
"sound" node which doesn't actually refer to any hardware block, it's a
node which describes how the hardware blocks are connected together, which
gets translated into a platform device.

When a master device gets added, it gets added to the list of master
devices, and then it's asked whether all the components that it needs
a

[PATCH V2] fix some coding style in drivers/staging/iio, and a break missing.

2014-03-21 Thread Jimmy Li
Signed-off-by: Jimmy Li
---
 drivers/staging/iio/accel/sca3000_core.c |3 ++-
 drivers/staging/iio/adc/ad7192.c |3 ++-
 drivers/staging/iio/adc/ad7606_core.c|2 +-
 drivers/staging/iio/adc/ad7816.c |6 +++---
 drivers/staging/iio/adc/mxs-lradc.c  |6 --
 drivers/staging/iio/addac/adt7316.c  |3 +--
 drivers/staging/iio/frequency/ad5930.c   |   23 +++
 drivers/staging/iio/frequency/ad9850.c   |2 +-
 drivers/staging/iio/light/isl29018.c |   10 ++
 drivers/staging/iio/light/tsl2583.c  |2 +-
 drivers/staging/iio/light/tsl2x7x_core.c |   12 ++--
 drivers/staging/iio/meter/ade7854-i2c.c  |3 ++-
 drivers/staging/iio/resolver/ad2s1200.c  |1 +
 13 files changed, 45 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/iio/accel/sca3000_core.c 
b/drivers/staging/iio/accel/sca3000_core.c
index ed30e32..c099294 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -506,7 +506,8 @@ static int sca3000_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&st->lock);
return ret;
}
-   *val = ((st->rx[0] & 0x3F) << 3) | ((st->rx[1] & 0xE0) 
>> 5);
+   *val = ((st->rx[0] & 0x3F) << 3) |
+   ((st->rx[1] & 0xE0) >> 5);
}
mutex_unlock(&st->lock);
return IIO_VAL_INT;
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 83bb44b..d1f9790 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -223,7 +223,8 @@ static int ad7192_setup(struct ad7192_state *st,
id &= AD7192_ID_MASK;
 
if (id != st->devid)
-   dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n", 
id);
+   dev_warn(&st->sd.spi->dev,
+   "device ID query failed (0x%X)\n", id);
 
switch (pdata->clock_source_sel) {
case AD7192_CLK_EXT_MCLK1_2:
diff --git a/drivers/staging/iio/adc/ad7606_core.c 
b/drivers/staging/iio/adc/ad7606_core.c
index f0f05f1..bf2c801 100644
--- a/drivers/staging/iio/adc/ad7606_core.c
+++ b/drivers/staging/iio/adc/ad7606_core.c
@@ -140,7 +140,7 @@ static ssize_t ad7606_store_range(struct device *dev,
return count;
 }
 
-static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR, \
+static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR,
   ad7606_show_range, ad7606_store_range, 0);
 static IIO_CONST_ATTR(in_voltage_range_available, "5000 1");
 
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 2369cf2..ec86c01 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -153,7 +153,8 @@ static ssize_t ad7816_show_available_modes(struct device 
*dev,
return sprintf(buf, "full\npower-save\n");
 }
 
-static IIO_DEVICE_ATTR(available_modes, S_IRUGO, ad7816_show_available_modes, 
NULL, 0);
+static IIO_DEVICE_ATTR(available_modes, S_IRUGO,
+   ad7816_show_available_modes, NULL, 0);
 
 static ssize_t ad7816_show_channel(struct device *dev,
struct device_attribute *attr,
@@ -442,6 +443,5 @@ static struct spi_driver ad7816_driver = {
 module_spi_driver(ad7816_driver);
 
 MODULE_AUTHOR("Sonic Zhang ");
-MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital"
-   " temperature sensor driver");
+MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital temperature sensor 
driver");
 MODULE_LICENSE("GPL v2");
diff --git a/drivers/staging/iio/adc/mxs-lradc.c 
b/drivers/staging/iio/adc/mxs-lradc.c
index 11fb952..84f7177 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -462,7 +462,8 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc 
*lradc, unsigned ch)
 * SoC's delay unit and start the conversion later
 * and automatically.
 */
-   mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC 
*/
+   mxs_lradc_reg_wrt(lradc,
+   LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */
LRADC_DELAY_TRIGGER_DELAYS(1 << 3) | /* trigger DELAY unit#3 */
LRADC_DELAY_KICK |
LRADC_DELAY_DELAY(lradc->settling_delay),
@@ -520,7 +521,8 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc 
*lradc, unsigned ch1,
 * SoC's delay unit and start the conversion later
 * and automatically.
 */
-   mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC 
*/
+   mxs_lradc_reg_wrt(lradc,
+   LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */
LRADC_DELAY_TRIGGER_DELAYS(1 << 3) | /* trigger DELAY unit#3 */
LRADC_DELAY_KICK |
LRADC_DELAY_DELAY(lradc->settling_delay), LRAD

[PATCH] drivers: staging: cxt1e1: hwprobe Fix different address spaces

2014-03-21 Thread Matei Oprea
Fix different address spaces when unmapping IO. hi->addr_mapped[0]
and hi->addr_mapped[1] should be tagged __iomem.

Signed-off-by: Matei Oprea 
Cc: ROSEdu Kernel Community 
---
 drivers/staging/cxt1e1/hwprobe.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 9b4198b..f55c27e 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -174,12 +174,12 @@ cleanup_ioremap(void)
if (hi->pci_slot == 0xff)
break;
if (hi->addr_mapped[0]) {
-   iounmap((void *)(hi->addr_mapped[0]));
+   iounmap((void __iomem *)(hi->addr_mapped[0]));
release_mem_region((long) hi->addr[0], hi->len[0]);
hi->addr_mapped[0] = 0;
}
if (hi->addr_mapped[1]) {
-   iounmap((void *)(hi->addr_mapped[1]));
+   iounmap((void __iomem *)(hi->addr_mapped[1]));
release_mem_region((long) hi->addr[1], hi->len[1]);
hi->addr_mapped[1] = 0;
}
-- 
1.7.9.5

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


Re: [PATCH] drivers: staging: cxt1e1: hwprobe Fix different address spaces

2014-03-21 Thread Denis Kirjanov
On 3/21/14, Matei Oprea  wrote:
> Fix different address spaces when unmapping IO. hi->addr_mapped[0]
> and hi->addr_mapped[1] should be tagged __iomem.
>
> Signed-off-by: Matei Oprea 
> Cc: ROSEdu Kernel Community 
> ---
>  drivers/staging/cxt1e1/hwprobe.c |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/cxt1e1/hwprobe.c
> b/drivers/staging/cxt1e1/hwprobe.c
> index 9b4198b..f55c27e 100644
> --- a/drivers/staging/cxt1e1/hwprobe.c
> +++ b/drivers/staging/cxt1e1/hwprobe.c
> @@ -174,12 +174,12 @@ cleanup_ioremap(void)
>   if (hi->pci_slot == 0xff)
>   break;
>   if (hi->addr_mapped[0]) {
> - iounmap((void *)(hi->addr_mapped[0]));
> + iounmap((void __iomem *)(hi->addr_mapped[0]));
>   release_mem_region((long) hi->addr[0], hi->len[0]);
>   hi->addr_mapped[0] = 0;
>   }
>   if (hi->addr_mapped[1]) {
> - iounmap((void *)(hi->addr_mapped[1]));
> + iounmap((void __iomem *)(hi->addr_mapped[1]));
>   release_mem_region((long) hi->addr[1], hi->len[1]);
>   hi->addr_mapped[1] = 0;
>   }

__iomem annotations should be added to the private structure pointers.
Look at the iounmap usage in the drivers.

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


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


Re: [PATCH] drivers: staging: cxt1e1: hwprobe Fix different address spaces

2014-03-21 Thread Josh Cartwright
On Fri, Mar 21, 2014 at 03:52:23PM +0200, Matei Oprea wrote:
> Fix different address spaces when unmapping IO. hi->addr_mapped[0]
> and hi->addr_mapped[1] should be tagged __iomem.
> 
> Signed-off-by: Matei Oprea 
> Cc: ROSEdu Kernel Community 
> ---
>  drivers/staging/cxt1e1/hwprobe.c |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/cxt1e1/hwprobe.c 
> b/drivers/staging/cxt1e1/hwprobe.c
> index 9b4198b..f55c27e 100644
> --- a/drivers/staging/cxt1e1/hwprobe.c
> +++ b/drivers/staging/cxt1e1/hwprobe.c
> @@ -174,12 +174,12 @@ cleanup_ioremap(void)
>   if (hi->pci_slot == 0xff)
>   break;
>   if (hi->addr_mapped[0]) {
> - iounmap((void *)(hi->addr_mapped[0]));
> + iounmap((void __iomem *)(hi->addr_mapped[0]));

While this may "fix" the sparse warning, it's far from ideal.  Like I
had suggested on IRC, a much better cleanup would be to make the
addr_mapped member an array of __iomem-tagged pointers, and fixup the
users.

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


[PATCH] staging: rtl8192u: r8192U_wx: Fix sparse warnings

2014-03-21 Thread Matei Oprea
Fix sparse "should be static" warnings. Those structures are
only referenced in file scope so they can be marked as static.

Signed-off-by: Matei Oprea 
Cc: ROSEdu Kernel Community 
---
 drivers/staging/rtl8192u/r8192U_wx.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_wx.c 
b/drivers/staging/rtl8192u/r8192U_wx.c
index c70af01..1a3e80d 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -24,7 +24,7 @@
 #include "dot11d.h"
 
 #define RATE_COUNT 12
-u32 rtl8180_rates[] = {100,200,550,1100,
+static u32 rtl8180_rates[] = {100,200,550,1100,
600,900,1200,1800,2400,3600,4800,5400};
 
 
@@ -979,7 +979,7 @@ static iw_handler r8192_private_handler[] = {
 };
 
 //#if WIRELESS_EXT >= 17
-struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
+static struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv->ieee80211;
@@ -1010,7 +1010,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct 
net_device *dev)
 //#endif
 
 
-struct iw_handler_def  r8192_wx_handlers_def={
+static struct iw_handler_def  r8192_wx_handlers_def={
.standard = r8192_wx_handlers,
.num_standard = ARRAY_SIZE(r8192_wx_handlers),
.private = r8192_private_handler,
-- 
1.7.9.5

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


[PATCH 00/05] staging: dgap: Digi International dgap driver

2014-03-21 Thread Mark Hounschell
patch 1 removes some unused code in dgap.c
patch 2 removes some unneeded comments in dgap.c
patch 3 fixes some whitespace warnings by checkpatch in dgap.h
patch 4 fixes several 80+ char lines in dgap.h.
 
Note that many of these 80+ char lines 
are lines using "volatile" which also
need fixed. Those volatiles will be fixed
in a later patch dedicated for that.

So this patch fails checkpatch because
of these already exsisting volatiles.  

patch 5 removes some unused code in dgap.h

-- 
1.8.1.4

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


[PATCH 01/05] staging: dgap: Remove some unused code in dgap.c

2014-03-21 Thread Mark Hounschell
This patch removes some unused code in dgap.c.

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/dgap/dgap.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index a5fc3c7..ea66c9f 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -78,10 +78,6 @@
 
 #include "dgap.h"
 
-#define init_MUTEX(sem) sema_init(sem, 1)
-#define DECLARE_MUTEX(name) \
-   struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
-
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Digi International, http://www.digi.com";);
 MODULE_DESCRIPTION("Driver for the Digi International EPCA PCI based product 
line");
@@ -245,9 +241,7 @@ static struct board_t *dgap_Board[MAXBOARDS];
 static ulong dgap_poll_counter;
 static char *dgap_config_buf;
 static int dgap_driver_state = DRIVER_INITIALIZED;
-DEFINE_SPINLOCK(dgap_dl_lock);
 static wait_queue_head_t dgap_dl_wait;
-static int dgap_dl_action;
 static int dgap_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -1197,7 +1191,6 @@ static void dgap_init_globals(void)
init_timer(&dgap_poll_timer);
 
init_waitqueue_head(&dgap_dl_wait);
-   dgap_dl_action = 0;
 }
 
 /
-- 
1.8.1.4

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


[PATCH 04/05] staging: dgap: Fix several 80+ line warnings in dgap.h

2014-03-21 Thread Mark Hounschell
This patch fixes several 80+ char line warnings as reported
by checkpatch in dgap.h

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/dgap/dgap.h | 244 +++-
 1 file changed, 129 insertions(+), 115 deletions(-)

diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h
index 1466901..2913f6e 100644
--- a/drivers/staging/dgap/dgap.h
+++ b/drivers/staging/dgap/dgap.h
@@ -207,9 +207,10 @@ typedef unsigned char  uchar;
 #define EVSTART 0x0800L /* Start of event buffer*/
 #define EVMAX   0x0c00L /* End of event buffer  */
 #define FEP5_PLUS   0x0E40  /* ASCII '5' and ASCII 'A' is here  */
-#define ECS_SEG 0x0E44  /* Segment of the extended channel 
structure */
-#define LINE_SPEED  0x10/* Offset into ECS_SEG for line speed  
 */
-   /* if the fep has extended  */
+#define ECS_SEG 0x0E44  /* Segment of the extended  */
+   /* channel structure*/
+#define LINE_SPEED  0x10/* Offset into ECS_SEG for line */
+   /* speed if the fep has extended */
/* capabilities */
 
 /* BIOS MAGIC SPOTS */
@@ -248,12 +249,12 @@ typedef unsigned char uchar;
 
 #define FEPTIMEOUT 20
 
-#define ENABLE_INTR0x0e04  /* Enable interrupts flag */
-#define FEPPOLL_MIN1   /* minimum of 1 millisecond */
-#define FEPPOLL_MAX20  /* maximum of 20 milliseconds */
-#define FEPPOLL0x0c26  /* Fep event poll 
interval */
+#define ENABLE_INTR0x0e04  /* Enable interrupts flag */
+#define FEPPOLL_MIN1   /* minimum of 1 millisecond */
+#define FEPPOLL_MAX20  /* maximum of 20 milliseconds */
+#define FEPPOLL0x0c26  /* Fep event poll interval */
 
-#defineIALTPIN 0x0080  /* Input flag to swap 
DSR <-> DCD */
+#defineIALTPIN 0x0080  /* Input flag to swap DSR <-> 
DCD */
 
 /
  * FEP supported functions
@@ -367,7 +368,7 @@ typedef unsigned char   uchar;
 #define A16P   43
 #define AVANFE 43  /* end of Avanstar family definitions */
 
-#define DA2000FS   44  /* start of AccelePort 2000 family definitions 
*/
+#define DA2000FS   44 /* start of AccelePort 2000 family definitions */
 #define DA22   44 /* AccelePort 2002 */
 #define DA24   45 /* AccelePort 2004 */
 #define DA28   46 /* AccelePort 2008 */
@@ -572,7 +573,8 @@ struct board_t {
ulong   irq;/* Interrupt request number */
ulong   intr_count; /* Count of interrupts */
u32 intr_used;  /* Non-zero if using interrupts */
-   u32 intr_running;   /* Non-zero if FEP knows its doing 
interrupts */
+   u32 intr_running;   /* Non-zero if FEP knows its doing */
+   /* interrupts */
 
ulong   port;   /* Start of base io port of the card */
ulong   port_end;   /* End of base io port of the card */
@@ -583,9 +585,10 @@ struct board_t {
uchar   *re_map_membase;/* Remapped memory of the card */
 
uchar   runwait;/* # Processes waiting for FEP  */
-   uchar   inhibit_poller; /* Tells  the poller to leave us alone 
*/
+   uchar   inhibit_poller; /* Tells the poller to leave us alone */
 
-   struct channel_t *channels[MAXPORTS]; /* array of pointers to our 
channels. */
+   struct channel_t *channels[MAXPORTS]; /* array of pointers to our */
+ /* channels.*/
 
struct tty_driver   *SerialDriver;
struct tty_port *SerialPorts;
@@ -600,16 +603,21 @@ struct board_t {
u32 dgap_Serial_Major;
u32 dgap_TransparentPrint_Major;
 
-   struct bs_t *bd_bs; /* Base structure pointer   
*/
+   struct bs_t *bd_bs; /* Base structure pointer */
 
-   char*flipbuf;   /* Our flip buffer, alloced if board is 
found */
-   char*flipflagbuf;   /* Our flip flag buffer, alloced if 
board is found */
+   char*flipbuf;   /* Our flip buffer, alloced if*/
+   /* board is found */
+   char*flipflagbuf;   /* Our flip flag buffer, alloced  */
+   /* if board is found  */
 
-   u16 dpatype; 

[PATCH 02/05] staging: dgap: Remove some unneeded comments

2014-03-21 Thread Mark Hounschell
This patch removes some unneeded comments from dgap.c

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/dgap/dgap.c | 29 -
 1 file changed, 29 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index ea66c9f..ea920e4 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -12,21 +12,6 @@
  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  * PURPOSE.  See the GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- * NOTE TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
- *
- * This is shared code between Digi's CVS archive and the
- * Linux Kernel sources.
- * Changing the source just for reformatting needlessly breaks
- * our CVS diff history.
- *
- * Send any bug fixes/changes to:  Eng.Linux at digi dot com.
- * Thank you.
- *
  */
 
 /*
@@ -83,12 +68,6 @@ MODULE_AUTHOR("Digi International, http://www.digi.com";);
 MODULE_DESCRIPTION("Driver for the Digi International EPCA PCI based product 
line");
 MODULE_SUPPORTED_DEVICE("dgap");
 
-/**
- *
- * protos for this file
- *
- */
-
 static int dgap_start(void);
 static void dgap_init_globals(void);
 static int dgap_found_board(struct pci_dev *pdev, int id);
@@ -101,7 +80,6 @@ static int dgap_probe1(struct pci_dev *pdev, int card_type);
 static int dgap_do_remap(struct board_t *brd);
 static irqreturn_t dgap_intr(int irq, void *voidbrd);
 
-/* Our function prototypes */
 static int dgap_tty_open(struct tty_struct *tty, struct file *file);
 static void dgap_tty_close(struct tty_struct *tty, struct file *file);
 static int dgap_block_til_ready(struct tty_struct *tty, struct file *file,
@@ -221,7 +199,6 @@ static int dgap_do_wait_for_fep(struct board_t *brd);
 static int dgap_tty_register_ports(struct board_t *brd);
 static int dgap_firmware_load(struct pci_dev *pdev, int card_type);
 
-/* Driver unload function */
 static void dgap_cleanup_module(void);
 
 module_exit(dgap_cleanup_module);
@@ -233,9 +210,6 @@ static const struct file_operations DgapBoardFops = {
.owner  = THIS_MODULE,
 };
 
-/*
- * Globals
- */
 static uint dgap_NumBoards;
 static struct board_t *dgap_Board[MAXBOARDS];
 static ulong dgap_poll_counter;
@@ -244,9 +218,6 @@ static int dgap_driver_state = DRIVER_INITIALIZED;
 static wait_queue_head_t dgap_dl_wait;
 static int dgap_poll_tick = 20;/* Poll interval - 20 ms */
 
-/*
- * Static vars.
- */
 static struct class *dgap_class;
 
 static struct board_t *dgap_BoardsByMajor[256];
-- 
1.8.1.4

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


[PATCH 05/05] staging:dgap: remove some unused code in dgap.h

2014-03-21 Thread Mark Hounschell
This patch removes some unused code in dgap.h

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/dgap/dgap.h | 53 -
 1 file changed, 53 deletions(-)

diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h
index 2913f6e..979ad40 100644
--- a/drivers/staging/dgap/dgap.h
+++ b/drivers/staging/dgap/dgap.h
@@ -839,59 +839,6 @@ struct rw_t {
unsigned char   rw_data[128];   /* Data to read/write   */
 };
 
-/***
- * Shrink Buffer and Board Information definitions and structures.
-
- /
-   /* Board type return codes */
-#definePCXI_TYPE 1 /* Board type at the designated port is a PC/Xi 
*/
-#define PCXM_TYPE 2 /* Board type at the designated port is a PC/Xm */
-#definePCXE_TYPE 3 /* Board type at the designated port is a PC/Xe 
*/
-#defineMCXI_TYPE 4 /* Board type at the designated port is a MC/Xi 
*/
-#define COMXI_TYPE 5 /* Board type at the designated port is a COM/Xi */
-
-/* Non-Zero Result codes. */
-#define RESULT_NOBDFND 1 /* A Digi product at that port is not config 
installed */
-#define RESULT_NODESCT 2 /* A memory descriptor was not obtainable */
-#define RESULT_NOOSSIG 3 /* FEP/OS signature was not detected on the board */
-#define RESULT_TOOSML  4 /* Too small an area to shrink.  */
-#define RESULT_NOCHAN  5 /* Channel structure for the board was not found */
-
-struct shrink_buf_struct {
-   unsigned long   shrink_buf_vaddr;   /* Virtual address of board */
-   unsigned long   shrink_buf_phys;/* Physical address of board */
-   unsigned long   shrink_buf_bseg;/* Amount of board memory */
-   unsigned long   shrink_buf_hseg;/* 186 Beginning of Dual-Port */
-
-   unsigned long   shrink_buf_lseg;/* 186 Beginning of freed mem */
-   unsigned long   shrink_buf_mseg;/* Linear address from start of
-  dual-port were freed memory
-  begins, host viewpoint. */
-
-   unsigned long   shrink_buf_bdparam; /* Parameter for xxmemon and
-  xxmemoff */
-
-   unsigned long   shrink_buf_reserva; /* Reserved */
-   unsigned long   shrink_buf_reservb; /* Reserved */
-   unsigned long   shrink_buf_reservc; /* Reserved */
-   unsigned long   shrink_buf_reservd; /* Reserved */
-
-   unsigned char   shrink_buf_result;  /* Reason for call failing
-  Zero is Good return */
-   unsigned char   shrink_buf_init;/* Non-Zero if it caused an
-  xxinit call. */
-
-   unsigned char   shrink_buf_anports; /* Number of async ports  */
-   unsigned char   shrink_buf_snports; /* Number of sync  ports */
-   unsigned char   shrink_buf_type;/* Board type 1 = PC/Xi,
- 2 = PC/Xm,
- 3 = PC/Xe
- 4 = MC/Xi
- 5 = COMX/i */
-   unsigned char   shrink_buf_card;/* Card number */
-
-};
-
 /
  * Structure to get driver status information
  /
-- 
1.8.1.4

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


[PATCH 03/05] staging: dgap: fix some whitespace warnings in dgap.h

2014-03-21 Thread Mark Hounschell
This patch fixes some whitespace warnings as reported
by checkpatch in dgap.h.

Signed-off-by: Mark Hounschell 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/dgap/dgap.h | 47 +++--
 1 file changed, 24 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/dgap/dgap.h b/drivers/staging/dgap/dgap.h
index 6b8f5f8..1466901 100644
--- a/drivers/staging/dgap/dgap.h
+++ b/drivers/staging/dgap/dgap.h
@@ -61,7 +61,7 @@ typedef unsigned char uchar;
 
 /*
  * defines from dgap_pci.h
- */ 
+ */
 #define PCIMAX 32  /* maximum number of PCI boards */
 
 #define DIGI_VID   0x114F
@@ -209,7 +209,8 @@ typedef unsigned char   uchar;
 #define FEP5_PLUS   0x0E40  /* ASCII '5' and ASCII 'A' is here  */
 #define ECS_SEG 0x0E44  /* Segment of the extended channel 
structure */
 #define LINE_SPEED  0x10/* Offset into ECS_SEG for line speed  
 */
-/* if the fep has extended 
capabilities */
+   /* if the fep has extended  */
+   /* capabilities */
 
 /* BIOS MAGIC SPOTS */
 #define ERROR   0x0C14L/* BIOS error code  
*/
@@ -362,13 +363,13 @@ typedef unsigned char uchar;
 #define MC8E8K  36
 
 #define AVANFS 42  /* start of Avanstar family definitions */
-#define A8P42
+#define A8P42
 #define A16P   43
 #define AVANFE 43  /* end of Avanstar family definitions */
 
 #define DA2000FS   44  /* start of AccelePort 2000 family definitions 
*/
-#define DA22   44 /* AccelePort 2002 */
-#define DA24   45 /* AccelePort 2004 */
+#define DA22   44 /* AccelePort 2002 */
+#define DA24   45 /* AccelePort 2004 */
 #define DA28   46 /* AccelePort 2008 */
 #define DA216  47 /* AccelePort 2016 */
 #define DAR4   48 /* AccelePort RAS 4 port */
@@ -578,7 +579,7 @@ struct board_t {
ulong   membase;/* Start of base memory of the card */
ulong   membase_end;/* End of base memory of the card */
 
-   uchar   *re_map_port;   /* Remapped io port of the card */
+   uchar   *re_map_port;   /* Remapped io port of the card */
uchar   *re_map_membase;/* Remapped memory of the card */
 
uchar   runwait;/* # Processes waiting for FEP  */
@@ -737,26 +738,26 @@ struct un_t {
/* Adapter Memory   */
 
 #defineDIGI_GETFLOW(('e'<<8) | 99) /* Get startc/stopc 
flow */
-   /* control characters*/
-#defineDIGI_SETFLOW(('e'<<8) | 100)/* Set 
startc/stopc flow */
+   /* control characters*/
+#defineDIGI_SETFLOW(('e'<<8) | 100)/* Set startc/stopc 
flow */
/* control characters*/
-#defineDIGI_GETAFLOW   (('e'<<8) | 101)/* Get Aux. 
startc/stopc */
-   /* flow control chars*/
-#defineDIGI_SETAFLOW   (('e'<<8) | 102)/* Set Aux. 
startc/stopc */
+#defineDIGI_GETAFLOW   (('e'<<8) | 101)/* Get Aux. 
startc/stopc */
+   /* flow control chars*/
+#defineDIGI_SETAFLOW   (('e'<<8) | 102)/* Set Aux. 
startc/stopc */
/* flow control chars*/
 
-#define DIGI_GEDELAY   (('d'<<8) | 246)/* Get edelay */
-#define DIGI_SEDELAY   (('d'<<8) | 247)/* Set edelay */
+#define DIGI_GEDELAY   (('d'<<8) | 246)/* Get edelay */
+#define DIGI_SEDELAY   (('d'<<8) | 247)/* Set edelay */
 
 struct digiflow_t {
-   unsigned char   startc; /* flow cntl start char 
*/
-   unsigned char   stopc;  /* flow cntl stop char  
*/
+   unsigned char   startc; /* flow cntl start char */
+   unsigned char   stopc;  /* flow cntl stop char  */
 };
 
 
 #ifdef FLOW_2200
-#defineF2200_GETA  (('e'<<8) | 104)/* Get 2x36 
flow cntl flags */
-#defineF2200_SETAW (('e'<<8) | 105)/* Set 2x36 
flow cntl flags */
+#defineF2200_GETA  (('e'<<8) | 104)/* Get 2x36 flow cntl 
flags */
+#defineF2200_SETAW (('e'<<8) | 105)/* Set 2x36 flow cntl 
flags */
 #defineF2200_MASK  0x03/* 2200 flow cntl bit 
mask  */
 #defineFCNTL_2200  0x01/* 2x36 terminal flow 
cntl  */
 #definePCNTL_2200  0x02/* 2x36 printer flow 
cntl   */
@@ -873,7 

[PATCH] staging: lustre: Fix typo in lustre/include

2014-03-21 Thread Masanari Iida
Fix spelling typo in comments within lustre/include.

Signed-off-by: Masanari Iida 
---
 drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h| 4 ++--
 drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h | 2 +-
 drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h   | 8 
 drivers/staging/lustre/include/linux/lnet/lib-lnet.h| 2 +-
 drivers/staging/lustre/include/linux/lnet/lib-types.h   | 6 +++---
 drivers/staging/lustre/include/linux/lnet/lnetst.h  | 2 +-
 drivers/staging/lustre/include/linux/lnet/types.h   | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
index c87efb4..d116fdf 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h
@@ -128,7 +128,7 @@ struct cfs_cpt_table *cfs_cpt_table_alloc(unsigned int 
ncpt);
 int
 cfs_cpt_number(struct cfs_cpt_table *cptab);
 /**
- * return number of HW cores or hypter-threadings in a CPU partition \a cpt
+ * return number of HW cores or hyper-threadings in a CPU partition \a cpt
  */
 int cfs_cpt_weight(struct cfs_cpt_table *cptab, int cpt);
 /**
@@ -152,7 +152,7 @@ int cfs_cpt_of_cpu(struct cfs_cpt_table *cptab, int cpu);
  */
 int cfs_cpt_bind(struct cfs_cpt_table *cptab, int cpt);
 /**
- * add \a cpu to CPU partion @cpt of \a cptab, return 1 for success,
+ * add \a cpu to CPU partition @cpt of \a cptab, return 1 for success,
  * otherwise 0 is returned
  */
 int cfs_cpt_set_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu);
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
index 776e9c0..9e610a9 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_crypto.h
@@ -31,7 +31,7 @@
 struct cfs_crypto_hash_type {
char*cht_name;  /**< hash algorithm name, equal to
 * format name for crypto api */
-   unsigned intcht_key;/**< init key by default (vaild for
+   unsigned intcht_key;/**< init key by default (valid for
 * 4 bytes context like crc32, adler */
unsigned intcht_size;   /**< hash digest size */
 };
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index e5d5db2..9541643 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -59,8 +59,8 @@
 /*
  * Ideally we would use HAVE_HASH_LONG for this, but on linux we configure
  * the linux kernel and user space at the same time, so we need to 
differentiate
- * between them explicitely. If this is not needed on other architectures, then
- * we'll need to move the functions to archi specific headers.
+ * between them explicitly. If this is not needed on other architectures, then
+ * we'll need to move the functions to architecture specific headers.
  */
 
 #include 
@@ -86,7 +86,7 @@ union cfs_hash_lock {
 
 /**
  * cfs_hash_bucket is a container of:
- * - lock, couter ...
+ * - lock, counter ...
  * - array of hash-head starting from hsb_head[0], hash-head can be one of
  *   . cfs_hash_head_t
  *   . cfs_hash_head_dep_t
@@ -136,7 +136,7 @@ enum cfs_hash_tag {
CFS_HASH_NO_BKTLOCK = 1 << 1,
/** rwlock to protect bucket */
CFS_HASH_RW_BKTLOCK = 1 << 2,
-   /** spinlcok to protect bucket */
+   /** spinlock to protect bucket */
CFS_HASH_SPIN_BKTLOCK   = 1 << 3,
/** always add new item to tail */
CFS_HASH_ADD_TAIL   = 1 << 4,
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h 
b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
index 856fcfa..06ff463 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h
@@ -181,7 +181,7 @@ lnet_net_lock_current(void)
 #define MAX_PORTALS 64
 
 /* these are only used by code with LNET_USE_LIB_FREELIST, but we still
- * exported them to !LNET_USE_LIB_FREELIST for easy implemetation */
+ * exported them to !LNET_USE_LIB_FREELIST for easy implementation */
 #define LNET_FL_MAX_MES2048
 #define LNET_FL_MAX_MDS2048
 #define LNET_FL_MAX_EQS512
diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h 
b/drivers/staging/lustre/include/linux/lnet/lib-types.h
index 1c13ef7..a63654b 100644
--- a/drivers/staging/lustre/include/linux/lnet/lib-types.h
+++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h
@@ -204,7 +204,7 @@ typedef struct lnet_msg {
unsigned int  msg_receiving:1;/* being received */
unsigned int  msg_txcr

Re: [PATCH net-next,v4] hyperv: Add support for virtual Receive Side Scaling (vRSS)

2014-03-21 Thread David Miller
From: Haiyang Zhang 
Date: Thu, 20 Mar 2014 15:28:41 -0700

> This feature allows multiple channels to be used by each virtual NIC.
> It is available on Hyper-V host 2012 R2.
> 
> Signed-off-by: Haiyang Zhang 
> Reviewed-by: K. Y. Srinivasan 

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


Re: [PATCH net-next,v4] hyperv: Add support for virtual Receive Side Scaling (vRSS)

2014-03-21 Thread David Miller
From: David Miller 
Date: Fri, 21 Mar 2014 14:49:57 -0400 (EDT)

> From: Haiyang Zhang 
> Date: Thu, 20 Mar 2014 15:28:41 -0700
> 
>> This feature allows multiple channels to be used by each virtual NIC.
>> It is available on Hyper-V host 2012 R2.
>> 
>> Signed-off-by: Haiyang Zhang 
>> Reviewed-by: K. Y. Srinivasan 
> 
> Applied, thanks.

Actually I had to revert, this doesn't even compile.

drivers/net/hyperv/netvsc.c: In function ‘netvsc_channel_cb’:
drivers/net/hyperv/netvsc.c:891:2: error: implicit declaration of function 
‘get_per_channel_state’ [-Werror=implicit-function-declaration]
drivers/net/hyperv/netvsc.c:891:9: warning: assignment makes pointer from 
integer without a cast [enabled by default]
drivers/net/hyperv/netvsc.c: In function ‘netvsc_device_add’:
drivers/net/hyperv/netvsc.c:998:2: error: implicit declaration of function 
‘set_per_channel_state’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/net/hyperv/netvsc.o] Error 1
make[3]: *** Waiting for unfinished jobs
drivers/net/hyperv/rndis_filter.c: In function ‘netvsc_sc_open’:
drivers/net/hyperv/rndis_filter.c:988:2: error: implicit declaration of 
function ‘set_per_channel_state’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[3]: *** [drivers/net/hyperv/rndis_filter.o] Error 1
make[2]: *** [drivers/net/hyperv] Error 2
make[2]: *** Waiting for unfinished jobs
make[1]: *** [drivers/net] Error 2
make[1]: *** Waiting for unfinished jobs
make: *** [drivers] Error 2
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH net-next,v4] hyperv: Add support for virtual Receive Side Scaling (vRSS)

2014-03-21 Thread Haiyang Zhang


> -Original Message-
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Friday, March 21, 2014 2:55 PM
> To: Haiyang Zhang
> Cc: net...@vger.kernel.org; KY Srinivasan; o...@aepfle.de;
> jasow...@redhat.com; linux-ker...@vger.kernel.org; driverdev-
> de...@linuxdriverproject.org
> Subject: Re: [PATCH net-next,v4] hyperv: Add support for virtual Receive
> Side Scaling (vRSS)
> 
> From: David Miller 
> Date: Fri, 21 Mar 2014 14:49:57 -0400 (EDT)
> 
> > From: Haiyang Zhang 
> > Date: Thu, 20 Mar 2014 15:28:41 -0700
> >
> >> This feature allows multiple channels to be used by each virtual NIC.
> >> It is available on Hyper-V host 2012 R2.
> >>
> >> Signed-off-by: Haiyang Zhang 
> >> Reviewed-by: K. Y. Srinivasan 
> >
> > Applied, thanks.
> 
> Actually I had to revert, this doesn't even compile.
> 
> drivers/net/hyperv/netvsc.c: In function ‘netvsc_channel_cb’:
> drivers/net/hyperv/netvsc.c:891:2: error: implicit declaration of
> function ‘get_per_channel_state’ [-Werror=implicit-function-declaration]
> drivers/net/hyperv/netvsc.c:891:9: warning: assignment makes pointer
> from integer without a cast [enabled by default]
> drivers/net/hyperv/netvsc.c: In function ‘netvsc_device_add’:
> drivers/net/hyperv/netvsc.c:998:2: error: implicit declaration of
> function ‘set_per_channel_state’ [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> make[3]: *** [drivers/net/hyperv/netvsc.o] Error 1
> make[3]: *** Waiting for unfinished jobs
> drivers/net/hyperv/rndis_filter.c: In function ‘netvsc_sc_open’:
> drivers/net/hyperv/rndis_filter.c:988:2: error: implicit declaration of
> function ‘set_per_channel_state’ [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> make[3]: *** [drivers/net/hyperv/rndis_filter.o] Error 1
> make[2]: *** [drivers/net/hyperv] Error 2
> make[2]: *** Waiting for unfinished jobs
> make[1]: *** [drivers/net] Error 2
> make[1]: *** Waiting for unfinished jobs
> make: *** [drivers] Error 2

The per channel state variable and functions are defined by this patch,
which has been applied on 2/07:
Drivers: hv: vmbus: Support per-channel driver state
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=8a7206a89f85c8439561b0eff85bb9440a2e97a9

Could it be merged into net-next tree?

Thanks,
- Haiyang

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


Re: [PATCH net-next,v4] hyperv: Add support for virtual Receive Side Scaling (vRSS)

2014-03-21 Thread David Miller
From: Haiyang Zhang 
Date: Fri, 21 Mar 2014 19:12:43 +

> Could it be merged into net-next tree?

You submitted a patch against net-next, that means you are implicitly
stating that all dependencies are in place in _that_ tree and that
you tested it in _that_ tree.

If the situation is otherwise you must explicitly state this in your
patch submission.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH net-next, v4] hyperv: Add support for virtual Receive Side Scaling (vRSS)

2014-03-21 Thread Haiyang Zhang
This feature allows multiple channels to be used by each virtual NIC.
It is available on Hyper-V host 2012 R2.

(It depends on this commit:
Drivers: hv: vmbus: Support per-channel driver state
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=8a7206a89f85c8439561b0eff85bb9440a2e97a9
)

Signed-off-by: Haiyang Zhang 
Reviewed-by: K. Y. Srinivasan 
---
 drivers/net/hyperv/hyperv_net.h   |  110 +-
 drivers/net/hyperv/netvsc.c   |  136 +-
 drivers/net/hyperv/netvsc_drv.c   |  103 +++-
 drivers/net/hyperv/rndis_filter.c |  189 -
 4 files changed, 504 insertions(+), 34 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 13010b4..dcafa82 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -28,6 +28,96 @@
 #include 
 #include 
 
+/* RSS related */
+#define OID_GEN_RECEIVE_SCALE_CAPABILITIES 0x00010203  /* query only */
+#define OID_GEN_RECEIVE_SCALE_PARAMETERS 0x00010204  /* query and set */
+
+#define NDIS_OBJECT_TYPE_RSS_CAPABILITIES 0x88
+#define NDIS_OBJECT_TYPE_RSS_PARAMETERS 0x89
+
+#define NDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2 2
+#define NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2 2
+
+struct ndis_obj_header {
+   u8 type;
+   u8 rev;
+   u16 size;
+} __packed;
+
+/* ndis_recv_scale_cap/cap_flag */
+#define NDIS_RSS_CAPS_MESSAGE_SIGNALED_INTERRUPTS 0x0100
+#define NDIS_RSS_CAPS_CLASSIFICATION_AT_ISR   0x0200
+#define NDIS_RSS_CAPS_CLASSIFICATION_AT_DPC   0x0400
+#define NDIS_RSS_CAPS_USING_MSI_X 0x0800
+#define NDIS_RSS_CAPS_RSS_AVAILABLE_ON_PORTS  0x1000
+#define NDIS_RSS_CAPS_SUPPORTS_MSI_X  0x2000
+#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV4  0x0100
+#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6  0x0200
+#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6_EX   0x0400
+
+struct ndis_recv_scale_cap { /* NDIS_RECEIVE_SCALE_CAPABILITIES */
+   struct ndis_obj_header hdr;
+   u32 cap_flag;
+   u32 num_int_msg;
+   u32 num_recv_que;
+   u16 num_indirect_tabent;
+} __packed;
+
+
+/* ndis_recv_scale_param flags */
+#define NDIS_RSS_PARAM_FLAG_BASE_CPU_UNCHANGED 0x0001
+#define NDIS_RSS_PARAM_FLAG_HASH_INFO_UNCHANGED0x0002
+#define NDIS_RSS_PARAM_FLAG_ITABLE_UNCHANGED   0x0004
+#define NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED 0x0008
+#define NDIS_RSS_PARAM_FLAG_DISABLE_RSS0x0010
+
+/* Hash info bits */
+#define NDIS_HASH_FUNC_TOEPLITZ 0x0001
+#define NDIS_HASH_IPV4  0x0100
+#define NDIS_HASH_TCP_IPV4  0x0200
+#define NDIS_HASH_IPV6  0x0400
+#define NDIS_HASH_IPV6_EX   0x0800
+#define NDIS_HASH_TCP_IPV6  0x1000
+#define NDIS_HASH_TCP_IPV6_EX   0x2000
+
+#define NDIS_RSS_INDIRECTION_TABLE_MAX_SIZE_REVISION_2 (128 * 4)
+#define NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2   40
+
+#define ITAB_NUM 128
+#define HASH_KEYLEN NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
+extern u8 netvsc_hash_key[];
+
+struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
+   struct ndis_obj_header hdr;
+
+   /* Qualifies the rest of the information */
+   u16 flag;
+
+   /* The base CPU number to do receive processing. not used */
+   u16 base_cpu_number;
+
+   /* This describes the hash function and type being enabled */
+   u32 hashinfo;
+
+   /* The size of indirection table array */
+   u16 indirect_tabsize;
+
+   /* The offset of the indirection table from the beginning of this
+* structure
+*/
+   u32 indirect_taboffset;
+
+   /* The size of the hash secret key */
+   u16 hashkey_size;
+
+   /* The offset of the secret key from the beginning of this structure */
+   u32 kashkey_offset;
+
+   u32 processor_masks_offset;
+   u32 num_processor_masks;
+   u32 processor_masks_entry_size;
+};
+
 /* Fwd declaration */
 struct hv_netvsc_packet;
 struct ndis_tcp_ip_checksum_info;
@@ -39,6 +129,8 @@ struct xferpage_packet {
 
/* # of netvsc packets this xfer packet contains */
u32 count;
+
+   struct vmbus_channel *channel;
 };
 
 /*
@@ -54,6 +146,9 @@ struct hv_netvsc_packet {
bool is_data_pkt;
u16 vlan_tci;
 
+   u16 q_idx;
+   struct vmbus_channel *channel;
+
/*
 * Valid only for receives when we break a xfer page packet
 * into multiple netvsc packets
@@ -120,6 +215,7 @@ void netvsc_linkstatus_callback(struct hv_device 
*device_obj,
 int netvsc_recv_callback(struct hv_device *device_obj,
struct hv_netvsc_packet *packet,
struct ndis_tcp_ip_checksum_info *csum_info);
+void netvsc_channel_cb(void *context);
 int rndis_filter_open(struct hv_device *dev);
 int rndis_filter_close(struct hv_device *dev);
 int rndis_filter_device_add(struct 

RE: [PATCH net-next,v4] hyperv: Add support for virtual Receive Side Scaling (vRSS)

2014-03-21 Thread Haiyang Zhang


> -Original Message-
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Friday, March 21, 2014 3:33 PM
> To: Haiyang Zhang
> Cc: net...@vger.kernel.org; KY Srinivasan; o...@aepfle.de;
> jasow...@redhat.com; linux-ker...@vger.kernel.org; driverdev-
> de...@linuxdriverproject.org
> Subject: Re: [PATCH net-next,v4] hyperv: Add support for virtual Receive
> Side Scaling (vRSS)
> 
> From: Haiyang Zhang 
> Date: Fri, 21 Mar 2014 19:12:43 +
> 
> > Could it be merged into net-next tree?
> 
> You submitted a patch against net-next, that means you are implicitly
> stating that all dependencies are in place in _that_ tree and that
> you tested it in _that_ tree.
> 
> If the situation is otherwise you must explicitly state this in your
> patch submission.

I will re-submit the vRSS patch with the dependency specified.
Thanks,
- Haiyang
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V2] fix some coding style in drivers/staging/iio, and a break missing.

2014-03-21 Thread Jonathan Cameron
Please separate the missing break fix into its own patch.  That will want to go 
in as a fix. The tree it will go through is therefore different from the rest 
of this patch which
 can take a slower path into the kernel tree.

Jonathan

On March 21, 2014 12:45:51 PM GMT+00:00, Jimmy Li  wrote:
>Signed-off-by: Jimmy Li
>---
> drivers/staging/iio/accel/sca3000_core.c |3 ++-
> drivers/staging/iio/adc/ad7192.c |3 ++-
> drivers/staging/iio/adc/ad7606_core.c|2 +-
> drivers/staging/iio/adc/ad7816.c |6 +++---
> drivers/staging/iio/adc/mxs-lradc.c  |6 --
> drivers/staging/iio/addac/adt7316.c  |3 +--
>drivers/staging/iio/frequency/ad5930.c   |   23 +++
> drivers/staging/iio/frequency/ad9850.c   |2 +-
> drivers/staging/iio/light/isl29018.c |   10 ++
> drivers/staging/iio/light/tsl2583.c  |2 +-
> drivers/staging/iio/light/tsl2x7x_core.c |   12 ++--
> drivers/staging/iio/meter/ade7854-i2c.c  |3 ++-
> drivers/staging/iio/resolver/ad2s1200.c  |1 +
> 13 files changed, 45 insertions(+), 31 deletions(-)
>
>diff --git a/drivers/staging/iio/accel/sca3000_core.c
>b/drivers/staging/iio/accel/sca3000_core.c
>index ed30e32..c099294 100644
>--- a/drivers/staging/iio/accel/sca3000_core.c
>+++ b/drivers/staging/iio/accel/sca3000_core.c
>@@ -506,7 +506,8 @@ static int sca3000_read_raw(struct iio_dev
>*indio_dev,
>   mutex_unlock(&st->lock);
>   return ret;
>   }
>-  *val = ((st->rx[0] & 0x3F) << 3) | ((st->rx[1] & 0xE0) 
>>> 5);
>+  *val = ((st->rx[0] & 0x3F) << 3) |
>+  ((st->rx[1] & 0xE0) >> 5);
>   }
>   mutex_unlock(&st->lock);
>   return IIO_VAL_INT;
>diff --git a/drivers/staging/iio/adc/ad7192.c
>b/drivers/staging/iio/adc/ad7192.c
>index 83bb44b..d1f9790 100644
>--- a/drivers/staging/iio/adc/ad7192.c
>+++ b/drivers/staging/iio/adc/ad7192.c
>@@ -223,7 +223,8 @@ static int ad7192_setup(struct ad7192_state *st,
>   id &= AD7192_ID_MASK;
> 
>   if (id != st->devid)
>-  dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n", 
>id);
>+  dev_warn(&st->sd.spi->dev,
>+  "device ID query failed (0x%X)\n", id);
> 
>   switch (pdata->clock_source_sel) {
>   case AD7192_CLK_EXT_MCLK1_2:
>diff --git a/drivers/staging/iio/adc/ad7606_core.c
>b/drivers/staging/iio/adc/ad7606_core.c
>index f0f05f1..bf2c801 100644
>--- a/drivers/staging/iio/adc/ad7606_core.c
>+++ b/drivers/staging/iio/adc/ad7606_core.c
>@@ -140,7 +140,7 @@ static ssize_t ad7606_store_range(struct device
>*dev,
>   return count;
> }
> 
>-static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR, \
>+static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR,
>  ad7606_show_range, ad7606_store_range, 0);
> static IIO_CONST_ATTR(in_voltage_range_available, "5000 1");
> 
>diff --git a/drivers/staging/iio/adc/ad7816.c
>b/drivers/staging/iio/adc/ad7816.c
>index 2369cf2..ec86c01 100644
>--- a/drivers/staging/iio/adc/ad7816.c
>+++ b/drivers/staging/iio/adc/ad7816.c
>@@ -153,7 +153,8 @@ static ssize_t ad7816_show_available_modes(struct
>device *dev,
>   return sprintf(buf, "full\npower-save\n");
> }
> 
>-static IIO_DEVICE_ATTR(available_modes, S_IRUGO,
>ad7816_show_available_modes, NULL, 0);
>+static IIO_DEVICE_ATTR(available_modes, S_IRUGO,
>+  ad7816_show_available_modes, NULL, 0);
> 
> static ssize_t ad7816_show_channel(struct device *dev,
>   struct device_attribute *attr,
>@@ -442,6 +443,5 @@ static struct spi_driver ad7816_driver = {
> module_spi_driver(ad7816_driver);
> 
> MODULE_AUTHOR("Sonic Zhang ");
>-MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital"
>-  " temperature sensor driver");
>+MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital temperature
>sensor driver");
> MODULE_LICENSE("GPL v2");
>diff --git a/drivers/staging/iio/adc/mxs-lradc.c
>b/drivers/staging/iio/adc/mxs-lradc.c
>index 11fb952..84f7177 100644
>--- a/drivers/staging/iio/adc/mxs-lradc.c
>+++ b/drivers/staging/iio/adc/mxs-lradc.c
>@@ -462,7 +462,8 @@ static void mxs_lradc_setup_ts_channel(struct
>mxs_lradc *lradc, unsigned ch)
>* SoC's delay unit and start the conversion later
>* and automatically.
>*/
>-  mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(0) | /* don't trigger
>ADC */
>+  mxs_lradc_reg_wrt(lradc,
>+  LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */
>   LRADC_DELAY_TRIGGER_DELAYS(1 << 3) | /* trigger DELAY unit#3 */
>   LRADC_DELAY_KICK |
>   LRADC_DELAY_DELAY(lradc->settling_delay),
>@@ -520,7 +521,8 @@ static void mxs_lradc_setup_ts_pressure(struct
>mxs_lradc *lradc, unsigned ch1,
>* SoC's delay unit and start the conversion later
>* and automatically.
> 

[PATCH] fix a missing break in devivers/staging/iio

2014-03-21 Thread Jimmy Li
fix a missing break.

Signed-off-by: Jimmy Li 
---
 drivers/staging/iio/resolver/ad2s1200.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/iio/resolver/ad2s1200.c 
b/drivers/staging/iio/resolver/ad2s1200.c
index 36eedd8..e2b4820 100644
--- a/drivers/staging/iio/resolver/ad2s1200.c
+++ b/drivers/staging/iio/resolver/ad2s1200.c
@@ -70,6 +70,7 @@ static int ad2s1200_read_raw(struct iio_dev *indio_dev,
vel = (((s16)(st->rx[0])) << 4) | ((st->rx[1] & 0xF0) >> 4);
vel = (vel << 4) >> 4;
*val = vel;
+   break;
default:
mutex_unlock(&st->lock);
return -EINVAL;
-- 
1.7.9.5

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


Re: [PATCH V2] fix some coding style in drivers/staging/iio, and a break missing.

2014-03-21 Thread Jimmy Li
the coding style patch is attached.
and the break missing one is https://lkml.org/lkml/2014/3/22/4.
sorry for the misspelling subject.

Signed-off-by: Jimmy Li
---
 drivers/staging/iio/accel/sca3000_core.c |3 ++-
 drivers/staging/iio/adc/ad7192.c |3 ++-
 drivers/staging/iio/adc/ad7606_core.c|2 +-
 drivers/staging/iio/adc/ad7816.c |6 +++---
 drivers/staging/iio/adc/mxs-lradc.c  |6 --
 drivers/staging/iio/addac/adt7316.c  |3 +--
 drivers/staging/iio/frequency/ad5930.c   |   23 +++
 drivers/staging/iio/frequency/ad9850.c   |2 +-
 drivers/staging/iio/light/isl29018.c |   10 ++
 drivers/staging/iio/light/tsl2583.c  |2 +-
 drivers/staging/iio/light/tsl2x7x_core.c |   12 ++--
 drivers/staging/iio/meter/ade7854-i2c.c  |3 ++-
 12 files changed, 44 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/iio/accel/sca3000_core.c 
b/drivers/staging/iio/accel/sca3000_core.c
index ed30e32..c099294 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -506,7 +506,8 @@ static int sca3000_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&st->lock);
return ret;
}
-   *val = ((st->rx[0] & 0x3F) << 3) | ((st->rx[1] & 0xE0) 
>> 5);
+   *val = ((st->rx[0] & 0x3F) << 3) |
+   ((st->rx[1] & 0xE0) >> 5);
}
mutex_unlock(&st->lock);
return IIO_VAL_INT;
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 83bb44b..d1f9790 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -223,7 +223,8 @@ static int ad7192_setup(struct ad7192_state *st,
id &= AD7192_ID_MASK;
 
if (id != st->devid)
-   dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n", 
id);
+   dev_warn(&st->sd.spi->dev,
+   "device ID query failed (0x%X)\n", id);
 
switch (pdata->clock_source_sel) {
case AD7192_CLK_EXT_MCLK1_2:
diff --git a/drivers/staging/iio/adc/ad7606_core.c 
b/drivers/staging/iio/adc/ad7606_core.c
index f0f05f1..bf2c801 100644
--- a/drivers/staging/iio/adc/ad7606_core.c
+++ b/drivers/staging/iio/adc/ad7606_core.c
@@ -140,7 +140,7 @@ static ssize_t ad7606_store_range(struct device *dev,
return count;
 }
 
-static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR, \
+static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR,
   ad7606_show_range, ad7606_store_range, 0);
 static IIO_CONST_ATTR(in_voltage_range_available, "5000 1");
 
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 2369cf2..ec86c01 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -153,7 +153,8 @@ static ssize_t ad7816_show_available_modes(struct device 
*dev,
return sprintf(buf, "full\npower-save\n");
 }
 
-static IIO_DEVICE_ATTR(available_modes, S_IRUGO, ad7816_show_available_modes, 
NULL, 0);
+static IIO_DEVICE_ATTR(available_modes, S_IRUGO,
+   ad7816_show_available_modes, NULL, 0);
 
 static ssize_t ad7816_show_channel(struct device *dev,
struct device_attribute *attr,
@@ -442,6 +443,5 @@ static struct spi_driver ad7816_driver = {
 module_spi_driver(ad7816_driver);
 
 MODULE_AUTHOR("Sonic Zhang ");
-MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital"
-   " temperature sensor driver");
+MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital temperature sensor 
driver");
 MODULE_LICENSE("GPL v2");
diff --git a/drivers/staging/iio/adc/mxs-lradc.c 
b/drivers/staging/iio/adc/mxs-lradc.c
index 11fb952..84f7177 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -462,7 +462,8 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc 
*lradc, unsigned ch)
 * SoC's delay unit and start the conversion later
 * and automatically.
 */
-   mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC 
*/
+   mxs_lradc_reg_wrt(lradc,
+   LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */
LRADC_DELAY_TRIGGER_DELAYS(1 << 3) | /* trigger DELAY unit#3 */
LRADC_DELAY_KICK |
LRADC_DELAY_DELAY(lradc->settling_delay),
@@ -520,7 +521,8 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc 
*lradc, unsigned ch1,
 * SoC's delay unit and start the conversion later
 * and automatically.
 */
-   mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC 
*/
+   mxs_lradc_reg_wrt(lradc,
+   LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */
LRADC_DELAY_TRIGGER_DELAYS(1 << 3) | /* trigger DELAY unit#3 */