Re: [PATCH v3 2/2] staging: media: davinci_vpfe: add kfree() on goto err statement

2018-03-20 Thread Dan Carpenter
Looks good.  Thanks!

regards,
dan carpenter

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


Re: [PATCH 01/11] staging: wilc1000: refactor scan() to free kmalloc memory on failure cases

2018-03-20 Thread Ajay Singh
Hi Dan,

Thanks for your detailed review comments.

On Tue, 20 Mar 2018 22:46:32 +0300
Dan Carpenter  wrote:

> On Tue, Mar 20, 2018 at 10:25:34PM +0530, Ajay Singh wrote:
> > Added changes to free the allocated memory in scan() for error condition.
> > Also added 'NULL' check validation before accessing allocated memory.
> > 
> > Signed-off-by: Ajay Singh 

> Don't put a blank line between the alloc and the check.  They're as
> connected as can be.  I hate "goto out;" but that is a personal
> preference which I would never push on to other developers...
> 

I will modify the code to address the review comments and will send the
updated patch.

> > +
> > +   ntwk->n_ssids = request->n_ssids;
> > +
> > +   for (i = 0; i < request->n_ssids; i++) {
> > +   if (request->ssids[i].ssid_len > 0) {
> > +   struct hidden_net_info *info = &ntwk->net_info[i];
> > +
> > +   info->ssid = kmemdup(request->ssids[i].ssid,
> > +request->ssids[i].ssid_len,
> > +GFP_KERNEL);
> > +
> > +   if (!info->ssid)
> > +   goto out_free;
> > +
> > +   info->ssid_len = request->ssids[i].ssid_len;
> > +   } else {
> > +   ntwk->n_ssids -= 1;
> > +   }  
> 
> You didn't introduce the problem, but this loop seems kind of buggy.  We
> should have two iterators, one for request->ssids[i] and one for
> ntwk->net_info[i].  Otherwise we're copying the array information but
> we're leaving holes in the destination array.  Which would be fine
> except we're not saving the totaly number of elements in the destination
> array, we're saving the number of elements with stuff in them.
> 
> So imagine that we have a request->n_ssids == 10 but only the last
> three elements have request->ssids[i].ssid_len > 0.  Then we record that
> ntwk->n_ssids is 3 but wthose elements are all holes.  So that can't
> work.  See handle_scan():
> 
>   for (i = 0; i < hidden_net->n_ssids; i++)
>   valuesize += ((hidden_net->net_info[i].ssid_len) + 1);
> 
> "valuesize" is wrong because it's looking at holes.

While testing, I found that the last element in request->ssids the
ssid_len is zero. For in between elements the values has some valid
length. I only tested for 'connect with AP' and 'iw scan' operation.
The scenario you have mention can occur for some instance. So, I will
modify the code to not have holes in allocated array at the time of
filling the data.
I will include these changes and send updated v2 patch set.

> 
> > +   }
> > +   return true;
> > +
> > +out_free:
> > +
> > +   for (; i >= 0 ; i--)
> > +   kfree(ntwk->net_info[i].ssid);  
> 
> The first kfree(ntwk->net_info[i].ssid); is a no-op.  You could write
> this like:
> 
>   while (--i >= 0)
>   kfree(ntwk->net_info[i].ssid);
> 

I will include these changes and send the updated patch.



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


[PATCH v3 2/2] staging: media: davinci_vpfe: add kfree() on goto err statement

2018-03-20 Thread Ji-Hun Kim
It needs to free of allocated params value in the goto error statement.

Signed-off-by: Ji-Hun Kim 
---
Changes since v2:
  - add kfree(params) on the error case of the function
  - rename unclear goto statement name
  - declare the params value at start of the function, so it can be free
end of the function

 drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c 
b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
index ffcd86d..735d8b5 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
@@ -1263,6 +1263,7 @@ static int ipipe_get_cgs_params(struct vpfe_ipipe_device 
*ipipe, void *param)
 static int ipipe_s_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config 
*cfg)
 {
struct vpfe_ipipe_device *ipipe = v4l2_get_subdevdata(sd);
+   struct ipipe_module_params *params;
unsigned int i;
int rval = 0;
 
@@ -1272,7 +1273,6 @@ static int ipipe_s_config(struct v4l2_subdev *sd, struct 
vpfe_ipipe_config *cfg)
if (cfg->flag & bit) {
const struct ipipe_module_if *module_if =
&ipipe_modules[i];
-   struct ipipe_module_params *params;
void __user *from = *(void * __user *)
((void *)cfg + module_if->config_offset);
size_t size;
@@ -1289,26 +1289,30 @@ static int ipipe_s_config(struct v4l2_subdev *sd, 
struct vpfe_ipipe_config *cfg)
if (to && from && size) {
if (copy_from_user(to, from, size)) {
rval = -EFAULT;
-   break;
+   goto err_free_params;
}
rval = module_if->set(ipipe, to);
if (rval)
-   goto error;
+   goto err_free_params;
} else if (to && !from && size) {
rval = module_if->set(ipipe, NULL);
if (rval)
-   goto error;
+   goto err_free_params;
}
kfree(params);
}
}
-error:
+   return 0;
+
+err_free_params:
+   kfree(params);
return rval;
 }
 
 static int ipipe_g_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config 
*cfg)
 {
struct vpfe_ipipe_device *ipipe = v4l2_get_subdevdata(sd);
+   struct ipipe_module_params *params;
unsigned int i;
int rval = 0;
 
@@ -1318,7 +1322,6 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct 
vpfe_ipipe_config *cfg)
if (cfg->flag & bit) {
const struct ipipe_module_if *module_if =
&ipipe_modules[i];
-   struct ipipe_module_params *params;
void __user *to = *(void * __user *)
((void *)cfg + module_if->config_offset);
size_t size;
@@ -1335,16 +1338,19 @@ static int ipipe_g_config(struct v4l2_subdev *sd, 
struct vpfe_ipipe_config *cfg)
if (to && from && size) {
rval = module_if->get(ipipe, from);
if (rval)
-   goto error;
+   goto err_free_params;
if (copy_to_user(to, from, size)) {
rval = -EFAULT;
-   break;
+   goto err_free_params;
}
}
kfree(params);
}
}
-error:
+   return 0;
+
+err_free_params:
+   kfree(params);
return rval;
 }
 
-- 
1.9.1

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


[PATCH v3 1/2] staging: media: davinci_vpfe: add error handling on kmalloc failure

2018-03-20 Thread Ji-Hun Kim
There is no failure checking on the param value which will be allocated
memory by kmalloc. Add a null pointer checking statement. Then goto error:
and return -ENOMEM error code when kmalloc is failed.

Signed-off-by: Ji-Hun Kim 
---
Changes since v1:
  - Return with -ENOMEM directly, instead of goto error: then return.
  - [Patch v3 1/2] is same with [patch v2]

 drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c 
b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
index 6a3434c..ffcd86d 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
@@ -1280,6 +1280,9 @@ static int ipipe_s_config(struct v4l2_subdev *sd, struct 
vpfe_ipipe_config *cfg)
 
params = kmalloc(sizeof(struct ipipe_module_params),
 GFP_KERNEL);
+   if (!params)
+   return -ENOMEM;
+
to = (void *)params + module_if->param_offset;
size = module_if->param_size;
 
@@ -1323,6 +1326,9 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct 
vpfe_ipipe_config *cfg)
 
params =  kmalloc(sizeof(struct ipipe_module_params),
GFP_KERNEL);
+   if (!params)
+   return -ENOMEM;
+
from = (void *)params + module_if->param_offset;
size = module_if->param_size;
 
-- 
1.9.1

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


Re: [v2 PATCH 5/5] Staging:rtl8723bs clean spaces

2018-03-20 Thread Joe Perches
On Tue, 2018-03-20 at 20:26 +, Paul McQuade wrote:
> Used checkpatch.pl to clean up spaces around if and for statements
> to make it easier to read

Perhaps the commit message can be made clearer.

I think this is technically correct, but it would
be nicer to describe these changes as moving braces
to the more common kernel-style locations.

> diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c 
> b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
[]
> @@ -20,8 +20,7 @@
>  
>  void rtw_os_free_recvframe(union recv_frame *precvframe)
>  {
> - if (precvframe->u.hdr.pkt)
> - {
> + if (precvframe->u.hdr.pkt) {
>   dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver 
> */
>  
>   precvframe->u.hdr.pkt = NULL;

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


Re: [PATCH 2/2] staging: vc04_services: Add outstanding VCHI TODOs

2018-03-20 Thread Eric Anholt
Stefan Wahren  writes:

> The TODO list missed some issues before we can move the driver out of staging.
>
> Signed-off-by: Stefan Wahren 
> ---
>  drivers/staging/vc04_services/interface/vchi/TODO | 27 
> +++
>  1 file changed, 27 insertions(+)
>
> diff --git a/drivers/staging/vc04_services/interface/vchi/TODO 
> b/drivers/staging/vc04_services/interface/vchi/TODO
> index 84e6733..7144de2 100644
> --- a/drivers/staging/vc04_services/interface/vchi/TODO
> +++ b/drivers/staging/vc04_services/interface/vchi/TODO
> @@ -23,3 +23,30 @@ there's a lot code that got built that's probably 
> unnecessary these
>  days.  Once we have the set of VCHI-using drivers we want in tree, we
>  should be able to do a sweep of the code to see what's left that's
>  unused.
> +
> +3) Make driver more portable
> +
> +Building this driver with arm/multi_v7_defconfig or arm64/defconfig
> +leads to data corruption during vchiq_test. This should be fixed.

Sounds good, but could you document that it's "vchiq_test -f" for
testing this?

With that, these two get my:

Reviewed-by: Eric Anholt 


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


Re: [PATCH v3]PCI: hv: fix PCI-BUS domainID corruption

2018-03-20 Thread Sridhar Pitchai
Hi Lorenzo,
   Transparent SRIOV is exposing the NIC directly to the kernel via
para-virtual device, unlike creating a netdev and associating it with the bond
driver. Further descriptions here,

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=0c195567a8f6e82ea5535cd9f1d54a1626dd233e

Previously, when using the bond driver, unique and persistent VF NIC name
was required, so we used serial number as PCI domain which is included as
part of the VF NIC name.  Transparent SRIOV mode puts VF NIC based on MAC
match as a slave of synthetic NIC, so VF NIC’s name is no longer important.

Thanks,
Sridhar

On 3/20/18, 11:32 AM, "Lorenzo Pieralisi"  wrote:

On Tue, Mar 20, 2018 at 05:56:15PM +, Sridhar Pitchai wrote:
> Hi Lorenzo,

> Are we good with the explanation? Can I send the patch with the
> updated commit comments?

Almost.

[...]

> Since we have the transparent SRIOV mode now, the short VF device name
> is no longer needed.

Can you correlate transparent SRIOV mode to the point you are making
below ? Please explain what transparent SRIOV mode allows you to remove
and why. The rest of the explanation seems OK.

Please follow this email format:


https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvger.kernel.org%2Flkml%2F%23s3-9&data=04%7C01%7CSridhar.Pitchai%40microsoft.com%7Cc5cdcb7951f64318e52708d58e90e6f2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636571675366181738%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=yBdqc4NQZsO7O9vfgJsr5olU8GfLNjF5e9EAaCb7vq4%3D&reserved=0

Thanks,
Lorenzo

> I still do not understand what this means and how it is related to the
> patch below, it may be clear to you, it is not to me, at all.
> 
> Sridhar >> the patch below, was introduced to make the device name 
small, by taking only
> 16bits of the serial number. Since we are not going to have the 
serial number
> updated to the BUS id, this has to be removed.
> 
> Fixes: 4a9b0933bdfc("PCI:hv:Use device serial number as PCI domain")
> 
> Fixes: 4a9b0933bdfc ("PCI: hv: Use device serial number as PCI 
domain")
> Sridhr >> yes
> 
> I asked you an explicit question. Commit above was added for a reason
> I assume. This patch implies that kernel has been broken since v4.11
> which is almost a year ago and nobody every noticed ? Or there are
> systems where commit above is _necessary_ and this patch would break
> them ?
> 
> I want a detailed explanation that highlights *why* it is safe to 
apply
> this patch and send it to stable kernels, commit log above won't do.
> 
> Sridhar>> HyperV provides a unique domain ID for PCI BUS. But it is 
modified by the child
> device when it is added. This cannot produce a unique domain ID all 
the time.
> Here in the bug, we see the collision between the serial number and 
already
> existing PCI bus. The cleaner way is never touch the domain ID 
provided by
> hyperV during the PCI bus creation. As long as hyperV make sure it 
provides a
> unique domain ID for the PCI for a VM it will not break, and HyperV 
will
> guarantees that the domain for the PCI bus for a given VM will be 
always unique.
> The original patch was also intending to have a unique domain ID for 
the PCI
> bus, by taking the serial number of the device, but it is not 
sufficient, when
> the device serial number is number which is the domain ID of the 
existing PCI
> bus.  With the current kernel we can repro this issue by adding a 
device with a
> serial number matching the existing PCI bus domain id. (in this case 
that
> happens to be zero).
> 
> 
> Thanks,
> Lorenzo
> 
> Cc: sta...@vger.kernel.org
> Signed-off-by: Sridhar Pitchai 
> ---
> Changes in v3:
> * fix the commit comment. [KY Srinivasan, Michael Kelley]
> ---
>   drivers/pci/host/pci-hyperv.c | 11 ---
>   1 file changed, 11 deletions(-)
> diff --git a/drivers/pci/host/pci-hyperv.c 
b/drivers/pci/host/pci-hyperv.c
> index 2faf38e..ac67e56 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -1518,17 +1518,6 @@ static struct hv_pci_dev 
*new_pcichild_device(struct hv_pcibus_device *hbus,
>   get_pcichild(hpdev, hv_pcidev_ref_childlist);
>   spin_lock_irqsave(&hbus->device_list_lock, flags);
>   
> - /*
> -  * When a device is being added to the bus, we set the PCI 
domain
> -  * number to be the device serial number, which is non-zero and
>

Re: [PATCH] staging: mt7621-gpio: remove redundant owner assignments of drivers

2018-03-20 Thread NeilBrown
On Tue, Mar 20 2018, hariprasath.ela...@gmail.com wrote:

> From: HariPrasath Elango 
>
> Remove the reduntant owner initialization from this platform driver as
> the platform_driver_register() takes care of it.
>
> Signed-off-by: HariPrasath Elango 
> ---
>  drivers/staging/mt7621-gpio/gpio-mt7621.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c 
> b/drivers/staging/mt7621-gpio/gpio-mt7621.c
> index 5c57abe..830d429 100644
> --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
> +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
> @@ -339,7 +339,6 @@ static struct platform_driver mediatek_gpio_driver = {
>   .probe = mediatek_gpio_probe,
>   .driver = {
>   .name = "mt7621_gpio",
> - .owner = THIS_MODULE,
>   .of_match_table = mediatek_gpio_match,
>   },
>  };
> -- 
> 2.10.0.GIT

Reviewed-by: NeilBrown 

Thanks,
NeilBrown


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


Re: [PATCH 0/7] staging: mt7621: Checkpatch cleanup

2018-03-20 Thread NeilBrown
On Tue, Mar 20 2018, Christian Lütke-Stetzkamp wrote:

> This patchset fiexes errors, warnings and checks found by checkpatch.
>
> Christian Lütke-Stetzkamp (7):
>   staging: mt7621-dma: Fix Pointer Location
>   staging: mt7621-dma: Fix Spacing
>   staging: mt7621-dma: Fix open brace position
>   staging: mt7621-dma: Remove assignment in if
>   staging: mt7621-dma: Fix ident by space
>   staging: mt7621-dma: Removing unnecessary braces
>   staging: mt7621-dma: Fixing parenthesis alignment
>
>  drivers/staging/mt7621-dma/mtk-hsdma.c   | 37 +
>  drivers/staging/mt7621-dma/ralink-gdma.c | 70 
> 
>  2 files changed, 54 insertions(+), 53 deletions(-)
>

Thanks for these.
Except for "Remove assignment in if" which I responded to separately:

  Reviewed-by: NeilBrown 

Thanks,
NeilBrown


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


Re: [PATCH 4/7] staging: mt7621-dma: Remove assignment in if

2018-03-20 Thread NeilBrown
On Tue, Mar 20 2018, Christian Lütke-Stetzkamp wrote:

> Fixes checkpatch error: ASSIGN_IN_IF by defining a new variable before if
>
> Signed-off-by: Christian Lütke-Stetzkamp 
> ---
>  drivers/staging/mt7621-dma/ralink-gdma.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/mt7621-dma/ralink-gdma.c 
> b/drivers/staging/mt7621-dma/ralink-gdma.c
> index 9548ce4afb77..60d557fb6553 100644
> --- a/drivers/staging/mt7621-dma/ralink-gdma.c
> +++ b/drivers/staging/mt7621-dma/ralink-gdma.c
> @@ -678,6 +678,7 @@ static enum dma_status gdma_dma_tx_status(struct dma_chan 
> *c,
>  
>   spin_lock_irqsave(&chan->vchan.lock, flags);
>   desc = chan->desc;
> + vdesc = vchan_find_desc(&chan->vchan, cookie);
>   if (desc && (cookie == desc->vdesc.tx.cookie)) {
>   /*
>* We never update edesc->residue in the cyclic case, so we
> @@ -689,7 +690,7 @@ static enum dma_status gdma_dma_tx_status(struct dma_chan 
> *c,
>   ((chan->next_sg - 1) * desc->sg[0].len);
>   else
>   state->residue = desc->residue;
> - } else if ((vdesc = vchan_find_desc(&chan->vchan, cookie)))
> + } else if (vdesc)
>   state->residue = to_gdma_dma_desc(vdesc)->residue;
>   spin_unlock_irqrestore(&chan->vchan.lock, flags);
>  

I don't like this change.  We now call vchan_find_desc() in situations
where we didn't before.  It isn't a very expensive function so that
doesn't matter a lot, but I think it is best not to do this.
If you want to remove the warning (and I'm not convinced that we need
to), please make it.

  
  } else {
  vdesc = vchan_find_desc(...);
  if (vdesec)
  state->residue = ...
 }

Thanks,
NeilBrown


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


[PATCH PATCH net 4/4] hv_netvsc: common detach logic

2018-03-20 Thread Stephen Hemminger
Make common function for detaching internals of device
during changes to MTU and RSS. Make sure no more packets
are transmitted and all packets have been received before
doing device teardown.

Change the wait logic to be common and use usleep_range().

Changes transmit enabling logic so that transmit queues are disabled
during the period when lower device is being changed. And enabled
only after sub channels are setup. This avoids issue where it could
be that a packet was being sent while subchannel was not initialized.

Fixes: 8195b1396ec8 ("hv_netvsc: fix deadlock on hotplug")
Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/hyperv_net.h   |   1 -
 drivers/net/hyperv/netvsc.c   |  20 +--
 drivers/net/hyperv/netvsc_drv.c   | 278 +-
 drivers/net/hyperv/rndis_filter.c |  17 +--
 4 files changed, 173 insertions(+), 143 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index cd538d5a7986..32861036c3fc 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -212,7 +212,6 @@ void netvsc_channel_cb(void *context);
 int netvsc_poll(struct napi_struct *napi, int budget);
 
 void rndis_set_subchannel(struct work_struct *w);
-bool rndis_filter_opened(const struct netvsc_device *nvdev);
 int rndis_filter_open(struct netvsc_device *nvdev);
 int rndis_filter_close(struct netvsc_device *nvdev);
 struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 37b0a30d6b03..7472172823f3 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -555,8 +555,6 @@ void netvsc_device_remove(struct hv_device *device)
= rtnl_dereference(net_device_ctx->nvdev);
int i;
 
-   cancel_work_sync(&net_device->subchan_work);
-
netvsc_revoke_buf(device, net_device);
 
RCU_INIT_POINTER(net_device_ctx->nvdev, NULL);
@@ -643,14 +641,18 @@ static void netvsc_send_tx_complete(struct netvsc_device 
*net_device,
queue_sends =
atomic_dec_return(&net_device->chan_table[q_idx].queue_sends);
 
-   if (net_device->destroy && queue_sends == 0)
-   wake_up(&net_device->wait_drain);
+   if (unlikely(net_device->destroy)) {
+   if (queue_sends == 0)
+   wake_up(&net_device->wait_drain);
+   } else {
+   struct netdev_queue *txq = netdev_get_tx_queue(ndev, q_idx);
 
-   if (netif_tx_queue_stopped(netdev_get_tx_queue(ndev, q_idx)) &&
-   (hv_ringbuf_avail_percent(&channel->outbound) > 
RING_AVAIL_PERCENT_HIWATER ||
-queue_sends < 1)) {
-   netif_tx_wake_queue(netdev_get_tx_queue(ndev, q_idx));
-   ndev_ctx->eth_stats.wake_queue++;
+   if (netif_tx_queue_stopped(txq) &&
+   (hv_ringbuf_avail_percent(&channel->outbound) > 
RING_AVAIL_PERCENT_HIWATER ||
+queue_sends < 1)) {
+   netif_tx_wake_queue(txq);
+   ndev_ctx->eth_stats.wake_queue++;
+   }
}
 }
 
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index faea0be18924..f28c85d212ce 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -46,7 +46,10 @@
 
 #include "hyperv_net.h"
 
-#define RING_SIZE_MIN  64
+#define RING_SIZE_MIN  64
+#define RETRY_US_LO5000
+#define RETRY_US_HI1
+#define RETRY_MAX  2000/* >10 sec */
 
 #define LINKCHANGE_INT (2 * HZ)
 #define VF_TAKEOVER_INT (HZ / 10)
@@ -123,10 +126,8 @@ static int netvsc_open(struct net_device *net)
}
 
rdev = nvdev->extension;
-   if (!rdev->link_state) {
+   if (!rdev->link_state)
netif_carrier_on(net);
-   netif_tx_wake_all_queues(net);
-   }
 
if (vf_netdev) {
/* Setting synthetic device up transparently sets
@@ -142,36 +143,25 @@ static int netvsc_open(struct net_device *net)
return 0;
 }
 
-static int netvsc_close(struct net_device *net)
+static int netvsc_wait_until_empty(struct netvsc_device *nvdev)
 {
-   struct net_device_context *net_device_ctx = netdev_priv(net);
-   struct net_device *vf_netdev
-   = rtnl_dereference(net_device_ctx->vf_netdev);
-   struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
-   int ret = 0;
-   u32 aread, i, msec = 10, retry = 0, retry_max = 20;
-   struct vmbus_channel *chn;
-
-   netif_tx_disable(net);
-
-   /* No need to close rndis filter if it is removed already */
-   if (!nvdev)
-   goto out;
-
-   ret = rndis_filter_close(nvdev);
-   if (ret != 0) {
-   netdev_err(net, "unable to close device (ret %d).\n", ret);
-   return ret;
-   }
+   unsigned int retry = 0;
+   int i;
 
/* Ensure pending bytes i

[PATCH PATCH net 0/4] hv_netvsc: fix races during shutdown and changes

2018-03-20 Thread Stephen Hemminger
This set of patches fixes issues identified by Vitaly Kuznetsov and
Mohammed Gamal related to state changes in Hyper-v network driver.

A lot of the issues are because setting up the netvsc device requires
a second step (in work queue) to get all the sub-channels running.

Stephen Hemminger (4):
  hv_netvsc: disable NAPI before channel close
  hv_netvsc: use RCU to fix concurrent rx and queue changes
  hv_netvsc: change GPAD teardown order on older versions
  hv_netvsc: common detach logic

 drivers/net/hyperv/hyperv_net.h   |   1 -
 drivers/net/hyperv/netvsc.c   |  52 +++
 drivers/net/hyperv/netvsc_drv.c   | 278 +-
 drivers/net/hyperv/rndis_filter.c |  56 
 4 files changed, 204 insertions(+), 183 deletions(-)

-- 
2.16.2

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


[PATCH PATCH net 1/4] hv_netvsc: disable NAPI before channel close

2018-03-20 Thread Stephen Hemminger
This makes sure that no CPU is still process packets when
the channel is closed.

Fixes: 76bb5db5c749 ("netvsc: fix use after free on module removal")
Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0265d703eb03..e70a44273f55 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -568,6 +568,10 @@ void netvsc_device_remove(struct hv_device *device)
 
RCU_INIT_POINTER(net_device_ctx->nvdev, NULL);
 
+   /* And disassociate NAPI context from device */
+   for (i = 0; i < net_device->num_chn; i++)
+   netif_napi_del(&net_device->chan_table[i].napi);
+
/*
 * At this point, no one should be accessing net_device
 * except in here
@@ -579,10 +583,6 @@ void netvsc_device_remove(struct hv_device *device)
 
netvsc_teardown_gpadl(device, net_device);
 
-   /* And dissassociate NAPI context from device */
-   for (i = 0; i < net_device->num_chn; i++)
-   netif_napi_del(&net_device->chan_table[i].napi);
-
/* Release all resources */
free_netvsc_device_rcu(net_device);
 }
-- 
2.16.2

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


[PATCH PATCH net 2/4] hv_netvsc: use RCU to fix concurrent rx and queue changes

2018-03-20 Thread Stephen Hemminger
The receive processing may continue to happen while the
internal network device state is in RCU grace period.
The internal RNDIS structure is associated with the
internal netvsc_device structure; both have the same
RCU lifetime.

Defer freeing all associated parts until after grace
period.

Fixes: 0cf737808ae7 ("hv_netvsc: netvsc_teardown_gpadl() split")
Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c   | 17 +
 drivers/net/hyperv/rndis_filter.c | 39 ---
 2 files changed, 21 insertions(+), 35 deletions(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index e70a44273f55..12c044baf1af 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -90,6 +90,11 @@ static void free_netvsc_device(struct rcu_head *head)
= container_of(head, struct netvsc_device, rcu);
int i;
 
+   kfree(nvdev->extension);
+   vfree(nvdev->recv_buf);
+   vfree(nvdev->send_buf);
+   kfree(nvdev->send_section_map);
+
for (i = 0; i < VRSS_CHANNEL_MAX; i++)
vfree(nvdev->chan_table[i].mrc.slots);
 
@@ -211,12 +216,6 @@ static void netvsc_teardown_gpadl(struct hv_device *device,
net_device->recv_buf_gpadl_handle = 0;
}
 
-   if (net_device->recv_buf) {
-   /* Free up the receive buffer */
-   vfree(net_device->recv_buf);
-   net_device->recv_buf = NULL;
-   }
-
if (net_device->send_buf_gpadl_handle) {
ret = vmbus_teardown_gpadl(device->channel,
   net_device->send_buf_gpadl_handle);
@@ -231,12 +230,6 @@ static void netvsc_teardown_gpadl(struct hv_device *device,
}
net_device->send_buf_gpadl_handle = 0;
}
-   if (net_device->send_buf) {
-   /* Free up the send buffer */
-   vfree(net_device->send_buf);
-   net_device->send_buf = NULL;
-   }
-   kfree(net_device->send_section_map);
 }
 
 int netvsc_alloc_recv_comp_ring(struct netvsc_device *net_device, u32 q_idx)
diff --git a/drivers/net/hyperv/rndis_filter.c 
b/drivers/net/hyperv/rndis_filter.c
index 00ec80c23fe5..963314eb3226 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -264,13 +264,23 @@ static void rndis_set_link_state(struct rndis_device 
*rdev,
}
 }
 
-static void rndis_filter_receive_response(struct rndis_device *dev,
-  struct rndis_message *resp)
+static void rndis_filter_receive_response(struct net_device *ndev,
+ struct netvsc_device *nvdev,
+ const struct rndis_message *resp)
 {
+   struct rndis_device *dev = nvdev->extension;
struct rndis_request *request = NULL;
bool found = false;
unsigned long flags;
-   struct net_device *ndev = dev->ndev;
+
+   /* This should never happen, it means control message
+* response received after device removed.
+*/
+   if (dev->state == RNDIS_DEV_UNINITIALIZED) {
+   netdev_err(ndev,
+  "got rndis message uninitialized\n");
+   return;
+   }
 
spin_lock_irqsave(&dev->request_lock, flags);
list_for_each_entry(request, &dev->req_list, list_ent) {
@@ -352,7 +362,6 @@ static inline void *rndis_get_ppi(struct rndis_packet 
*rpkt, u32 type)
 
 static int rndis_filter_receive_data(struct net_device *ndev,
 struct netvsc_device *nvdev,
-struct rndis_device *dev,
 struct rndis_message *msg,
 struct vmbus_channel *channel,
 void *data, u32 data_buflen)
@@ -372,7 +381,7 @@ static int rndis_filter_receive_data(struct net_device 
*ndev,
 * should be the data packet size plus the trailer padding size
 */
if (unlikely(data_buflen < rndis_pkt->data_len)) {
-   netdev_err(dev->ndev, "rndis message buffer "
+   netdev_err(ndev, "rndis message buffer "
   "overflow detected (got %u, min %u)"
   "...dropping this message!\n",
   data_buflen, rndis_pkt->data_len);
@@ -400,35 +409,20 @@ int rndis_filter_receive(struct net_device *ndev,
 void *data, u32 buflen)
 {
struct net_device_context *net_device_ctx = netdev_priv(ndev);
-   struct rndis_device *rndis_dev = net_dev->extension;
struct rndis_message *rndis_msg = data;
 
-   /* Make sure the rndis device state is initialized */
-   if (unlikely(!rndis_dev)) {
-   netif_dbg(net_device_ctx, rx_err, ndev,
- "got rndis message but no rndis device!\n");
-

[PATCH PATCH net 3/4] hv_netvsc: change GPAD teardown order on older versions

2018-03-20 Thread Stephen Hemminger
On older versions of Windows, the host ignores messages after
vmbus channel is closed.

Workaround this by doing what Windows does and send the teardown
before close on older versions of NVSP protocol.

Reported-by: Mohammed Gamal 
Fixes: 0cf737808ae7 ("hv_netvsc: netvsc_teardown_gpadl() split")
Signed-off-by: Stephen Hemminger 
---
 drivers/net/hyperv/netvsc.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 12c044baf1af..37b0a30d6b03 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -571,10 +571,15 @@ void netvsc_device_remove(struct hv_device *device)
 */
netdev_dbg(ndev, "net device safe to remove\n");
 
+   /* older versions require that buffer be revoked before close */
+   if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_4)
+   netvsc_teardown_gpadl(device, net_device);
+
/* Now, we can close the channel safely */
vmbus_close(device->channel);
 
-   netvsc_teardown_gpadl(device, net_device);
+   if (net_device->nvsp_version >= NVSP_PROTOCOL_VERSION_4)
+   netvsc_teardown_gpadl(device, net_device);
 
/* Release all resources */
free_netvsc_device_rcu(net_device);
-- 
2.16.2

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


[PATCH 7/7] staging: mt7621-dma: Fixing parenthesis alignment

2018-03-20 Thread Christian Lütke-Stetzkamp
Fixes checkpatch check: PARENTHESIS_ALIGNMENT

Signed-off-by: Christian Lütke-Stetzkamp 
---
 drivers/staging/mt7621-dma/mtk-hsdma.c   | 29 +
 drivers/staging/mt7621-dma/ralink-gdma.c | 55 
 2 files changed, 43 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c 
b/drivers/staging/mt7621-dma/mtk-hsdma.c
index a0492f486810..df6ebf41bdea 100644
--- a/drivers/staging/mt7621-dma/mtk-hsdma.c
+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
@@ -191,13 +191,13 @@ static inline u32 mtk_hsdma_read(struct mtk_hsdam_engine 
*hsdma, u32 reg)
 }
 
 static inline void mtk_hsdma_write(struct mtk_hsdam_engine *hsdma,
-   unsigned reg, u32 val)
+  unsigned reg, u32 val)
 {
writel(val, hsdma->base + reg);
 }
 
 static void mtk_hsdma_reset_chan(struct mtk_hsdam_engine *hsdma,
-   struct mtk_hsdma_chan *chan)
+struct mtk_hsdma_chan *chan)
 {
chan->tx_idx = 0;
chan->rx_idx = HSDMA_DESCS_NUM - 1;
@@ -235,7 +235,7 @@ static void hsdma_dump_reg(struct mtk_hsdam_engine *hsdma)
 }
 
 static void hsdma_dump_desc(struct mtk_hsdam_engine *hsdma,
-   struct mtk_hsdma_chan *chan)
+   struct mtk_hsdma_chan *chan)
 {
struct hsdma_desc *tx_desc;
struct hsdma_desc *rx_desc;
@@ -256,7 +256,7 @@ static void hsdma_dump_desc(struct mtk_hsdam_engine *hsdma,
 }
 
 static void mtk_hsdma_reset(struct mtk_hsdam_engine *hsdma,
-   struct mtk_hsdma_chan *chan)
+   struct mtk_hsdma_chan *chan)
 {
int i;
 
@@ -319,7 +319,7 @@ static int mtk_hsdma_terminate_all(struct dma_chan *c)
 }
 
 static int mtk_hsdma_start_transfer(struct mtk_hsdam_engine *hsdma,
-   struct mtk_hsdma_chan *chan)
+   struct mtk_hsdma_chan *chan)
 {
dma_addr_t src, dst;
size_t len, tlen;
@@ -404,7 +404,7 @@ static int gdma_next_desc(struct mtk_hsdma_chan *chan)
 }
 
 static void mtk_hsdma_chan_done(struct mtk_hsdam_engine *hsdma,
-   struct mtk_hsdma_chan *chan)
+   struct mtk_hsdma_chan *chan)
 {
struct mtk_hsdma_desc *desc;
int chan_issued;
@@ -439,7 +439,7 @@ static irqreturn_t mtk_hsdma_irq(int irq, void *devid)
tasklet_schedule(&hsdma->task);
else
dev_dbg(hsdma->ddev.dev, "unhandle irq status %08x\n",
-   status);
+   status);
/* clean intr bits */
mtk_hsdma_write(hsdma, HSDMA_REG_INT_STATUS, status);
 
@@ -486,7 +486,8 @@ static struct dma_async_tx_descriptor 
*mtk_hsdma_prep_dma_memcpy(
 }
 
 static enum dma_status mtk_hsdma_tx_status(struct dma_chan *c,
-   dma_cookie_t cookie, struct dma_tx_state *state)
+  dma_cookie_t cookie,
+  struct dma_tx_state *state)
 {
return dma_cookie_status(c, cookie, state);
 }
@@ -546,7 +547,7 @@ static void mtk_hsdma_tasklet(unsigned long arg)
 }
 
 static int mtk_hsdam_alloc_desc(struct mtk_hsdam_engine *hsdma,
-   struct mtk_hsdma_chan *chan)
+   struct mtk_hsdma_chan *chan)
 {
int i;
 
@@ -568,7 +569,7 @@ static int mtk_hsdam_alloc_desc(struct mtk_hsdam_engine 
*hsdma,
 }
 
 static void mtk_hsdam_free_desc(struct mtk_hsdam_engine *hsdma,
-   struct mtk_hsdma_chan *chan)
+   struct mtk_hsdma_chan *chan)
 {
if (chan->tx_ring) {
dma_free_coherent(hsdma->ddev.dev,
@@ -610,8 +611,8 @@ static int mtk_hsdma_init(struct mtk_hsdam_engine *hsdma)
/* hardware info */
reg = mtk_hsdma_read(hsdma, HSDMA_REG_INFO);
dev_info(hsdma->ddev.dev, "rx: %d, tx: %d\n",
-   (reg >> HSDMA_INFO_RX_SHIFT) & HSDMA_INFO_RX_MASK,
-   (reg >> HSDMA_INFO_TX_SHIFT) & HSDMA_INFO_TX_MASK);
+(reg >> HSDMA_INFO_RX_SHIFT) & HSDMA_INFO_RX_MASK,
+(reg >> HSDMA_INFO_TX_SHIFT) & HSDMA_INFO_TX_MASK);
 
hsdma_dump_reg(hsdma);
 
@@ -685,7 +686,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
return -EINVAL;
}
ret = devm_request_irq(&pdev->dev, irq, mtk_hsdma_irq,
-   0, dev_name(&pdev->dev), hsdma);
+  0, dev_name(&pdev->dev), hsdma);
if (ret) {
dev_err(&pdev->dev, "failed to request irq\n");
return ret;
@@ -725,7 +726,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
}
 
ret = of_dma_controller_register(pdev->dev.of_node,
-   of_dma_xlate_by_chan_id, hsdma);
+of_dma_xlate_by_chan_id, hsdma);
if (ret) {
dev_err(&pdev->dev, "failed to regist

[PATCH 5/7] staging: mt7621-dma: Fix ident by space

2018-03-20 Thread Christian Lütke-Stetzkamp
Fixes checkpatch error: CODE_IDENT

Signed-off-by: Christian Lütke-Stetzkamp 
---
 drivers/staging/mt7621-dma/ralink-gdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-dma/ralink-gdma.c 
b/drivers/staging/mt7621-dma/ralink-gdma.c
index 60d557fb6553..27120a35ca33 100644
--- a/drivers/staging/mt7621-dma/ralink-gdma.c
+++ b/drivers/staging/mt7621-dma/ralink-gdma.c
@@ -907,7 +907,7 @@ static int gdma_dma_remove(struct platform_device *pdev)
struct gdma_dma_dev *dma_dev = platform_get_drvdata(pdev);
 
tasklet_kill(&dma_dev->task);
-of_dma_controller_free(pdev->dev.of_node);
+   of_dma_controller_free(pdev->dev.of_node);
dma_async_device_unregister(&dma_dev->ddev);
 
return 0;
-- 
2.13.6

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


[PATCH 6/7] staging: mt7621-dma: Removing unnecessary braces

2018-03-20 Thread Christian Lütke-Stetzkamp
Fixes checkpatch warning: BRACES

Signed-off-by: Christian Lütke-Stetzkamp 
---
 drivers/staging/mt7621-dma/mtk-hsdma.c   | 4 ++--
 drivers/staging/mt7621-dma/ralink-gdma.c | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c 
b/drivers/staging/mt7621-dma/mtk-hsdma.c
index 3ac120e42f3d..a0492f486810 100644
--- a/drivers/staging/mt7621-dma/mtk-hsdma.c
+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
@@ -507,9 +507,9 @@ static void mtk_hsdma_tx(struct mtk_hsdam_engine *hsdma)
 
if (test_and_clear_bit(0, &hsdma->chan_issued)) {
chan = &hsdma->chan[0];
-   if (chan->desc) {
+   if (chan->desc)
mtk_hsdma_start_transfer(hsdma, chan);
-   } else
+   else
dev_dbg(hsdma->ddev.dev, "chan 0 no desc to issue\n");
}
 }
diff --git a/drivers/staging/mt7621-dma/ralink-gdma.c 
b/drivers/staging/mt7621-dma/ralink-gdma.c
index 27120a35ca33..2d540c41fbde 100644
--- a/drivers/staging/mt7621-dma/ralink-gdma.c
+++ b/drivers/staging/mt7621-dma/ralink-gdma.c
@@ -595,11 +595,10 @@ static struct dma_async_tx_descriptor 
*gdma_dma_prep_dma_memcpy(
for (i = 0; i < num_periods; i++) {
desc->sg[i].src_addr = src;
desc->sg[i].dst_addr = dest;
-   if (len > xfer_count) {
+   if (len > xfer_count)
desc->sg[i].len = xfer_count;
-   } else {
+   else
desc->sg[i].len = len;
-   }
src += desc->sg[i].len;
dest += desc->sg[i].len;
len -= desc->sg[i].len;
-- 
2.13.6

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


[PATCH 4/7] staging: mt7621-dma: Remove assignment in if

2018-03-20 Thread Christian Lütke-Stetzkamp
Fixes checkpatch error: ASSIGN_IN_IF by defining a new variable before if

Signed-off-by: Christian Lütke-Stetzkamp 
---
 drivers/staging/mt7621-dma/ralink-gdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-dma/ralink-gdma.c 
b/drivers/staging/mt7621-dma/ralink-gdma.c
index 9548ce4afb77..60d557fb6553 100644
--- a/drivers/staging/mt7621-dma/ralink-gdma.c
+++ b/drivers/staging/mt7621-dma/ralink-gdma.c
@@ -678,6 +678,7 @@ static enum dma_status gdma_dma_tx_status(struct dma_chan 
*c,
 
spin_lock_irqsave(&chan->vchan.lock, flags);
desc = chan->desc;
+   vdesc = vchan_find_desc(&chan->vchan, cookie);
if (desc && (cookie == desc->vdesc.tx.cookie)) {
/*
 * We never update edesc->residue in the cyclic case, so we
@@ -689,7 +690,7 @@ static enum dma_status gdma_dma_tx_status(struct dma_chan 
*c,
((chan->next_sg - 1) * desc->sg[0].len);
else
state->residue = desc->residue;
-   } else if ((vdesc = vchan_find_desc(&chan->vchan, cookie)))
+   } else if (vdesc)
state->residue = to_gdma_dma_desc(vdesc)->residue;
spin_unlock_irqrestore(&chan->vchan.lock, flags);
 
-- 
2.13.6

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


[PATCH 1/7] staging: mt7621-dma: Fix Pointer Location

2018-03-20 Thread Christian Lütke-Stetzkamp
Fixes checkpatch error: POINTER_LOCATION

Signed-off-by: Christian Lütke-Stetzkamp 
---
 drivers/staging/mt7621-dma/mtk-hsdma.c   | 2 +-
 drivers/staging/mt7621-dma/ralink-gdma.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c 
b/drivers/staging/mt7621-dma/mtk-hsdma.c
index 5eba86e2d566..507cb68e7808 100644
--- a/drivers/staging/mt7621-dma/mtk-hsdma.c
+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
@@ -462,7 +462,7 @@ static void mtk_hsdma_issue_pending(struct dma_chan *c)
spin_unlock_bh(&chan->vchan.lock);
 }
 
-static struct dma_async_tx_descriptor * mtk_hsdma_prep_dma_memcpy(
+static struct dma_async_tx_descriptor *mtk_hsdma_prep_dma_memcpy(
struct dma_chan *c, dma_addr_t dest, dma_addr_t src,
size_t len, unsigned long flags)
 {
diff --git a/drivers/staging/mt7621-dma/ralink-gdma.c 
b/drivers/staging/mt7621-dma/ralink-gdma.c
index 23ddd64eb1b3..b550385a4519 100644
--- a/drivers/staging/mt7621-dma/ralink-gdma.c
+++ b/drivers/staging/mt7621-dma/ralink-gdma.c
@@ -569,7 +569,7 @@ static struct dma_async_tx_descriptor 
*gdma_dma_prep_slave_sg(
return NULL;
 }
 
-static struct dma_async_tx_descriptor * gdma_dma_prep_dma_memcpy(
+static struct dma_async_tx_descriptor *gdma_dma_prep_dma_memcpy(
struct dma_chan *c, dma_addr_t dest, dma_addr_t src,
size_t len, unsigned long flags)
 {
-- 
2.13.6

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


[PATCH 3/7] staging: mt7621-dma: Fix open brace position

2018-03-20 Thread Christian Lütke-Stetzkamp
Fixes checkpatch error: OPEN_BRACE

Signed-off-by: Christian Lütke-Stetzkamp 
---
 drivers/staging/mt7621-dma/ralink-gdma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/mt7621-dma/ralink-gdma.c 
b/drivers/staging/mt7621-dma/ralink-gdma.c
index b550385a4519..9548ce4afb77 100644
--- a/drivers/staging/mt7621-dma/ralink-gdma.c
+++ b/drivers/staging/mt7621-dma/ralink-gdma.c
@@ -134,8 +134,7 @@ struct gdma_dma_dev {
struct gdma_dmaengine_chan chan[];
 };
 
-struct gdma_data
-{
+struct gdma_data {
int chancnt;
u32 done_int_reg;
void (*init)(struct gdma_dma_dev *dma_dev);
-- 
2.13.6

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


[PATCH 2/7] staging: mt7621-dma: Fix Spacing

2018-03-20 Thread Christian Lütke-Stetzkamp
Fixes checkpatch error: SPACING

Signed-off-by: Christian Lütke-Stetzkamp 
---
 drivers/staging/mt7621-dma/mtk-hsdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c 
b/drivers/staging/mt7621-dma/mtk-hsdma.c
index 507cb68e7808..3ac120e42f3d 100644
--- a/drivers/staging/mt7621-dma/mtk-hsdma.c
+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
@@ -510,7 +510,7 @@ static void mtk_hsdma_tx(struct mtk_hsdam_engine *hsdma)
if (chan->desc) {
mtk_hsdma_start_transfer(hsdma, chan);
} else
-   dev_dbg(hsdma->ddev.dev,"chan 0 no desc to issue\n");
+   dev_dbg(hsdma->ddev.dev, "chan 0 no desc to issue\n");
}
 }
 
-- 
2.13.6

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


[PATCH 0/7] staging: mt7621: Checkpatch cleanup

2018-03-20 Thread Christian Lütke-Stetzkamp
This patchset fiexes errors, warnings and checks found by checkpatch.

Christian Lütke-Stetzkamp (7):
  staging: mt7621-dma: Fix Pointer Location
  staging: mt7621-dma: Fix Spacing
  staging: mt7621-dma: Fix open brace position
  staging: mt7621-dma: Remove assignment in if
  staging: mt7621-dma: Fix ident by space
  staging: mt7621-dma: Removing unnecessary braces
  staging: mt7621-dma: Fixing parenthesis alignment

 drivers/staging/mt7621-dma/mtk-hsdma.c   | 37 +
 drivers/staging/mt7621-dma/ralink-gdma.c | 70 
 2 files changed, 54 insertions(+), 53 deletions(-)

-- 
2.13.6

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


[PATCH] staging: pi433: cleanup local variable

2018-03-20 Thread Valentin Vidic
Rename temporary local variable and add required blank line.

Fixes checkpatch warning:

  WARNING: Missing a blank line after declarations

Signed-off-by: Valentin Vidic 
---
 drivers/staging/pi433/pi433_if.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 583b3803cf38..d1e0ddbc79ce 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -711,12 +711,13 @@ pi433_tx_thread(void *data)
while ((repetitions > 0) && (size > position)) {
if ((size - position) > device->free_in_fifo) {
/* msg to big for fifo - take a part */
-   int temp = device->free_in_fifo;
+   int write_size = device->free_in_fifo;
+
device->free_in_fifo = 0;
rf69_write_fifo(spi,
&device->buffer[position],
-   temp);
-   position += temp;
+   write_size);
+   position += write_size;
} else {
/* msg fits into fifo - take all */
device->free_in_fifo -= size;
-- 
2.16.2

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


[v2 PATCH 1/5] Staging:rtl8723bs static variables are always 0

2018-03-20 Thread Paul McQuade
C standard guarantees that:
global and static variables will be implicitly initialized to 0 or NULL
if no explicit initializer is given.

Signed-off-by: Paul McQuade 
---
 drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c 
b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index 9a885e626d1c..37ee8d90709a 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -19,7 +19,7 @@
 
 #ifdef PROC_DEBUG
 
-static struct proc_dir_entry *rtw_proc = NULL;
+static struct proc_dir_entry *rtw_proc;
 
 #define RTW_PROC_NAME "rtl8723bs"
 
-- 
2.16.2

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


[v2 PATCH 5/5] Staging:rtl8723bs clean spaces

2018-03-20 Thread Paul McQuade
Used checkpatch.pl to clean up spaces around if and for statements
to make it easier to read

Signed-off-by: Paul McQuade 
---
 drivers/staging/rtl8723bs/os_dep/recv_linux.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c 
b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index b43e24c3a23a..e6de8d2eabb7 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -20,8 +20,7 @@
 
 void rtw_os_free_recvframe(union recv_frame *precvframe)
 {
-   if (precvframe->u.hdr.pkt)
-   {
+   if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver 
*/
 
precvframe->u.hdr.pkt = NULL;
@@ -46,10 +45,8 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
 
precvframe = (union recv_frame*) precvpriv->precv_frame_buf;
 
-   for (i = 0; i < NR_RECVFRAME; i++)
-   {
-   if (precvframe->u.hdr.pkt)
-   {
+   for (i = 0; i < NR_RECVFRAME; i++) {
+   if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by 
driver */
precvframe->u.hdr.pkt = NULL;
}
-- 
2.16.2

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


[v2 PATCH 2/5] Staging:rtl8723bs clean up spaces

2018-03-20 Thread Paul McQuade
Used checkpatch.pl to clean up spaces around
for statements to make it easier to read

Signed-off-by: Paul McQuade 
---
 drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c 
b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index 37ee8d90709a..49c8684dc25b 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -142,7 +142,7 @@ int rtw_drv_proc_init(void)
goto exit;
}
 
-   for (i = 0;icam_cache[i].ctrl != 0)
DBG_871X_SEL_NL(m, "%2u 0x%04x "MAC_FMT" "KEY_FMT" %3u 
%-7s"
/*  %2u %2u 0x%02x %5u" */
@@ -663,7 +663,7 @@ static struct proc_dir_entry *rtw_odm_proc_init(struct 
net_device *dev)
 
adapter->dir_odm = dir_odm;
 
-   for (i = 0;idir_dev);
@@ -721,7 +721,7 @@ struct proc_dir_entry *rtw_adapter_proc_init(struct 
net_device *dev)
 
adapter->dir_dev = dir_dev;
 
-   for (i = 0;ihttp://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[v2 PATCH 3/5] Staging:rtl8723bs Remove unnecessary braces

2018-03-20 Thread Paul McQuade
Remove unnecessary parentheses highlighted by checkpatch.pl

Signed-off-by: Paul McQuade 
---
 drivers/staging/rtl8723bs/os_dep/recv_linux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c 
b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index e804b430931c..117fda4fa1bf 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -181,11 +181,11 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, 
_pkt *pkt, struct rx_pkt
pkt->dev = padapter->pnetdev;
 
 #ifdef CONFIG_TCP_CSUM_OFFLOAD_RX
-   if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1)) 
{
+   if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
pkt->ip_summed = CHECKSUM_UNNECESSARY;
-   } else {
+   else
pkt->ip_summed = CHECKSUM_NONE;
-   }
+
 #else /* !CONFIG_TCP_CSUM_OFFLOAD_RX */
pkt->ip_summed = CHECKSUM_NONE;
 #endif /* CONFIG_TCP_CSUM_OFFLOAD_RX */
-- 
2.16.2

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


[v2 PATCH 4/5] Staging:rtl8723bs:Add blank line after declaration

2018-03-20 Thread Paul McQuade
missing a blank line after declaration checkpatch warnings.
Issue found by checkpatch.pl

Signed-off-by: Paul McQuade 
---
 drivers/staging/rtl8723bs/os_dep/recv_linux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c 
b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 117fda4fa1bf..b43e24c3a23a 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -43,6 +43,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
 {
sint i;
union recv_frame *precvframe;
+
precvframe = (union recv_frame*) precvpriv->precv_frame_buf;
 
for (i = 0; i < NR_RECVFRAME; i++)
-- 
2.16.2

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


[PATCH 1/2] staging: vc04_services: Remove import of bcm2835-camera from TODO

2018-03-20 Thread Stefan Wahren
The bcm2835-camera driver has already been imported. So remove it from the TODO.

Signed-off-by: Stefan Wahren 
---
 drivers/staging/vc04_services/interface/vchi/TODO | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchi/TODO 
b/drivers/staging/vc04_services/interface/vchi/TODO
index 46b20a1..84e6733 100644
--- a/drivers/staging/vc04_services/interface/vchi/TODO
+++ b/drivers/staging/vc04_services/interface/vchi/TODO
@@ -9,11 +9,6 @@ some of the ones we want:
   requests to the firmware, which are transmitted across VCHIQ.  vcdbg
   is really useful for debugging firmware interactions.
 
-  - bcm2835-camera 
(https://github.com/raspberrypi/linux/tree/rpi-4.4.y/drivers/media/platform/bcm2835)
-
-  This driver will let us get images from the camera using the MMAL
-  protocol over VCHI.
-
   - VCSM 
(https://github.com/raspberrypi/linux/tree/rpi-4.4.y/drivers/char/broadcom/vc_sm)
 
   This driver is used for talking about regions of VC memory across
-- 
2.7.4

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


[PATCH 2/2] staging: vc04_services: Add outstanding VCHI TODOs

2018-03-20 Thread Stefan Wahren
The TODO list missed some issues before we can move the driver out of staging.

Signed-off-by: Stefan Wahren 
---
 drivers/staging/vc04_services/interface/vchi/TODO | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/drivers/staging/vc04_services/interface/vchi/TODO 
b/drivers/staging/vc04_services/interface/vchi/TODO
index 84e6733..7144de2 100644
--- a/drivers/staging/vc04_services/interface/vchi/TODO
+++ b/drivers/staging/vc04_services/interface/vchi/TODO
@@ -23,3 +23,30 @@ there's a lot code that got built that's probably 
unnecessary these
 days.  Once we have the set of VCHI-using drivers we want in tree, we
 should be able to do a sweep of the code to see what's left that's
 unused.
+
+3) Make driver more portable
+
+Building this driver with arm/multi_v7_defconfig or arm64/defconfig
+leads to data corruption during vchiq_test. This should be fixed.
+
+4) Fix kernel module support
+
+Even the VPU firmware doesn't support a VCHI re-connect, the driver
+should properly handle a module unload. This also includes that all
+resources must be freed (kthreads, debugfs entries, ...) and global
+variables avoided.
+
+5) Fix stack hog
+
+Running make checkstack shows that vchiq_dump_service_use_state() has
+an extensive stack usage. Maybe other functions are also affected.
+
+6) Cleanup logging mechanism
+
+The driver should probably be using the standard kernel logging mechanisms
+such as dev_info, dev_dbg, and friends.
+
+7) Documentation
+
+A short top-down description of this driver's architecture (function of
+kthreads, userspace, limitations) could be very helpful for reviewers.
-- 
2.7.4

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


Re: [PATCH 01/11] staging: wilc1000: refactor scan() to free kmalloc memory on failure cases

2018-03-20 Thread Dan Carpenter
On Tue, Mar 20, 2018 at 10:25:34PM +0530, Ajay Singh wrote:
> Added changes to free the allocated memory in scan() for error condition.
> Also added 'NULL' check validation before accessing allocated memory.
> 
> Signed-off-by: Ajay Singh 
> ---
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 62 
> +--
>  1 file changed, 46 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
> b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index 9d8d5d0..b784e15 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -582,6 +582,49 @@ static int set_channel(struct wiphy *wiphy,
>   return result;
>  }
>  
> +static inline bool

This shouldn't be a bool function.  It should return 0 and -ENOMEM.
Bool functions should kind of have the return values built into the name
like access_ok() or IS_ERR().

> +wilc_wfi_cfg_alloc_fill_ssid(struct cfg80211_scan_request *request,
> +  struct hidden_network *ntwk)
> +{
> + int i = 0;

No need to initialize "i".

> +
> + ntwk->net_info = kcalloc(request->n_ssids,
> +  sizeof(struct hidden_network), GFP_KERNEL);
> +
> + if (!ntwk->net_info)
> + goto out;

Don't put a blank line between the alloc and the check.  They're as
connected as can be.  I hate "goto out;" but that is a personal
preference which I would never push on to other developers...

> +
> + ntwk->n_ssids = request->n_ssids;
> +
> + for (i = 0; i < request->n_ssids; i++) {
> + if (request->ssids[i].ssid_len > 0) {
> + struct hidden_net_info *info = &ntwk->net_info[i];
> +
> + info->ssid = kmemdup(request->ssids[i].ssid,
> +  request->ssids[i].ssid_len,
> +  GFP_KERNEL);
> +
> + if (!info->ssid)
> + goto out_free;
> +
> + info->ssid_len = request->ssids[i].ssid_len;
> + } else {
> + ntwk->n_ssids -= 1;
> + }

You didn't introduce the problem, but this loop seems kind of buggy.  We
should have two iterators, one for request->ssids[i] and one for
ntwk->net_info[i].  Otherwise we're copying the array information but
we're leaving holes in the destination array.  Which would be fine
except we're not saving the totaly number of elements in the destination
array, we're saving the number of elements with stuff in them.

So imagine that we have a request->n_ssids == 10 but only the last
three elements have request->ssids[i].ssid_len > 0.  Then we record that
ntwk->n_ssids is 3 but wthose elements are all holes.  So that can't
work.  See handle_scan():

for (i = 0; i < hidden_net->n_ssids; i++)
valuesize += ((hidden_net->net_info[i].ssid_len) + 1);

"valuesize" is wrong because it's looking at holes.

> + }
> + return true;
> +
> +out_free:
> +
> + for (; i >= 0 ; i--)
> + kfree(ntwk->net_info[i].ssid);

The first kfree(ntwk->net_info[i].ssid); is a no-op.  You could write
this like:

while (--i >= 0)
kfree(ntwk->net_info[i].ssid);

Or:

while (i--)
kfree(ntwk->net_info[i].ssid);

Or you could do:

for (i--; i >= 0 ; i--)
kfree(ntwk->net_info[i].ssid);

I don't care...

regards,
dan carpenter

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


Re: [PATCH v3]PCI: hv: fix PCI-BUS domainID corruption

2018-03-20 Thread Lorenzo Pieralisi
On Tue, Mar 20, 2018 at 05:56:15PM +, Sridhar Pitchai wrote:
> Hi Lorenzo,

> Are we good with the explanation? Can I send the patch with the
> updated commit comments?

Almost.

[...]

> Since we have the transparent SRIOV mode now, the short VF device name
> is no longer needed.

Can you correlate transparent SRIOV mode to the point you are making
below ? Please explain what transparent SRIOV mode allows you to remove
and why. The rest of the explanation seems OK.

Please follow this email format:

http://vger.kernel.org/lkml/#s3-9

Thanks,
Lorenzo

> I still do not understand what this means and how it is related to the
> patch below, it may be clear to you, it is not to me, at all.
> 
> Sridhar >> the patch below, was introduced to make the device name small, 
> by taking only
> 16bits of the serial number. Since we are not going to have the serial 
> number
> updated to the BUS id, this has to be removed.
> 
> Fixes: 4a9b0933bdfc("PCI:hv:Use device serial number as PCI domain")
> 
> Fixes: 4a9b0933bdfc ("PCI: hv: Use device serial number as PCI domain")
> Sridhr >> yes
> 
> I asked you an explicit question. Commit above was added for a reason
> I assume. This patch implies that kernel has been broken since v4.11
> which is almost a year ago and nobody every noticed ? Or there are
> systems where commit above is _necessary_ and this patch would break
> them ?
> 
> I want a detailed explanation that highlights *why* it is safe to apply
> this patch and send it to stable kernels, commit log above won't do.
> 
> Sridhar>> HyperV provides a unique domain ID for PCI BUS. But it is 
> modified by the child
> device when it is added. This cannot produce a unique domain ID all the 
> time.
> Here in the bug, we see the collision between the serial number and 
> already
> existing PCI bus. The cleaner way is never touch the domain ID provided by
> hyperV during the PCI bus creation. As long as hyperV make sure it 
> provides a
> unique domain ID for the PCI for a VM it will not break, and HyperV will
> guarantees that the domain for the PCI bus for a given VM will be always 
> unique.
> The original patch was also intending to have a unique domain ID for the 
> PCI
> bus, by taking the serial number of the device, but it is not sufficient, 
> when
> the device serial number is number which is the domain ID of the existing 
> PCI
> bus.  With the current kernel we can repro this issue by adding a device 
> with a
> serial number matching the existing PCI bus domain id. (in this case that
> happens to be zero).
> 
> 
> Thanks,
> Lorenzo
> 
> Cc: sta...@vger.kernel.org
> Signed-off-by: Sridhar Pitchai 
> ---
> Changes in v3:
> * fix the commit comment. [KY Srinivasan, Michael Kelley]
> ---
>   drivers/pci/host/pci-hyperv.c | 11 ---
>   1 file changed, 11 deletions(-)
> diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
> index 2faf38e..ac67e56 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -1518,17 +1518,6 @@ static struct hv_pci_dev 
> *new_pcichild_device(struct hv_pcibus_device *hbus,
>   get_pcichild(hpdev, hv_pcidev_ref_childlist);
>   spin_lock_irqsave(&hbus->device_list_lock, flags);
>   
> - /*
> -  * When a device is being added to the bus, we set the PCI domain
> -  * number to be the device serial number, which is non-zero and
> -  * unique on the same VM.  The serial numbers start with 1, and
> -  * increase by 1 for each device.  So device names including this
> -  * can have shorter names than based on the bus instance UUID.
> -  * Only the first device serial number is used for domain, so the
> -  * domain number will not change after the first device is added.
> -  */
> - if (list_empty(&hbus->children))
> - hbus->sysdata.domain = desc->ser;
>   list_add_tail(&hpdev->list_entry, &hbus->children);
>   spin_unlock_irqrestore(&hbus->device_list_lock, flags);
>   return hpdev;
> --
> 2.7.4 
> 
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 06/21] fpga: Remove depends on HAS_DMA in case of platform dependency

2018-03-20 Thread Alan Tull
On Tue, Mar 20, 2018 at 5:04 AM, Geert Uytterhoeven
 wrote:

Hi Geert,

> Hi Alan,
>
> On Mon, Mar 19, 2018 at 5:06 PM, Alan Tull  wrote:
>> On Fri, Mar 16, 2018 at 8:51 AM, Geert Uytterhoeven
>>  wrote:
>> This essentially removes this commit
>>
>> commit 1c8cb409491403036919dd1c6b45013dc8835a44
>> Author: Sudip Mukherjee 
>> Date:   Wed Aug 3 13:45:46 2016 -0700
>>
>> drivers/fpga/Kconfig: fix build failure
>>
>> While building m32r allmodconfig the build is failing with the error:
>>
>>   ERROR: "bad_dma_ops" [drivers/fpga/zynq-fpga.ko] undefined!
>>
>> Xilinx Zynq FPGA is using DMA but there was no dependency while
>> building.
>>
>> Link: 
>> http://lkml.kernel.org/r/1464346526-13913-1-git-send-email-sudipm.mukher...@gmail.com
>> Signed-off-by: Sudip Mukherjee 
>> Acked-by: Moritz Fischer 
>> Cc: Alan Tull 
>> Signed-off-by: Andrew Morton 
>> Signed-off-by: Linus Torvalds 
>
> Yes it does. The major change is that the first (core) series introduces
> all needed dummies to do successful compile-testing on NO_DMA=y platforms.

OK yes, I looked at the first patch that does the fix.  Looks good.
Thanks for doing this.

>
>>> Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
>>> symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
>>> In most cases this other symbol is an architecture or platform specific
>>> symbol, or PCI.
>>>
>>> Generic symbols and drivers without platform dependencies keep their
>>> dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
>>> cannot work anyway.
>>>
>>> This simplifies the dependencies, and allows to improve compile-testing.
>>>
>>> Signed-off-by: Geert Uytterhoeven 
>>> Reviewed-by: Mark Brown 
>>> Acked-by: Robin Murphy 
Acked-by: Alan Tull 

Regards,
Alan

>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> ge...@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
> -- Linus Torvalds
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3]PCI: hv: fix PCI-BUS domainID corruption

2018-03-20 Thread Sridhar Pitchai
Hi Lorenzo,
Are we good with the explanation? Can I send the patch with the updated commit 
comments?

Thanks
Sridhar

On 3/15/18, 11:24 AM, "Sridhar Pitchai"  wrote:

Apologies for not aligning my reply, I just realized after looking into
the mail archive in LKML.  I have aligned the replay now.


On 3/15/18, 10:56 AM, "Sridhar Pitchai"  
wrote:

Hi Lorenzo,
Answering the question inline.
Kindly let me know if it clarifies. I will send out another patch after we 
agree on the clarification.

Thanks
Sridhar Pitchai

-Original Message-
From: Lorenzo Pieralisi 
Sent: Thursday, March 15, 2018 5:05 AM
To: Sridhar Pitchai 
Cc: Bjorn Helgaas ; Jake Oshins ; 
Haiyang Zhang ; Stephen Hemminger 
; Dexuan Cui ; KY Srinivasan 
; Michael Kelley (EOSG) ; 
de...@linuxdriverproject.org; linux-...@vger.kernel.org; 
linux-ker...@vger.kernel.org
Subject: Re: [PATCH v3]PCI: hv: fix PCI-BUS domainID corruption

On Thu, Mar 15, 2018 at 12:03:07AM +, Sridhar Pitchai wrote:
Whenever PCI bus is added, HyperV guarantees the BUS id is unique. Even

"Whenever a PCI bus is added"
Sridhar>> yes

with that when a first device is added to the bus, it overrides bus domain
ID with the device serial number. Sometime this can result in BUS ID not

Define "Sometime".

Sridhar>> HyperV when it creates a PCI bus it guarantees it provide a 
unique ID for it.
But, that unique BUS ID is replaced with device serial number. 0 is a valid
device serial number, and if there exists a PCI bus with domain ID 0 (Gen 1
version of hyperV VM have this for para virtual devices), this will result 
in
PCI bus id not being unique.


being unique. In this case, when PCI_BUS and a device to bus is added, the
first device overwrites the bus domain ID to the device serial number,
which is 0. Since there exsist a PCI bus with domain ID 0 already the PCI

s/exsist/exist

Sridhar>> yes

bus addition fails. This patch make sure when a device is added to a bus,
it never updated the bus domain ID.

s/updated/updates
Sridhar >> yes

Since we have the transparent SRIOV mode now, the short VF device name
is no longer needed.

I still do not understand what this means and how it is related to the
patch below, it may be clear to you, it is not to me, at all.

Sridhar >> the patch below, was introduced to make the device name small, 
by taking only
16bits of the serial number. Since we are not going to have the serial 
number
updated to the BUS id, this has to be removed.

Fixes: 4a9b0933bdfc("PCI:hv:Use device serial number as PCI domain")

Fixes: 4a9b0933bdfc ("PCI: hv: Use device serial number as PCI domain")
Sridhr >> yes

I asked you an explicit question. Commit above was added for a reason
I assume. This patch implies that kernel has been broken since v4.11
which is almost a year ago and nobody every noticed ? Or there are
systems where commit above is _necessary_ and this patch would break
them ?

I want a detailed explanation that highlights *why* it is safe to apply
this patch and send it to stable kernels, commit log above won't do.

Sridhar>> HyperV provides a unique domain ID for PCI BUS. But it is 
modified by the child
device when it is added. This cannot produce a unique domain ID all the 
time.
Here in the bug, we see the collision between the serial number and already
existing PCI bus. The cleaner way is never touch the domain ID provided by
hyperV during the PCI bus creation. As long as hyperV make sure it provides 
a
unique domain ID for the PCI for a VM it will not break, and HyperV will
guarantees that the domain for the PCI bus for a given VM will be always 
unique.
The original patch was also intending to have a unique domain ID for the PCI
bus, by taking the serial number of the device, but it is not sufficient, 
when
the device serial number is number which is the domain ID of the existing 
PCI
bus.  With the current kernel we can repro this issue by adding a device 
with a
serial number matching the existing PCI bus domain id. (in this case that
happens to be zero).


Thanks,
Lorenzo

Cc: sta...@vger.kernel.org
Signed-off-by: Sridhar Pitchai 
---
Changes in v3:
* fix the commit comment. [KY Srinivasan, Michael Kelley]
---
  drivers/pci/host/pci-hyperv.c | 11 ---
  1 file changed, 11 deletions(-)
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 2faf38e..ac67e56 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1518,17 +1518,6 @@ static struct hv_pci_dev *new_pcichild_device(struct 
hv_pcibus_device *hbus,
get_pcichild(hpdev, hv_pcidev_ref_ch

[PATCH 2/3] staging: ks7010: replace some custom defines with the ones in uapi/linux/if_ether.h

2018-03-20 Thread Sergio Paracuellos
This commit reviews some custom defines changing them for the
globals defined in if_ether header file.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/ks7010/eap_packet.h | 8 +---
 drivers/staging/ks7010/ks_hostif.c  | 8 
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/ks7010/eap_packet.h 
b/drivers/staging/ks7010/eap_packet.h
index dca2a14..1bf1a8c 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -3,13 +3,10 @@
 #define EAP_PACKET_H
 
 #include 
+#include 
 
 #define WBIT(n) (1 << (n))
 
-#ifndef ETH_ALEN
-#define ETH_ALEN 6
-#endif
-
 #define ETHER_HDR_SIZE 20
 
 struct ether_hdr {
@@ -20,9 +17,6 @@ struct ether_hdr {
unsigned char h_command;
unsigned char h_vendor_id[3];
__be16 h_proto; /* packet type ID field */
-#define ETHER_PROTOCOL_TYPE_EAP0x888e
-#define ETHER_PROTOCOL_TYPE_IP 0x0800
-#define ETHER_PROTOCOL_TYPE_ARP0x0806
/* followed by length octets of data */
 } __packed;
 
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index ce1ac11..3ef9126 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1152,7 +1152,7 @@ int hostif_data_request(struct ks_wlan_private *priv, 
struct sk_buff *skb)
eth_proto = ntohs(eth_hdr->h_proto);
 
/* for MIC FAILURE REPORT check */
-   if (eth_proto == ETHER_PROTOCOL_TYPE_EAP &&
+   if (eth_proto == ETH_P_PAE &&
priv->wpa.mic_failure.failure > 0) {
aa1x_hdr = (struct ieee802_1x_hdr *)(eth_hdr + 1);
if (aa1x_hdr->type == IEEE802_1X_TYPE_EAPOL_KEY) {
@@ -1162,7 +1162,7 @@ int hostif_data_request(struct ks_wlan_private *priv, 
struct sk_buff *skb)
}
 
if (priv->wpa.rsn_enabled && priv->wpa.key[0].key_len) {
-   if (eth_proto == ETHER_PROTOCOL_TYPE_EAP &&
+   if (eth_proto == ETH_P_PAE &&
priv->wpa.key[1].key_len == 0 &&
priv->wpa.key[2].key_len == 0 &&
priv->wpa.key[3].key_len == 0) {
@@ -1189,7 +1189,7 @@ int hostif_data_request(struct ks_wlan_private *priv, 
struct sk_buff *skb)
}
}
} else {
-   if (eth_proto == ETHER_PROTOCOL_TYPE_EAP)
+   if (eth_proto == ETH_P_PAE)
pp->auth_type = cpu_to_le16((uint16_t)TYPE_AUTH);
else
pp->auth_type = cpu_to_le16((uint16_t)TYPE_DATA);
@@ -1206,7 +1206,7 @@ int hostif_data_request(struct ks_wlan_private *priv, 
struct sk_buff *skb)
   send_packet_complete, skb);
 
/* MIC FAILURE REPORT check */
-   if (eth_proto == ETHER_PROTOCOL_TYPE_EAP &&
+   if (eth_proto == ETH_P_PAE &&
priv->wpa.mic_failure.failure > 0) {
if (keyinfo & WPA_KEY_INFO_ERROR &&
keyinfo & WPA_KEY_INFO_REQUEST) {
-- 
2.7.4

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


[PATCH 3/3] staging: ks7010: review custom bit defines using macros from bitops header file

2018-03-20 Thread Sergio Paracuellos
This commit reviews custom definitions using custom bit macros changing
them for the ones defined in the bitops header file.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/ks7010/eap_packet.h | 33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/ks7010/eap_packet.h 
b/drivers/staging/ks7010/eap_packet.h
index 1bf1a8c..58c2a3d 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -3,10 +3,9 @@
 #define EAP_PACKET_H
 
 #include 
+#include 
 #include 
 
-#define WBIT(n) (1 << (n))
-
 #define ETHER_HDR_SIZE 20
 
 struct ether_hdr {
@@ -98,23 +97,23 @@ struct wpa_eapol_key {
/* followed by key_data_length bytes of key_data */
 } __packed;
 
-#define WPA_KEY_INFO_TYPE_MASK (WBIT(0) | WBIT(1) | WBIT(2))
-#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 WBIT(0)
-#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES WBIT(1)
-#define WPA_KEY_INFO_KEY_TYPE WBIT(3)  /* 1 = Pairwise, 0 = Group key */
+#define WPA_KEY_INFO_TYPE_MASK GENMASK(2, 0)
+#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 BIT(0)
+#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES BIT(1)
+#define WPA_KEY_INFO_KEY_TYPE BIT(3)   /* 1 = Pairwise, 0 = Group key */
 /* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */
-#define WPA_KEY_INFO_KEY_INDEX_MASK (WBIT(4) | WBIT(5))
+#define WPA_KEY_INFO_KEY_INDEX_MASK GENMASK(5, 4)
 #define WPA_KEY_INFO_KEY_INDEX_SHIFT 4
-#define WPA_KEY_INFO_INSTALL WBIT(6)   /* pairwise */
-#define WPA_KEY_INFO_TXRX WBIT(6)  /* group */
-#define WPA_KEY_INFO_ACK WBIT(7)
-#define WPA_KEY_INFO_MIC WBIT(8)
-#define WPA_KEY_INFO_SECURE WBIT(9)
-#define WPA_KEY_INFO_ERROR WBIT(10)
-#define WPA_KEY_INFO_REQUEST WBIT(11)
-#define WPA_KEY_INFO_ENCR_KEY_DATA WBIT(12)/* IEEE 802.11i/RSN only */
-
-#define WPA_CAPABILITY_PREAUTH WBIT(0)
+#define WPA_KEY_INFO_INSTALL BIT(6)/* pairwise */
+#define WPA_KEY_INFO_TXRX BIT(6)   /* group */
+#define WPA_KEY_INFO_ACK BIT(7)
+#define WPA_KEY_INFO_MIC BIT(8)
+#define WPA_KEY_INFO_SECURE BIT(9)
+#define WPA_KEY_INFO_ERROR BIT(10)
+#define WPA_KEY_INFO_REQUEST BIT(11)
+#define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12) /* IEEE 802.11i/RSN only */
+
+#define WPA_CAPABILITY_PREAUTH BIT(0)
 
 #define GENERIC_INFO_ELEM 0xdd
 #define RSN_INFO_ELEM 0x30
-- 
2.7.4

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


[PATCH 1/3] staging: ks7010: remove not used function signature ks_wlan_read_config_file

2018-03-20 Thread Sergio Paracuellos
This commit removes definition of function ks_wlan_read_config_file
which is not being used at all.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/ks7010/ks_wlan_ioctl.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h 
b/drivers/staging/ks7010/ks_wlan_ioctl.h
index 28b381c..121e7cb 100644
--- a/drivers/staging/ks7010/ks_wlan_ioctl.h
+++ b/drivers/staging/ks7010/ks_wlan_ioctl.h
@@ -58,7 +58,6 @@
 #include "ks_wlan.h"
 #include 
 
-int ks_wlan_read_config_file(struct ks_wlan_private *priv);
 int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
unsigned int commit_flag);
 
-- 
2.7.4

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


[PATCH 0/3] staging: ks7010: Reviews some custom stuff in favour of kernel definitions

2018-03-20 Thread Sergio Paracuellos
This patch series removes some custom definitions included in the driver
replacing them with the ones used in the linux kernel global headers. Not
used function signature is removed also.

Sergio Paracuellos (3):
  staging: ks7010: remove not used function signature
ks_wlan_read_config_file
  staging: ks7010: replace some custom defines with the ones in
uapi/linux/if_ether.h
  staging: ks7010: review custom bit defines using macros from bitops
header file

 drivers/staging/ks7010/eap_packet.h| 41 ++
 drivers/staging/ks7010/ks_hostif.c |  8 +++
 drivers/staging/ks7010/ks_wlan_ioctl.h |  1 -
 3 files changed, 21 insertions(+), 29 deletions(-)

-- 
2.7.4

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


[PATCH 11/11] staging: wilc1000: remove line over 80 char warning in few functions

2018-03-20 Thread Ajay Singh
Remove 'line over 80 characters' issues found by checkpatch.pl script
for following functions.

disconnect()
del_pmksa()
wilc_create_wiphy()
del_pmksa()

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

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index b9bba86..69f1e06 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -823,7 +823,8 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
return ret;
 }
 
-static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 
reason_code)
+static int disconnect(struct wiphy *wiphy, struct net_device *dev,
+ u16 reason_code)
 {
s32 ret = 0;
struct wilc_priv *priv;
@@ -1267,7 +1268,8 @@ static int del_pmksa(struct wiphy *wiphy, struct 
net_device *netdev,
for (i = 0; i < priv->pmkid_list.numpmkid; i++) {
if (!memcmp(pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid,
ETH_ALEN)) {
-   memset(&priv->pmkid_list.pmkidlist[i], 0, sizeof(struct 
host_if_pmkid));
+   memset(&priv->pmkid_list.pmkidlist[i], 0,
+  sizeof(struct host_if_pmkid));
break;
}
}
@@ -1979,7 +1981,8 @@ static int add_station(struct wiphy *wiphy, struct 
net_device *dev,
 
if (vif->iftype == AP_MODE || vif->iftype == GO_MODE) {
memcpy(sta_params.bssid, mac, ETH_ALEN);
-   memcpy(priv->assoc_stainfo.sta_associated_bss[params->aid], 
mac, ETH_ALEN);
+   memcpy(priv->assoc_stainfo.sta_associated_bss[params->aid], mac,
+  ETH_ALEN);
sta_params.aid = params->aid;
sta_params.rates_len = params->supported_rates_len;
sta_params.rates = params->supported_rates;
@@ -2235,7 +2238,8 @@ static struct wireless_dev *wilc_wfi_cfg_alloc(void)
return NULL;
 }
 
-struct wireless_dev *wilc_create_wiphy(struct net_device *net, struct device 
*dev)
+struct wireless_dev *wilc_create_wiphy(struct net_device *net,
+  struct device *dev)
 {
struct wilc_priv *priv;
struct wireless_dev *wdev;
-- 
2.7.4

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


[PATCH 09/11] staging: wilc1000: remove line over 80 char in cfg_connect_result()

2018-03-20 Thread Ajay Singh
Fix 'line over 80 characters' issues reported by checkpatch.pl script in
cfg_connect_result().

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 34 +++
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 1b6fe64..af1b8aa 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -460,6 +460,17 @@ static void cfg_scan_result(enum scan_event scan_event,
}
 }
 
+static inline bool wilc_wfi_cfg_scan_time_expired(int i)
+{
+   unsigned long now = jiffies;
+
+   if (time_after(now, last_scanned_shadow[i].time_scan_cached +
+  (unsigned long)(nl80211_SCAN_RESULT_EXPIRE - (1 * HZ
+   return true;
+   else
+   return false;
+}
+
 int wilc_connecting;
 
 static void cfg_connect_result(enum conn_event conn_disconn_evt,
@@ -505,17 +516,14 @@ static void cfg_connect_result(enum conn_event 
conn_disconn_evt,
bool scan_refresh = false;
u32 i;
 
-   memcpy(priv->associated_bss, conn_info->bssid, 
ETH_ALEN);
+   memcpy(priv->associated_bss, conn_info->bssid,
+  ETH_ALEN);
 
for (i = 0; i < last_scanned_cnt; i++) {
if (memcmp(last_scanned_shadow[i].bssid,
   conn_info->bssid,
   ETH_ALEN) == 0) {
-   unsigned long now = jiffies;
-
-   if (time_after(now,
-  
last_scanned_shadow[i].time_scan_cached +
-  (unsigned 
long)(nl80211_SCAN_RESULT_EXPIRE - (1 * HZ
+   if (wilc_wfi_cfg_scan_time_expired(i))
scan_refresh = true;
 
break;
@@ -527,9 +535,11 @@ static void cfg_connect_result(enum conn_event 
conn_disconn_evt,
}
 
cfg80211_connect_result(dev, conn_info->bssid,
-   conn_info->req_ies, 
conn_info->req_ies_len,
-   conn_info->resp_ies, 
conn_info->resp_ies_len,
-   connect_status, GFP_KERNEL);
+   conn_info->req_ies,
+   conn_info->req_ies_len,
+   conn_info->resp_ies,
+   conn_info->resp_ies_len, connect_status,
+   GFP_KERNEL);
} else if (conn_disconn_evt == CONN_DISCONN_EVENT_DISCONN_NOTIF){
wilc_optaining_ip = false;
p2p_local_random = 0x01;
@@ -546,9 +556,9 @@ static void cfg_connect_result(enum conn_event 
conn_disconn_evt,
else if (!wfi_drv->IFC_UP && dev == wl->vif[1]->ndev)
disconn_info->reason = 1;
 
-   cfg80211_disconnected(dev, disconn_info->reason, 
disconn_info->ie,
- disconn_info->ie_len, false,
- GFP_KERNEL);
+   cfg80211_disconnected(dev, disconn_info->reason,
+ disconn_info->ie, disconn_info->ie_len,
+ false, GFP_KERNEL);
}
 }
 
-- 
2.7.4

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


[PATCH 10/11] staging: wilc1000: remove unused 'struct add_key_params'

2018-03-20 Thread Ajay Singh
Cleanup patch to remove unused struct data structure.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index af1b8aa..b9bba86 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -160,12 +160,6 @@ static struct ieee80211_supported_band WILC_WFI_band_2ghz 
= {
.n_bitrates = ARRAY_SIZE(ieee80211_bitrates),
 };
 
-struct add_key_params {
-   u8 key_idx;
-   bool pairwise;
-   u8 *mac_addr;
-};
-
 #define AGING_TIME (9 * 1000)
 #define during_ip_time 15000
 
-- 
2.7.4

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


[PATCH 07/11] staging: wilc1000: rename hAgingTimer to avoid camelCase issue

2018-03-20 Thread Ajay Singh
Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9950ca5..ebebdc3 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -90,7 +90,7 @@ static const struct wiphy_wowlan_support wowlan_support = {
 static struct network_info 
last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
 static u32 last_scanned_cnt;
 struct timer_list wilc_during_ip_timer;
-static struct timer_list hAgingTimer;
+static struct timer_list aging_timer;
 static u8 op_ifcs;
 
 #define CHAN2G(_channel, _freq, _flags) {   \
@@ -174,7 +174,7 @@ static void clear_shadow_scan(void)
int i;
 
if (op_ifcs == 0) {
-   del_timer_sync(&hAgingTimer);
+   del_timer_sync(&aging_timer);
 
for (i = 0; i < last_scanned_cnt; i++) {
if (last_scanned_shadow[last_scanned_cnt].ies) {
@@ -276,7 +276,7 @@ static void remove_network_from_shadow(struct timer_list 
*unused)
}
 
if (last_scanned_cnt != 0) {
-   mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
+   mod_timer(&aging_timer, jiffies + msecs_to_jiffies(AGING_TIME));
}
 }
 
@@ -291,7 +291,7 @@ static int is_network_in_shadow(struct network_info 
*nw_info, void *user_void)
int i;
 
if (last_scanned_cnt == 0) {
-   mod_timer(&hAgingTimer, jiffies + msecs_to_jiffies(AGING_TIME));
+   mod_timer(&aging_timer, jiffies + msecs_to_jiffies(AGING_TIME));
state = -1;
} else {
for (i = 0; i < last_scanned_cnt; i++) {
@@ -2282,7 +2282,7 @@ int wilc_init_host_int(struct net_device *net)
 
priv = wdev_priv(net->ieee80211_ptr);
if (op_ifcs == 0) {
-   timer_setup(&hAgingTimer, remove_network_from_shadow, 0);
+   timer_setup(&aging_timer, remove_network_from_shadow, 0);
timer_setup(&wilc_during_ip_timer, clear_duringIP, 0);
}
op_ifcs++;
-- 
2.7.4

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


[PATCH 08/11] staging: wilc1000: fix line over 80 char issue in clear_shadow_scan()

2018-03-20 Thread Ajay Singh
Remove 'line over 80 char' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index ebebdc3..1b6fe64 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -173,20 +173,21 @@ static void clear_shadow_scan(void)
 {
int i;
 
-   if (op_ifcs == 0) {
-   del_timer_sync(&aging_timer);
+   if (op_ifcs != 0)
+   return;
 
-   for (i = 0; i < last_scanned_cnt; i++) {
-   if (last_scanned_shadow[last_scanned_cnt].ies) {
-   kfree(last_scanned_shadow[i].ies);
-   last_scanned_shadow[last_scanned_cnt].ies = 
NULL;
-   }
+   del_timer_sync(&aging_timer);
 
-   kfree(last_scanned_shadow[i].join_params);
-   last_scanned_shadow[i].join_params = NULL;
+   for (i = 0; i < last_scanned_cnt; i++) {
+   if (last_scanned_shadow[last_scanned_cnt].ies) {
+   kfree(last_scanned_shadow[i].ies);
+   last_scanned_shadow[last_scanned_cnt].ies = NULL;
}
-   last_scanned_cnt = 0;
+
+   kfree(last_scanned_shadow[i].join_params);
+   last_scanned_shadow[i].join_params = NULL;
}
+   last_scanned_cnt = 0;
 }
 
 static u32 get_rssi_avg(struct network_info *network_info)
-- 
2.7.4

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


[PATCH 06/11] staging: wilc1000: refactor mgmt_tx to fix line over 80 chars

2018-03-20 Thread Ajay Singh
Refactor mgmt_tx() to fix line over 80 characters issue. Split the
function to avoid the checkpatch.pl warning. Returning the same error
code in case of memory allocation failure.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 187 +-
 1 file changed, 111 insertions(+), 76 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index d7ff0a9..9950ca5 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1555,6 +1555,58 @@ static int cancel_remain_on_channel(struct wiphy *wiphy,
priv->remain_on_ch_params.listen_session_id);
 }
 
+static void wilc_wfi_cfg_tx_vendor_spec(struct p2p_mgmt_data *mgmt_tx,
+   struct cfg80211_mgmt_tx_params *params,
+   u8 iftype, u32 buf_len)
+{
+   const u8 *buf = params->buf;
+   size_t len = params->len;
+   u32 i;
+   u8 subtype = buf[P2P_PUB_ACTION_SUBTYPE];
+
+   if (subtype == GO_NEG_REQ || subtype == GO_NEG_RSP) {
+   if (p2p_local_random == 1 &&
+   p2p_recv_random < p2p_local_random) {
+   get_random_bytes(&p2p_local_random, 1);
+   p2p_local_random++;
+   }
+   }
+
+   if (p2p_local_random > p2p_recv_random && (subtype == GO_NEG_REQ ||
+  subtype == GO_NEG_RSP ||
+  subtype == P2P_INV_REQ ||
+  subtype == P2P_INV_RSP)) {
+   bool found = false;
+   bool oper_ch = false;
+
+   for (i = P2P_PUB_ACTION_SUBTYPE + 2; i < len; i++) {
+   if (buf[i] == P2PELEM_ATTR_ID &&
+   !(memcmp(p2p_oui, &buf[i + 2], 4))) {
+   if (subtype == P2P_INV_REQ ||
+   subtype == P2P_INV_RSP)
+   oper_ch = true;
+
+   found = true;
+   break;
+   }
+   }
+
+   if (found)
+   wilc_wfi_cfg_parse_tx_action(&mgmt_tx->buff[i + 6],
+len - (i + 6), oper_ch,
+iftype);
+
+   if (subtype != P2P_INV_REQ && subtype != P2P_INV_RSP) {
+   int vendor_spec_len = sizeof(p2p_vendor_spec);
+
+   memcpy(&mgmt_tx->buff[len], p2p_vendor_spec,
+  vendor_spec_len);
+   mgmt_tx->buff[len + vendor_spec_len] = p2p_local_random;
+   mgmt_tx->size = buf_len;
+   }
+   }
+}
+
 static int mgmt_tx(struct wiphy *wiphy,
   struct wireless_dev *wdev,
   struct cfg80211_mgmt_tx_params *params,
@@ -1568,9 +1620,9 @@ static int mgmt_tx(struct wiphy *wiphy,
struct p2p_mgmt_data *mgmt_tx;
struct wilc_priv *priv;
struct host_if_drv *wfi_drv;
-   u32 i;
struct wilc_vif *vif;
u32 buf_len = len + sizeof(p2p_vendor_spec) + sizeof(p2p_local_random);
+   int ret = 0;
 
vif = netdev_priv(wdev->netdev);
priv = wiphy_priv(wiphy);
@@ -1580,92 +1632,75 @@ static int mgmt_tx(struct wiphy *wiphy,
priv->tx_cookie = *cookie;
mgmt = (const struct ieee80211_mgmt *)buf;
 
-   if (ieee80211_is_mgmt(mgmt->frame_control)) {
-   mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL);
-   if (!mgmt_tx)
-   return -EFAULT;
+   if (!ieee80211_is_mgmt(mgmt->frame_control))
+   goto out;
 
-   mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL);
-   if (!mgmt_tx->buff) {
-   kfree(mgmt_tx);
-   return -ENOMEM;
-   }
+   mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL);
+   if (!mgmt_tx) {
+   ret = -ENOMEM;
+   goto out;
+   }
+
+   mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL);
+   if (!mgmt_tx->buff) {
+   ret = -ENOMEM;
+   kfree(mgmt_tx);
+   goto out;
+   }
+
+   memcpy(mgmt_tx->buff, buf, len);
+   mgmt_tx->size = len;
+
+   if (ieee80211_is_probe_resp(mgmt->frame_control)) {
+   wilc_set_mac_chnl_num(vif, chan->hw_value);
+   curr_channel = chan->hw_value;
+   goto out_txq_add_pkt;
+   }
 
-   memcpy(mgmt_tx->buff, buf, len);
-   mgmt_tx->size = len;
+   if (!ieee80211_is_action(mgmt->frame_control))
+   goto out_txq_add_pkt;
 
-   if (ieee80211_is_prob

[PATCH 03/11] staging: wilc1000: remove line over 80 char warnings in set_wiphy_params()

2018-03-20 Thread Ajay Singh
Fix 'line over 80 character' issue reported by checkpatch.pl script in
set_wiphy_params(). Directly used the 'wiphy' pointer received as
function argument instead of using 'priv->dev->ieee80211_ptr->wiphy'.

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

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index cd5ad9b..9d35a08 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1192,20 +1192,20 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 
changed)
 
if (changed & WIPHY_PARAM_RETRY_SHORT) {
cfg_param_val.flag  |= RETRY_SHORT;
-   cfg_param_val.short_retry_limit = 
priv->dev->ieee80211_ptr->wiphy->retry_short;
+   cfg_param_val.short_retry_limit = wiphy->retry_short;
}
if (changed & WIPHY_PARAM_RETRY_LONG) {
cfg_param_val.flag |= RETRY_LONG;
-   cfg_param_val.long_retry_limit = 
priv->dev->ieee80211_ptr->wiphy->retry_long;
+   cfg_param_val.long_retry_limit = wiphy->retry_long;
}
if (changed & WIPHY_PARAM_FRAG_THRESHOLD) {
cfg_param_val.flag |= FRAG_THRESHOLD;
-   cfg_param_val.frag_threshold = 
priv->dev->ieee80211_ptr->wiphy->frag_threshold;
+   cfg_param_val.frag_threshold = wiphy->frag_threshold;
}
 
if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
cfg_param_val.flag |= RTS_THRESHOLD;
-   cfg_param_val.rts_threshold = 
priv->dev->ieee80211_ptr->wiphy->rts_threshold;
+   cfg_param_val.rts_threshold = wiphy->rts_threshold;
}
 
ret = wilc_hif_set_cfg(vif, &cfg_param_val);
-- 
2.7.4

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


[PATCH 04/11] staging: wilc1000: refactor WILC_WFI_p2p_rx() to avoid line over 80 char

2018-03-20 Thread Ajay Singh
Fix 'line over 80 characters' issue found by checkpatch.pl script.
Refactor and split the function to avoid the checkpatch reported issues.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 145 --
 1 file changed, 82 insertions(+), 63 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9d35a08..090d59d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1365,12 +1365,49 @@ static void wilc_wfi_cfg_parse_tx_action(u8 *buf, u32 
len, bool oper_ch,
   op_channel_attr_index);
 }
 
+static void wilc_wfi_cfg_parse_rx_vendor_spec(struct wilc_priv *priv, u8 *buff,
+ u32 size)
+{
+   int i;
+   u8 subtype;
+   struct wilc_vif *vif = netdev_priv(priv->dev);
+
+   subtype = buff[P2P_PUB_ACTION_SUBTYPE];
+   if ((subtype == GO_NEG_REQ || subtype == GO_NEG_RSP) && !wilc_ie) {
+   for (i = P2P_PUB_ACTION_SUBTYPE; i < size; i++) {
+   if (!memcmp(p2p_vendor_spec, &buff[i], 6)) {
+   p2p_recv_random = buff[i + 6];
+   wilc_ie = true;
+   break;
+   }
+   }
+   }
+
+   if (p2p_local_random <= p2p_recv_random) {
+   netdev_dbg(vif->ndev,
+  "PEER WILL BE GO LocaRand=%02x RecvRand %02x\n",
+  p2p_local_random, p2p_recv_random);
+   return;
+   }
+
+   if (subtype == GO_NEG_REQ || subtype == GO_NEG_RSP ||
+   subtype == P2P_INV_REQ || subtype == P2P_INV_RSP) {
+   for (i = P2P_PUB_ACTION_SUBTYPE + 2; i < size; i++) {
+   if (buff[i] == P2PELEM_ATTR_ID &&
+   !(memcmp(p2p_oui, &buff[i + 2], 4))) {
+   wilc_wfi_cfg_parse_rx_action(&buff[i + 6],
+size - (i + 6));
+   break;
+   }
+   }
+   }
+}
+
 void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size)
 {
struct wilc_priv *priv;
u32 header, pkt_offset;
struct host_if_drv *wfi_drv;
-   u32 i = 0;
s32 s32Freq;
 
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
@@ -1381,75 +1418,57 @@ void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, 
u32 size)
pkt_offset = GET_PKT_OFFSET(header);
 
if (pkt_offset & IS_MANAGMEMENT_CALLBACK) {
-   if (buff[FRAME_TYPE_ID] == IEEE80211_STYPE_PROBE_RESP) {
-   cfg80211_mgmt_tx_status(priv->wdev, priv->tx_cookie, 
buff, size, true, GFP_KERNEL);
-   return;
-   } else {
-   if (pkt_offset & IS_MGMT_STATUS_SUCCES)
-   cfg80211_mgmt_tx_status(priv->wdev, 
priv->tx_cookie, buff, size, true, GFP_KERNEL);
-   else
-   cfg80211_mgmt_tx_status(priv->wdev, 
priv->tx_cookie, buff, size, false, GFP_KERNEL);
-   return;
-   }
-   } else {
-   s32Freq = ieee80211_channel_to_frequency(curr_channel, 
NL80211_BAND_2GHZ);
+   bool ack = false;
 
-   if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
-   if (priv->cfg_scanning && time_after_eq(jiffies, 
(unsigned long)wfi_drv->p2p_timeout)) {
-   netdev_dbg(dev, "Receiving action wrong ch\n");
-   return;
-   }
-   if (buff[ACTION_CAT_ID] == PUB_ACTION_ATTR_ID) {
-   switch (buff[ACTION_SUBTYPE_ID]) {
-   case GAS_INITIAL_REQ:
-   break;
+   if (buff[FRAME_TYPE_ID] == IEEE80211_STYPE_PROBE_RESP ||
+   pkt_offset & IS_MGMT_STATUS_SUCCES)
+   ack = true;
 
-   case GAS_INITIAL_RSP:
-   break;
+   cfg80211_mgmt_tx_status(priv->wdev, priv->tx_cookie, buff, size,
+   ack, GFP_KERNEL);
+   return;
+   }
 
-   case PUBLIC_ACT_VENDORSPEC:
-   if (!memcmp(p2p_oui, 
&buff[ACTION_SUBTYPE_ID + 1], 4)) {
-   if 
((buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == 
GO_NEG_RSP)) {
-   if (!wilc_ie) {
-   for (i = 
P2P_PUB_ACTION_SUBTYPE; i < size; i++) {
-   

[PATCH 05/11] staging: wilc1000: rename WILC_WFI_p2p_rx & s32Freq to avoid camelCase

2018-03-20 Thread Ajay Singh
Fix 'Avoid camelCase' issue found by checkpatch.pl script.

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

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 38a83bd..2236967 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1166,7 +1166,7 @@ void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 
size)
vif = netdev_priv(wilc->vif[1]->ndev);
if ((buff[0] == vif->frame_reg[0].type && vif->frame_reg[0].reg) ||
(buff[0] == vif->frame_reg[1].type && vif->frame_reg[1].reg))
-   WILC_WFI_p2p_rx(wilc->vif[1]->ndev, buff, size);
+   wilc_wfi_p2p_rx(wilc->vif[1]->ndev, buff, size);
 }
 
 void wilc_netdev_cleanup(struct wilc *wilc)
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 090d59d..d7ff0a9 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -360,7 +360,7 @@ static void cfg_scan_result(enum scan_event scan_event,
 {
struct wilc_priv *priv;
struct wiphy *wiphy;
-   s32 s32Freq;
+   s32 freq;
struct ieee80211_channel *channel;
struct cfg80211_bss *bss = NULL;
 
@@ -379,9 +379,9 @@ static void cfg_scan_result(enum scan_event scan_event,
((s32)network_info->rssi * 100) > 100))
return;
 
-   s32Freq = ieee80211_channel_to_frequency((s32)network_info->ch,
-NL80211_BAND_2GHZ);
-   channel = ieee80211_get_channel(wiphy, s32Freq);
+   freq = ieee80211_channel_to_frequency((s32)network_info->ch,
+ NL80211_BAND_2GHZ);
+   channel = ieee80211_get_channel(wiphy, freq);
 
if (!channel)
return;
@@ -1403,12 +1403,12 @@ static void wilc_wfi_cfg_parse_rx_vendor_spec(struct 
wilc_priv *priv, u8 *buff,
}
 }
 
-void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size)
+void wilc_wfi_p2p_rx(struct net_device *dev, u8 *buff, u32 size)
 {
struct wilc_priv *priv;
u32 header, pkt_offset;
struct host_if_drv *wfi_drv;
-   s32 s32Freq;
+   s32 freq;
 
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
wfi_drv = (struct host_if_drv *)priv->hif_drv;
@@ -1429,10 +1429,10 @@ void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, 
u32 size)
return;
}
 
-   s32Freq = ieee80211_channel_to_frequency(curr_channel, 
NL80211_BAND_2GHZ);
+   freq = ieee80211_channel_to_frequency(curr_channel, NL80211_BAND_2GHZ);
 
if (!ieee80211_is_action(buff[FRAME_TYPE_ID])) {
-   cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size, 0);
+   cfg80211_rx_mgmt(priv->wdev, freq, 0, buff, size, 0);
return;
}
 
@@ -1468,7 +1468,7 @@ void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, 
u32 size)
}
}
 
-   cfg80211_rx_mgmt(priv->wdev, s32Freq, 0, buff, size, 0);
+   cfg80211_rx_mgmt(priv->wdev, freq, 0, buff, size, 0);
 }
 
 static void wilc_wfi_mgmt_tx_complete(void *priv, int status)
diff --git a/drivers/staging/wilc1000/wilc_wlan.h 
b/drivers/staging/wilc1000/wilc_wlan.h
index fa157a6..4abbfa7 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -300,7 +300,7 @@ void wilc_enable_tcp_ack_filter(bool value);
 int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc);
 int wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev);
 
-void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
+void wilc_wfi_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
 void host_wakeup_notify(struct wilc *wilc);
 void host_sleep_notify(struct wilc *wilc);
 extern bool wilc_enable_ps;
-- 
2.7.4

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


[PATCH 02/11] staging: wilc1000: removed unused global variables for gtk and ptk information

2018-03-20 Thread Ajay Singh
Removed the unnecessary global variables used to store gtk and ptk
information. Key data stored in the params was never access using these
global variables.

Global variables given below are removed

g_add_gtk_key_params;
g_key_gtk_params;
g_add_ptk_key_params;
g_key_ptk_params;
g_key_wep_params;
g_ptk_keys_saved;
g_gtk_keys_saved;
g_wep_keys_saved;

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 80 ---
 1 file changed, 80 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index b784e15..cd5ad9b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -166,15 +166,6 @@ struct add_key_params {
u8 *mac_addr;
 };
 
-static struct add_key_params g_add_gtk_key_params;
-static struct wilc_wfi_key g_key_gtk_params;
-static struct add_key_params g_add_ptk_key_params;
-static struct wilc_wfi_key g_key_ptk_params;
-static struct wilc_wfi_wep_key g_key_wep_params;
-static bool g_ptk_keys_saved;
-static bool g_gtk_keys_saved;
-static bool g_wep_keys_saved;
-
 #define AGING_TIME (9 * 1000)
 #define during_ip_time 15000
 
@@ -740,12 +731,6 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len;
memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, 
sme->key_len);
 
-   g_key_wep_params.key_len = sme->key_len;
-   g_key_wep_params.key = kmalloc(sme->key_len, 
GFP_KERNEL);
-   memcpy(g_key_wep_params.key, sme->key, sme->key_len);
-   g_key_wep_params.key_idx = sme->key_idx;
-   g_wep_keys_saved = true;
-
wilc_set_wep_default_keyid(vif, sme->key_idx);
wilc_add_wep_key_bss_sta(vif, sme->key, sme->key_len,
 sme->key_idx);
@@ -755,12 +740,6 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len;
memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, 
sme->key_len);
 
-   g_key_wep_params.key_len = sme->key_len;
-   g_key_wep_params.key = kmalloc(sme->key_len, 
GFP_KERNEL);
-   memcpy(g_key_wep_params.key, sme->key, sme->key_len);
-   g_key_wep_params.key_idx = sme->key_idx;
-   g_wep_keys_saved = true;
-
wilc_set_wep_default_keyid(vif, sme->key_idx);
wilc_add_wep_key_bss_sta(vif, sme->key, sme->key_len,
 sme->key_idx);
@@ -1019,27 +998,6 @@ static int add_key(struct wiphy *wiphy, struct net_device 
*netdev, u8 key_index,
keylen = params->key_len - 16;
}
 
-   if (!g_gtk_keys_saved && netdev == 
wl->vif[0]->ndev) {
-   g_add_gtk_key_params.key_idx = 
key_index;
-   g_add_gtk_key_params.pairwise = 
pairwise;
-   if (!mac_addr) {
-   g_add_gtk_key_params.mac_addr = 
NULL;
-   } else {
-   g_add_gtk_key_params.mac_addr = 
kmalloc(ETH_ALEN, GFP_KERNEL);
-   
memcpy(g_add_gtk_key_params.mac_addr, mac_addr, ETH_ALEN);
-   }
-   g_key_gtk_params.key_len = 
params->key_len;
-   g_key_gtk_params.seq_len = 
params->seq_len;
-   g_key_gtk_params.key =  
kmalloc(params->key_len, GFP_KERNEL);
-   memcpy(g_key_gtk_params.key, 
params->key, params->key_len);
-   if (params->seq_len > 0) {
-   g_key_gtk_params.seq =  
kmalloc(params->seq_len, GFP_KERNEL);
-   memcpy(g_key_gtk_params.seq, 
params->seq, params->seq_len);
-   }
-   g_key_gtk_params.cipher = 
params->cipher;
-   g_gtk_keys_saved = true;
-   }
-
wilc_add_rx_gtk(vif, params->key, keylen,
key_index, params->seq_len,
params->seq, rx_mic,
@@ -1052,27 +1010,6 @@ static int add_key(struct wiphy *wiphy, struct 
net_device *netdev, u8 key_

[PATCH 01/11] staging: wilc1000: refactor scan() to free kmalloc memory on failure cases

2018-03-20 Thread Ajay Singh
Added changes to free the allocated memory in scan() for error condition.
Also added 'NULL' check validation before accessing allocated memory.

Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 62 +--
 1 file changed, 46 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9d8d5d0..b784e15 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -582,6 +582,49 @@ static int set_channel(struct wiphy *wiphy,
return result;
 }
 
+static inline bool
+wilc_wfi_cfg_alloc_fill_ssid(struct cfg80211_scan_request *request,
+struct hidden_network *ntwk)
+{
+   int i = 0;
+
+   ntwk->net_info = kcalloc(request->n_ssids,
+sizeof(struct hidden_network), GFP_KERNEL);
+
+   if (!ntwk->net_info)
+   goto out;
+
+   ntwk->n_ssids = request->n_ssids;
+
+   for (i = 0; i < request->n_ssids; i++) {
+   if (request->ssids[i].ssid_len > 0) {
+   struct hidden_net_info *info = &ntwk->net_info[i];
+
+   info->ssid = kmemdup(request->ssids[i].ssid,
+request->ssids[i].ssid_len,
+GFP_KERNEL);
+
+   if (!info->ssid)
+   goto out_free;
+
+   info->ssid_len = request->ssids[i].ssid_len;
+   } else {
+   ntwk->n_ssids -= 1;
+   }
+   }
+   return true;
+
+out_free:
+
+   for (; i >= 0 ; i--)
+   kfree(ntwk->net_info[i].ssid);
+
+   kfree(ntwk->net_info);
+out:
+
+   return false;
+}
+
 static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
 {
struct wilc_priv *priv;
@@ -606,23 +649,10 @@ static int scan(struct wiphy *wiphy, struct 
cfg80211_scan_request *request)
scan_ch_list[i] = 
(u8)ieee80211_frequency_to_channel(request->channels[i]->center_freq);
 
if (request->n_ssids >= 1) {
-   hidden_ntwk.net_info =
-   kmalloc_array(request->n_ssids,
- sizeof(struct hidden_network),
- GFP_KERNEL);
-   if (!hidden_ntwk.net_info)
+   if (!wilc_wfi_cfg_alloc_fill_ssid(request,
+ &hidden_ntwk))
return -ENOMEM;
-   hidden_ntwk.n_ssids = request->n_ssids;
-
-   for (i = 0; i < request->n_ssids; i++) {
-   if (request->ssids[i].ssid_len != 0) {
-   hidden_ntwk.net_info[i].ssid = 
kmalloc(request->ssids[i].ssid_len, GFP_KERNEL);
-   memcpy(hidden_ntwk.net_info[i].ssid, 
request->ssids[i].ssid, request->ssids[i].ssid_len);
-   hidden_ntwk.net_info[i].ssid_len = 
request->ssids[i].ssid_len;
-   } else {
-   hidden_ntwk.n_ssids -= 1;
-   }
-   }
+
ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
scan_ch_list,
request->n_channels,
-- 
2.7.4

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


[PATCH 00/11] staging: wilc1000: fix for checkpatch and handled malloc memory properly

2018-03-20 Thread Ajay Singh
This patch series contains fixes to avoid checkpatch issues and removed
unused code. Few patch contains changes related to NULL check and freeing of
dynamically allocated memory.


Ajay Singh (11):
  staging: wilc1000: refactor scan() to free kmalloc memory on failure
cases
  staging: wilc1000: removed unused global variables for gtk and ptk
information
  staging: wilc1000: remove line over 80 char warnings in
set_wiphy_params()
  staging: wilc1000: refactor WILC_WFI_p2p_rx() to avoid line over 80
char
  staging: wilc1000: rename WILC_WFI_p2p_rx & s32Freq to avoid camelCase
  staging: wilc1000: refactor mgmt_tx to fix line over 80 chars
  staging: wilc1000: rename hAgingTimer to avoid camelCase issue
  staging: wilc1000: fix line over 80 char issue in clear_shadow_scan()
  staging: wilc1000: remove line over 80 char in cfg_connect_result()
  staging: wilc1000: remove unused 'struct add_key_params'
  staging: wilc1000: remove line over 80 char warning in few functions

 drivers/staging/wilc1000/linux_wlan.c |   2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 577 +++---
 drivers/staging/wilc1000/wilc_wlan.h  |   2 +-
 3 files changed, 297 insertions(+), 284 deletions(-)

-- 
2.7.4

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


Re: [PATCH] staging: lustre: Fix unneeded byte-ordering cast

2018-03-20 Thread Justin Skists
On 20 March 2018 at 01:06, NeilBrown  wrote:
> On Sat, Mar 17 2018, Justin Skists wrote:
>
>> Fix sparse warning:
>>
>>   CHECK   drivers/staging//lustre/lnet/lnet/acceptor.c
>> drivers/staging//lustre/lnet/lnet/acceptor.c:243:30: warning: cast to
>> restricted __le32
>>
>> LNET_PROTO_TCP_MAGIC, as a define, is already CPU byte-ordered when
>> compared to 'magic', so no need for a cast.
>>
>> Signed-off-by: Justin Skists 
>> ---
>>  drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c 
>> b/drivers/staging/lustre/lnet/lnet/acceptor.c
>> index fb478e20e204..13e981781b9a 100644
>> --- a/drivers/staging/lustre/lnet/lnet/acceptor.c
>> +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c
>> @@ -240,7 +240,7 @@ lnet_accept(struct socket *sock, __u32 magic)
>>   return -EPROTO;
>>   }
>>
>> - if (magic == le32_to_cpu(LNET_PROTO_TCP_MAGIC))
>> + if (magic == LNET_PROTO_TCP_MAGIC)
>>   str = "'old' socknal/tcpnal";
>>   else
>>   str = "unrecognised";
>
> This code is almost completely irrelevant (it just choose which error
> message to use when failing), but we may as well get it right and I
> cannot see why your change is a fix.

I admit that the change is trivial, and, in hindsight, the word fix is
a little "strong".
The rationale was that the if-statement, as it was, probably wouldn't work as
intented on big-endian systems.

I chose this sparse warning to test the waters, as it was an isolated change,
before I thought about proposing a bigger change: There are quite a few
sparse warning in regards to struct lnet_hdr with regards to __u32 vs. __le32
(etc.) restricted castings.

> I suspect a more correct fix would be to use
>   lnet_accept_magic(magic, LNET_PROTO_TCP_MAGIC)
> as the condition of the if().  This is consistent with other code that
> tests magic, and it is consistent with the general understanding that
> "magic" should be in host-byte-order for the peer which sent the
> message.
>
> Could you resubmit with that change?

I agree that your suggestion is a much better fix.

As Greg has already accepted the patch in question into staging-next,
would the correct course of action be for me to submit a new patch with a
"fixes" tag based on staging-next? Or would Greg prefer to drop the
previous one for a fresh v2?

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


[PATCH v4 1/2] staging: ks7010: replace KS_WLAN_DEBUG with DEBUG preprocessor directive

2018-03-20 Thread Sergio Paracuellos
This commit replaces custom KS_WLAN_DEBUG which is not being used anymore
in favour of DEBUG which is the one included when debugging is enabled.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/ks7010/Makefile  | 1 -
 drivers/staging/ks7010/ks7010_sdio.c | 9 -
 drivers/staging/ks7010/ks_hostif.c   | 6 +++---
 drivers/staging/ks7010/ks_wlan.h | 2 +-
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
index 69fcf8d..07dc16c 100644
--- a/drivers/staging/ks7010/Makefile
+++ b/drivers/staging/ks7010/Makefile
@@ -1,4 +1,3 @@
 obj-$(CONFIG_KS7010) += ks7010.o
 
-ccflags-y   += -DKS_WLAN_DEBUG=0
 ks7010-y:= michael_mic.o ks_hostif.o ks_wlan_net.o ks7010_sdio.o
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 50a7a15..b8f55a1 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -385,11 +385,10 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, 
uint16_t size)
 
/* length check */
if (size > 2046 || size == 0) {
-#ifdef KS_WLAN_DEBUG
-   if (KS_WLAN_DEBUG > 5)
-   print_hex_dump_bytes("INVALID DATA dump: ",
-DUMP_PREFIX_OFFSET,
-rx_buffer->data, 32);
+#ifdef DEBUG
+   print_hex_dump_bytes("INVALID DATA dump: ",
+DUMP_PREFIX_OFFSET,
+rx_buffer->data, 32);
 #endif
ret = ks7010_sdio_writeb(priv, READ_STATUS, REG_STATUS_IDLE);
if (ret)
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index d644a1d..81391df 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2409,10 +2409,10 @@ void hostif_sme_enqueue(struct ks_wlan_private *priv, 
unsigned short event)
if (cnt_smeqbody(priv) < (SME_EVENT_BUFF_SIZE - 1)) {
priv->sme_i.event_buff[priv->sme_i.qtail] = event;
inc_smeqtail(priv);
-#ifdef KS_WLAN_DEBUG
+#ifdef DEBUG
if (priv->sme_i.max_event_count < cnt_smeqbody(priv))
priv->sme_i.max_event_count = cnt_smeqbody(priv);
-#endif /* KS_WLAN_DEBUG */
+#endif
} else {
/* in case of buffer overflow */
netdev_err(priv->net_dev, "sme queue buffer overflow\n");
@@ -2461,7 +2461,7 @@ int hostif_init(struct ks_wlan_private *priv)
priv->sme_i.sme_status = SME_IDLE;
priv->sme_i.qhead = 0;
priv->sme_i.qtail = 0;
-#ifdef KS_WLAN_DEBUG
+#ifdef DEBUG
priv->sme_i.max_event_count = 0;
 #endif
spin_lock_init(&priv->sme_i.sme_spin);
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 4fff7f7..6bad88d2 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -192,7 +192,7 @@ struct sme_info {
int event_buff[SME_EVENT_BUFF_SIZE];
unsigned int qhead;
unsigned int qtail;
-#ifdef KS_WLAN_DEBUG
+#ifdef DEBUG
/* for debug */
unsigned int max_event_count;
 #endif
-- 
2.7.4

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


[PATCH v4 0/2] staging: ks7010: clean up some debug stuff

2018-03-20 Thread Sergio Paracuellos
This patch was in a previous patch series and only this one 
wasn't applied. So include here v4 which reviews and clean up 
some write only fields used in debug mode.

First patch of v3 wasn't be modified. Just another extra patch 
has been added removing write only fields only used in debug.

v3:
* Review KS_WLAN_DEBUG in driver sources properly replacing 
it to DEBUG directive.

v4: 
* Review sme_info structure debug fields and clean up related code.

Sergio Paracuellos (2):
  staging: ks7010: replace KS_WLAN_DEBUG with DEBUG preprocessor
directive
  staging: ks7010: remove max_event_count field which is only being used
in debug

 drivers/staging/ks7010/Makefile  | 1 -
 drivers/staging/ks7010/ks7010_sdio.c | 9 -
 drivers/staging/ks7010/ks_hostif.c   | 7 ---
 drivers/staging/ks7010/ks_wlan.h | 4 
 4 files changed, 4 insertions(+), 17 deletions(-)

-- 
2.7.4

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


[PATCH v4 2/2] staging: ks7010: remove max_event_count field which is only being used in debug

2018-03-20 Thread Sergio Paracuellos
This patch removes max_event_count field of sme_info structure which is a
write only variable just being used for debug purposes.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/ks7010/ks_hostif.c | 7 ---
 drivers/staging/ks7010/ks_wlan.h   | 4 
 2 files changed, 11 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 81391df..ce1ac11 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2409,10 +2409,6 @@ void hostif_sme_enqueue(struct ks_wlan_private *priv, 
unsigned short event)
if (cnt_smeqbody(priv) < (SME_EVENT_BUFF_SIZE - 1)) {
priv->sme_i.event_buff[priv->sme_i.qtail] = event;
inc_smeqtail(priv);
-#ifdef DEBUG
-   if (priv->sme_i.max_event_count < cnt_smeqbody(priv))
-   priv->sme_i.max_event_count = cnt_smeqbody(priv);
-#endif
} else {
/* in case of buffer overflow */
netdev_err(priv->net_dev, "sme queue buffer overflow\n");
@@ -2461,9 +2457,6 @@ int hostif_init(struct ks_wlan_private *priv)
priv->sme_i.sme_status = SME_IDLE;
priv->sme_i.qhead = 0;
priv->sme_i.qtail = 0;
-#ifdef DEBUG
-   priv->sme_i.max_event_count = 0;
-#endif
spin_lock_init(&priv->sme_i.sme_spin);
priv->sme_i.sme_flag = 0;
 
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 6bad88d2..aeabbe3 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -192,10 +192,6 @@ struct sme_info {
int event_buff[SME_EVENT_BUFF_SIZE];
unsigned int qhead;
unsigned int qtail;
-#ifdef DEBUG
-   /* for debug */
-   unsigned int max_event_count;
-#endif
spinlock_t sme_spin;
unsigned long sme_flag;
 };
-- 
2.7.4

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


Re: [PATCH v3] staging: ks7010: replace KS_WLAN_DEBUG with DEBUG preprocessor directive

2018-03-20 Thread Dan Carpenter
On Tue, Mar 20, 2018 at 02:48:50PM +0100, Sergio Paracuellos wrote:
> This commit replaces custom KS_WLAN_DEBUG which is not being used anymore
> in favour of DEBUG which is the one included when debugging is enabled.
> 
> Signed-off-by: Sergio Paracuellos 
> ---
> This patch was in a previous patch series and only this one wasn't applied.
> So include here v3 only for this remaining one.
> v3:
> * Review KS_WLAN_DEBUG in driver sources properly replacing it to DEBUG 
> directive.
> 
>  drivers/staging/ks7010/Makefile  | 1 -
>  drivers/staging/ks7010/ks7010_sdio.c | 9 -
>  drivers/staging/ks7010/ks_hostif.c   | 6 +++---
>  drivers/staging/ks7010/ks_wlan.h | 2 +-
>  4 files changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
> index 69fcf8d..07dc16c 100644
> --- a/drivers/staging/ks7010/Makefile
> +++ b/drivers/staging/ks7010/Makefile
> @@ -1,4 +1,3 @@
>  obj-$(CONFIG_KS7010) += ks7010.o
>  
> -ccflags-y += -DKS_WLAN_DEBUG=0
>  ks7010-y  := michael_mic.o ks_hostif.o ks_wlan_net.o ks7010_sdio.o
> diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
> b/drivers/staging/ks7010/ks7010_sdio.c
> index 50a7a15..b8f55a1 100644
> --- a/drivers/staging/ks7010/ks7010_sdio.c
> +++ b/drivers/staging/ks7010/ks7010_sdio.c
> @@ -385,11 +385,10 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, 
> uint16_t size)
>  
>   /* length check */
>   if (size > 2046 || size == 0) {
> -#ifdef KS_WLAN_DEBUG
> - if (KS_WLAN_DEBUG > 5)
> - print_hex_dump_bytes("INVALID DATA dump: ",
> -  DUMP_PREFIX_OFFSET,
> -  rx_buffer->data, 32);
> +#ifdef DEBUG
> + print_hex_dump_bytes("INVALID DATA dump: ",
> +  DUMP_PREFIX_OFFSET,
> +  rx_buffer->data, 32);
>  #endif
>   ret = ks7010_sdio_writeb(priv, READ_STATUS, REG_STATUS_IDLE);
>   if (ret)
> diff --git a/drivers/staging/ks7010/ks_hostif.c 
> b/drivers/staging/ks7010/ks_hostif.c
> index d644a1d..81391df 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -2409,10 +2409,10 @@ void hostif_sme_enqueue(struct ks_wlan_private *priv, 
> unsigned short event)
>   if (cnt_smeqbody(priv) < (SME_EVENT_BUFF_SIZE - 1)) {
>   priv->sme_i.event_buff[priv->sme_i.qtail] = event;
>   inc_smeqtail(priv);
> -#ifdef KS_WLAN_DEBUG
> +#ifdef DEBUG
>   if (priv->sme_i.max_event_count < cnt_smeqbody(priv))
>   priv->sme_i.max_event_count = cnt_smeqbody(priv);

priv->sme_i.max_event_count is a write only variable.  Just delete it
and the related code.

regards,
dan carpenter

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


[PATCH] Staging: xgifb: XGI_main_26.c: Refactored the function

2018-03-20 Thread Pratik Jain
Refactored the function `XGIfb_search_refresh_rate` by removing a level
of `if...else` block nesting. Removed unnecessary parantheses.

Signed-off-by: Pratik Jain 
---
 drivers/staging/xgifb/XGI_main_26.c | 59 +++--
 1 file changed, 30 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 10107de0119a..aee969aab681 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -544,41 +544,42 @@ static u8 XGIfb_search_refresh_rate(struct 
xgifb_video_info *xgifb_info,
yres = XGIbios_mode[xgifb_info->mode_idx].yres;
 
xgifb_info->rate_idx = 0;
-   while ((XGIfb_vrate[i].idx != 0) && (XGIfb_vrate[i].xres <= xres)) {
-   if ((XGIfb_vrate[i].xres == xres) &&
-   (XGIfb_vrate[i].yres == yres)) {
-   if (XGIfb_vrate[i].refresh == rate) {
+
+   while (XGIfb_vrate[i].idx != 0 && XGIfb_vrate[i].xres <= xres) {
+   /* Skip values with xres or yres less than specified */
+   if ((XGIfb_vrate[i].yres != yres) ||
+   (XGIfb_vrate[i].xres < xres)) {
+   i++;
+   continue;
+   }
+   if (XGIfb_vrate[i].refresh == rate) {
+   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
+   break;
+   } else if (XGIfb_vrate[i].refresh > rate) {
+   if (XGIfb_vrate[i].refresh - rate <= 3) {
+   pr_debug("Adjusting rate from %d up to %d\n",
+   rate, XGIfb_vrate[i].refresh);
xgifb_info->rate_idx = XGIfb_vrate[i].idx;
-   break;
-   } else if (XGIfb_vrate[i].refresh > rate) {
-   if ((XGIfb_vrate[i].refresh - rate) <= 3) {
-   pr_debug("Adjusting rate from %d up to 
%d\n",
-rate, XGIfb_vrate[i].refresh);
-   xgifb_info->rate_idx =
-   XGIfb_vrate[i].idx;
-   xgifb_info->refresh_rate =
-   XGIfb_vrate[i].refresh;
-   } else if (((rate - XGIfb_vrate[i - 1].refresh)
-   <= 2) && (XGIfb_vrate[i].idx
-   != 1)) {
-   pr_debug("Adjusting rate from %d down 
to %d\n",
-rate,
-XGIfb_vrate[i - 1].refresh);
-   xgifb_info->rate_idx =
-   XGIfb_vrate[i - 1].idx;
-   xgifb_info->refresh_rate =
-   XGIfb_vrate[i - 1].refresh;
-   }
-   break;
-   } else if ((rate - XGIfb_vrate[i].refresh) <= 2) {
+   xgifb_info->refresh_rate =
+   XGIfb_vrate[i].refresh;
+   } else if ((i > 0) &&
+  (rate - XGIfb_vrate[i - 1].refresh <= 2)) {
pr_debug("Adjusting rate from %d down to %d\n",
-rate, XGIfb_vrate[i].refresh);
-   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
-   break;
+   rate, XGIfb_vrate[i - 1].refresh);
+   xgifb_info->rate_idx = XGIfb_vrate[i - 1].idx;
+   xgifb_info->refresh_rate =
+   XGIfb_vrate[i - 1].refresh;
}
+   break;
+   } else if (rate - XGIfb_vrate[i].refresh <= 2) {
+   pr_debug("Adjusting rate from %d down to %d\n",
+   rate, XGIfb_vrate[i].refresh);
+   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
+   break;
}
i++;
}
+
if (xgifb_info->rate_idx > 0)
return xgifb_info->rate_idx;
pr_info("Unsupported rate %d for %dx%d\n",
-- 
2.16.2

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


[PATCH v3] staging: ks7010: replace KS_WLAN_DEBUG with DEBUG preprocessor directive

2018-03-20 Thread Sergio Paracuellos
This commit replaces custom KS_WLAN_DEBUG which is not being used anymore
in favour of DEBUG which is the one included when debugging is enabled.

Signed-off-by: Sergio Paracuellos 
---
This patch was in a previous patch series and only this one wasn't applied.
So include here v3 only for this remaining one.
v3:
* Review KS_WLAN_DEBUG in driver sources properly replacing it to DEBUG 
directive.

 drivers/staging/ks7010/Makefile  | 1 -
 drivers/staging/ks7010/ks7010_sdio.c | 9 -
 drivers/staging/ks7010/ks_hostif.c   | 6 +++---
 drivers/staging/ks7010/ks_wlan.h | 2 +-
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
index 69fcf8d..07dc16c 100644
--- a/drivers/staging/ks7010/Makefile
+++ b/drivers/staging/ks7010/Makefile
@@ -1,4 +1,3 @@
 obj-$(CONFIG_KS7010) += ks7010.o
 
-ccflags-y   += -DKS_WLAN_DEBUG=0
 ks7010-y:= michael_mic.o ks_hostif.o ks_wlan_net.o ks7010_sdio.o
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 50a7a15..b8f55a1 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -385,11 +385,10 @@ static void ks_wlan_hw_rx(struct ks_wlan_private *priv, 
uint16_t size)
 
/* length check */
if (size > 2046 || size == 0) {
-#ifdef KS_WLAN_DEBUG
-   if (KS_WLAN_DEBUG > 5)
-   print_hex_dump_bytes("INVALID DATA dump: ",
-DUMP_PREFIX_OFFSET,
-rx_buffer->data, 32);
+#ifdef DEBUG
+   print_hex_dump_bytes("INVALID DATA dump: ",
+DUMP_PREFIX_OFFSET,
+rx_buffer->data, 32);
 #endif
ret = ks7010_sdio_writeb(priv, READ_STATUS, REG_STATUS_IDLE);
if (ret)
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index d644a1d..81391df 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2409,10 +2409,10 @@ void hostif_sme_enqueue(struct ks_wlan_private *priv, 
unsigned short event)
if (cnt_smeqbody(priv) < (SME_EVENT_BUFF_SIZE - 1)) {
priv->sme_i.event_buff[priv->sme_i.qtail] = event;
inc_smeqtail(priv);
-#ifdef KS_WLAN_DEBUG
+#ifdef DEBUG
if (priv->sme_i.max_event_count < cnt_smeqbody(priv))
priv->sme_i.max_event_count = cnt_smeqbody(priv);
-#endif /* KS_WLAN_DEBUG */
+#endif
} else {
/* in case of buffer overflow */
netdev_err(priv->net_dev, "sme queue buffer overflow\n");
@@ -2461,7 +2461,7 @@ int hostif_init(struct ks_wlan_private *priv)
priv->sme_i.sme_status = SME_IDLE;
priv->sme_i.qhead = 0;
priv->sme_i.qtail = 0;
-#ifdef KS_WLAN_DEBUG
+#ifdef DEBUG
priv->sme_i.max_event_count = 0;
 #endif
spin_lock_init(&priv->sme_i.sme_spin);
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 4fff7f7..6bad88d2 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -192,7 +192,7 @@ struct sme_info {
int event_buff[SME_EVENT_BUFF_SIZE];
unsigned int qhead;
unsigned int qtail;
-#ifdef KS_WLAN_DEBUG
+#ifdef DEBUG
/* for debug */
unsigned int max_event_count;
 #endif
-- 
2.7.4

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


[PATCHv3] staging: wilc1000: replace switch statement by simple if condition

2018-03-20 Thread hariprasath . elango
From: HariPrasath Elango 

In this case,there is only a single switch case statement.So replacing
by a simple if condition

Signed-off-by: HariPrasath Elango 
---
 changes since v3:
*rebase on latest code
*missed revision history in v2

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9d8d5d0..730d64f 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -776,14 +776,8 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
}
 
if (sme->crypto.n_akm_suites) {
-   switch (sme->crypto.akm_suites[0]) {
-   case WLAN_AKM_SUITE_8021X:
+   if (sme->crypto.akm_suites[0] == WLAN_AKM_SUITE_8021X)
auth_type = IEEE8021;
-   break;
-
-   default:
-   break;
-   }
}
 
curr_channel = nw_info->ch;
-- 
2.10.0.GIT

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


Re: [PATCHv2] staging: wilc1000: replace switch statement by simple if condition

2018-03-20 Thread
On Tue, Mar 20, 2018 at 12:47:21PM +0100, Greg KH wrote:
> On Tue, Mar 20, 2018 at 05:13:31PM +0530, hariprasath.ela...@gmail.com wrote:
> > From: HariPrasath Elango 
> > 
> > In this case,there is only a single switch case statement.So replacing
> > by a simple if condition
> > 
> > Signed-off-by: HariPrasath Elango 
> > ---
> >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 +---
> >  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> What changed from v1?  Always put that information below the --- line,
> like the kernel documentation asks you to do.
> 
> v3?  :)
> 
> thanks,
> 
> greg k-h

Lesson learned. I will send a v3 with version history included

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


[PATCH v2] staging: fsl-dpaa2/eth: Defer probing if no MC portal available

2018-03-20 Thread Ioana Radulescu
MC portals may not be available at the initial probing attempt
due to dependencies on other modules.

Check the return value of the MC portal allocation function and
defer probing in case it's not available yet. For all other error
cases the behaviour stays the same.

Signed-off-by: Ioana Radulescu 
Suggested-by: Nipun Gupta 
---
v2: rebase on latest driver code

 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c 
b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
index f013af6..ac1a750 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
@@ -2441,7 +2441,10 @@ static int dpaa2_eth_probe(struct fsl_mc_device 
*dpni_dev)
err = fsl_mc_portal_allocate(dpni_dev, FSL_MC_IO_ATOMIC_CONTEXT_PORTAL,
 &priv->mc_io);
if (err) {
-   dev_err(dev, "MC portal allocation failed\n");
+   if (err == -ENXIO)
+   err = -EPROBE_DEFER;
+   else
+   dev_err(dev, "MC portal allocation failed\n");
goto err_portal_alloc;
}
 
-- 
2.7.4

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


Re: [PATCH] Staging: xgifb: XGI_main_26.c: Refactored the function

2018-03-20 Thread Dan Carpenter
On Tue, Mar 20, 2018 at 02:05:49PM +0530, Pratik Jain wrote:
> Refactored the function `XGIfb_search_refresh_rate` by removing a level
> of `if...else` block nesting. Removed unnecessary parantheses.
> 
> Signed-off-by: Pratik Jain 
> ---
>  drivers/staging/xgifb/XGI_main_26.c | 63 
> +++--
>  1 file changed, 33 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/staging/xgifb/XGI_main_26.c 
> b/drivers/staging/xgifb/XGI_main_26.c
> index 10107de0119a..ef9a726cd35d 100644
> --- a/drivers/staging/xgifb/XGI_main_26.c
> +++ b/drivers/staging/xgifb/XGI_main_26.c
> @@ -544,41 +544,44 @@ static u8 XGIfb_search_refresh_rate(struct 
> xgifb_video_info *xgifb_info,
>   yres = XGIbios_mode[xgifb_info->mode_idx].yres;
>  
>   xgifb_info->rate_idx = 0;
> - while ((XGIfb_vrate[i].idx != 0) && (XGIfb_vrate[i].xres <= xres)) {
> - if ((XGIfb_vrate[i].xres == xres) &&
> - (XGIfb_vrate[i].yres == yres)) {
> - if (XGIfb_vrate[i].refresh == rate) {
> + 

There is a stray tab here.  You didn't run checkpatch.pl.

> + // Skip values with less xres

Linus likes this comment style, but I would prefer normal comments,
please.

> + while (XGIfb_vrate[i].idx != 0 && XGIfb_vrate[i].xres < xres)
> + ++i;
> +

I have reviewed the code, and I still find the single loop more
readable.

> + while (XGIfb_vrate[i].idx != 0 && XGIfb_vrate[i].xres <= xres) {
> + if (XGIfb_vrate[i].yres != yres) {
> + ++i;
> + continue;
> + }

I would like a change that did:

if ((XGIfb_vrate[i].xres != xres) ||
(XGIfb_vrate[i].yres != yres)) {
i++;
continue;
}

so we could pull everything in one tab.

> + if (XGIfb_vrate[i].refresh == rate) {
> + xgifb_info->rate_idx = XGIfb_vrate[i].idx;
> + break;
> + } else if (XGIfb_vrate[i].refresh > rate) {
> + if (XGIfb_vrate[i].refresh - rate <= 3) {
> + pr_debug("Adjusting rate from %d up to %d\n",
> + rate, XGIfb_vrate[i].refresh);
>   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
> - break;
> - } else if (XGIfb_vrate[i].refresh > rate) {
> - if ((XGIfb_vrate[i].refresh - rate) <= 3) {
> - pr_debug("Adjusting rate from %d up to 
> %d\n",
> -  rate, XGIfb_vrate[i].refresh);
> - xgifb_info->rate_idx =
> - XGIfb_vrate[i].idx;
> - xgifb_info->refresh_rate =
> - XGIfb_vrate[i].refresh;
> - } else if (((rate - XGIfb_vrate[i - 1].refresh)
> - <= 2) && (XGIfb_vrate[i].idx
> - != 1)) {
> - pr_debug("Adjusting rate from %d down 
> to %d\n",
> -  rate,
> -  XGIfb_vrate[i - 1].refresh);
> - xgifb_info->rate_idx =
> - XGIfb_vrate[i - 1].idx;
> - xgifb_info->refresh_rate =
> - XGIfb_vrate[i - 1].refresh;
> - }
> - break;
> - } else if ((rate - XGIfb_vrate[i].refresh) <= 2) {
> + xgifb_info->refresh_rate =
> + XGIfb_vrate[i].refresh;
> + } else if ((rate - XGIfb_vrate[i - 1].refresh <= 2)
> + && (XGIfb_vrate[i].idx != 1)) {
^^^
This bug is there in the original code, and not something that you
introduced but the second part of the if condition is to ensure that
we didn't do an array underflow in the first part of the if statement.

These days that can trigger a kasan warning, I believe.

The conditions should be swapped around to avoid the read before the
start of the array altogether.  And, in fact, it should be written like
this to make it easier for static analysis tools:

} else if (i != 0 &&
   rate - XGIfb_vrate[i - 1].refresh <= 2) {

regards,
dan carpenter


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


[PATCH] Staging: xgifb: XGI_main_26.c: Refactored the function

2018-03-20 Thread Pratik Jain
Refactored the function `XGIfb_search_refresh_rate` by removing a level
of `if...else` block nesting. Removed unnecessary parantheses.

Signed-off-by: Pratik Jain 
---
 drivers/staging/xgifb/XGI_main_26.c | 61 +++--
 1 file changed, 32 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 10107de0119a..7bbc12f3146f 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -544,41 +544,44 @@ static u8 XGIfb_search_refresh_rate(struct 
xgifb_video_info *xgifb_info,
yres = XGIbios_mode[xgifb_info->mode_idx].yres;
 
xgifb_info->rate_idx = 0;
-   while ((XGIfb_vrate[i].idx != 0) && (XGIfb_vrate[i].xres <= xres)) {
-   if ((XGIfb_vrate[i].xres == xres) &&
-   (XGIfb_vrate[i].yres == yres)) {
-   if (XGIfb_vrate[i].refresh == rate) {
+   
+   // Skip values with less xres
+   while (XGIfb_vrate[i].idx != 0 && XGIfb_vrate[i].xres < xres)
+   i++;
+
+   while (XGIfb_vrate[i].idx != 0 && XGIfb_vrate[i].xres <= xres) {
+   if (XGIfb_vrate[i].yres != yres) {
+   i++;
+   continue;
+   }
+   if (XGIfb_vrate[i].refresh == rate) {
+   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
+   break;
+   } else if (XGIfb_vrate[i].refresh > rate) {
+   if (XGIfb_vrate[i].refresh - rate <= 3) {
+   pr_debug("Adjusting rate from %d up to %d\n",
+   rate, XGIfb_vrate[i].refresh);
xgifb_info->rate_idx = XGIfb_vrate[i].idx;
-   break;
-   } else if (XGIfb_vrate[i].refresh > rate) {
-   if ((XGIfb_vrate[i].refresh - rate) <= 3) {
-   pr_debug("Adjusting rate from %d up to 
%d\n",
-rate, XGIfb_vrate[i].refresh);
-   xgifb_info->rate_idx =
-   XGIfb_vrate[i].idx;
-   xgifb_info->refresh_rate =
-   XGIfb_vrate[i].refresh;
-   } else if (((rate - XGIfb_vrate[i - 1].refresh)
-   <= 2) && (XGIfb_vrate[i].idx
-   != 1)) {
-   pr_debug("Adjusting rate from %d down 
to %d\n",
-rate,
-XGIfb_vrate[i - 1].refresh);
-   xgifb_info->rate_idx =
-   XGIfb_vrate[i - 1].idx;
-   xgifb_info->refresh_rate =
-   XGIfb_vrate[i - 1].refresh;
-   }
-   break;
-   } else if ((rate - XGIfb_vrate[i].refresh) <= 2) {
+   xgifb_info->refresh_rate =
+   XGIfb_vrate[i].refresh;
+   } else if ((rate - XGIfb_vrate[i - 1].refresh <= 2)
+   && (XGIfb_vrate[i].idx != 1)) {
pr_debug("Adjusting rate from %d down to %d\n",
-rate, XGIfb_vrate[i].refresh);
-   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
-   break;
+   rate, XGIfb_vrate[i - 1].refresh);
+   xgifb_info->rate_idx = XGIfb_vrate[i - 1].idx;
+   xgifb_info->refresh_rate =
+   XGIfb_vrate[i - 1].refresh;
}
+   break;
+   } else if (rate - XGIfb_vrate[i].refresh <= 2) {
+   pr_debug("Adjusting rate from %d down to %d\n",
+   rate, XGIfb_vrate[i].refresh);
+   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
+   break;
}
i++;
}
+
if (xgifb_info->rate_idx > 0)
return xgifb_info->rate_idx;
pr_info("Unsupported rate %d for %dx%d\n",
-- 
2.16.2

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


Re: [PATCHv2] staging: wilc1000: replace switch statement by simple if condition

2018-03-20 Thread Greg KH
On Tue, Mar 20, 2018 at 05:13:31PM +0530, hariprasath.ela...@gmail.com wrote:
> From: HariPrasath Elango 
> 
> In this case,there is only a single switch case statement.So replacing
> by a simple if condition
> 
> Signed-off-by: HariPrasath Elango 
> ---
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 +---
>  1 file changed, 1 insertion(+), 7 deletions(-)

What changed from v1?  Always put that information below the --- line,
like the kernel documentation asks you to do.

v3?  :)

thanks,

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


[PATCHv2] staging: wilc1000: replace switch statement by simple if condition

2018-03-20 Thread hariprasath . elango
From: HariPrasath Elango 

In this case,there is only a single switch case statement.So replacing
by a simple if condition

Signed-off-by: HariPrasath Elango 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9d8d5d0..730d64f 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -776,14 +776,8 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
}
 
if (sme->crypto.n_akm_suites) {
-   switch (sme->crypto.akm_suites[0]) {
-   case WLAN_AKM_SUITE_8021X:
+   if (sme->crypto.akm_suites[0] == WLAN_AKM_SUITE_8021X)
auth_type = IEEE8021;
-   break;
-
-   default:
-   break;
-   }
}
 
curr_channel = nw_info->ch;
-- 
2.10.0.GIT

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


Re: [PATCH 5/7] staging: wilc1000: replace switch statement by simple if condition

2018-03-20 Thread
On Tue, Mar 20, 2018 at 02:29:51PM +0300, Dan Carpenter wrote:
> On Tue, Mar 20, 2018 at 11:42:27AM +0530,  wrote:
> > On Mon, Mar 19, 2018 at 07:45:46PM +0100, Greg KH wrote:
> > > On Wed, Mar 14, 2018 at 06:15:03PM +0530, hariprasath.ela...@gmail.com 
> > > wrote:
> > > > From: HariPrasath Elango 
> > > > 
> > > > In this case,there is only a single switch case statement.So replacing
> > > > by a simple if condition.
> > > > 
> > > > Signed-off-by: HariPrasath Elango 
> > > > ---
> > > >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 +---
> > > >  1 file changed, 1 insertion(+), 7 deletions(-)
> > > 
> > > Does not apply to my tree :(
> > 
> > Hi Greg,
> > 
> > Sorry about that.
> 
> Probably there were other patches on the list that were applied first.
> It's likely not your fault, but just part of the process.
> 
> > Shall I sent a v2 after rebasing my repo ? Will that
> > be fine ? 
> 
> Yes.
> 
> regards,
> dan carpenter

Hi dan,thanks for the feedback. I will send a new version of the patch
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: xgifb: XGI_main_26.c: Refactored the function

2018-03-20 Thread Pratik Jain
You got a valid point about `++i` and `i++`. But I still feel
that it is less complicated than previous one. I am explicitly
saying(in first loop) that we are skipping some values to get
to a specific index. Apart from that, we can avoid unncessary
wrapping and indentation. Logic becomes much more explicit if
broken down to two loops.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 5/7] staging: wilc1000: replace switch statement by simple if condition

2018-03-20 Thread Dan Carpenter
On Tue, Mar 20, 2018 at 11:42:27AM +0530,  wrote:
> On Mon, Mar 19, 2018 at 07:45:46PM +0100, Greg KH wrote:
> > On Wed, Mar 14, 2018 at 06:15:03PM +0530, hariprasath.ela...@gmail.com 
> > wrote:
> > > From: HariPrasath Elango 
> > > 
> > > In this case,there is only a single switch case statement.So replacing
> > > by a simple if condition.
> > > 
> > > Signed-off-by: HariPrasath Elango 
> > > ---
> > >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 +---
> > >  1 file changed, 1 insertion(+), 7 deletions(-)
> > 
> > Does not apply to my tree :(
> 
> Hi Greg,
> 
> Sorry about that.

Probably there were other patches on the list that were applied first.
It's likely not your fault, but just part of the process.

> Shall I sent a v2 after rebasing my repo ? Will that
> be fine ? 

Yes.

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


Re: [PATCH] Staging: xgifb: XGI_main_26.c: Refactored the function

2018-03-20 Thread Dan Carpenter
I'm trying to review this, but I feel like this makes it slightly more
complicated for no reason.  Why break it up into two loops?

> - i++;
> + ++i;

These are equivalent, so you should default to accepting the original
author's style.  Otherwise the next person to touch this code will just
change it back and we get into a cycle of pointless changes.

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


Re: [PATCH v2 00/21] Allow compile-testing NO_DMA (drivers)

2018-03-20 Thread Wolfram Sang

> To play it safe, you want to postpone the subsystem patches until the core
> part has landed upstream. I will rebase and resubmit after v4.17-rc1.

Thanks for the heads up. I'll wait for the rebased patch then and apply
it after rc1 for 4.17.



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


Re: [PATCH v2 10/21] lightnvm: Remove depends on HAS_DMA in case of platform dependency

2018-03-20 Thread Geert Uytterhoeven
Hi Madalin-cristian,

On Mon, Mar 19, 2018 at 6:27 AM, Madalin-cristian Bucur
 wrote:
>> -Original Message-
>> From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org]
>> On Behalf Of Geert Uytterhoeven
>> Remove dependencies on HAS_DMA where a Kconfig symbol depends on
>> another
>> symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
>> In most cases this other symbol is an architecture or platform specific
>> symbol, or PCI.
>>
>> Generic symbols and drivers without platform dependencies keep their
>> dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
>> cannot work anyway.
>>
>> This simplifies the dependencies, and allows to improve compile-testing.
>>
>> Notes:
>>   - FSL_FMAN keeps its dependency on HAS_DMA, as it calls set_dma_ops(),
>> which does not exist if HAS_DMA=n (Do we need a dummy? The use of
>> set_dma_ops() in this driver is questionable),
>
> Hi,
>
> The set_dma_ops() is no longer required in the fsl/fman, I'll send a patch to 
> remove it.

Thank you, looking forward to it!

>>   - SND_SOC_LPASS_IPQ806X and SND_SOC_LPASS_PLATFORM loose their
>> dependency on HAS_DMA, as they are selected from
>> SND_SOC_APQ8016_SBC.
>>
>> Signed-off-by: Geert Uytterhoeven 
>> Reviewed-by: Mark Brown 
>> Acked-by: Robin Murphy 

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 14/21] mtd: Remove depends on HAS_DMA in case of platform dependency

2018-03-20 Thread Geert Uytterhoeven
Hi Boris,

On Sun, Mar 18, 2018 at 11:04 PM, Boris Brezillon
 wrote:
> On Fri, 16 Mar 2018 14:51:47 +0100
> Geert Uytterhoeven  wrote:
>
>> Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
>> symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
>> In most cases this other symbol is an architecture or platform specific
>> symbol, or PCI.
>>
>> Generic symbols and drivers without platform dependencies keep their
>> dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
>> cannot work anyway.
>>
>> This simplifies the dependencies, and allows to improve compile-testing.
>>
>
> Don't know which release you're targeting but it's likely to conflict
> with the change I have in my nand/next branch. Is this a problem if I
> take this patch through the mtd tree after [1] has reached Linus' tree?

No problem, I will rebase and resubmit after v4.17-rc1.

> [1]https://lkml.org/lkml/2018/3/16/435
>
>> Signed-off-by: Geert Uytterhoeven 
>> Reviewed-by: Mark Brown 
>> Acked-by: Robin Murphy 

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 06/21] fpga: Remove depends on HAS_DMA in case of platform dependency

2018-03-20 Thread Geert Uytterhoeven
Hi Alan,

On Mon, Mar 19, 2018 at 5:06 PM, Alan Tull  wrote:
> On Fri, Mar 16, 2018 at 8:51 AM, Geert Uytterhoeven
>  wrote:
> This essentially removes this commit
>
> commit 1c8cb409491403036919dd1c6b45013dc8835a44
> Author: Sudip Mukherjee 
> Date:   Wed Aug 3 13:45:46 2016 -0700
>
> drivers/fpga/Kconfig: fix build failure
>
> While building m32r allmodconfig the build is failing with the error:
>
>   ERROR: "bad_dma_ops" [drivers/fpga/zynq-fpga.ko] undefined!
>
> Xilinx Zynq FPGA is using DMA but there was no dependency while
> building.
>
> Link: 
> http://lkml.kernel.org/r/1464346526-13913-1-git-send-email-sudipm.mukher...@gmail.com
> Signed-off-by: Sudip Mukherjee 
> Acked-by: Moritz Fischer 
> Cc: Alan Tull 
> Signed-off-by: Andrew Morton 
> Signed-off-by: Linus Torvalds 

Yes it does. The major change is that the first (core) series introduces
all needed dummies to do successful compile-testing on NO_DMA=y platforms.

>> Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
>> symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
>> In most cases this other symbol is an architecture or platform specific
>> symbol, or PCI.
>>
>> Generic symbols and drivers without platform dependencies keep their
>> dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
>> cannot work anyway.
>>
>> This simplifies the dependencies, and allows to improve compile-testing.
>>
>> Signed-off-by: Geert Uytterhoeven 
>> Reviewed-by: Mark Brown 
>> Acked-by: Robin Murphy 

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 00/21] Allow compile-testing NO_DMA (drivers)

2018-03-20 Thread Geert Uytterhoeven
Hi Wolfram,

On Fri, Mar 16, 2018 at 10:23 PM, Wolfram Sang  wrote:
>> To avoid allmodconfig/allyesconfig regressions on NO_DMA=y platforms,
>> this (drivers) series should be applied after the previous (core)
>> series (but not many people may notice/care ;-)
>
> I still don't get if there is a dependency on the core patches. I.e.
> shall I apply the subsystem patch now by myself or do you want to push
> the series after the core patch and need my ack here?

Yes, there is a dependency. Without the core patches, enabling COMPILE_TEST,
and compile-testing drivers irrelevant on obscure NO_DMA=y platforms will
cause build failures.

To play it safe, you want to postpone the subsystem patches until the core
part has landed upstream. I will rebase and resubmit after v4.17-rc1.

Thanks, and sorry for being unclear.

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: xgifb: XGI_main_26.c: Refactored the function

2018-03-20 Thread Pratik Jain
Refactored the function `XGIfb_search_refresh_rate` by removing a level
of `if...else` block nesting. Removed unnecessary parantheses.

Signed-off-by: Pratik Jain 
---
 drivers/staging/xgifb/XGI_main_26.c | 63 +++--
 1 file changed, 33 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 10107de0119a..ef9a726cd35d 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -544,41 +544,44 @@ static u8 XGIfb_search_refresh_rate(struct 
xgifb_video_info *xgifb_info,
yres = XGIbios_mode[xgifb_info->mode_idx].yres;
 
xgifb_info->rate_idx = 0;
-   while ((XGIfb_vrate[i].idx != 0) && (XGIfb_vrate[i].xres <= xres)) {
-   if ((XGIfb_vrate[i].xres == xres) &&
-   (XGIfb_vrate[i].yres == yres)) {
-   if (XGIfb_vrate[i].refresh == rate) {
+   
+   // Skip values with less xres
+   while (XGIfb_vrate[i].idx != 0 && XGIfb_vrate[i].xres < xres)
+   ++i;
+
+   while (XGIfb_vrate[i].idx != 0 && XGIfb_vrate[i].xres <= xres) {
+   if (XGIfb_vrate[i].yres != yres) {
+   ++i;
+   continue;
+   }
+   if (XGIfb_vrate[i].refresh == rate) {
+   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
+   break;
+   } else if (XGIfb_vrate[i].refresh > rate) {
+   if (XGIfb_vrate[i].refresh - rate <= 3) {
+   pr_debug("Adjusting rate from %d up to %d\n",
+   rate, XGIfb_vrate[i].refresh);
xgifb_info->rate_idx = XGIfb_vrate[i].idx;
-   break;
-   } else if (XGIfb_vrate[i].refresh > rate) {
-   if ((XGIfb_vrate[i].refresh - rate) <= 3) {
-   pr_debug("Adjusting rate from %d up to 
%d\n",
-rate, XGIfb_vrate[i].refresh);
-   xgifb_info->rate_idx =
-   XGIfb_vrate[i].idx;
-   xgifb_info->refresh_rate =
-   XGIfb_vrate[i].refresh;
-   } else if (((rate - XGIfb_vrate[i - 1].refresh)
-   <= 2) && (XGIfb_vrate[i].idx
-   != 1)) {
-   pr_debug("Adjusting rate from %d down 
to %d\n",
-rate,
-XGIfb_vrate[i - 1].refresh);
-   xgifb_info->rate_idx =
-   XGIfb_vrate[i - 1].idx;
-   xgifb_info->refresh_rate =
-   XGIfb_vrate[i - 1].refresh;
-   }
-   break;
-   } else if ((rate - XGIfb_vrate[i].refresh) <= 2) {
+   xgifb_info->refresh_rate =
+   XGIfb_vrate[i].refresh;
+   } else if ((rate - XGIfb_vrate[i - 1].refresh <= 2)
+   && (XGIfb_vrate[i].idx != 1)) {
pr_debug("Adjusting rate from %d down to %d\n",
-rate, XGIfb_vrate[i].refresh);
-   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
-   break;
+   rate, XGIfb_vrate[i - 1].refresh);
+   xgifb_info->rate_idx = XGIfb_vrate[i - 1].idx;
+   xgifb_info->refresh_rate =
+   XGIfb_vrate[i - 1].refresh;
}
+   break;
+   } else if (rate - XGIfb_vrate[i].refresh <= 2) {
+   pr_debug("Adjusting rate from %d down to %d\n",
+   rate, XGIfb_vrate[i].refresh);
+   xgifb_info->rate_idx = XGIfb_vrate[i].idx;
+   break;
}
-   i++;
+   ++i;
}
+
if (xgifb_info->rate_idx > 0)
return xgifb_info->rate_idx;
pr_info("Unsupported rate %d for %dx%d\n",
-- 
2.16.2

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


[PATCH] staging: mt7621-gpio: remove redundant owner assignments of drivers

2018-03-20 Thread hariprasath . elango
From: HariPrasath Elango 

Remove the reduntant owner initialization from this platform driver as
the platform_driver_register() takes care of it.

Signed-off-by: HariPrasath Elango 
---
 drivers/staging/mt7621-gpio/gpio-mt7621.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c 
b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index 5c57abe..830d429 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -339,7 +339,6 @@ static struct platform_driver mediatek_gpio_driver = {
.probe = mediatek_gpio_probe,
.driver = {
.name = "mt7621_gpio",
-   .owner = THIS_MODULE,
.of_match_table = mediatek_gpio_match,
},
 };
-- 
2.10.0.GIT

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


Re: [PATCH v2 1/3] staging: xm2mvscale: Driver support for Xilinx M2M Video Scaler

2018-03-20 Thread Hans Verkuil
On 03/20/2018 02:41 AM, Nicolas Dufresne wrote:
> Le mardi 20 mars 2018 à 00:46 +, Rohit Athavale a écrit :
>> Hi Hans,
>>
>> Thanks for taking the time to take a look at this.
>>
>>> This should definitely use the V4L2 API. I guess it could be added
>>> to staging/media with a big fat TODO that this should be converted
>>> to
>>> the V4L2 mem2mem framework.
>>>
>>> But it makes no sense to re-invent the V4L2 streaming API :-)
>>>
>>> drivers/media/platform/mx2_emmaprp.c does something similar to
>>> this.
>>> It's a little bit outdated (not using the latest m2m helper
>>> functions)
>>> but it is a good starting point.
>>
>> I looked at the mx2_emmaprp.c and the Samsung G-Scaler M2M driver.
>> IMHO, the main difference between
>> the Hardware registers/capabilities is that mx2_emmaprp driver or the
>> gsc driver, have one scaling "channel"
>> if we might call it. Whereas the HW/IP I have in mind has 4-8 scaling
>> channels.
>>
>> By a scaling channel, I mean an entity of the HW or IP, that can take
>> the following parameters :
>>  - Input height, stride , width, color format, input Y and Cb/Cr
>> physically contiguous memory pointers 
>>  - Output height, stride, width, color format, output Y and Cb/Cr
>> physically contiguous  memory pointers
>>
>> Based on the above parameters, when the above are provided and the IP
>> is started, we get an interrupt on completion.
>> I'm sure you are familiar with this model. However, in the case of
>> this IP, there could be 4-8 such channels and a single interrupt
>> on the completion of the all 4-8 scaling operations.
>>
>> In this IP, we are trying to have 4-8 input sources being scaled by
>> this single piece of hardware, by time multiplexing.
>>
>> An example use case is :
>>
>> Four applications (sources) will feed (enqueue) 4 input buffers to
>> the scaler, the scaler driver will synchronize the programming of
>> these buffers, when the number of buffers received  by the driver
>> meets our batch size (say a batch size of 4), it will kick start the
>> IP. The four applications  will poll on the fd, upon receiving an
>> interrupt from the hardware the poll will unblock. And all four
>> applications can dequeue their respective buffers and display them on
>> a sink.
> 
> You should think of a better scheduling model, it will be really hard
> to design userspace that collaborate in order to optimize the IP usage.
> I think a better approach would be to queue while the IP is busy. These
> queues can then be sorted and prioritized.
> 
>>
>> But each "channel" can be set to do accept its own individual input
>> and output formats. When I went through :
>> https://www.kernel.org/doc/html/v4.14/media/uapi/v4l/open.html#multip
>> le-opens
>>
>> It appears, once an application has invoked VIDIOC_REQBUFS or
>> VIDIOC_CREATE_BUFS, other applications cannot VIDIOC_S_FMT on them.
>> However to maximize the available number of channels, it would be
>> necessary to allow several applications to be able to 
>> perform VIDIOC_S_FMT on the device node in the case of this hardware
>> as different channels can be expected to deal with different scaling
>> operations.
> 
> This does not apply to M2M devices. Each time userspace open an M2M
> device, it will get a different instance (unless there is no more
> resource available). What drivers like Samsung FIMC, GSCALER, MFC. etc.
> do, is that they limit the number of instances (open calls) to the
> number of streams they can handle in parallel. They don't seem to share
> an IRQ when doing batch though.
> 
>>
>> One option is to create a logical /dev/videoX node for each such
>> channel, and have a parent driver perform the interrupt handling,
>> batch size setting and other such common functionalities. Is there a
>> way to allow multiple applications talk to the same video device
>> node/file handle without creating logical video nodes for each
>> channel ?
> 
> FIMC used to expose a node per instance and it was terribly hard to
> use. I don't think this is a good idea.

See Nicolas' answers. The mem2mem framework should work well for you,
I think. The job_ready callback can be used to signal when enough
buffers are queued to satisfy your IP requirements.

BTW, those requirements sound really weird. Is this really how Xilinx
wants to implement this? It's not how scalers are used 'in the real world'.
This whole 'batching' thing is strange.

Regards,

Hans

> 
>>
>> Please let me know if the description of HW is not clear. I will look
>> forward to hear comments from you.
>>
>>>
>>> So for this series:
>>>
>>> Nacked-by: Hans Verkuil 
>>>
>>> If this was added to drivers/staging/media instead and with an
>>> updated
>>> TODO, then we can accept it, but we need to see some real effort
>>> afterwards
>>> to switch this to the right API. Otherwise it will be removed again
>>> after a few kernel cycles.
>>>
>>
>> Many thanks for providing a pathway to get this into
>> drivers/staging/media
>>
>> I will drop this series, and r

Re: [PATCH] staging: android: ashmem: Fix possible deadlock in ashmem_ioctl

2018-03-20 Thread Greg KH
On Mon, Mar 19, 2018 at 03:16:51PM -0700, Joel Fernandes (Google) wrote:
> On Tue, Feb 27, 2018 at 10:59 PM, Yisheng Xie  wrote:
> > ashmem_mutex may create a chain of dependencies like:
> >
> > CPU0CPU1
> >  mmap syscall   ioctl syscall
> >  -> mmap_sem (acquired) -> ashmem_ioctl
> >  -> ashmem_mmap-> ashmem_mutex (acquired)
> > -> ashmem_mutex (try to acquire)   -> copy_from_user
> >   -> mmap_sem (try to acquire)
> >
> > There is a lock odering problem between mmap_sem and ashmem_mutex causing
> > a lockdep splat[1] during a syzcaller test. This patch fixes the problem
> > by move copy_from_user out of ashmem_mutex.
> >
> > [1] https://www.spinics.net/lists/kernel/msg2733200.html
> >
> > Fixes: ce8a3a9e76d0 (staging: android: ashmem: Fix a race condition in pin 
> > ioctls)
> > Reported-by: syzbot+d7a918a7a8e1c952b...@syzkaller.appspotmail.com
> > Signed-off-by: Yisheng Xie 
> 
> Greg,
> Could you take this patch for the stable trees? I do see it in staging
> already. I couldn't find it in stable so wanted to bring it to your
> attention. If you already aware of it, please ignore my note.

Ah, I didn't realize this needed to be added to the stable trees, I'll
queue it up after this current round of releases happen in a few days.

thanks,

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