Getting the ccree driver out of staging

2018-01-09 Thread Gilad Ben-Yossef
Hi folks,

With the enormous help of people in the to and CCed lists I've gotten
the ccree driver to a point I believe it is ready to graduate out of
the staging tree:

- The code base has been reduced by something by 30% and is *much*
more  readable and manageable.
- The very few checkpatch warnings are all false positives (one due to
dt bindings going through the crypto tree, the others due to harmless
macro argument reuse)
and the few sparse output are equally benign.
- The driver follows the crypto API expected behavior as much as I can tell.
- Fixed all the bugs I could fine as a result of tcrypt tests.
- It works :-)

There are obviously more things todo, but I believe they are out of
scope for staging.

So, if you see something that still needs work, kindly let me know.
Alternatively, will you accept a patch moving it to drivers/crypto/?

Many thanks,
Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2018-01-09 Thread Long Li
> Christoph,
> 
> > Ok.  If the stable maintainers are ok with your small fix I'm not
> > going to complain too loudly.  But I'm always worried about stable
> > trees divering too much from mainline.
> 
> The seemingly innocuous transition from SG_GAPS to virt boundary has
> caused several data corruption regressions in the distro kernels. So has the
> corresponding conversion of storvsc.
> 
> As a result, getting the current upstream code into 4.1 would mean
> backporting and testing a significant amount of both block layer and driver
> code. I don't think it's worth the risk. This patch is simple and the path of 
> least
> resistance.
> 
> Acked-by: Martin K. Petersen 

Sorry to bring up this patch again. It seems it hasn't made it to stable 
branches.

Please take a look.

> 
> --
> Martin K. PetersenOracle Linux Engineering
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: pi433: remove unnecessary parentheses

2018-01-09 Thread Joe Perches
On Tue, 2018-01-09 at 20:28 +0100, Greg Kroah-Hartman wrote:
> On Tue, Jan 09, 2018 at 11:21:37AM -0800, Joe Perches wrote:
> > On Tue, 2018-01-09 at 15:31 +0100, Greg Kroah-Hartman wrote:
> > > On Mon, Jan 08, 2018 at 06:38:55PM +0100, Valentin Vidic wrote:
> > > > Fixes checkpatch warnings:
> > > >   CHECK: Unnecessary parentheses around 'mantisse != mantisse16'
> > > >   CHECK: Unnecessary parentheses around 'mantisse != mantisse20'
> > > >   CHECK: Unnecessary parentheses around 'mantisse != mantisse24'
> > 
> > []
> > > > diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> > 
> > []
> > > > @@ -391,9 +391,9 @@ static int rf69_set_bandwidth_intern(struct 
> > > > spi_device *spi, u8 reg,
> > > > return -EINVAL;
> > > > }
> > > >  
> > > > -   if ((mantisse != mantisse16) &&
> > > > -   (mantisse != mantisse20) &&
> > > > -   (mantisse != mantisse24)) {
> > > > +   if (mantisse != mantisse16 &&
> > > > +   mantisse != mantisse20 &&
> > > > +   mantisse != mantisse24) {
> > > 
> > > I'm getting really tired of seeing this checkpatch warning, when it's a
> > > major pain.
> > 
> > Your idea of major pain and mine differ a bit.
> 
> I don't like taking patches that cause future problems.

What future problems might this particular case present
that isn't generic in all patches.

> > > Joe, can you please turn these off.  Patches like this will force people
> > > to have to remember that != is higher precidence than &&.
> > 
> > As it's not just 1 precedence level but 4 and 5, it
> > really shouldn't be that hard to remember.
> 
> I can't remember any of them, and I should not have to.

That depends on how well you know your C.

>   That's the
> point, you should not assume anyone knows the levels, code is written
> for developers to understand first, and the compiler second.

And someone that knows C knows those levels and the parentheses
can just be visual noise requiring extra thought.

Sometimes it's useful, sometimes it's not.

if (a == b && c == d)

is pretty trivial.

and I believe

if ((a == b))

emits clang warnings

>   By
> removing these, it doesn't do anything for the compiler, but makes the
> developer think longer about them.

Generally I have to think more with more parentheses.

> > > The original code here was just fine.
> > 
> > And I don't really disagree with you.
> > 
> > David Miller has a preference for the parenthesis free
> > style. I believe he mentioned it sometime in August 2017
> > but I can't find it right now.
> > 
> > Anyway, perhaps
> > ---
> >  scripts/checkpatch.pl | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index d2464058ab5d..3a7499de2c2d 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -4526,7 +4526,9 @@ sub process {
> > }
> >  
> >  # check for unnecessary parentheses around comparisons in if uses
> > -   if ($^V && $^V ge 5.10.0 && defined($stat) &&
> > +# when !drivers/staging or the command-line uses --strict
> > +   if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) &&
> > +   $^V && $^V ge 5.10.0 && defined($stat) &&
> 
> How about only if in the networking area?  I don't want to take patches
> for this for other parts of the kernel either, it's really useless.

AFAIK: Almost no one thinks when sending staging patches.

For other parts of the tree, it requires --strict on the
command line.  AFAIK: almost no one uses that and if they
do, then they can determine for themselves if they want
to remove excessive parentheses.


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


[PATCH v3 5/6] uio_hv_generic: add rescind support

2018-01-09 Thread Stephen Hemminger
When host rescinds the device, the UIO driver will clear the interrupt
state and notify application. The read (or write) on the interrupt FD
will then fail with -EIO. This is simpler than adding lots extra uevent
stuff inside UIO.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst |  4 
 drivers/uio/uio_hv_generic.c   | 19 +++
 2 files changed, 23 insertions(+)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index 97e6435b3934..693e3bd84e79 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -698,6 +698,10 @@ prevents the device from generating further interrupts 
until the bit is
 cleared. The userspace driver should clear this bit before blocking and
 waiting for more interrupts.
 
+When host rescinds a device, the interrupt file descriptor is marked down
+and any reads of the interrupt file descriptor will return -EIO. Similar
+to a closed socket or disconnected serial device.
+
 The vmbus device regions are mapped into uio device resources:
 0) Channel ring buffers: guest to host and host to guest
 1) Guest to host interrupt signalling pages
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index ee6d862ef4bd..8c6b04a26c47 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -103,6 +103,23 @@ static void hv_uio_channel_cb(void *context)
uio_event_notify(&pdata->info);
 }
 
+/*
+ * Callback from vmbus_event when channel is rescinded.
+ */
+static void hv_uio_rescind(struct vmbus_channel *channel)
+{
+   struct hv_device *hv_dev = channel->primary_channel->device_obj;
+   struct hv_uio_private_data *pdata = hv_get_drvdata(hv_dev);
+
+   /*
+* Turn off the interrupt file handle
+* Next read for event will return -EIO
+*/
+   pdata->info.irq = 0;
+
+   /* Wake up reader */
+   uio_event_notify(&pdata->info);
+}
 
 static void
 hv_uio_cleanup(struct hv_device *dev, struct hv_uio_private_data *pdata)
@@ -218,6 +235,8 @@ hv_uio_probe(struct hv_device *dev,
goto fail_close;
}
 
+   vmbus_set_chn_rescind_callback(dev->channel, hv_uio_rescind);
+
hv_set_drvdata(dev, pdata);
 
return 0;
-- 
2.15.1

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


[PATCH v3 2/6] uio: document uio_hv_generic regions

2018-01-09 Thread Stephen Hemminger
Describe the regions present with uio_hv_generic in documentation for
driver API.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index 3a0d3f5f5c53..968f4c21c733 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -698,6 +698,11 @@ prevents the device from generating further interrupts 
until the bit is
 cleared. The userspace driver should clear this bit before blocking and
 waiting for more interrupts.
 
+The vmbus device regions are mapped into uio device resources:
+0) Channel ring buffers: guest to host and host to guest
+1) Guest to host interrupt signalling pages
+2) Guest to host monitor page
+
 Further information
 ===
 
-- 
2.15.1

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


[PATCH v3 4/6] uio_hv_generic: check that host supports monitor page

2018-01-09 Thread Stephen Hemminger
In order for userspace application to signal host, it needs the
host to support the monitor page property. Check for the flag
and fail if this is not supported.

Signed-off-by: Stephen Hemminger 
---
 drivers/uio/uio_hv_generic.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index dcd80aad9636..ee6d862ef4bd 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -133,6 +133,13 @@ hv_uio_probe(struct hv_device *dev,
if (ret)
goto fail;
 
+   /* Communicating with host has to be via shared memory not hypercall */
+   if (!dev->channel->offermsg.monitor_allocated) {
+   dev_err(&dev->device, "vmbus channel requires hypercall\n");
+   ret = -ENOTSUPP;
+   goto fail_close;
+   }
+
dev->channel->inbound.ring_buffer->interrupt_mask = 1;
set_channel_read_mode(dev->channel, HV_CALL_ISR);
 
-- 
2.15.1

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


[PATCH v3 6/6] uio_hv_generic: support sub-channels

2018-01-09 Thread Stephen Hemminger
Use sysfs to allow supporting sub-channels. The userspace application
makes request to host to create sub-channels and the UIO kernel
driver populates the sysfs per-channel directory with a binary
attribute file that can be used to read/write ring.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst |  5 ++
 drivers/uio/uio_hv_generic.c   | 95 --
 2 files changed, 97 insertions(+), 3 deletions(-)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index 693e3bd84e79..7d36a50c0484 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -709,6 +709,11 @@ The vmbus device regions are mapped into uio device 
resources:
 3) Network receive buffer region
 4) Network send buffer region
 
+If a subchannel is created by a request to host, then the uio_hv_generic
+device driver will create a sysfs binary file for the per-channel ring buffer.
+For example:
+   
/sys/bus/vmbus/devices/3811fe4d-0fa0-4b62-981a-74fc1084c757/channels/21/ring_buffer
+
 Further information
 ===
 
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 8c6b04a26c47..2c98b9d75e0e 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -39,7 +39,8 @@
 #define DRIVER_AUTHOR  "Stephen Hemminger "
 #define DRIVER_DESC"Generic UIO driver for VMBus devices"
 
-#define HV_RING_SIZE512/* pages */
+#define HV_RING_SIZE512
+#define HV_RING_BYTES   (HV_RING_SIZE * PAGE_SIZE)
 #define SEND_BUFFER_SIZE (15 * 1024 * 1024)
 #define RECV_BUFFER_SIZE (15 * 1024 * 1024)
 
@@ -121,6 +122,93 @@ static void hv_uio_rescind(struct vmbus_channel *channel)
uio_event_notify(&pdata->info);
 }
 
+/*
+ * Handle fault when looking for sub channel ring buffer
+ * Subchannel ring buffer is same as resource 0 which is main ring buffer
+ * This is derived from uio_vma_fault
+ */
+static int hv_uio_vma_fault(struct vm_fault *vmf)
+{
+   struct vm_area_struct *vma = vmf->vma;
+   void *ring_buffer = vma->vm_private_data;
+   struct page *page;
+   void *addr;
+
+   addr = ring_buffer + (vmf->pgoff << PAGE_SHIFT);
+   page = virt_to_page(addr);
+   get_page(page);
+   vmf->page = page;
+   return 0;
+}
+
+static const struct vm_operations_struct hv_uio_vm_ops = {
+   .fault = hv_uio_vma_fault,
+};
+
+/* Sysfs API to allow mmap of the ring buffers */
+static int hv_uio_ring_mmap(struct file *filp, struct kobject *kobj,
+   struct bin_attribute *attr,
+   struct vm_area_struct *vma)
+{
+   struct vmbus_channel *channel
+   = container_of(kobj, struct vmbus_channel, kobj);
+   unsigned long requested_pages;
+
+   if (vma->vm_end < vma->vm_start)
+   return -EINVAL;
+
+   /* only allow 0 for now */
+   if (vma->vm_pgoff > 0)
+   return -EINVAL;
+
+   requested_pages = vma_pages(vma);
+   if (requested_pages > 2 * HV_RING_SIZE)
+   return -EINVAL;
+
+   vma->vm_private_data = channel->ringbuffer_pages;
+   vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+   vma->vm_ops = &hv_uio_vm_ops;
+   return 0;
+}
+
+static struct bin_attribute ring_buffer_bin_attr __ro_after_init = {
+   .attr = {
+   .name = "ring",
+   .mode = 0600,
+   },
+   .mmap = hv_uio_ring_mmap,
+   .size = 2 * HV_RING_BYTES,
+};
+
+/* Callback from VMBUS subystem when new channel created. */
+static void
+hv_uio_new_channel(struct vmbus_channel *new_sc)
+{
+   struct hv_device *hv_dev = new_sc->primary_channel->device_obj;
+   struct device *device = &hv_dev->device;
+   struct hv_uio_private_data *pdata = hv_get_drvdata(hv_dev);
+   int ret;
+
+   /* Create host communication ring */
+   ret = vmbus_open(new_sc, HV_RING_BYTES,
+HV_RING_BYTES, NULL, 0,
+hv_uio_channel_cb, pdata);
+   if (ret) {
+   dev_err(device, "vmbus_open subchannel failed: %d\n", ret);
+   return;
+   }
+
+   /* Disable interrupts on sub channel */
+   new_sc->inbound.ring_buffer->interrupt_mask = 1;
+   set_channel_read_mode(new_sc, HV_CALL_ISR);
+
+   ret = sysfs_create_bin_file(&new_sc->kobj, &ring_buffer_bin_attr);
+   if (ret) {
+   dev_err(device, "sysfs create ring bin file failed; %d\n", ret);
+   vmbus_close(new_sc);
+   }
+}
+
 static void
 hv_uio_cleanup(struct hv_device *dev, struct hv_uio_private_data *pdata)
 {
@@ -144,8 +232,8 @@ hv_uio_probe(struct hv_device *dev,
if (!pdata)
return -ENOMEM;
 
-   ret = vmbus_open(dev->channel, HV_RING_SIZE * PAGE_SIZE,
-HV_RING_SIZE * PAGE_SIZE, NULL, 0,
+   ret = vmbus_open(dev->channel, HV_RING_BYTES,
+H

[PATCH v3 3/6] uio_hv_generic: create send and receive buffers

2018-01-09 Thread Stephen Hemminger
Map in receive and send buffers for networking in UIO device.
These buffers are special and need to be setup by kernel
API's; userspace can not do it.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst |  2 +
 drivers/uio/uio_hv_generic.c   | 71 +-
 2 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index 968f4c21c733..97e6435b3934 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -702,6 +702,8 @@ The vmbus device regions are mapped into uio device 
resources:
 0) Channel ring buffers: guest to host and host to guest
 1) Guest to host interrupt signalling pages
 2) Guest to host monitor page
+3) Network receive buffer region
+4) Network send buffer region
 
 Further information
 ===
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index a0c4c07a907f..dcd80aad9636 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -39,6 +39,10 @@
 #define DRIVER_AUTHOR  "Stephen Hemminger "
 #define DRIVER_DESC"Generic UIO driver for VMBus devices"
 
+#define HV_RING_SIZE512/* pages */
+#define SEND_BUFFER_SIZE (15 * 1024 * 1024)
+#define RECV_BUFFER_SIZE (15 * 1024 * 1024)
+
 /*
  * List of resources to be mapped to user space
  * can be extended up to MAX_UIO_MAPS(5) items
@@ -47,13 +51,21 @@ enum hv_uio_map {
TXRX_RING_MAP = 0,
INT_PAGE_MAP,
MON_PAGE_MAP,
+   RECV_BUF_MAP,
+   SEND_BUF_MAP
 };
 
-#define HV_RING_SIZE   512
-
 struct hv_uio_private_data {
struct uio_info info;
struct hv_device *device;
+
+   void*recv_buf;
+   u32 recv_gpadl;
+   charrecv_name[32];  /* "recv_4294967295" */
+
+   void*send_buf;
+   u32 send_gpadl;
+   charsend_name[32];
 };
 
 /*
@@ -91,6 +103,19 @@ static void hv_uio_channel_cb(void *context)
uio_event_notify(&pdata->info);
 }
 
+
+static void
+hv_uio_cleanup(struct hv_device *dev, struct hv_uio_private_data *pdata)
+{
+   if (pdata->send_gpadl)
+   vmbus_teardown_gpadl(dev->channel, pdata->send_gpadl);
+   vfree(pdata->send_buf);
+
+   if (pdata->recv_gpadl)
+   vmbus_teardown_gpadl(dev->channel, pdata->recv_gpadl);
+   vfree(pdata->recv_buf);
+}
+
 static int
 hv_uio_probe(struct hv_device *dev,
 const struct hv_vmbus_device_id *dev_id)
@@ -137,6 +162,46 @@ hv_uio_probe(struct hv_device *dev,
pdata->info.mem[MON_PAGE_MAP].size = PAGE_SIZE;
pdata->info.mem[MON_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
 
+   pdata->recv_buf = vzalloc(RECV_BUFFER_SIZE);
+   if (pdata->recv_buf == NULL) {
+   ret = -ENOMEM;
+   goto fail_close;
+   }
+
+   ret = vmbus_establish_gpadl(dev->channel, pdata->recv_buf,
+   RECV_BUFFER_SIZE, &pdata->recv_gpadl);
+   if (ret)
+   goto fail_close;
+
+   /* put Global Physical Address Label in name */
+   snprintf(pdata->recv_name, sizeof(pdata->recv_name),
+"recv:%u", pdata->recv_gpadl);
+   pdata->info.mem[RECV_BUF_MAP].name = pdata->recv_name;
+   pdata->info.mem[RECV_BUF_MAP].addr
+   = (phys_addr_t)pdata->recv_buf;
+   pdata->info.mem[RECV_BUF_MAP].size = RECV_BUFFER_SIZE;
+   pdata->info.mem[RECV_BUF_MAP].memtype = UIO_MEM_VIRTUAL;
+
+
+   pdata->send_buf = vzalloc(SEND_BUFFER_SIZE);
+   if (pdata->send_buf == NULL) {
+   ret = -ENOMEM;
+   goto fail_close;
+   }
+
+   ret = vmbus_establish_gpadl(dev->channel, pdata->send_buf,
+   SEND_BUFFER_SIZE, &pdata->send_gpadl);
+   if (ret)
+   goto fail_close;
+
+   snprintf(pdata->send_name, sizeof(pdata->send_name),
+"send:%u", pdata->send_gpadl);
+   pdata->info.mem[SEND_BUF_MAP].name = pdata->send_name;
+   pdata->info.mem[SEND_BUF_MAP].addr
+   = (phys_addr_t)pdata->send_buf;
+   pdata->info.mem[SEND_BUF_MAP].size = SEND_BUFFER_SIZE;
+   pdata->info.mem[SEND_BUF_MAP].memtype = UIO_MEM_VIRTUAL;
+
pdata->info.priv = pdata;
pdata->device = dev;
 
@@ -151,6 +216,7 @@ hv_uio_probe(struct hv_device *dev,
return 0;
 
 fail_close:
+   hv_uio_cleanup(dev, pdata);
vmbus_close(dev->channel);
 fail:
kfree(pdata);
@@ -167,6 +233,7 @@ hv_uio_remove(struct hv_device *dev)
return 0;
 
uio_unregister_device(&pdata->info);
+   hv_uio_cleanup(dev, pdata);
hv_set_drvdata(dev, NULL);
vmbus_close(dev->channel);
kfree(pdata);
-- 
2.15.1

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

[PATCH v3 0/6] uio_hv_generice improvements

2018-01-09 Thread Stephen Hemminger
These patches extend uio_hv_generic driver to make it usable
for DPDK networking. The original version did not enough
functionality to support userspace network drivers. Needed support
of send/receive buffers and sub channels.

Patches against current char-misc-next

v3
  - rebase on current char-misc-next (already got vmbus patches)
  - don't use module parameters (not necessary now)

Stephen Hemminger (6):
  doc: fix documentation about uio_hv_generic
  uio: document uio_hv_generic regions
  uio_hv_generic: create send and receive buffers
  uio_hv_generic: check that host supports monitor page
  uio_hv_generic: add rescind support
  uio_hv_generic: support sub-channels

 Documentation/driver-api/uio-howto.rst |  31 --
 drivers/uio/uio_hv_generic.c   | 190 -
 2 files changed, 210 insertions(+), 11 deletions(-)

-- 
2.15.1

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


[PATCH v3 1/6] doc: fix documentation about uio_hv_generic

2018-01-09 Thread Stephen Hemminger
The vmbus sysfs file names changed in
 commit f6b2db084b65 ("vmbus: make sysfs names consistent with PCI")
and the uio documenatation does not match the current names.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index f73d660b2956..3a0d3f5f5c53 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -667,27 +667,28 @@ Making the driver recognize the device
 Since the driver does not declare any device GUID's, it will not get
 loaded automatically and will not automatically bind to any devices, you
 must load it and allocate id to the driver yourself. For example, to use
-the network device GUID::
+the network device class GUID::
 
  modprobe uio_hv_generic
  echo "f8615163-df3e-46c5-913f-f2d2f965ed0e" > 
/sys/bus/vmbus/drivers/uio_hv_generic/new_id
 
 If there already is a hardware specific kernel driver for the device,
 the generic driver still won't bind to it, in this case if you want to
-use the generic driver (why would you?) you'll have to manually unbind
-the hardware specific driver and bind the generic driver, like this::
+use the generic driver for a userspace library you'll have to manually unbind
+the hardware specific driver and bind the generic driver, using the device 
specific GUID
+like this::
 
-  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 > 
/sys/bus/vmbus/drivers/hv_netvsc/unbind
-  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 > 
/sys/bus/vmbus/drivers/uio_hv_generic/bind
+  echo -n ed963694-e847-4b2a-85af-bc9cfc11d6f3 > 
/sys/bus/vmbus/drivers/hv_netvsc/unbind
+  echo -n ed963694-e847-4b2a-85af-bc9cfc11d6f3 > 
/sys/bus/vmbus/drivers/uio_hv_generic/bind
 
 You can verify that the device has been bound to the driver by looking
 for it in sysfs, for example like the following::
 
-ls -l 
/sys/bus/vmbus/devices/vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver
+ls -l 
/sys/bus/vmbus/devices/ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver
 
 Which if successful should print::
 
-  .../vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver -> 
../../../bus/vmbus/drivers/uio_hv_generic
+  .../ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver -> 
../../../bus/vmbus/drivers/uio_hv_generic
 
 Things to know about uio_hv_generic
 ---
-- 
2.15.1

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


Re: [PATCH] staging: pi433: Cleanup codestyle, indent statements after case labels

2018-01-09 Thread Dan Carpenter
On Tue, Jan 09, 2018 at 09:04:50PM +0100, Valentin Vidic wrote:
> On Sun, Dec 24, 2017 at 02:42:57PM +0100, Marcus Wolf wrote:
> > >  int rf69_set_dagc(struct spi_device *spi, enum dagc dagc)
> > >  {
> > >   switch (dagc) {
> > > - case normalMode: return rf69_write_reg(spi, 
> > > REG_TESTDAGC, DAGC_NORMAL);
> > > - case improve:return rf69_write_reg(spi, 
> > > REG_TESTDAGC, DAGC_IMPROVED_LOWBETA0);
> > > - case improve4LowModulationIndex: return rf69_write_reg(spi, 
> > > REG_TESTDAGC, DAGC_IMPROVED_LOWBETA1);
> > > + case normalMode:
> > > + return rf69_write_reg(spi, REG_TESTDAGC, DAGC_NORMAL);
> > > + case improve:
> > > + return rf69_write_reg(spi, REG_TESTDAGC, 
> > > DAGC_IMPROVED_LOWBETA0);
> > > + case improve4LowModulationIndex:
> > > + return rf69_write_reg(spi, REG_TESTDAGC, 
> > > DAGC_IMPROVED_LOWBETA1);
> > >   default:
> > >   dev_dbg(&spi->dev, "set: illegal input param");
> > >   return -EINVAL;
> > > 
> > 
> > Hi Michael,
> > 
> > first of all thank you for your effort :-)
> > 
> > For me, the readability is reduced with this patch.
> > 
> > But that's just my opinion/favour...
> 
> Would something like this be any better for these simple switch
> statements?
> 

It's often better to avoid switch statements.

int rf69_set_dagc(struct spi_device *spi, enum dagc dagc)
{
static const int dagc_reg[] = {
[normalMode] = DAGC_NORMAL,
[improve] = DAGC_IMPROVED_LOWBETA0,
[improve4LowModulationIndex] = DAGC_IMPROVED_LOWBETA1,
};

if (dagc >= ARRAY_SIZE(dagc_reg))
return -EINVAL;

return rf69_write_reg(spi, REG_TESTDAGC, dagc_reg[dagc]);
}

regards,
dan carpenter

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


Re: [PATCH] staging: pi433: Cleanup codestyle, indent statements after case labels

2018-01-09 Thread Marcus Wolf


Am 09.01.2018 um 21:04 schrieb Valentin Vidic:
> On Sun, Dec 24, 2017 at 02:42:57PM +0100, Marcus Wolf wrote:
>>>  int rf69_set_dagc(struct spi_device *spi, enum dagc dagc)
>>>  {
>>> switch (dagc) {
>>> -   case normalMode: return rf69_write_reg(spi, 
>>> REG_TESTDAGC, DAGC_NORMAL);
>>> -   case improve:return rf69_write_reg(spi, 
>>> REG_TESTDAGC, DAGC_IMPROVED_LOWBETA0);
>>> -   case improve4LowModulationIndex: return rf69_write_reg(spi, 
>>> REG_TESTDAGC, DAGC_IMPROVED_LOWBETA1);
>>> +   case normalMode:
>>> +   return rf69_write_reg(spi, REG_TESTDAGC, DAGC_NORMAL);
>>> +   case improve:
>>> +   return rf69_write_reg(spi, REG_TESTDAGC, 
>>> DAGC_IMPROVED_LOWBETA0);
>>> +   case improve4LowModulationIndex:
>>> +   return rf69_write_reg(spi, REG_TESTDAGC, 
>>> DAGC_IMPROVED_LOWBETA1);
>>> default:
>>> dev_dbg(&spi->dev, "set: illegal input param");
>>> return -EINVAL;
>>>
>>
>> Hi Michael,
>>
>> first of all thank you for your effort :-)
>>
>> For me, the readability is reduced with this patch.
>>
>> But that's just my opinion/favour...
> 
> Would something like this be any better for these simple switch
> statements?
> 
> int rf69_set_dagc(struct spi_device *spi, enum dagc dagc)
> {
>int dagc_value;
> 
>switch (dagc) {
>case normalMode:   dagc_value = DAGC_NORMAL;
>case improve:  dagc_value = DAGC_IMPROVED_LOWBETA0;
>...
>default:
> dev_dbg(&spi->dev, "set: illegal input param");
> return -EINVAL;
>}
> 
>return rf69_write_reg(spi, REG_TESTDAGC, dagc_value);
> }
> 

Hi Valentin,

I'd like such code very much. Marcin Ciupak already made such a proposal
but most probably the mainline changed to fast so he couldn't place his
patch...

If you would like to refactor the rf69.c in that way, I would be very happy.
Hope others will like this, too.

Thanks,

Marcus

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


Re: [PATCH] staging: pi433: Cleanup codestyle, indent statements after case labels

2018-01-09 Thread Valentin Vidic
On Sun, Dec 24, 2017 at 02:42:57PM +0100, Marcus Wolf wrote:
> >  int rf69_set_dagc(struct spi_device *spi, enum dagc dagc)
> >  {
> > switch (dagc) {
> > -   case normalMode: return rf69_write_reg(spi, 
> > REG_TESTDAGC, DAGC_NORMAL);
> > -   case improve:return rf69_write_reg(spi, 
> > REG_TESTDAGC, DAGC_IMPROVED_LOWBETA0);
> > -   case improve4LowModulationIndex: return rf69_write_reg(spi, 
> > REG_TESTDAGC, DAGC_IMPROVED_LOWBETA1);
> > +   case normalMode:
> > +   return rf69_write_reg(spi, REG_TESTDAGC, DAGC_NORMAL);
> > +   case improve:
> > +   return rf69_write_reg(spi, REG_TESTDAGC, 
> > DAGC_IMPROVED_LOWBETA0);
> > +   case improve4LowModulationIndex:
> > +   return rf69_write_reg(spi, REG_TESTDAGC, 
> > DAGC_IMPROVED_LOWBETA1);
> > default:
> > dev_dbg(&spi->dev, "set: illegal input param");
> > return -EINVAL;
> > 
> 
> Hi Michael,
> 
> first of all thank you for your effort :-)
> 
> For me, the readability is reduced with this patch.
> 
> But that's just my opinion/favour...

Would something like this be any better for these simple switch
statements?

int rf69_set_dagc(struct spi_device *spi, enum dagc dagc)
{
   int dagc_value;

   switch (dagc) {
   case normalMode:   dagc_value = DAGC_NORMAL;
   case improve:  dagc_value = DAGC_IMPROVED_LOWBETA0;
   ...
   default:
dev_dbg(&spi->dev, "set: illegal input param");
return -EINVAL;
   }

   return rf69_write_reg(spi, REG_TESTDAGC, dagc_value);
}

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


Re: [PATCH 2/2] drivers: android: Fix logtags in methods

2018-01-09 Thread Greg Kroah-Hartman
On Tue, Jan 09, 2018 at 07:45:33PM +, Harsh Shandilya wrote:
> On Tue 9 Jan, 2018, 10:32 PM Greg Kroah-Hartman, 
> wrote:
> 
> > On Fri, Dec 22, 2017 at 07:37:03PM +0530, Harsh Shandilya wrote:
> > > From: Harsh Shandilya 
> > >
> > > Several methods in the driver were hardcoding
> > > the function name in their logging calls which
> > > is a checkpatch violation. Utilise the __func__
> > > macro to avoid needing to add the function name
> > > as is to the string.
> > >
> > > Test: logtags in dmesg remain unaffected before
> > > and after the patch.
> > >
> > > Signed-off-by: Harsh Shandilya 
> > >
> > > Cc: Greg Kroah-Hartman 
> > > Cc: "Arve Hjønnevåg" 
> > > Cc: Todd Kjos 
> > > Cc: Martijn Coenen 
> > > Cc: de...@driverdev.osuosl.org
> > > Cc: linux-ker...@vger.kernel.org
> > > ---
> > >  drivers/android/binder.c | 13 +++--
> > >  1 file changed, 7 insertions(+), 6 deletions(-)
> >
> > Patch does not apply to my tree :(
> >
> 
> If you drop
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/commit/?h=char-misc-next&id=00c41cddebde8d1a635bf81a7b255b7e56fd0d15
> then the patch should go in cleanly. My patch includes the changes from
> Elad's already.

That patch came first in my inbox, I'm not going to revert it from the
tree now, sorry.

Just rebase and resend if your patch did "more".

thanks,

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


Re: [PATCH] staging: pi433: remove unnecessary parentheses

2018-01-09 Thread Joe Perches
On Tue, 2018-01-09 at 15:31 +0100, Greg Kroah-Hartman wrote:
> On Mon, Jan 08, 2018 at 06:38:55PM +0100, Valentin Vidic wrote:
> > Fixes checkpatch warnings:
> >   CHECK: Unnecessary parentheses around 'mantisse != mantisse16'
> >   CHECK: Unnecessary parentheses around 'mantisse != mantisse20'
> >   CHECK: Unnecessary parentheses around 'mantisse != mantisse24'
[]
> > diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
[]
> > @@ -391,9 +391,9 @@ static int rf69_set_bandwidth_intern(struct spi_device 
> > *spi, u8 reg,
> > return -EINVAL;
> > }
> >  
> > -   if ((mantisse != mantisse16) &&
> > -   (mantisse != mantisse20) &&
> > -   (mantisse != mantisse24)) {
> > +   if (mantisse != mantisse16 &&
> > +   mantisse != mantisse20 &&
> > +   mantisse != mantisse24) {
> 
> I'm getting really tired of seeing this checkpatch warning, when it's a
> major pain.

Your idea of major pain and mine differ a bit.

> Joe, can you please turn these off.  Patches like this will force people
> to have to remember that != is higher precidence than &&.

As it's not just 1 precedence level but 4 and 5, it
really shouldn't be that hard to remember.

> The original code here was just fine.

And I don't really disagree with you.

David Miller has a preference for the parenthesis free
style. I believe he mentioned it sometime in August 2017
but I can't find it right now.

Anyway, perhaps
---
 scripts/checkpatch.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d2464058ab5d..3a7499de2c2d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4526,7 +4526,9 @@ sub process {
}
 
 # check for unnecessary parentheses around comparisons in if uses
-   if ($^V && $^V ge 5.10.0 && defined($stat) &&
+# when !drivers/staging or the command-line uses --strict
+   if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) &&
+   $^V && $^V ge 5.10.0 && defined($stat) &&
$stat =~ /(^.\s*if\s*($balanced_parens))/) {
my $if_stat = $1;
my $test = substr($2, 1, -1);

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


Re: [PATCH] staging: pi433: remove unnecessary parentheses

2018-01-09 Thread Greg Kroah-Hartman
On Tue, Jan 09, 2018 at 11:21:37AM -0800, Joe Perches wrote:
> On Tue, 2018-01-09 at 15:31 +0100, Greg Kroah-Hartman wrote:
> > On Mon, Jan 08, 2018 at 06:38:55PM +0100, Valentin Vidic wrote:
> > > Fixes checkpatch warnings:
> > >   CHECK: Unnecessary parentheses around 'mantisse != mantisse16'
> > >   CHECK: Unnecessary parentheses around 'mantisse != mantisse20'
> > >   CHECK: Unnecessary parentheses around 'mantisse != mantisse24'
> []
> > > diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> []
> > > @@ -391,9 +391,9 @@ static int rf69_set_bandwidth_intern(struct 
> > > spi_device *spi, u8 reg,
> > >   return -EINVAL;
> > >   }
> > >  
> > > - if ((mantisse != mantisse16) &&
> > > - (mantisse != mantisse20) &&
> > > - (mantisse != mantisse24)) {
> > > + if (mantisse != mantisse16 &&
> > > + mantisse != mantisse20 &&
> > > + mantisse != mantisse24) {
> > 
> > I'm getting really tired of seeing this checkpatch warning, when it's a
> > major pain.
> 
> Your idea of major pain and mine differ a bit.

I don't like taking patches that cause future problems.

> > Joe, can you please turn these off.  Patches like this will force people
> > to have to remember that != is higher precidence than &&.
> 
> As it's not just 1 precedence level but 4 and 5, it
> really shouldn't be that hard to remember.

I can't remember any of them, and I should not have to.  That's the
point, you should not assume anyone knows the levels, code is written
for developers to understand first, and the compiler second.  By
removing these, it doesn't do anything for the compiler, but makes the
developer think longer about them.

> > The original code here was just fine.
> 
> And I don't really disagree with you.
> 
> David Miller has a preference for the parenthesis free
> style. I believe he mentioned it sometime in August 2017
> but I can't find it right now.
> 
> Anyway, perhaps
> ---
>  scripts/checkpatch.pl | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index d2464058ab5d..3a7499de2c2d 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -4526,7 +4526,9 @@ sub process {
>   }
>  
>  # check for unnecessary parentheses around comparisons in if uses
> - if ($^V && $^V ge 5.10.0 && defined($stat) &&
> +# when !drivers/staging or the command-line uses --strict
> + if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) &&
> + $^V && $^V ge 5.10.0 && defined($stat) &&

How about only if in the networking area?  I don't want to take patches
for this for other parts of the kernel either, it's really useless.

thanks,

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


Re: [PATCH 05/10] uio_hv_generic: make ring size configurable

2018-01-09 Thread Greg KH
On Tue, Jan 09, 2018 at 11:14:11AM -0800, Stephen Hemminger wrote:
> On Tue, 9 Jan 2018 19:58:34 +0100
> Greg KH  wrote:
> 
> > On Tue, Jan 09, 2018 at 10:53:10AM -0800, Stephen Hemminger wrote:
> > > On Tue, 9 Jan 2018 19:42:40 +0100
> > > Greg KH  wrote:
> > >   
> > > > On Thu, Jan 04, 2018 at 02:13:29PM -0800, Stephen Hemminger wrote:  
> > > > > Allow setting size of ring buffer for host communication via
> > > > > module parameter.
> > > > > 
> > > > > Signed-off-by: Stephen Hemminger 
> > > > > ---
> > > > >  drivers/uio/uio_hv_generic.c | 25 +
> > > > >  1 file changed, 21 insertions(+), 4 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/uio/uio_hv_generic.c 
> > > > > b/drivers/uio/uio_hv_generic.c
> > > > > index 8d5f529a1dc1..24f8689fdb14 100644
> > > > > --- a/drivers/uio/uio_hv_generic.c
> > > > > +++ b/drivers/uio/uio_hv_generic.c
> > > > > @@ -39,6 +39,13 @@
> > > > >  #define DRIVER_AUTHOR"Stephen Hemminger  > > > > microsoft.com>"
> > > > >  #define DRIVER_DESC  "Generic UIO driver for VMBus devices"
> > > > >  
> > > > > +#define RING_SIZE_MIN 64
> > > > > +#define RING_SIZE_MAX 512
> > > > > +
> > > > > +static unsigned int ring_size = 128;
> > > > > +module_param(ring_size, uint, 0444);
> > > > > +MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
> > > > 
> > > > Ugh, really?  Module parameters suck rocks.  No other way to do this
> > > > dynamically?  This affects all devices for the driver, is that ok?
> > > > 
> > > > And how does anyone know to change this or not?  Why would it be
> > > > changed?  Why can't the kernel get this right on its own?  
> > > 
> > > You made UIO API so restrictive there is no parameterization available.  
> > 
> > _I_ did?  Heck, I don't remember what I did last month, let alone almost
> > a decade ago...
> > 
> > > The size of ring buffer is generally unchanged.   
> > 
> > Then why is this needed at all?
> 
> The default ring buffer is quite large, and wasteful with small VM's with 
> network device driver
> we do autotuning now based on number of channels which is based on number of 
> cpu's.
> 
> How about integrating that?

Autotuning is great, I would love to see that.

thanks,

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


Re: [PATCH 05/10] uio_hv_generic: make ring size configurable

2018-01-09 Thread Stephen Hemminger
On Tue, 9 Jan 2018 19:58:34 +0100
Greg KH  wrote:

> On Tue, Jan 09, 2018 at 10:53:10AM -0800, Stephen Hemminger wrote:
> > On Tue, 9 Jan 2018 19:42:40 +0100
> > Greg KH  wrote:
> >   
> > > On Thu, Jan 04, 2018 at 02:13:29PM -0800, Stephen Hemminger wrote:  
> > > > Allow setting size of ring buffer for host communication via
> > > > module parameter.
> > > > 
> > > > Signed-off-by: Stephen Hemminger 
> > > > ---
> > > >  drivers/uio/uio_hv_generic.c | 25 +
> > > >  1 file changed, 21 insertions(+), 4 deletions(-)
> > > > 
> > > > diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
> > > > index 8d5f529a1dc1..24f8689fdb14 100644
> > > > --- a/drivers/uio/uio_hv_generic.c
> > > > +++ b/drivers/uio/uio_hv_generic.c
> > > > @@ -39,6 +39,13 @@
> > > >  #define DRIVER_AUTHOR  "Stephen Hemminger "
> > > >  #define DRIVER_DESC"Generic UIO driver for VMBus devices"
> > > >  
> > > > +#define RING_SIZE_MIN 64
> > > > +#define RING_SIZE_MAX 512
> > > > +
> > > > +static unsigned int ring_size = 128;
> > > > +module_param(ring_size, uint, 0444);
> > > > +MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
> > > 
> > > Ugh, really?  Module parameters suck rocks.  No other way to do this
> > > dynamically?  This affects all devices for the driver, is that ok?
> > > 
> > > And how does anyone know to change this or not?  Why would it be
> > > changed?  Why can't the kernel get this right on its own?  
> > 
> > You made UIO API so restrictive there is no parameterization available.  
> 
> _I_ did?  Heck, I don't remember what I did last month, let alone almost
> a decade ago...
> 
> > The size of ring buffer is generally unchanged.   
> 
> Then why is this needed at all?

The default ring buffer is quite large, and wasteful with small VM's with 
network device driver
we do autotuning now based on number of channels which is based on number of 
cpu's.

How about integrating that?


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


Re: [PATCH 05/10] uio_hv_generic: make ring size configurable

2018-01-09 Thread Greg KH
On Tue, Jan 09, 2018 at 10:53:10AM -0800, Stephen Hemminger wrote:
> On Tue, 9 Jan 2018 19:42:40 +0100
> Greg KH  wrote:
> 
> > On Thu, Jan 04, 2018 at 02:13:29PM -0800, Stephen Hemminger wrote:
> > > Allow setting size of ring buffer for host communication via
> > > module parameter.
> > > 
> > > Signed-off-by: Stephen Hemminger 
> > > ---
> > >  drivers/uio/uio_hv_generic.c | 25 +
> > >  1 file changed, 21 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
> > > index 8d5f529a1dc1..24f8689fdb14 100644
> > > --- a/drivers/uio/uio_hv_generic.c
> > > +++ b/drivers/uio/uio_hv_generic.c
> > > @@ -39,6 +39,13 @@
> > >  #define DRIVER_AUTHOR"Stephen Hemminger "
> > >  #define DRIVER_DESC  "Generic UIO driver for VMBus devices"
> > >  
> > > +#define RING_SIZE_MIN 64
> > > +#define RING_SIZE_MAX 512
> > > +
> > > +static unsigned int ring_size = 128;
> > > +module_param(ring_size, uint, 0444);
> > > +MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");  
> > 
> > Ugh, really?  Module parameters suck rocks.  No other way to do this
> > dynamically?  This affects all devices for the driver, is that ok?
> > 
> > And how does anyone know to change this or not?  Why would it be
> > changed?  Why can't the kernel get this right on its own?
> 
> You made UIO API so restrictive there is no parameterization available.

_I_ did?  Heck, I don't remember what I did last month, let alone almost
a decade ago...

> The size of ring buffer is generally unchanged. 

Then why is this needed at all?

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


Re: [PATCH 05/10] uio_hv_generic: make ring size configurable

2018-01-09 Thread Stephen Hemminger
On Tue, 9 Jan 2018 19:42:40 +0100
Greg KH  wrote:

> On Thu, Jan 04, 2018 at 02:13:29PM -0800, Stephen Hemminger wrote:
> > Allow setting size of ring buffer for host communication via
> > module parameter.
> > 
> > Signed-off-by: Stephen Hemminger 
> > ---
> >  drivers/uio/uio_hv_generic.c | 25 +
> >  1 file changed, 21 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
> > index 8d5f529a1dc1..24f8689fdb14 100644
> > --- a/drivers/uio/uio_hv_generic.c
> > +++ b/drivers/uio/uio_hv_generic.c
> > @@ -39,6 +39,13 @@
> >  #define DRIVER_AUTHOR  "Stephen Hemminger "
> >  #define DRIVER_DESC"Generic UIO driver for VMBus devices"
> >  
> > +#define RING_SIZE_MIN 64
> > +#define RING_SIZE_MAX 512
> > +
> > +static unsigned int ring_size = 128;
> > +module_param(ring_size, uint, 0444);
> > +MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");  
> 
> Ugh, really?  Module parameters suck rocks.  No other way to do this
> dynamically?  This affects all devices for the driver, is that ok?
> 
> And how does anyone know to change this or not?  Why would it be
> changed?  Why can't the kernel get this right on its own?

You made UIO API so restrictive there is no parameterization available.
The size of ring buffer is generally unchanged. 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 00/11] vmbus and uio_hv_generice improvements

2018-01-09 Thread Greg KH
On Tue, Jan 09, 2018 at 10:29:03AM -0800, Stephen Hemminger wrote:
> These patches improve vmbus sysfs support for better management and
> make the UIO hyperv driver usable. The original version did not enough
> functionality to support userspace network drivers. Needed support
> of send/receive buffers and sub channels.
> 
> Patches against current char-misc-next
> 
> v2
>   - revise documentation files as well

Can you rebase these, I've applied a bunch of them, but not all, sorry,
we crossed emails...

thanks,

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


Re: [PATCH 08/10] uio_hv_generic: check that host supports monitor page

2018-01-09 Thread Greg KH
On Thu, Jan 04, 2018 at 02:13:32PM -0800, Stephen Hemminger wrote:
> In order for userspace application to signal host, it needs the
> host to support the monitor page property. Check for the flag
> and fail if this is not supported.
> 
> Signed-off-by: Stephen Hemminger 
> ---
>  drivers/uio/uio_hv_generic.c | 20 ++--
>  1 file changed, 14 insertions(+), 6 deletions(-)

This didn't apply due to me skipping the module patches, so I've stopped
here.

thanks,

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


Re: [PATCH 06/10] uio_hv_generic: create send and receive buffers

2018-01-09 Thread Greg KH
On Thu, Jan 04, 2018 at 02:13:30PM -0800, Stephen Hemminger wrote:
> Map in receive and send buffers for networking in UIO device.
> These buffers are special and need to be setup by kernel
> API's.
> 
> Signed-off-by: Stephen Hemminger 
> ---
>  drivers/uio/uio_hv_generic.c | 114 
> +--
>  1 file changed, 109 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
> index 24f8689fdb14..0d945eb6efbb 100644
> --- a/drivers/uio/uio_hv_generic.c
> +++ b/drivers/uio/uio_hv_generic.c
> @@ -35,7 +35,7 @@
>  
>  #include "../hv/hyperv_vmbus.h"
>  
> -#define DRIVER_VERSION   "0.02.0"
> +#define DRIVER_VERSION   "0.02.1"

The driver version should be deleted, it means nothing as the code is in
the kernel tree.

>  #define DRIVER_AUTHOR"Stephen Hemminger "
>  #define DRIVER_DESC  "Generic UIO driver for VMBus devices"
>  
> @@ -46,19 +46,38 @@ static unsigned int ring_size = 128;
>  module_param(ring_size, uint, 0444);
>  MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
>  
> -/*
> - * List of resources to be mapped to user space
> - * can be extended up to MAX_UIO_MAPS(5) items
> - */
> +#define RECV_BUFFER_MAX ((16 * 1024 * 1024) / PAGE_SIZE)
> +
> +static unsigned int recv_buffer_size = RECV_BUFFER_MAX;
> +module_param(recv_buffer_size, uint, 0444);
> +MODULE_PARM_DESC(recv_buffer_size, "Receive buffer size (# of pages)");
> +
> +#define SEND_BUFFER_MAX ((15 * 1024 * 1024) / PAGE_SIZE)
> +
> +static unsigned int send_buffer_size = SEND_BUFFER_MAX;
> +module_param(send_buffer_size, uint, 0444);
> +MODULE_PARM_DESC(send_buffer_size, "Send buffer size (# of pages)");

Same comments about the module options :(

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


Re: [PATCH 05/10] uio_hv_generic: make ring size configurable

2018-01-09 Thread Greg KH
On Thu, Jan 04, 2018 at 02:13:29PM -0800, Stephen Hemminger wrote:
> Allow setting size of ring buffer for host communication via
> module parameter.
> 
> Signed-off-by: Stephen Hemminger 
> ---
>  drivers/uio/uio_hv_generic.c | 25 +
>  1 file changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
> index 8d5f529a1dc1..24f8689fdb14 100644
> --- a/drivers/uio/uio_hv_generic.c
> +++ b/drivers/uio/uio_hv_generic.c
> @@ -39,6 +39,13 @@
>  #define DRIVER_AUTHOR"Stephen Hemminger "
>  #define DRIVER_DESC  "Generic UIO driver for VMBus devices"
>  
> +#define RING_SIZE_MIN 64
> +#define RING_SIZE_MAX 512
> +
> +static unsigned int ring_size = 128;
> +module_param(ring_size, uint, 0444);
> +MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");

Ugh, really?  Module parameters suck rocks.  No other way to do this
dynamically?  This affects all devices for the driver, is that ok?

And how does anyone know to change this or not?  Why would it be
changed?  Why can't the kernel get this right on its own?

thanks,

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


[PATCH v2 08/11] uio_hv_generic: use ISR callback method

2018-01-09 Thread Stephen Hemminger
The UIO IRQ handler doesn't need to be called from a tasklet.

Signed-off-by: Stephen Hemminger 
---
 drivers/uio/uio_hv_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 0d945eb6efbb..18735731206e 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -159,7 +159,7 @@ hv_uio_probe(struct hv_device *dev,
goto fail;
 
dev->channel->inbound.ring_buffer->interrupt_mask = 1;
-   set_channel_read_mode(dev->channel, HV_CALL_DIRECT);
+   set_channel_read_mode(dev->channel, HV_CALL_ISR);
 
/* Fill general uio info */
pdata->info.name = "uio_hv_generic";
-- 
2.15.1

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


[PATCH v2 06/11] uio_hv_generic: make ring size configurable

2018-01-09 Thread Stephen Hemminger
Allow setting size of ring buffer for host communication via
module parameter.

Signed-off-by: Stephen Hemminger 
---
 drivers/uio/uio_hv_generic.c | 25 +
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 8d5f529a1dc1..24f8689fdb14 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -39,6 +39,13 @@
 #define DRIVER_AUTHOR  "Stephen Hemminger "
 #define DRIVER_DESC"Generic UIO driver for VMBus devices"
 
+#define RING_SIZE_MIN 64
+#define RING_SIZE_MAX 512
+
+static unsigned int ring_size = 128;
+module_param(ring_size, uint, 0444);
+MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
+
 /*
  * List of resources to be mapped to user space
  * can be extended up to MAX_UIO_MAPS(5) items
@@ -49,8 +56,6 @@ enum hv_uio_map {
MON_PAGE_MAP,
 };
 
-#define HV_RING_SIZE   512
-
 struct hv_uio_private_data {
struct uio_info info;
struct hv_device *device;
@@ -102,8 +107,8 @@ hv_uio_probe(struct hv_device *dev,
if (!pdata)
return -ENOMEM;
 
-   ret = vmbus_open(dev->channel, HV_RING_SIZE * PAGE_SIZE,
-HV_RING_SIZE * PAGE_SIZE, NULL, 0,
+   ret = vmbus_open(dev->channel, ring_size * PAGE_SIZE,
+ring_size * PAGE_SIZE, NULL, 0,
 hv_uio_channel_cb, pdata);
if (ret)
goto fail;
@@ -183,6 +188,18 @@ static struct hv_driver hv_uio_drv = {
 static int __init
 hyperv_module_init(void)
 {
+   if (ring_size < RING_SIZE_MIN) {
+   ring_size = RING_SIZE_MIN;
+   pr_info("Increased ring_size to %u (min allowed)\n",
+   ring_size);
+   }
+
+   if (ring_size > RING_SIZE_MAX) {
+   ring_size = RING_SIZE_MAX;
+   pr_info("Decreased ring_size to %u (max allowed)\n",
+   ring_size);
+   }
+
return vmbus_driver_register(&hv_uio_drv);
 }
 
-- 
2.15.1

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


[PATCH v2 10/11] uio_hv_generic: add rescind support

2018-01-09 Thread Stephen Hemminger
When host rescinds the device, the UIO driver will clear the interrupt
state and notify application. The read (or write) on the interrupt FD
will then fail with -EIO. This is simpler than adding lots extra uevent
stuff inside UIO.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst |  4 
 drivers/uio/uio_hv_generic.c   | 19 +++
 2 files changed, 23 insertions(+)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index a4228e371244..0030de9205fd 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -698,6 +698,10 @@ prevents the device from generating further interrupts 
until the bit is
 cleared. The userspace driver should clear this bit before blocking and
 waiting for more interrupts.
 
+When host rescinds a device, the interrupt file descriptor is marked down
+and any reads of the interrupt file descriptor will return -EIO. Similar
+to a closed socket or disconnected serial device.
+
 The vmbus device regions are mapped into uio device resources.
 0) Channel ring buffers: guest to host and host to guest
 1) Guest to host interrupt signalling pages
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index b5fe0db844a7..eab173665dd4 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -115,6 +115,23 @@ static void hv_uio_channel_cb(void *context)
uio_event_notify(&pdata->info);
 }
 
+/*
+ * Callback from vmbus_event when channel is rescinded.
+ */
+static void hv_uio_rescind(struct vmbus_channel *channel)
+{
+   struct hv_device *hv_dev = channel->primary_channel->device_obj;
+   struct hv_uio_private_data *pdata = hv_get_drvdata(hv_dev);
+
+   /*
+* Turn off the interrupt file handle
+* Next read for event will return -EIO
+*/
+   pdata->info.irq = 0;
+
+   /* Wake up reader */
+   uio_event_notify(&pdata->info);
+}
 
 static void
 hv_uio_cleanup(struct hv_device *dev, struct hv_uio_private_data *pdata)
@@ -248,6 +265,8 @@ hv_uio_probe(struct hv_device *dev,
goto fail_cleanup;
}
 
+   vmbus_set_chn_rescind_callback(dev->channel, hv_uio_rescind);
+
hv_set_drvdata(dev, pdata);
 
return 0;
-- 
2.15.1

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


[PATCH v2 09/11] uio_hv_generic: check that host supports monitor page

2018-01-09 Thread Stephen Hemminger
In order for userspace application to signal host, it needs the
host to support the monitor page property. Check for the flag
and fail if this is not supported.

Signed-off-by: Stephen Hemminger 
---
 drivers/uio/uio_hv_generic.c | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 18735731206e..b5fe0db844a7 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -158,6 +158,13 @@ hv_uio_probe(struct hv_device *dev,
if (ret)
goto fail;
 
+   /* Communicating with host has to be via shared memory not hypercall */
+   if (!dev->channel->offermsg.monitor_allocated) {
+   dev_err(&dev->device, "vmbus channel requires hypercall\n");
+   ret = -ENOTSUPP;
+   goto fail_close;
+   }
+
dev->channel->inbound.ring_buffer->interrupt_mask = 1;
set_channel_read_mode(dev->channel, HV_CALL_ISR);
 
@@ -192,13 +199,13 @@ hv_uio_probe(struct hv_device *dev,
pdata->recv_buf = vzalloc(buf_size);
if (pdata->recv_buf == NULL) {
ret = -ENOMEM;
-   goto fail_close;
+   goto fail_cleanup;
}
 
ret = vmbus_establish_gpadl(dev->channel, pdata->recv_buf,
buf_size, &pdata->recv_gpadl);
if (ret)
-   goto fail_close;
+   goto fail_cleanup;
 
/* put Global Physical Address Label in name */
snprintf(pdata->recv_name, sizeof(pdata->recv_name),
@@ -215,13 +222,13 @@ hv_uio_probe(struct hv_device *dev,
pdata->send_buf = vzalloc(buf_size);
if (pdata->send_buf == NULL) {
ret = -ENOMEM;
-   goto fail_close;
+   goto fail_cleanup;
}
 
ret = vmbus_establish_gpadl(dev->channel, pdata->send_buf,
buf_size, &pdata->send_gpadl);
if (ret)
-   goto fail_close;
+   goto fail_cleanup;
 
snprintf(pdata->send_name, sizeof(pdata->send_name),
 "send:%u", pdata->send_gpadl);
@@ -238,15 +245,16 @@ hv_uio_probe(struct hv_device *dev,
ret = uio_register_device(&dev->device, &pdata->info);
if (ret) {
dev_err(&dev->device, "hv_uio register failed\n");
-   goto fail_close;
+   goto fail_cleanup;
}
 
hv_set_drvdata(dev, pdata);
 
return 0;
 
-fail_close:
+fail_cleanup:
hv_uio_cleanup(dev, pdata);
+fail_close:
vmbus_close(dev->channel);
 fail:
kfree(pdata);
-- 
2.15.1

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


[PATCH v2 11/11] uio_hv_generic: support sub-channels

2018-01-09 Thread Stephen Hemminger
Use sysfs to allow supporting sub-channels. The userspace application
makes request to host to create sub-channels and the UIO kernel
driver populates the sysfs per-channel directory with a binary
attribute file that can be used to read/write ring.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst |  5 ++
 drivers/uio/uio_hv_generic.c   | 91 ++
 2 files changed, 96 insertions(+)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index 0030de9205fd..23509429c85c 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -709,6 +709,11 @@ The vmbus device regions are mapped into uio device 
resources.
 3) Network receive buffer region
 4) Network send buffer region
 
+If a subchannel is created by a request to host, then the uio_hv_generic
+device driver will create a sysfs binary file for the per-channel ring buffer.
+For example:
+   
/sys/bus/vmbus/devices/3811fe4d-0fa0-4b62-981a-74fc1084c757/channels/21/ring_buffer
+
 Further information
 ===
 
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index eab173665dd4..a2289122e99d 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -133,6 +133,94 @@ static void hv_uio_rescind(struct vmbus_channel *channel)
uio_event_notify(&pdata->info);
 }
 
+/*
+ * Handle fault when looking for sub channel ring buffer
+ * Subchannel ring buffer is same as resource 0 which is main ring buffer
+ * This is derived from uio_vma_fault
+ */
+static int hv_uio_vma_fault(struct vm_fault *vmf)
+{
+   struct vm_area_struct *vma = vmf->vma;
+   void *ring_buffer = vma->vm_private_data;
+   struct page *page;
+   void *addr;
+
+   addr = ring_buffer + (vmf->pgoff << PAGE_SHIFT);
+   page = virt_to_page(addr);
+   get_page(page);
+   vmf->page = page;
+   return 0;
+}
+
+static const struct vm_operations_struct hv_uio_vm_ops = {
+   .fault = hv_uio_vma_fault,
+};
+
+/* Sysfs API to allow mmap of the ring buffers */
+static int hv_uio_ring_mmap(struct file *filp, struct kobject *kobj,
+   struct bin_attribute *attr,
+   struct vm_area_struct *vma)
+{
+   struct vmbus_channel *channel
+   = container_of(kobj, struct vmbus_channel, kobj);
+   unsigned long requested_pages, actual_pages;
+
+   if (vma->vm_end < vma->vm_start)
+   return -EINVAL;
+
+   /* only allow 0 for now */
+   if (vma->vm_pgoff > 0)
+   return -EINVAL;
+
+   requested_pages = vma_pages(vma);
+   actual_pages = 2 * ring_size;
+   if (requested_pages > actual_pages)
+   return -EINVAL;
+
+   vma->vm_private_data = channel->ringbuffer_pages;
+   vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+   vma->vm_ops = &hv_uio_vm_ops;
+   return 0;
+}
+
+static struct bin_attribute ring_buffer_bin_attr __ro_after_init = {
+   .attr = {
+   .name = "ring",
+   .mode = 0600,
+   /* size is set at init time */
+   },
+   .mmap = hv_uio_ring_mmap,
+};
+
+/* Callback from VMBUS subystem when new channel created. */
+static void
+hv_uio_new_channel(struct vmbus_channel *new_sc)
+{
+   struct hv_device *hv_dev = new_sc->primary_channel->device_obj;
+   struct device *device = &hv_dev->device;
+   struct hv_uio_private_data *pdata = hv_get_drvdata(hv_dev);
+   int ret;
+
+   /* Create host communication ring */
+   ret = vmbus_open(new_sc, ring_size * PAGE_SIZE,
+ring_size * PAGE_SIZE, NULL, 0,
+hv_uio_channel_cb, pdata);
+   if (ret) {
+   dev_err(device, "vmbus_open subchannel failed: %d\n", ret);
+   return;
+   }
+
+   /* Disable interrupts on sub channel */
+   new_sc->inbound.ring_buffer->interrupt_mask = 1;
+   set_channel_read_mode(new_sc, HV_CALL_ISR);
+
+   ret = sysfs_create_bin_file(&new_sc->kobj, &ring_buffer_bin_attr);
+   if (ret) {
+   dev_err(device, "sysfs create ring bin file failed; %d\n", ret);
+   vmbus_close(new_sc);
+   }
+}
+
 static void
 hv_uio_cleanup(struct hv_device *dev, struct hv_uio_private_data *pdata)
 {
@@ -266,6 +354,7 @@ hv_uio_probe(struct hv_device *dev,
}
 
vmbus_set_chn_rescind_callback(dev->channel, hv_uio_rescind);
+   vmbus_set_sc_create_callback(dev->channel, hv_uio_new_channel);
 
hv_set_drvdata(dev, pdata);
 
@@ -319,6 +408,8 @@ hyperv_module_init(void)
ring_size);
}
 
+   ring_buffer_bin_attr.size = 2 * ring_size * PAGE_SIZE;
+
if (recv_buffer_size > RECV_BUFFER_MAX) {
recv_buffer_size = RECV_BUFFER_MAX;
pr_info("Decreased receive_buffer_size to %u (max allowed)\n",
-- 
2.15.1

[PATCH v2 05/11] uio_hv_generic: use standard mmap for resources

2018-01-09 Thread Stephen Hemminger
The generic UIO mmap should work for us.

Signed-off-by: Stephen Hemminger 
---
 drivers/uio/uio_hv_generic.c | 33 +++--
 1 file changed, 7 insertions(+), 26 deletions(-)

diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 4fea9a578990..8d5f529a1dc1 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -56,24 +56,6 @@ struct hv_uio_private_data {
struct hv_device *device;
 };
 
-static int
-hv_uio_mmap(struct uio_info *info, struct vm_area_struct *vma)
-{
-   int mi;
-
-   if (vma->vm_pgoff >= MAX_UIO_MAPS)
-   return -EINVAL;
-
-   if (info->mem[vma->vm_pgoff].size == 0)
-   return -EINVAL;
-
-   mi = (int)vma->vm_pgoff;
-
-   return remap_pfn_range(vma, vma->vm_start,
-   info->mem[mi].addr >> PAGE_SHIFT,
-   vma->vm_end - vma->vm_start, vma->vm_page_prot);
-}
-
 /*
  * This is the irqcontrol callback to be registered to uio_info.
  * It can be used to disable/enable interrupt from user space processes.
@@ -133,26 +115,25 @@ hv_uio_probe(struct hv_device *dev,
pdata->info.name = "uio_hv_generic";
pdata->info.version = DRIVER_VERSION;
pdata->info.irqcontrol = hv_uio_irqcontrol;
-   pdata->info.mmap = hv_uio_mmap;
pdata->info.irq = UIO_IRQ_CUSTOM;
 
/* mem resources */
pdata->info.mem[TXRX_RING_MAP].name = "txrx_rings";
pdata->info.mem[TXRX_RING_MAP].addr
-   = virt_to_phys(dev->channel->ringbuffer_pages);
+   = (phys_addr_t)dev->channel->ringbuffer_pages;
pdata->info.mem[TXRX_RING_MAP].size
-   = dev->channel->ringbuffer_pagecount * PAGE_SIZE;
+   = dev->channel->ringbuffer_pagecount << PAGE_SHIFT;
pdata->info.mem[TXRX_RING_MAP].memtype = UIO_MEM_LOGICAL;
 
pdata->info.mem[INT_PAGE_MAP].name = "int_page";
-   pdata->info.mem[INT_PAGE_MAP].addr =
-   virt_to_phys(vmbus_connection.int_page);
+   pdata->info.mem[INT_PAGE_MAP].addr
+   = (phys_addr_t)vmbus_connection.int_page;
pdata->info.mem[INT_PAGE_MAP].size = PAGE_SIZE;
pdata->info.mem[INT_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
 
-   pdata->info.mem[MON_PAGE_MAP].name = "monitor_pages";
-   pdata->info.mem[MON_PAGE_MAP].addr =
-   virt_to_phys(vmbus_connection.monitor_pages[1]);
+   pdata->info.mem[MON_PAGE_MAP].name = "monitor_page";
+   pdata->info.mem[MON_PAGE_MAP].addr
+   = (phys_addr_t)vmbus_connection.monitor_pages[1];
pdata->info.mem[MON_PAGE_MAP].size = PAGE_SIZE;
pdata->info.mem[MON_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
 
-- 
2.15.1

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


[PATCH v2 07/11] uio_hv_generic: create send and receive buffers

2018-01-09 Thread Stephen Hemminger
Map in receive and send buffers for networking in UIO device.
These buffers are special and need to be setup by kernel
API's.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst |   2 +
 drivers/uio/uio_hv_generic.c   | 114 +++--
 2 files changed, 111 insertions(+), 5 deletions(-)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index 272795951565..a4228e371244 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -702,6 +702,8 @@ The vmbus device regions are mapped into uio device 
resources.
 0) Channel ring buffers: guest to host and host to guest
 1) Guest to host interrupt signalling pages
 2) Guest to host monitor page
+3) Network receive buffer region
+4) Network send buffer region
 
 Further information
 ===
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 24f8689fdb14..0d945eb6efbb 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -35,7 +35,7 @@
 
 #include "../hv/hyperv_vmbus.h"
 
-#define DRIVER_VERSION "0.02.0"
+#define DRIVER_VERSION "0.02.1"
 #define DRIVER_AUTHOR  "Stephen Hemminger "
 #define DRIVER_DESC"Generic UIO driver for VMBus devices"
 
@@ -46,19 +46,38 @@ static unsigned int ring_size = 128;
 module_param(ring_size, uint, 0444);
 MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
 
-/*
- * List of resources to be mapped to user space
- * can be extended up to MAX_UIO_MAPS(5) items
- */
+#define RECV_BUFFER_MAX ((16 * 1024 * 1024) / PAGE_SIZE)
+
+static unsigned int recv_buffer_size = RECV_BUFFER_MAX;
+module_param(recv_buffer_size, uint, 0444);
+MODULE_PARM_DESC(recv_buffer_size, "Receive buffer size (# of pages)");
+
+#define SEND_BUFFER_MAX ((15 * 1024 * 1024) / PAGE_SIZE)
+
+static unsigned int send_buffer_size = SEND_BUFFER_MAX;
+module_param(send_buffer_size, uint, 0444);
+MODULE_PARM_DESC(send_buffer_size, "Send buffer size (# of pages)");
+
+/* List of resources to be mapped to user space */
 enum hv_uio_map {
TXRX_RING_MAP = 0,
INT_PAGE_MAP,
MON_PAGE_MAP,
+   RECV_BUF_MAP,
+   SEND_BUF_MAP
 };
 
 struct hv_uio_private_data {
struct uio_info info;
struct hv_device *device;
+
+   void*recv_buf;
+   u32 recv_gpadl;
+   charrecv_name[32];  /* "recv_4294967295" */
+
+   void*send_buf;
+   u32 send_gpadl;
+   charsend_name[32];
 };
 
 /*
@@ -96,11 +115,37 @@ static void hv_uio_channel_cb(void *context)
uio_event_notify(&pdata->info);
 }
 
+
+static void
+hv_uio_cleanup(struct hv_device *dev, struct hv_uio_private_data *pdata)
+{
+   if (pdata->send_gpadl) {
+   vmbus_teardown_gpadl(dev->channel, pdata->send_gpadl);
+   pdata->send_gpadl = 0;
+   }
+
+   if (pdata->send_buf) {
+   vfree(pdata->send_buf);
+   pdata->send_buf = NULL;
+   }
+
+   if (pdata->recv_gpadl) {
+   vmbus_teardown_gpadl(dev->channel, pdata->recv_gpadl);
+   pdata->recv_gpadl = 0;
+   }
+
+   if (pdata->recv_buf) {
+   vfree(pdata->recv_buf);
+   pdata->recv_buf = NULL;
+   }
+}
+
 static int
 hv_uio_probe(struct hv_device *dev,
 const struct hv_vmbus_device_id *dev_id)
 {
struct hv_uio_private_data *pdata;
+   size_t buf_size;
int ret;
 
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
@@ -142,6 +187,51 @@ hv_uio_probe(struct hv_device *dev,
pdata->info.mem[MON_PAGE_MAP].size = PAGE_SIZE;
pdata->info.mem[MON_PAGE_MAP].memtype = UIO_MEM_LOGICAL;
 
+   if (recv_buffer_size) {
+   buf_size = recv_buffer_size * PAGE_SIZE;
+   pdata->recv_buf = vzalloc(buf_size);
+   if (pdata->recv_buf == NULL) {
+   ret = -ENOMEM;
+   goto fail_close;
+   }
+
+   ret = vmbus_establish_gpadl(dev->channel, pdata->recv_buf,
+   buf_size, &pdata->recv_gpadl);
+   if (ret)
+   goto fail_close;
+
+   /* put Global Physical Address Label in name */
+   snprintf(pdata->recv_name, sizeof(pdata->recv_name),
+"recv:%u", pdata->recv_gpadl);
+   pdata->info.mem[RECV_BUF_MAP].name = pdata->recv_name;
+   pdata->info.mem[RECV_BUF_MAP].addr
+   = (phys_addr_t)pdata->recv_buf;
+   pdata->info.mem[RECV_BUF_MAP].size = buf_size;
+   pdata->info.mem[RECV_BUF_MAP].memtype = UIO_MEM_VIRTUAL;
+   }
+
+   if (send_buffer_size) {
+   buf_size = send_buffer_size * PAGE_SIZE;
+   pdata->send_buf = vzalloc(buf_size);
+   if (pdata->send_buf == NULL) {
+   ret = -ENOME

[PATCH v2 02/11] vmbus: fix ABI documentation

2018-01-09 Thread Stephen Hemminger
Fixes to vmbus ABI document including:
- make it clear that relid is numeric value in sub directory
- clarify interrupt mask description
- spelling fixes
- document regions

Signed-off-by: Stephen Hemminger 
---
 Documentation/ABI/stable/sysfs-bus-vmbus | 39 +++-
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus 
b/Documentation/ABI/stable/sysfs-bus-vmbus
index d4077cc60d55..b7174a5616d6 100644
--- a/Documentation/ABI/stable/sysfs-bus-vmbus
+++ b/Documentation/ABI/stable/sysfs-bus-vmbus
@@ -42,70 +42,77 @@ Contact:K. Y. Srinivasan 
 Description:   The 16 bit vendor ID of the device
 Users: tools/hv/lsvmbus and user level RDMA libraries
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/cpu
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN
+Date:  September. 2017
+KernelVersion: 4.14
+Contact:   Stephen Hemminger 
+Description:   Directory for per-channel information
+   NN is the VMBUS relid associtated with the channel.
+
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/cpu
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
 Description:   VCPU (sub)channel is affinitized to
-Users: tools/hv/lsvmbus and other debuggig tools
+Users: tools/hv/lsvmbus and other debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/cpu
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/cpu
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
 Description:   VCPU (sub)channel is affinitized to
-Users: tools/hv/lsvmbus and other debuggig tools
+Users: tools/hv/lsvmbus and other debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/in_mask
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/in_mask
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
-Description:   Inbound channel signaling state
+Description:   Host to guest channel interrupt mask
 Users: Debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/latency
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/latency
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
 Description:   Channel signaling latency
 Users: Debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/out_mask
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/out_mask
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
-Description:   Outbound channel signaling state
+Description:   Guest to host channel interrupt mask
 Users: Debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/pending
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/pending
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
 Description:   Channel interrupt pending state
 Users: Debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/read_avail
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/read_avail
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
-Description:   Bytes availabble to read
+Description:   Bytes available to read
 Users: Debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/write_avail
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/write_avail
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
-Description:   Bytes availabble to write
+Description:   Bytes available to write
 Users: Debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/events
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/events
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
 Description:   Number of times we have signaled the host
 Users: Debugging tools
 
-What:  /sys/bus/vmbus/devices/vmbus_*/channels/relid/interrupts
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/interrupts
 Date:  September. 2017
 KernelVersion: 4.14
 Contact:   Stephen Hemminger 
-- 
2.15.1

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


[PATCH v2 04/11] uio_hv_generic: fix documentation and configuration comments

2018-01-09 Thread Stephen Hemminger
The suggested method for configuration does not work with
current kernels. Paths and ids changed.

Signed-off-by: Stephen Hemminger 
---
 Documentation/driver-api/uio-howto.rst | 20 +---
 drivers/uio/uio_hv_generic.c   |  8 +---
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/Documentation/driver-api/uio-howto.rst 
b/Documentation/driver-api/uio-howto.rst
index f73d660b2956..272795951565 100644
--- a/Documentation/driver-api/uio-howto.rst
+++ b/Documentation/driver-api/uio-howto.rst
@@ -667,27 +667,28 @@ Making the driver recognize the device
 Since the driver does not declare any device GUID's, it will not get
 loaded automatically and will not automatically bind to any devices, you
 must load it and allocate id to the driver yourself. For example, to use
-the network device GUID::
+the network device class GUID::
 
  modprobe uio_hv_generic
  echo "f8615163-df3e-46c5-913f-f2d2f965ed0e" > 
/sys/bus/vmbus/drivers/uio_hv_generic/new_id
 
 If there already is a hardware specific kernel driver for the device,
 the generic driver still won't bind to it, in this case if you want to
-use the generic driver (why would you?) you'll have to manually unbind
-the hardware specific driver and bind the generic driver, like this::
+use the generic driver for a userspace library you'll have to manually unbind
+the hardware specific driver and bind the generic driver, using the device 
specific GUID
+like this::
 
-  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 > 
/sys/bus/vmbus/drivers/hv_netvsc/unbind
-  echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 > 
/sys/bus/vmbus/drivers/uio_hv_generic/bind
+  echo -n ed963694-e847-4b2a-85af-bc9cfc11d6f3 > 
/sys/bus/vmbus/drivers/hv_netvsc/unbind
+  echo -n ed963694-e847-4b2a-85af-bc9cfc11d6f3 > 
/sys/bus/vmbus/drivers/uio_hv_generic/bind
 
 You can verify that the device has been bound to the driver by looking
 for it in sysfs, for example like the following::
 
-ls -l 
/sys/bus/vmbus/devices/vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver
+ls -l 
/sys/bus/vmbus/devices/ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver
 
 Which if successful should print::
 
-  .../vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver -> 
../../../bus/vmbus/drivers/uio_hv_generic
+  .../ed963694-e847-4b2a-85af-bc9cfc11d6f3/driver -> 
../../../bus/vmbus/drivers/uio_hv_generic
 
 Things to know about uio_hv_generic
 ---
@@ -697,6 +698,11 @@ prevents the device from generating further interrupts 
until the bit is
 cleared. The userspace driver should clear this bit before blocking and
 waiting for more interrupts.
 
+The vmbus device regions are mapped into uio device resources.
+0) Channel ring buffers: guest to host and host to guest
+1) Guest to host interrupt signalling pages
+2) Guest to host monitor page
+
 Further information
 ===
 
diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 48d5327d38d4..4fea9a578990 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -10,11 +10,13 @@
  * Since the driver does not declare any device ids, you must allocate
  * id and bind the device to the driver yourself.  For example:
  *
+ * Associate Network GUID with UIO device
  * # echo "f8615163-df3e-46c5-913f-f2d2f965ed0e" \
- *> /sys/bus/vmbus/drivers/uio_hv_generic
- * # echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 \
+ *> /sys/bus/vmbus/drivers/uio_hv_generic/new_id
+ * Then rebind
+ * # echo -n "ed963694-e847-4b2a-85af-bc9cfc11d6f3" \
  *> /sys/bus/vmbus/drivers/hv_netvsc/unbind
- * # echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 \
+ * # echo -n "ed963694-e847-4b2a-85af-bc9cfc11d6f3" \
  *> /sys/bus/vmbus/drivers/uio_hv_generic/bind
  */
 
-- 
2.15.1

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


[PATCH v2 03/11] vmbus: add monitor_id and subchannel_id to sysfs per channel

2018-01-09 Thread Stephen Hemminger
Useful to identify which network queue is associated with
which vmbus channel.

Signed-off-by: Stephen Hemminger 
---
 Documentation/ABI/stable/sysfs-bus-vmbus | 14 ++
 drivers/hv/vmbus_drv.c   | 17 +
 2 files changed, 31 insertions(+)

diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus 
b/Documentation/ABI/stable/sysfs-bus-vmbus
index b7174a5616d6..e46be65d0e1d 100644
--- a/Documentation/ABI/stable/sysfs-bus-vmbus
+++ b/Documentation/ABI/stable/sysfs-bus-vmbus
@@ -118,3 +118,17 @@ KernelVersion: 4.14
 Contact:   Stephen Hemminger 
 Description:   Number of times we have taken an interrupt (incoming)
 Users: Debugging tools
+
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/subchannel_id
+Date:  January. 2018
+KernelVersion: 4.16
+Contact:   Stephen Hemminger 
+Description:   Subchannel ID associated with VMBUS channel
+Users: Debugging tools and userspace drivers
+
+What:  /sys/bus/vmbus/devices/vmbus_*/channels/NN/monitor_id
+Date:  January. 2018
+KernelVersion: 4.16
+Contact:   Stephen Hemminger 
+Description:   Monitor bit associated with channel
+Users: Debugging tools and userspace drivers
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 74e256db7d57..91cba71c0113 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1255,6 +1255,21 @@ static ssize_t channel_events_show(const struct 
vmbus_channel *channel, char *bu
 }
 static VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL);
 
+static ssize_t subchannel_monitor_id_show(const struct vmbus_channel *channel,
+ char *buf)
+{
+   return sprintf(buf, "%u\n", channel->offermsg.monitorid);
+}
+static VMBUS_CHAN_ATTR(monitor_id, S_IRUGO, subchannel_monitor_id_show, NULL);
+
+static ssize_t subchannel_id_show(const struct vmbus_channel *channel,
+ char *buf)
+{
+   return sprintf(buf, "%u\n",
+  channel->offermsg.offer.sub_channel_index);
+}
+static VMBUS_CHAN_ATTR_RO(subchannel_id);
+
 static struct attribute *vmbus_chan_attrs[] = {
&chan_attr_out_mask.attr,
&chan_attr_in_mask.attr,
@@ -1265,6 +1280,8 @@ static struct attribute *vmbus_chan_attrs[] = {
&chan_attr_latency.attr,
&chan_attr_interrupts.attr,
&chan_attr_events.attr,
+   &chan_attr_monitor_id.attr,
+   &chan_attr_subchannel_id.attr,
NULL
 };
 
-- 
2.15.1

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


[PATCH v2 01/11] vmbus: make channel attributes static

2018-01-09 Thread Stephen Hemminger
These channel attribute data structures are only used by
vmbus_drv sysfs routines.

Signed-off-by: Stephen Hemminger 
---
 drivers/hv/vmbus_drv.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 610223f0e945..74e256db7d57 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1193,7 +1193,7 @@ static ssize_t out_mask_show(const struct vmbus_channel 
*channel, char *buf)
 
return sprintf(buf, "%u\n", rbi->ring_buffer->interrupt_mask);
 }
-VMBUS_CHAN_ATTR_RO(out_mask);
+static VMBUS_CHAN_ATTR_RO(out_mask);
 
 static ssize_t in_mask_show(const struct vmbus_channel *channel, char *buf)
 {
@@ -1201,7 +1201,7 @@ static ssize_t in_mask_show(const struct vmbus_channel 
*channel, char *buf)
 
return sprintf(buf, "%u\n", rbi->ring_buffer->interrupt_mask);
 }
-VMBUS_CHAN_ATTR_RO(in_mask);
+static VMBUS_CHAN_ATTR_RO(in_mask);
 
 static ssize_t read_avail_show(const struct vmbus_channel *channel, char *buf)
 {
@@ -1209,7 +1209,7 @@ static ssize_t read_avail_show(const struct vmbus_channel 
*channel, char *buf)
 
return sprintf(buf, "%u\n", hv_get_bytes_to_read(rbi));
 }
-VMBUS_CHAN_ATTR_RO(read_avail);
+static VMBUS_CHAN_ATTR_RO(read_avail);
 
 static ssize_t write_avail_show(const struct vmbus_channel *channel, char *buf)
 {
@@ -1217,13 +1217,13 @@ static ssize_t write_avail_show(const struct 
vmbus_channel *channel, char *buf)
 
return sprintf(buf, "%u\n", hv_get_bytes_to_write(rbi));
 }
-VMBUS_CHAN_ATTR_RO(write_avail);
+static VMBUS_CHAN_ATTR_RO(write_avail);
 
 static ssize_t show_target_cpu(const struct vmbus_channel *channel, char *buf)
 {
return sprintf(buf, "%u\n", channel->target_cpu);
 }
-VMBUS_CHAN_ATTR(cpu, S_IRUGO, show_target_cpu, NULL);
+static VMBUS_CHAN_ATTR(cpu, S_IRUGO, show_target_cpu, NULL);
 
 static ssize_t channel_pending_show(const struct vmbus_channel *channel,
char *buf)
@@ -1232,7 +1232,7 @@ static ssize_t channel_pending_show(const struct 
vmbus_channel *channel,
   channel_pending(channel,
   vmbus_connection.monitor_pages[1]));
 }
-VMBUS_CHAN_ATTR(pending, S_IRUGO, channel_pending_show, NULL);
+static VMBUS_CHAN_ATTR(pending, S_IRUGO, channel_pending_show, NULL);
 
 static ssize_t channel_latency_show(const struct vmbus_channel *channel,
char *buf)
@@ -1241,19 +1241,19 @@ static ssize_t channel_latency_show(const struct 
vmbus_channel *channel,
   channel_latency(channel,
   vmbus_connection.monitor_pages[1]));
 }
-VMBUS_CHAN_ATTR(latency, S_IRUGO, channel_latency_show, NULL);
+static VMBUS_CHAN_ATTR(latency, S_IRUGO, channel_latency_show, NULL);
 
 static ssize_t channel_interrupts_show(const struct vmbus_channel *channel, 
char *buf)
 {
return sprintf(buf, "%llu\n", channel->interrupts);
 }
-VMBUS_CHAN_ATTR(interrupts, S_IRUGO, channel_interrupts_show, NULL);
+static VMBUS_CHAN_ATTR(interrupts, S_IRUGO, channel_interrupts_show, NULL);
 
 static ssize_t channel_events_show(const struct vmbus_channel *channel, char 
*buf)
 {
return sprintf(buf, "%llu\n", channel->sig_events);
 }
-VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL);
+static VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL);
 
 static struct attribute *vmbus_chan_attrs[] = {
&chan_attr_out_mask.attr,
-- 
2.15.1

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


[PATCH v2 00/11] vmbus and uio_hv_generice improvements

2018-01-09 Thread Stephen Hemminger
These patches improve vmbus sysfs support for better management and
make the UIO hyperv driver usable. The original version did not enough
functionality to support userspace network drivers. Needed support
of send/receive buffers and sub channels.

Patches against current char-misc-next

v2
  - revise documentation files as well

Stephen Hemminger (11):
  vmbus: make channel attributes static
  vmbus: fix ABI documentation
  vmbus: add monitor_id and subchannel_id to sysfs per channel
  uio_hv_generic: fix documentation and configuration comments
  uio_hv_generic: use standard mmap for resources
  uio_hv_generic: make ring size configurable
  uio_hv_generic: create send and receive buffers
  uio_hv_generic: use ISR callback method
  uio_hv_generic: check that host supports monitor page
  uio_hv_generic: add rescind support
  uio_hv_generic: support sub-channels

 Documentation/ABI/stable/sysfs-bus-vmbus |  53 --
 Documentation/driver-api/uio-howto.rst   |  31 +++-
 drivers/hv/vmbus_drv.c   |  35 +++-
 drivers/uio/uio_hv_generic.c | 300 +++
 4 files changed, 348 insertions(+), 71 deletions(-)

-- 
2.15.1

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


[PATCH][staging-next] ncpfs: remove redundant cast of struct ncp_inode_info

2018-01-09 Thread Colin King
From: Colin Ian King 

Casting a value returned by memory an allocation function is
not required and can be removed. Also add in a newline after before
the first statement. Code clean up as suggested by coccinelle.

Signed-off-by: Colin Ian King 
---
 drivers/staging/ncpfs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ncpfs/inode.c b/drivers/staging/ncpfs/inode.c
index 41de88cdc053..bb411610a071 100644
--- a/drivers/staging/ncpfs/inode.c
+++ b/drivers/staging/ncpfs/inode.c
@@ -53,7 +53,8 @@ static struct kmem_cache * ncp_inode_cachep;
 static struct inode *ncp_alloc_inode(struct super_block *sb)
 {
struct ncp_inode_info *ei;
-   ei = (struct ncp_inode_info *)kmem_cache_alloc(ncp_inode_cachep, 
GFP_KERNEL);
+
+   ei = kmem_cache_alloc(ncp_inode_cachep, GFP_KERNEL);
if (!ei)
return NULL;
return &ei->vfs_inode;
-- 
2.15.1

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


Re: [PATCH 02/10] vmbus: add monitor_id and subchannel_id to sysfs per channel

2018-01-09 Thread Greg KH
On Thu, Jan 04, 2018 at 02:13:26PM -0800, Stephen Hemminger wrote:
> Useful to identify which network queue is associated with
> which vmbus channel.
> 
> Signed-off-by: Stephen Hemminger 
> ---
>  drivers/hv/vmbus_drv.c | 17 +
>  1 file changed, 17 insertions(+)

No Documentation/ABI/ update?

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


Re: [PATCH 2/2] drivers: android: Fix logtags in methods

2018-01-09 Thread Greg Kroah-Hartman
On Fri, Dec 22, 2017 at 07:37:03PM +0530, Harsh Shandilya wrote:
> From: Harsh Shandilya 
> 
> Several methods in the driver were hardcoding
> the function name in their logging calls which
> is a checkpatch violation. Utilise the __func__
> macro to avoid needing to add the function name
> as is to the string.
> 
> Test: logtags in dmesg remain unaffected before
> and after the patch.
> 
> Signed-off-by: Harsh Shandilya 
> 
> Cc: Greg Kroah-Hartman 
> Cc: "Arve Hjønnevåg" 
> Cc: Todd Kjos 
> Cc: Martijn Coenen 
> Cc: de...@driverdev.osuosl.org
> Cc: linux-ker...@vger.kernel.org
> ---
>  drivers/android/binder.c | 13 +++--
>  1 file changed, 7 insertions(+), 6 deletions(-)

Patch does not apply to my tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Luis de Bethencourt
On 01/09/2018 04:46 PM, Greg Kroah-Hartman wrote:
> On Tue, Jan 09, 2018 at 04:17:01PM +, Luis de Bethencourt wrote:
>> Fix trailing semicolon.
> 
> Please be more explicit.  That says what it does, but not _why_ :)
> 

After walking around with my head down in shame I sent a new version.

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


[PATCH v3] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Luis de Bethencourt
The trailing semicolon is an empty statement that does no operation.
Removing it since it doesn't do anything.

Signed-off-by: Luis de Bethencourt 
---

Hi all,

Testing the waters with this cleanup patch. If it is OK to send these there are
two very similar ones, plus more in general. Happy to send them.

I have a C.H.I.P. board, which is why this driver is interesting for me to play
with.

Thanks for the review so far,
Luis

Changes since v1:
  - Added a changelog body to the commit message

Changes since v2:
  - New and improved changelog explaining why the reason for the fix

 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 3fca0c2d4c8d..da59496f6e04 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -967,7 +967,7 @@ static int rtw_wx_set_mode(struct net_device *dev, struct 
iw_request_info *a,
break;
 
default :
-   ret = -EINVAL;;
+   ret = -EINVAL;
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("\n 
Mode: %s is not supported \n", iw_operation_mode[wrqu->mode]));
goto exit;
}
-- 
2.15.1

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


Re: [PATCH] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Greg Kroah-Hartman
On Tue, Jan 09, 2018 at 05:11:52PM +0100, Hans de Goede wrote:
> Hi,
> 
> On 09-01-18 17:02, Luis de Bethencourt wrote:
> > On 01/09/2018 03:20 PM, Greg Kroah-Hartman wrote:
> > > On Tue, Jan 09, 2018 at 03:09:27PM +, Luis de Bethencourt wrote:
> > > > Signed-off-by: Luis de Bethencourt 
> > > > ---
> > > 
> > > I can't take patches without any changelog text, sorry :(
> > > 
> > 
> > Hi Greg,
> > 
> > I have done some research around previous patches to this driver and
> > I am not entirely sure what you mean.
> > 
> > Sorry, but I need to ask before sending a v2.
> > 
> > Do you mind I'm missing a small summary in the commit message? Fix is
> > so small I thought just the commit subject would be enough.
> > 
> > It is something different let me know and I will correct it.
> 
> I'm not entirely sure, but I believe Greg may have a script for this,
> given the amount of mail he receives and commits without a changelog
> in general not being a good idea.

No script for this, yet :)

> What I usually do with trivial patches like this, is simply take the
> part after the last : in the subject, append a "." and voila you've
> a changelog txt. So in this case that would simply be:
> 
> Fix trailing semicolon.

Ick, no, come on, you can do it correctly...

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


Re: [PATCH v2] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Greg Kroah-Hartman
On Tue, Jan 09, 2018 at 04:17:01PM +, Luis de Bethencourt wrote:
> Fix trailing semicolon.

Please be more explicit.  That says what it does, but not _why_ :)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/1] staging: pi433: Cleanup codestyle, indent statements after case labels

2018-01-09 Thread Michael Panzlaff
This patch changes the indentation of the statements after case labels.
The linux coding guidelines do not explicitly mentiond this but pretty
much all existing code doesn't put any statements into the same line of
their belonging case labels. Therefore this adapts to the more usual style.

Please note that there is still a lot of > 80 character lines which will
cause checkpatch warnings. This patch does not intent to fix this
already existing issue.

Signed-off-by: Michael Panzlaff 
Signed-off-by: Tillmann Zipperer 
---
 drivers/staging/pi433/rf69.c | 237 ---
 1 file changed, 158 insertions(+), 79 deletions(-)

diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index bdd00f7..7ccdff6 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -111,11 +111,16 @@ static inline int rf69_read_mod_write(struct spi_device 
*spi, u8 reg, u8 mask, u
 int rf69_set_mode(struct spi_device *spi, enum mode mode)
 {
switch (mode) {
-   case transmit:return rf69_read_mod_write(spi, REG_OPMODE, 
MASK_OPMODE_MODE, OPMODE_MODE_TRANSMIT);
-   case receive: return rf69_read_mod_write(spi, REG_OPMODE, 
MASK_OPMODE_MODE, OPMODE_MODE_RECEIVE);
-   case synthesizer: return rf69_read_mod_write(spi, REG_OPMODE, 
MASK_OPMODE_MODE, OPMODE_MODE_SYNTHESIZER);
-   case standby: return rf69_read_mod_write(spi, REG_OPMODE, 
MASK_OPMODE_MODE, OPMODE_MODE_STANDBY);
-   case mode_sleep:  return rf69_read_mod_write(spi, REG_OPMODE, 
MASK_OPMODE_MODE, OPMODE_MODE_SLEEP);
+   case transmit:
+   return rf69_read_mod_write(spi, REG_OPMODE, MASK_OPMODE_MODE, 
OPMODE_MODE_TRANSMIT);
+   case receive:
+   return rf69_read_mod_write(spi, REG_OPMODE, MASK_OPMODE_MODE, 
OPMODE_MODE_RECEIVE);
+   case synthesizer:
+   return rf69_read_mod_write(spi, REG_OPMODE, MASK_OPMODE_MODE, 
OPMODE_MODE_SYNTHESIZER);
+   case standby:
+   return rf69_read_mod_write(spi, REG_OPMODE, MASK_OPMODE_MODE, 
OPMODE_MODE_STANDBY);
+   case mode_sleep:
+   return rf69_read_mod_write(spi, REG_OPMODE, MASK_OPMODE_MODE, 
OPMODE_MODE_SLEEP);
default:
dev_dbg(&spi->dev, "set: illegal input param");
return -EINVAL;
@@ -134,8 +139,10 @@ int rf69_set_data_mode(struct spi_device *spi, u8 
data_mode)
 int rf69_set_modulation(struct spi_device *spi, enum modulation modulation)
 {
switch (modulation) {
-   case OOK: return rf69_read_mod_write(spi, REG_DATAMODUL, 
MASK_DATAMODUL_MODULATION_TYPE, DATAMODUL_MODULATION_TYPE_OOK);
-   case FSK: return rf69_read_mod_write(spi, REG_DATAMODUL, 
MASK_DATAMODUL_MODULATION_TYPE, DATAMODUL_MODULATION_TYPE_FSK);
+   case OOK:
+   return rf69_read_mod_write(spi, REG_DATAMODUL, 
MASK_DATAMODUL_MODULATION_TYPE, DATAMODUL_MODULATION_TYPE_OOK);
+   case FSK:
+   return rf69_read_mod_write(spi, REG_DATAMODUL, 
MASK_DATAMODUL_MODULATION_TYPE, DATAMODUL_MODULATION_TYPE_FSK);
default:
dev_dbg(&spi->dev, "set: illegal input param");
return -EINVAL;
@@ -149,9 +156,12 @@ static enum modulation rf69_get_modulation(struct 
spi_device *spi)
currentValue = rf69_read_reg(spi, REG_DATAMODUL);
 
switch (currentValue & MASK_DATAMODUL_MODULATION_TYPE) {
-   case DATAMODUL_MODULATION_TYPE_OOK: return OOK;
-   case DATAMODUL_MODULATION_TYPE_FSK: return FSK;
-   default:return UNDEF;
+   case DATAMODUL_MODULATION_TYPE_OOK:
+   return OOK;
+   case DATAMODUL_MODULATION_TYPE_FSK:
+   return FSK;
+   default:
+   return UNDEF;
}
 }
 
@@ -161,19 +171,26 @@ int rf69_set_modulation_shaping(struct spi_device *spi,
switch (rf69_get_modulation(spi)) {
case FSK:
switch (mod_shaping) {
-   case SHAPING_OFF: return rf69_read_mod_write(spi, 
REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, 
DATAMODUL_MODULATION_SHAPE_NONE);
-   case SHAPING_1_0: return rf69_read_mod_write(spi, 
REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_1_0);
-   case SHAPING_0_5: return rf69_read_mod_write(spi, 
REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_0_5);
-   case SHAPING_0_3: return rf69_read_mod_write(spi, 
REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_0_3);
+   case SHAPING_OFF:
+   return rf69_read_mod_write(spi, REG_DATAMODUL, 
MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_NONE);
+   case SHAPING_1_0:
+   return rf69_read_mod_write(spi, REG_DATAMODUL, 
MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_1_0);
+   case SHAPING_0_5:
+   return rf69_read_mod_write(spi, REG_DATAMODUL, 
MASK_DA

[PATCH v2] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Luis de Bethencourt
Fix trailing semicolon.

Signed-off-by: Luis de Bethencourt 
---

Changes since v1:
  - Added a changelog body to the commit message

 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 3fca0c2d4c8d..da59496f6e04 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -967,7 +967,7 @@ static int rtw_wx_set_mode(struct net_device *dev, struct 
iw_request_info *a,
break;
 
default :
-   ret = -EINVAL;;
+   ret = -EINVAL;
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("\n 
Mode: %s is not supported \n", iw_operation_mode[wrqu->mode]));
goto exit;
}
-- 
2.15.1

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


Re: [PATCH] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Luis de Bethencourt
On 01/09/2018 04:11 PM, Hans de Goede wrote:
> Hi,
> 
> On 09-01-18 17:02, Luis de Bethencourt wrote:
>> On 01/09/2018 03:20 PM, Greg Kroah-Hartman wrote:
>>> On Tue, Jan 09, 2018 at 03:09:27PM +, Luis de Bethencourt wrote:
 Signed-off-by: Luis de Bethencourt 
 ---
>>>
>>> I can't take patches without any changelog text, sorry :(
>>>
>>
>> Hi Greg,
>>
>> I have done some research around previous patches to this driver and
>> I am not entirely sure what you mean.
>>
>> Sorry, but I need to ask before sending a v2.
>>
>> Do you mind I'm missing a small summary in the commit message? Fix is
>> so small I thought just the commit subject would be enough.
>>
>> It is something different let me know and I will correct it.
> 
> I'm not entirely sure, but I believe Greg may have a script for this,
> given the amount of mail he receives and commits without a changelog
> in general not being a good idea.
> 
> What I usually do with trivial patches like this, is simply take the
> part after the last : in the subject, append a "." and voila you've
> a changelog txt. So in this case that would simply be:
> 
> Fix trailing semicolon.
> 
> Regards,
> 
> Hans
> 
> 
> 

Hi Hans,

That was my plan! Resending.

I like your detailed step-by-step guide :)

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


Re: [PATCH] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Hans de Goede

Hi,

On 09-01-18 17:02, Luis de Bethencourt wrote:

On 01/09/2018 03:20 PM, Greg Kroah-Hartman wrote:

On Tue, Jan 09, 2018 at 03:09:27PM +, Luis de Bethencourt wrote:

Signed-off-by: Luis de Bethencourt 
---


I can't take patches without any changelog text, sorry :(



Hi Greg,

I have done some research around previous patches to this driver and
I am not entirely sure what you mean.

Sorry, but I need to ask before sending a v2.

Do you mind I'm missing a small summary in the commit message? Fix is
so small I thought just the commit subject would be enough.

It is something different let me know and I will correct it.


I'm not entirely sure, but I believe Greg may have a script for this,
given the amount of mail he receives and commits without a changelog
in general not being a good idea.

What I usually do with trivial patches like this, is simply take the
part after the last : in the subject, append a "." and voila you've
a changelog txt. So in this case that would simply be:

Fix trailing semicolon.

Regards,

Hans



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


Re: [PATCH] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Luis de Bethencourt
On 01/09/2018 03:20 PM, Greg Kroah-Hartman wrote:
> On Tue, Jan 09, 2018 at 03:09:27PM +, Luis de Bethencourt wrote:
>> Signed-off-by: Luis de Bethencourt 
>> ---
> 
> I can't take patches without any changelog text, sorry :(
> 

Hi Greg,

I have done some research around previous patches to this driver and
I am not entirely sure what you mean.

Sorry, but I need to ask before sending a v2.

Do you mind I'm missing a small summary in the commit message? Fix is
so small I thought just the commit subject would be enough.

It is something different let me know and I will correct it.

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


Re: [-next PATCH 3/4] treewide: Use DEVICE_ATTR_RO

2018-01-09 Thread Greg Kroah-Hartman
On Thu, Dec 21, 2017 at 11:34:10AM +0200, Sakari Ailus wrote:
> Hi Joe,
> 
> On Tue, Dec 19, 2017 at 10:15:08AM -0800, Joe Perches wrote:
> > diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c 
> > b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> > index a1c81c12718c..4338b8a1309f 100644
> > --- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> > +++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
> > @@ -158,10 +158,10 @@ static ssize_t dynamic_pool_show(struct device *dev,
> > return ret;
> >  };
> >  
> > -static DEVICE_ATTR(active_bo, 0444, active_bo_show, NULL);
> > -static DEVICE_ATTR(free_bo, 0444, free_bo_show, NULL);
> > -static DEVICE_ATTR(reserved_pool, 0444, reserved_pool_show, NULL);
> > -static DEVICE_ATTR(dynamic_pool, 0444, dynamic_pool_show, NULL);
> > +static DEVICE_ATTR_RO(active_bo);
> > +static DEVICE_ATTR_RO(free_bo);
> > +static DEVICE_ATTR_RO(reserved_pool);
> > +static DEVICE_ATTR_RO(dynamic_pool);
> >  
> >  static struct attribute *sysfs_attrs_ctrl[] = {
> > &dev_attr_active_bo.attr,
> 
> I have the exact same changes queued up in my tree. As there seem to be no
> dependencies to other patches in your set, how about dropping this chunk?

I've now dropped it, thanks.

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


Re: [PATCH] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Greg Kroah-Hartman
On Tue, Jan 09, 2018 at 03:09:27PM +, Luis de Bethencourt wrote:
> Signed-off-by: Luis de Bethencourt 
> ---

I can't take patches without any changelog text, sorry :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: Fix trailing semicolon

2018-01-09 Thread Luis de Bethencourt
Signed-off-by: Luis de Bethencourt 
---

Hi all,

Testing the waters with this cleanup patch. If it is OK to send these there are
two very similar ones, plus more in general. Happy to send them.

I have a C.H.I.P. board, which is why this driver is interesting for me to play
with.

Thanks,
Luis


 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 3fca0c2d4c8d..da59496f6e04 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -967,7 +967,7 @@ static int rtw_wx_set_mode(struct net_device *dev, struct 
iw_request_info *a,
break;
 
default :
-   ret = -EINVAL;;
+   ret = -EINVAL;
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("\n 
Mode: %s is not supported \n", iw_operation_mode[wrqu->mode]));
goto exit;
}
-- 
2.15.1

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


[PATCH v2] staging: pi433: align function parameters with open parenthesis

2018-01-09 Thread Valentin Vidic
Fixes checkpatch warnings:

  CHECK: Alignment should match open parenthesis

Signed-off-by: Valentin Vidic 
---
 v2: add missing Signed-off-by

 drivers/staging/pi433/pi433_if.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index f56425ffbe90..edcd7e798f99 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -799,7 +799,7 @@ pi433_read(struct file *filp, char __user *buf, size_t 
size, loff_t *f_pos)
 
 static ssize_t
 pi433_write(struct file *filp, const char __user *buf,
-   size_t count, loff_t *f_pos)
+   size_t count, loff_t *f_pos)
 {
struct pi433_instance   *instance;
struct pi433_device *device;
@@ -870,17 +870,17 @@ pi433_ioctl(struct file *filp, unsigned int cmd, unsigned 
long arg)
switch (cmd) {
case PI433_IOC_RD_TX_CFG:
if (copy_to_user(argp, &instance->tx_cfg,
-   sizeof(struct pi433_tx_cfg)))
+sizeof(struct pi433_tx_cfg)))
return -EFAULT;
break;
case PI433_IOC_WR_TX_CFG:
if (copy_from_user(&instance->tx_cfg, argp,
-   sizeof(struct pi433_tx_cfg)))
+  sizeof(struct pi433_tx_cfg)))
return -EFAULT;
break;
case PI433_IOC_RD_RX_CFG:
if (copy_to_user(argp, &device->rx_cfg,
-   sizeof(struct pi433_rx_cfg)))
+sizeof(struct pi433_rx_cfg)))
return -EFAULT;
break;
case PI433_IOC_WR_RX_CFG:
@@ -893,7 +893,7 @@ pi433_ioctl(struct file *filp, unsigned int cmd, unsigned 
long arg)
}
 
if (copy_from_user(&device->rx_cfg, argp,
-   sizeof(struct pi433_rx_cfg))) {
+  sizeof(struct pi433_rx_cfg))) {
mutex_unlock(&device->rx_lock);
return -EFAULT;
}
-- 
2.15.1

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


Re: [PATCH] staging: pi433: align function parameters with open parenthesis

2018-01-09 Thread Greg Kroah-Hartman
On Mon, Jan 08, 2018 at 06:39:33PM +0100, Valentin Vidic wrote:
> Fixes checkpatch warnings:
> 
>   CHECK: Alignment should match open parenthesis
> ---
>  drivers/staging/pi433/pi433_if.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

No signed-off-by line :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: pi433: remove unnecessary parentheses

2018-01-09 Thread Greg Kroah-Hartman
On Mon, Jan 08, 2018 at 06:38:55PM +0100, Valentin Vidic wrote:
> Fixes checkpatch warnings:
> 
>   CHECK: Unnecessary parentheses around 'mantisse != mantisse16'
>   CHECK: Unnecessary parentheses around 'mantisse != mantisse20'
>   CHECK: Unnecessary parentheses around 'mantisse != mantisse24'
> 
> Signed-off-by: Valentin Vidic 
> ---
>  drivers/staging/pi433/rf69.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
> index bdd00f750765..a07fc6bc27f7 100644
> --- a/drivers/staging/pi433/rf69.c
> +++ b/drivers/staging/pi433/rf69.c
> @@ -391,9 +391,9 @@ static int rf69_set_bandwidth_intern(struct spi_device 
> *spi, u8 reg,
>   return -EINVAL;
>   }
>  
> - if ((mantisse != mantisse16) &&
> - (mantisse != mantisse20) &&
> - (mantisse != mantisse24)) {
> + if (mantisse != mantisse16 &&
> + mantisse != mantisse20 &&
> + mantisse != mantisse24) {

I'm getting really tired of seeing this checkpatch warning, when it's a
major pain.

Joe, can you please turn these off.  Patches like this will force people
to have to remember that != is higher precidence than &&.  The original
code here was just fine.

thanks,

greg k-h

>   dev_dbg(&spi->dev, "set: illegal input param");
>   return -EINVAL;
>   }
> -- 
> 2.15.1
> 
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: wilc1000: removed typedef from enum BSSTYPE_T

2018-01-09 Thread Greg KH
On Tue, Jan 09, 2018 at 02:37:42PM +0530, Ajay Singh wrote:
> This patch removes typedef from enum BSSTYPE_T and
> rename it to bss_types.
> 
> It fixes "WARNING: do not add new typdefs" warning
> reported by checkpatch.pl.
> 
> Signed-off-by: ajaysk 

Hi,

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

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

- You sent multiple patches, yet no indication of which ones should be
  applied in which order.  Greg could just guess, but if you are
  receiving this email, he guessed wrong and the patches didn't apply.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/SubmittingPatches for a description of how
  to do this so that Greg has a chance to apply these correctly.

- You did not use your real name.  Signed-off-by: and From: has to have
  a real name associated with it.  Use whatever you sign legal documents
  with, no anonymous patches are allowed.

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

thanks,

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


答复: [PATCH] ION: Sys_heap: fix the incorrect pool->gfp_mask setting

2018-01-09 Thread Zengtao (B)
>-邮件原件-
>发件人: Dan Carpenter [mailto:dan.carpen...@oracle.com]
>发送时间: 2018年1月9日 17:14
>收件人: Chenfeng (puck) 
>抄送: Zengtao (B) ; labb...@redhat.com;
>sumit.sem...@linaro.org; gre...@linuxfoundation.org; a...@android.com;
>tk...@android.com; m...@android.com; de...@driverdev.osuosl.org;
>linux-ker...@vger.kernel.org
>主题: Re: [PATCH] ION: Sys_heap: fix the incorrect pool->gfp_mask setting
>
>On Tue, Jan 09, 2018 at 11:30:09AM +0800, Chen Feng wrote:
>>
>>
>> On 2018/1/9 18:43, Zeng Tao wrote:
>> > This issue is introduced by the commit  ("ION: Sys_heap:
>> > Add cached pool to spead up cached buffer alloc"),
>
>Use the Fixes tag.
>
>Fixes: e7f63771b60e ("ION: Sys_heap: Add cached pool to spead up cached
>buffer alloc")
>
Agree, thanks. 

>> the gfp_mask low
>> > order pool is overlapped by the high order inside the loop, so the
>> > gfp_mask of all pools are set to high_order_gfp_flags.
>> >
>>
>> Thanks
>> > Signed-off-by: Zeng Tao 
>> > ---
>> >  drivers/staging/android/ion/ion_system_heap.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/staging/android/ion/ion_system_heap.c
>> > b/drivers/staging/android/ion/ion_system_heap.c
>> > index 4dc5d7a..b6386be 100644
>> > --- a/drivers/staging/android/ion/ion_system_heap.c
>> > +++ b/drivers/staging/android/ion/ion_system_heap.c
>> > @@ -298,10 +298,10 @@ static int ion_system_heap_create_pools(struct
>ion_page_pool **pools,
>> >bool cached)
>> >  {
>> >int i;
>> > -  gfp_t gfp_flags = low_order_gfp_flags;
>> >
>> >for (i = 0; i < NUM_ORDERS; i++) {
>> >struct ion_page_pool *pool;
>> > +  gfp_t gfp_flags = low_order_gfp_flags;
>>
>> Not define here. Better "gfp_flags = low_order_gfp_flags"
>
>Either way is fine... 
>

>regards,
>dan carpenter

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


[PATCH 5/5] staging: ccree: dma mask is type u64

2018-01-09 Thread Gilad Ben-Yossef
The dma mask var was defined as dma_addr_t but should be
u64. This showed as a sparse warning when building for 32 bit.
Fix it by changing type to u64 and drop the cast.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/staging/ccree/cc_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ccree/cc_driver.c 
b/drivers/staging/ccree/cc_driver.c
index b49bc25..6682d9d 100644
--- a/drivers/staging/ccree/cc_driver.c
+++ b/drivers/staging/ccree/cc_driver.c
@@ -156,7 +156,7 @@ static int init_cc_resources(struct platform_device 
*plat_dev)
struct device *dev = &plat_dev->dev;
struct device_node *np = dev->of_node;
u32 signature_val;
-   dma_addr_t dma_mask;
+   u64 dma_mask;
int rc = 0;
 
new_drvdata = devm_kzalloc(dev, sizeof(*new_drvdata), GFP_KERNEL);
@@ -205,7 +205,7 @@ static int init_cc_resources(struct platform_device 
*plat_dev)
if (!plat_dev->dev.dma_mask)
plat_dev->dev.dma_mask = &plat_dev->dev.coherent_dma_mask;
 
-   dma_mask = (dma_addr_t)(DMA_BIT_MASK(DMA_BIT_MASK_LEN));
+   dma_mask = DMA_BIT_MASK(DMA_BIT_MASK_LEN);
while (dma_mask > 0x7fffUL) {
if (dma_supported(&plat_dev->dev, dma_mask)) {
rc = dma_set_coherent_mask(&plat_dev->dev, dma_mask);
-- 
2.7.4

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


[PATCH 4/5] staging: ccree: make stub function static inline

2018-01-09 Thread Gilad Ben-Yossef
The debugfs interface defines stub function if debugfs is not
enabled, which were missing the 'static inline' qualifiers causing
sparse warnings.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/staging/ccree/cc_debugfs.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ccree/cc_debugfs.h 
b/drivers/staging/ccree/cc_debugfs.h
index 354ec17..5b5320e 100644
--- a/drivers/staging/ccree/cc_debugfs.h
+++ b/drivers/staging/ccree/cc_debugfs.h
@@ -13,19 +13,19 @@ void cc_debugfs_fini(struct cc_drvdata *drvdata);
 
 #else
 
-int cc_debugfs_global_init(void)
+static inline int cc_debugfs_global_init(void)
 {
return 0;
 }
 
-void cc_debugfs_global_fini(void) {}
+static inline void cc_debugfs_global_fini(void) {}
 
-int cc_debugfs_init(struct cc_drvdata *drvdata)
+static inline int cc_debugfs_init(struct cc_drvdata *drvdata)
 {
return 0;
 }
 
-void cc_debugfs_fini(struct cc_drvdata *drvdata) {}
+static inline void cc_debugfs_fini(struct cc_drvdata *drvdata) {}
 
 #endif
 
-- 
2.7.4

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


[PATCH 1/5] staging: ccree: use a consistent file naming convention

2018-01-09 Thread Gilad Ben-Yossef
The ccree driver source files were using an inconsistent
naming convention stemming from what the company was called
when they were added.

Move to a single consistent naming convention for better
code readability.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/staging/ccree/Makefile   |  6 +++---
 drivers/staging/ccree/{ssi_aead.c => cc_aead.c}  | 12 ++--
 drivers/staging/ccree/{ssi_aead.h => cc_aead.h}  |  2 +-
 .../ccree/{ssi_buffer_mgr.c => cc_buffer_mgr.c}  |  8 
 .../ccree/{ssi_buffer_mgr.h => cc_buffer_mgr.h}  |  4 ++--
 drivers/staging/ccree/{ssi_cipher.c => cc_cipher.c}  |  8 
 drivers/staging/ccree/{ssi_cipher.h => cc_cipher.h}  |  6 +++---
 drivers/staging/ccree/cc_debugfs.c   |  2 +-
 drivers/staging/ccree/{ssi_driver.c => cc_driver.c}  | 20 ++--
 drivers/staging/ccree/{ssi_driver.h => cc_driver.h}  |  6 +++---
 drivers/staging/ccree/{ssi_fips.c => cc_fips.c}  |  4 ++--
 drivers/staging/ccree/{ssi_fips.h => cc_fips.h}  |  0
 drivers/staging/ccree/{ssi_hash.c => cc_hash.c}  | 10 +-
 drivers/staging/ccree/{ssi_hash.h => cc_hash.h}  |  4 ++--
 drivers/staging/ccree/{dx_host.h => cc_host_regs.h}  |  0
 drivers/staging/ccree/cc_hw_queue_defs.h |  2 +-
 drivers/staging/ccree/{ssi_ivgen.c => cc_ivgen.c}| 10 +-
 drivers/staging/ccree/{ssi_ivgen.h => cc_ivgen.h}|  0
 .../ccree/{dx_crys_kernel.h => cc_kernel_regs.h} |  0
 drivers/staging/ccree/{ssi_pm.c => cc_pm.c}  | 14 +++---
 drivers/staging/ccree/{ssi_pm.h => cc_pm.h}  |  4 ++--
 .../ccree/{ssi_request_mgr.c => cc_request_mgr.c}| 10 +-
 .../ccree/{ssi_request_mgr.h => cc_request_mgr.h}|  2 +-
 .../staging/ccree/{ssi_sram_mgr.c => cc_sram_mgr.c}  |  4 ++--
 .../staging/ccree/{ssi_sram_mgr.h => cc_sram_mgr.h}  |  0
 25 files changed, 69 insertions(+), 69 deletions(-)
 rename drivers/staging/ccree/{ssi_aead.c => cc_aead.c} (99%)
 rename drivers/staging/ccree/{ssi_aead.h => cc_aead.h} (99%)
 rename drivers/staging/ccree/{ssi_buffer_mgr.c => cc_buffer_mgr.c} (99%)
 rename drivers/staging/ccree/{ssi_buffer_mgr.h => cc_buffer_mgr.h} (97%)
 rename drivers/staging/ccree/{ssi_cipher.c => cc_cipher.c} (99%)
 rename drivers/staging/ccree/{ssi_cipher.h => cc_cipher.h} (95%)
 rename drivers/staging/ccree/{ssi_driver.c => cc_driver.c} (98%)
 rename drivers/staging/ccree/{ssi_driver.h => cc_driver.h} (98%)
 rename drivers/staging/ccree/{ssi_fips.c => cc_fips.c} (98%)
 rename drivers/staging/ccree/{ssi_fips.h => cc_fips.h} (100%)
 rename drivers/staging/ccree/{ssi_hash.c => cc_hash.c} (99%)
 rename drivers/staging/ccree/{ssi_hash.h => cc_hash.h} (98%)
 rename drivers/staging/ccree/{dx_host.h => cc_host_regs.h} (100%)
 rename drivers/staging/ccree/{ssi_ivgen.c => cc_ivgen.c} (98%)
 rename drivers/staging/ccree/{ssi_ivgen.h => cc_ivgen.h} (100%)
 rename drivers/staging/ccree/{dx_crys_kernel.h => cc_kernel_regs.h} (100%)
 rename drivers/staging/ccree/{ssi_pm.c => cc_pm.c} (93%)
 rename drivers/staging/ccree/{ssi_pm.h => cc_pm.h} (95%)
 rename drivers/staging/ccree/{ssi_request_mgr.c => cc_request_mgr.c} (99%)
 rename drivers/staging/ccree/{ssi_request_mgr.h => cc_request_mgr.h} (98%)
 rename drivers/staging/ccree/{ssi_sram_mgr.c => cc_sram_mgr.c} (98%)
 rename drivers/staging/ccree/{ssi_sram_mgr.h => cc_sram_mgr.h} (100%)

diff --git a/drivers/staging/ccree/Makefile b/drivers/staging/ccree/Makefile
index c107e25..bdc2797 100644
--- a/drivers/staging/ccree/Makefile
+++ b/drivers/staging/ccree/Makefile
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-$(CONFIG_CRYPTO_DEV_CCREE) := ccree.o
-ccree-y := ssi_driver.o ssi_buffer_mgr.o ssi_request_mgr.o ssi_cipher.o 
ssi_hash.o ssi_aead.o ssi_ivgen.o ssi_sram_mgr.o
-ccree-$(CONFIG_CRYPTO_FIPS) += ssi_fips.o
+ccree-y := cc_driver.o cc_buffer_mgr.o cc_request_mgr.o cc_cipher.o cc_hash.o 
cc_aead.o cc_ivgen.o cc_sram_mgr.o
+ccree-$(CONFIG_CRYPTO_FIPS) += cc_fips.o
 ccree-$(CONFIG_DEBUG_FS) += cc_debugfs.o
-ccree-$(CONFIG_PM) += ssi_pm.o
+ccree-$(CONFIG_PM) += cc_pm.o
diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/cc_aead.c
similarity index 99%
rename from drivers/staging/ccree/ssi_aead.c
rename to drivers/staging/ccree/cc_aead.c
index 6f41a00..da74423 100644
--- a/drivers/staging/ccree/ssi_aead.c
+++ b/drivers/staging/ccree/cc_aead.c
@@ -15,12 +15,12 @@
 #include 
 #include 
 #include 
-#include "ssi_driver.h"
-#include "ssi_buffer_mgr.h"
-#include "ssi_aead.h"
-#include "ssi_request_mgr.h"
-#include "ssi_hash.h"
-#include "ssi_sram_mgr.h"
+#include "cc_driver.h"
+#include "cc_buffer_mgr.h"
+#include "cc_aead.h"
+#include "cc_request_mgr.h"
+#include "cc_hash.h"
+#include "cc_sram_mgr.h"
 
 #define template_aead  template_u.aead
 
diff --git a/drivers/staging/ccree/ssi_aead.h b/drivers/staging/ccree/cc_aead.h
similarity index 99%
rename from drivers/staging/ccree/ssi_aead.h
rename to drivers/staging/ccree/cc_aead.h

[PATCH 3/5] staging: ccree: add missing include

2018-01-09 Thread Gilad Ben-Yossef
Add the missing include of include file with function declarations.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/staging/ccree/cc_debugfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/ccree/cc_debugfs.c 
b/drivers/staging/ccree/cc_debugfs.c
index f927a73..08f8db4 100644
--- a/drivers/staging/ccree/cc_debugfs.c
+++ b/drivers/staging/ccree/cc_debugfs.c
@@ -6,6 +6,7 @@
 #include 
 #include "cc_driver.h"
 #include "cc_crypto_ctx.h"
+#include "cc_debugfs.h"
 
 struct cc_debugfs_ctx {
struct dentry *dir;
-- 
2.7.4

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


[PATCH 0/5] more cleanups

2018-01-09 Thread Gilad Ben-Yossef
File name consistency renames, include files diet and address
some sparse warnings.

Gilad Ben-Yossef (5):
  staging: ccree: use a consistent file naming convention
  staging: ccree: remove unneeded includes
  staging: ccree: add missing include
  staging: ccree: make stub function static inline
  staging: ccree: dma mask is type u64

 drivers/staging/ccree/Makefile |  6 +--
 drivers/staging/ccree/{ssi_aead.c => cc_aead.c}| 19 +++-
 drivers/staging/ccree/{ssi_aead.h => cc_aead.h}|  2 +-
 .../ccree/{ssi_buffer_mgr.c => cc_buffer_mgr.c}| 14 ++
 .../ccree/{ssi_buffer_mgr.h => cc_buffer_mgr.h}|  4 +-
 .../staging/ccree/{ssi_cipher.c => cc_cipher.c}| 12 ++---
 .../staging/ccree/{ssi_cipher.h => cc_cipher.h}|  6 +--
 drivers/staging/ccree/cc_debugfs.c |  3 +-
 drivers/staging/ccree/cc_debugfs.h |  8 ++--
 .../staging/ccree/{ssi_driver.c => cc_driver.c}| 55 +-
 .../staging/ccree/{ssi_driver.h => cc_driver.h}|  6 +--
 drivers/staging/ccree/{ssi_fips.c => cc_fips.c}|  4 +-
 drivers/staging/ccree/{ssi_fips.h => cc_fips.h}|  0
 drivers/staging/ccree/{ssi_hash.c => cc_hash.c}| 12 ++---
 drivers/staging/ccree/{ssi_hash.h => cc_hash.h}|  4 +-
 .../staging/ccree/{dx_host.h => cc_host_regs.h}|  0
 drivers/staging/ccree/cc_hw_queue_defs.h   |  2 +-
 drivers/staging/ccree/{ssi_ivgen.c => cc_ivgen.c}  | 11 ++---
 drivers/staging/ccree/{ssi_ivgen.h => cc_ivgen.h}  |  0
 .../ccree/{dx_crys_kernel.h => cc_kernel_regs.h}   |  0
 drivers/staging/ccree/{ssi_pm.c => cc_pm.c}| 16 +++
 drivers/staging/ccree/{ssi_pm.h => cc_pm.h}|  4 +-
 .../ccree/{ssi_request_mgr.c => cc_request_mgr.c}  | 15 ++
 .../ccree/{ssi_request_mgr.h => cc_request_mgr.h}  |  2 +-
 .../ccree/{ssi_sram_mgr.c => cc_sram_mgr.c}|  4 +-
 .../ccree/{ssi_sram_mgr.h => cc_sram_mgr.h}|  0
 26 files changed, 76 insertions(+), 133 deletions(-)
 rename drivers/staging/ccree/{ssi_aead.c => cc_aead.c} (99%)
 rename drivers/staging/ccree/{ssi_aead.h => cc_aead.h} (99%)
 rename drivers/staging/ccree/{ssi_buffer_mgr.c => cc_buffer_mgr.c} (99%)
 rename drivers/staging/ccree/{ssi_buffer_mgr.h => cc_buffer_mgr.h} (97%)
 rename drivers/staging/ccree/{ssi_cipher.c => cc_cipher.c} (99%)
 rename drivers/staging/ccree/{ssi_cipher.h => cc_cipher.h} (95%)
 rename drivers/staging/ccree/{ssi_driver.c => cc_driver.c} (90%)
 rename drivers/staging/ccree/{ssi_driver.h => cc_driver.h} (98%)
 rename drivers/staging/ccree/{ssi_fips.c => cc_fips.c} (98%)
 rename drivers/staging/ccree/{ssi_fips.h => cc_fips.h} (100%)
 rename drivers/staging/ccree/{ssi_hash.c => cc_hash.c} (99%)
 rename drivers/staging/ccree/{ssi_hash.h => cc_hash.h} (98%)
 rename drivers/staging/ccree/{dx_host.h => cc_host_regs.h} (100%)
 rename drivers/staging/ccree/{ssi_ivgen.c => cc_ivgen.c} (97%)
 rename drivers/staging/ccree/{ssi_ivgen.h => cc_ivgen.h} (100%)
 rename drivers/staging/ccree/{dx_crys_kernel.h => cc_kernel_regs.h} (100%)
 rename drivers/staging/ccree/{ssi_pm.c => cc_pm.c} (91%)
 rename drivers/staging/ccree/{ssi_pm.h => cc_pm.h} (95%)
 rename drivers/staging/ccree/{ssi_request_mgr.c => cc_request_mgr.c} (98%)
 rename drivers/staging/ccree/{ssi_request_mgr.h => cc_request_mgr.h} (98%)
 rename drivers/staging/ccree/{ssi_sram_mgr.c => cc_sram_mgr.c} (98%)
 rename drivers/staging/ccree/{ssi_sram_mgr.h => cc_sram_mgr.h} (100%)

-- 
2.7.4

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


[PATCH 2/5] staging: ccree: remove unneeded includes

2018-01-09 Thread Gilad Ben-Yossef
Remove include files not needed for compilation.

Signed-off-by: Gilad Ben-Yossef 
---
 drivers/staging/ccree/cc_aead.c|  7 ---
 drivers/staging/ccree/cc_buffer_mgr.c  |  6 --
 drivers/staging/ccree/cc_cipher.c  |  4 
 drivers/staging/ccree/cc_driver.c  | 31 ---
 drivers/staging/ccree/cc_hash.c|  2 --
 drivers/staging/ccree/cc_ivgen.c   |  1 -
 drivers/staging/ccree/cc_pm.c  |  2 --
 drivers/staging/ccree/cc_request_mgr.c |  5 -
 8 files changed, 58 deletions(-)

diff --git a/drivers/staging/ccree/cc_aead.c b/drivers/staging/ccree/cc_aead.c
index da74423..265adff 100644
--- a/drivers/staging/ccree/cc_aead.c
+++ b/drivers/staging/ccree/cc_aead.c
@@ -3,18 +3,11 @@
 
 #include 
 #include 
-#include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include "cc_driver.h"
 #include "cc_buffer_mgr.h"
 #include "cc_aead.h"
diff --git a/drivers/staging/ccree/cc_buffer_mgr.c 
b/drivers/staging/ccree/cc_buffer_mgr.c
index 01c786c..14b2eab 100644
--- a/drivers/staging/ccree/cc_buffer_mgr.c
+++ b/drivers/staging/ccree/cc_buffer_mgr.c
@@ -1,17 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright (C) 2012-2018 ARM Limited or its affiliates. */
 
-#include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #include "cc_buffer_mgr.h"
 #include "cc_lli_defs.h"
diff --git a/drivers/staging/ccree/cc_cipher.c 
b/drivers/staging/ccree/cc_cipher.c
index eca0578..8afdbc1 100644
--- a/drivers/staging/ccree/cc_cipher.c
+++ b/drivers/staging/ccree/cc_cipher.c
@@ -3,12 +3,8 @@
 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/staging/ccree/cc_driver.c 
b/drivers/staging/ccree/cc_driver.c
index 98d491e..b49bc25 100644
--- a/drivers/staging/ccree/cc_driver.c
+++ b/drivers/staging/ccree/cc_driver.c
@@ -5,43 +5,12 @@
 #include 
 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
-#include 
-
-/* cache.h required for L1_CACHE_ALIGN() and cache_line_size() */
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/staging/ccree/cc_hash.c b/drivers/staging/ccree/cc_hash.c
index 7c1645d..86f9ec7 100644
--- a/drivers/staging/ccree/cc_hash.c
+++ b/drivers/staging/ccree/cc_hash.c
@@ -3,10 +3,8 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/staging/ccree/cc_ivgen.c b/drivers/staging/ccree/cc_ivgen.c
index 43f70d4..25a3131 100644
--- a/drivers/staging/ccree/cc_ivgen.c
+++ b/drivers/staging/ccree/cc_ivgen.c
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright (C) 2012-2018 ARM Limited or its affiliates. */
 
-#include 
 #include 
 #include "cc_driver.h"
 #include "cc_ivgen.h"
diff --git a/drivers/staging/ccree/cc_pm.c b/drivers/staging/ccree/cc_pm.c
index 1f5da86..c7d6b86 100644
--- a/drivers/staging/ccree/cc_pm.c
+++ b/drivers/staging/ccree/cc_pm.c
@@ -2,9 +2,7 @@
 /* Copyright (C) 2012-2018 ARM Limited or its affiliates. */
 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include "cc_driver.h"
 #include "cc_buffer_mgr.h"
diff --git a/drivers/staging/ccree/cc_request_mgr.c 
b/drivers/staging/ccree/cc_request_mgr.c
index cbcfcc3..8372410 100644
--- a/drivers/staging/ccree/cc_request_mgr.c
+++ b/drivers/staging/ccree/cc_request_mgr.c
@@ -2,11 +2,6 @@
 /* Copyright (C) 2012-2018 ARM Limited or its affiliates. */
 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include "cc_driver.h"
 #include "cc_buffer_mgr.h"
 #include "cc_request_mgr.h"
-- 
2.7.4

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


[PATCH] staging: wilc1000: removed enum typedef BUS_RELEASE_T

2018-01-09 Thread Ajay Singh
This patch removes enum typedef BUS_RELEASE_T and define
"enum bus_release" to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c| 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 80a5a0b..a2b26ec 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -13,7 +13,7 @@ static inline void acquire_bus(struct wilc *wilc, enum 
bus_acquire acquire)
chip_wakeup(wilc);
 }
 
-static inline void release_bus(struct wilc *wilc, BUS_RELEASE_T release)
+static inline void release_bus(struct wilc *wilc, enum bus_release release)
 {
if (release == RELEASE_ALLOW_SLEEP)
chip_allow_sleep(wilc);
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 65cb53d..c1483c8 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -148,10 +148,10 @@ enum bus_acquire {
ACQUIRE_AND_WAKEUP  = 1,
 };
 
-typedef enum {
+enum bus_release {
RELEASE_ONLY= 0,
RELEASE_ALLOW_SLEEP = 1,
-} BUS_RELEASE_T;
+};
 
 enum {
NO_SECURITY = 0,
-- 
2.7.4


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


[PATCH] staging: wilc1000: removed enum typedef BUS_ACQUIRE_T

2018-01-09 Thread Ajay Singh
This patch removes enum typedef BUS_ACQUIRE_T and define
enum bus_acquire to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c| 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 3a58a62..80a5a0b 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -6,7 +6,7 @@
 
 static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP;
 
-static inline void acquire_bus(struct wilc *wilc, BUS_ACQUIRE_T acquire)
+static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire)
 {
mutex_lock(&wilc->hif_cs);
if (acquire == ACQUIRE_AND_WAKEUP)
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 70e3558..65cb53d 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -143,10 +143,10 @@ enum chip_ps_states {
CHIP_SLEEPING_MANUAL= 2
 };
 
-typedef enum {
+enum bus_acquire {
ACQUIRE_ONLY= 0,
ACQUIRE_AND_WAKEUP  = 1,
-} BUS_ACQUIRE_T;
+};
 
 typedef enum {
RELEASE_ONLY= 0,
-- 
2.7.4


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


Re: [PATCH v2] Staging: greybus: camera: cleanup multiple checks for null pointers

2018-01-09 Thread Johan Hovold
On Mon, Jan 08, 2018 at 10:20:15PM +0530, Sumit Pundir wrote:
> Fixed coding style issue regarding null comparison at multiple lines.
> Issue reported by checkpatch.pl
> 
> Signed-off-by: Sumit Pundir 
> ---
> v2:
>  Updated the patch title and description.

Thanks for the update.

Acked-by: Johan Hovold 

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


[PATCH] staging: wilc1000: removed enum typedef CHIP_PS_STATE_T

2018-01-09 Thread Ajay Singh
This patch removes enum typedef CHIP_PS_STATE_T and introduce
enum chip_ps_states to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan.c| 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index f49dfa8..3a58a62 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -4,7 +4,7 @@
 #include "wilc_wfi_netdevice.h"
 #include "wilc_wlan_cfg.h"
 
-static CHIP_PS_STATE_T chip_ps_state = CHIP_WAKEDUP;
+static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP;
 
 static inline void acquire_bus(struct wilc *wilc, BUS_ACQUIRE_T acquire)
 {
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 068a59d..70e3558 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -137,11 +137,11 @@ enum {
MAX_PSPOLL_PS   = 4
 };
 
-typedef enum {
+enum chip_ps_states {
CHIP_WAKEDUP= 0,
CHIP_SLEEPING_AUTO  = 1,
CHIP_SLEEPING_MANUAL= 2
-} CHIP_PS_STATE_T;
+};
 
 typedef enum {
ACQUIRE_ONLY= 0,
-- 
2.7.4


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


[PATCH] staging: wilc1000: removed enums typedef for BEACON_IE & TX_RATE_T

2018-01-09 Thread Ajay Singh
This patch removed the unnecessary enum typedef for BEACON_IE &
TX_RATE_T
It fix "WARNING: do not add new typedefs" reported by checkpatch.pl

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index cf4a44d..068a59d 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -75,7 +75,7 @@ typedef void (*wilc_tx_complete_func_t)(void *, int);
 #define MAX_SSID_LEN33
 #define MAX_RATES_SUPPORTED 12
 
-typedef enum {
+enum {
SUPP_RATES_IE   = 1,
EXT_SUPP_RATES_IE   = 50,
HT_CAPABILITY_IE= 45,
@@ -83,7 +83,7 @@ typedef enum {
WPA_IE  = 221,
WMM_IE  = 221,
P2P_IE  = 221,
-} BEACON_IE;
+};
 
 enum bss_types {
INFRASTRUCTURE  = 0,
@@ -91,7 +91,7 @@ enum bss_types {
AP,
 };
 
-typedef enum {
+enum {
RATE_AUTO   = 0,
RATE_1MB= 1,
RATE_2MB= 2,
@@ -105,7 +105,7 @@ typedef enum {
RATE_26MB   = 36,
RATE_48MB   = 48,
RATE_54MB   = 54
-} TX_RATE_T;
+};
 
 enum {
B_ONLY_MODE = 0,/* 1, 2 M, otherwise 5, 11 M */
-- 
2.7.4


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


[PATCH] staging: wilc1000: removed few unnecessary enums typedef

2018-01-09 Thread Ajay Singh
This patch removes following N_OPERATING_MODE_T,N_OBSS_DETECTION_T,
N_PROTECTION_TYPE_T,N_SMPS_MODE_T,TX_ABORT_OPTION_T, typedef enum.
Now, these enums are used as anonymous-enums for constants.

checkpatch.pl warning to not add new typedef is fixes with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index eec8760..cf4a44d 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -226,40 +226,40 @@ enum {
G_RTS_CTS_PROT,
 };
 
-typedef enum {
+enum {
HT_MIXED_MODE   = 1,
HT_ONLY_20MHZ_MODE,
HT_ONLY_20_40MHZ_MODE,
-} N_OPERATING_MODE_T;
+};
 
-typedef enum {
+enum {
NO_DETECT   = 0,
DETECT_ONLY = 1,
DETECT_PROTECT  = 2,
DETECT_PROTECT_REPORT   = 3,
-} N_OBSS_DETECTION_T;
+};
 
-typedef enum {
+enum {
RTS_CTS_NONHT_PROT  = 0,/* RTS-CTS at non-HT rate */
FIRST_FRAME_NONHT_PROT, /* First frame at non-HT rate */
LSIG_TXOP_PROT, /* LSIG TXOP Protection */
FIRST_FRAME_MIXED_PROT, /* First frame at Mixed format */
-} N_PROTECTION_TYPE_T;
+};
 
-typedef enum {
+enum {
STATIC_MODE = 1,
DYNAMIC_MODE= 2,
MIMO_MODE   = 3,/* power save disable */
-} N_SMPS_MODE_T;
+};
 
-typedef enum {
+enum {
DISABLE_SELF_CTS,
ENABLE_SELF_CTS,
DISABLE_TX_ABORT,
ENABLE_TX_ABORT,
HW_TRIGGER_ABORT,
SW_TRIGGER_ABORT,
-} TX_ABORT_OPTION_T;
+};
 
 enum wid_type {
WID_CHAR= 0,
-- 
2.7.4


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


[PATCH] staging: wilc1000: removed few unnecessary enums typedef

2018-01-09 Thread Ajay Singh
This patch removes following RSNA_REKEY_POLICY_T,SCAN_CLASS_FITLER_T,
SCAN_PRI_T,CH_FILTER_T,N_PROTECTION_MODE_T,G_PROTECTION_MODE_T typedef
enum.
Now, these enums are used as anonymous-enums for constants.

checkpatch.pl warning to avoid new typedef is fixes with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 598ba9e..eec8760 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -189,42 +189,42 @@ enum {
NO_REQUEST  = 2,
 };
 
-typedef enum {
+enum {
REKEY_DISABLE   = 1,
REKEY_TIME_BASE,
REKEY_PKT_BASE,
REKEY_TIME_PKT_BASE
-} RSNA_REKEY_POLICY_T;
+};
 
-typedef enum {
+enum {
FILTER_NO   = 0x00,
FILTER_AP_ONLY  = 0x01,
FILTER_STA_ONLY = 0x02
-} SCAN_CLASS_FITLER_T;
+};
 
-typedef enum {
+enum {
PRI_HIGH_RSSI   = 0x00,
PRI_LOW_RSSI= 0x04,
PRI_DETECT  = 0x08
-} SCAN_PRI_T;
+};
 
-typedef enum {
+enum {
CH_FILTER_OFF   = 0x00,
CH_FILTER_ON= 0x10
-} CH_FILTER_T;
+};
 
-typedef enum {
+enum {
AUTO_PROT   = 0,/* Auto */
NO_PROT,/* Do not use any protection */
ERP_PROT,   /* Protect all ERP frame exchanges */
HT_PROT,/* Protect all HT frame exchanges  */
GF_PROT,/* Protect all GF frame exchanges  */
-} N_PROTECTION_MODE_T;
+};
 
-typedef enum {
+enum {
G_SELF_CTS_PROT,
G_RTS_CTS_PROT,
-} G_PROTECTION_MODE_T;
+};
 
 typedef enum {
HT_MIXED_MODE   = 1,
-- 
2.7.4


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


[PATCH] staging: wilc1000: removed unnecessary enum typedefs

2018-01-09 Thread Ajay Singh
This patch removes following G_PREAMBLE_T,SCANTYPE_T,
USER_PS_MODE_T,SECURITY_T,ACK_POLICY_T,RESET_REQ_T typedef enum.

Now, these enums are used as anonymous-enums for constants.

checkpatch.pl warning to avoid new typedef is fixes with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 222bde2..598ba9e 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -114,28 +114,28 @@ enum {
G_MIXED_11B_2_MODE, /* 1,2,5,11,6,12,24 otherwise all on */
 };
 
-typedef enum {
+enum {
G_SHORT_PREAMBLE= 0,/* Short Preamble */
G_LONG_PREAMBLE = 1,/* Long Preamble */
G_AUTO_PREAMBLE = 2,/* Auto Preamble Selection */
-} G_PREAMBLE_T;
+};
 
 #define MAC_CONNECTED  1
 #define MAC_DISCONNECTED   0
 
 #define SCAN_DONE  TRUE
-typedef enum {
+enum {
PASSIVE_SCAN= 0,
ACTIVE_SCAN = 1,
-} SCANTYPE_T;
+};
 
-typedef enum {
+enum {
NO_POWERSAVE= 0,
MIN_FAST_PS = 1,
MAX_FAST_PS = 2,
MIN_PSPOLL_PS   = 3,
MAX_PSPOLL_PS   = 4
-} USER_PS_MODE_T;
+};
 
 typedef enum {
CHIP_WAKEDUP= 0,
@@ -153,7 +153,7 @@ typedef enum {
RELEASE_ALLOW_SLEEP = 1,
 } BUS_RELEASE_T;
 
-typedef enum {
+enum {
NO_SECURITY = 0,
WEP_40  = 0x3,
WEP_104 = 0x7,
@@ -163,7 +163,7 @@ typedef enum {
WPA2_AES= 0x31,
WPA2_TKIP   = 0x51,
WPA2_AES_TKIP   = 0x71, /* Aes or Tkip */
-} SECURITY_T;
+};
 
 enum AUTHTYPE {
OPEN_SYSTEM = 1,
@@ -178,16 +178,16 @@ enum SITESURVEY {
SITE_SURVEY_OFF = 2
 };
 
-typedef enum {
+enum {
NORMAL_ACK  = 0,
NO_ACK,
-} ACK_POLICY_T;
+};
 
-typedef enum {
+enum {
DONT_RESET  = 0,
DO_RESET= 1,
NO_REQUEST  = 2,
-} RESET_REQ_T;
+};
 
 typedef enum {
REKEY_DISABLE   = 1,
-- 
2.7.4


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


[PATCH] staging: wilc1000: remove unnecessary typedef enum G_OPERATING_MODE_T

2018-01-09 Thread Ajay Singh
This patch has removed G_OPERATING_MODE_T typedef enum.
Now, its used as anonymous-enums for constants.
checkpatch.pl warning to avoid new typedef is fixed with this patch.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 2baf6c4..222bde2 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -107,12 +107,12 @@ typedef enum {
RATE_54MB   = 54
 } TX_RATE_T;
 
-typedef enum {
+enum {
B_ONLY_MODE = 0,/* 1, 2 M, otherwise 5, 11 M */
G_ONLY_MODE,/* 6,12,24 otherwise 9,18,36,48,54 */
G_MIXED_11B_1_MODE, /* 1,2,5.5,11 otherwise all on */
G_MIXED_11B_2_MODE, /* 1,2,5,11,6,12,24 otherwise all on */
-} G_OPERATING_MODE_T;
+};
 
 typedef enum {
G_SHORT_PREAMBLE= 0,/* Short Preamble */
-- 
2.7.4


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


[PATCH] staging: wilc1000: removed typedef from enum BSSTYPE_T

2018-01-09 Thread Ajay Singh
This patch removes typedef from enum BSSTYPE_T and
rename it to bss_types.

It fixes "WARNING: do not add new typdefs" warning
reported by checkpatch.pl.

Signed-off-by: ajaysk 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index d69248a..4ff1a59 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -202,7 +202,7 @@ struct host_if_msg {
 };
 
 struct join_bss_param {
-   BSSTYPE_T bss_type;
+   enum bss_types bss_type;
u8 dtim_period;
u16 beacon_period;
u16 cap_info;
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index c1693cf..2baf6c4 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -85,11 +85,11 @@ typedef enum {
P2P_IE  = 221,
 } BEACON_IE;
 
-typedef enum {
+enum bss_types {
INFRASTRUCTURE  = 0,
INDEPENDENT,
AP,
-} BSSTYPE_T;
+};
 
 typedef enum {
RATE_AUTO   = 0,
-- 
2.7.4


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


Re: [PATCH] ION: Sys_heap: fix the incorrect pool->gfp_mask setting

2018-01-09 Thread Dan Carpenter
On Tue, Jan 09, 2018 at 11:30:09AM +0800, Chen Feng wrote:
> 
> 
> On 2018/1/9 18:43, Zeng Tao wrote:
> > This issue is introduced by the commit  ("ION: Sys_heap:
> > Add cached pool to spead up cached buffer alloc"),

Use the Fixes tag.

Fixes: e7f63771b60e ("ION: Sys_heap: Add cached pool to spead up cached buffer 
alloc")

> the gfp_mask low
> > order pool is overlapped by the high order inside the loop, so the
> > gfp_mask of all pools are set to high_order_gfp_flags.
> > 
> 
> Thanks
> > Signed-off-by: Zeng Tao 
> > ---
> >  drivers/staging/android/ion/ion_system_heap.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/android/ion/ion_system_heap.c 
> > b/drivers/staging/android/ion/ion_system_heap.c
> > index 4dc5d7a..b6386be 100644
> > --- a/drivers/staging/android/ion/ion_system_heap.c
> > +++ b/drivers/staging/android/ion/ion_system_heap.c
> > @@ -298,10 +298,10 @@ static int ion_system_heap_create_pools(struct 
> > ion_page_pool **pools,
> > bool cached)
> >  {
> > int i;
> > -   gfp_t gfp_flags = low_order_gfp_flags;
> >  
> > for (i = 0; i < NUM_ORDERS; i++) {
> > struct ion_page_pool *pool;
> > +   gfp_t gfp_flags = low_order_gfp_flags;
> 
> Not define here. Better "gfp_flags = low_order_gfp_flags"

Either way is fine...

regards,
dan carpenter

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