Re: [PATCH] android: binder: Remove deprecated create_singlethread_workqueue

2016-08-15 Thread Tejun Heo
On Sat, Aug 13, 2016 at 10:16:24PM +0530, Bhaktipriya Shridhar wrote:
> The workqueue is being used to run deferred work for the android binder.
> 
> The "binder_deferred_workqueue" queues only a single work item and hence
> does not require ordering. Also, this workqueue is not being used on a
> memory recliam path. Hence, the singlethreaded workqueue has been
> replaced with the use of system_wq.
> 
> System workqueues have been able to handle high level of concurrency
> for a long time now and hence it's not required to have a singlethreaded
> workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
> created with create_singlethread_workqueue(), system_wq allows multiple
> work items to overlap executions even on the same CPU; however, a
> per-cpu workqueue doesn't have any CPU locality or global ordering
> guarantee unless the target CPU is explicitly specified and thus the
> increase of local concurrency shouldn't make any difference.
> 
> Signed-off-by: Bhaktipriya Shridhar 

Acked-by: Tejun Heo 

Thanks.

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


Re: Building a subdirectory ignores parent subdir-ccflags

2016-08-15 Thread Joe Perches
On Tue, 2016-08-16 at 00:07 +0200, Michal Marek wrote:

Hi Michal.

> > Perhaps making a specific directory should also walk up
> > any parent directory Makefiles looking for subdir flags.
> > 
> > Is that unreasonable?  Any suggestions?
> I suggest to do make drivers/staging/lustre/. If building the lustre
> subdirectories is going to be a common use case, then you can propagate
> the subdir-ccflags-y assignment down to the individual Makefiles.

I don't have a problem with that.

Others might though for whatever reason.

There are a couple other places in the tree that
also use subdir-ccflags where the results of making
a subdirectory would either fail or have unexpected
results.

Does it matter?  Not much, but it could be nicer if
it's possible for parent Makefile paths to be ascended.

I'm not much of a Makefile person, but perhaps you have
some clues/tips/suggestions for implementation?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v2 RESEND 2/4] Drivers: hv: balloon: account for gaps in hot add regions

2016-08-15 Thread Alex Ng (LIS)
> @@ -676,35 +686,63 @@ static void hv_mem_hot_add(unsigned long start,
> unsigned long size,
> 
>  static void hv_online_page(struct page *pg)  {
> - struct list_head *cur;
>   struct hv_hotadd_state *has;
> + struct hv_hotadd_gap *gap;
>   unsigned long cur_start_pgp;
>   unsigned long cur_end_pgp;
> + bool is_gap = false;
> 
>   list_for_each(cur, _device.ha_region_list) {
>   has = list_entry(cur, struct hv_hotadd_state, list);
>   cur_start_pgp = (unsigned long)
> + pfn_to_page(has->start_pfn);
> + cur_end_pgp = (unsigned long)pfn_to_page(has->end_pfn);
> +
> + /* The page belongs to a different HAS. */
> + if (((unsigned long)pg < cur_start_pgp) ||
> + ((unsigned long)pg >= cur_end_pgp))
> + continue;
> +
> + cur_start_pgp = (unsigned long)
>   pfn_to_page(has->covered_start_pfn);
>   cur_end_pgp = (unsigned long)pfn_to_page(has-
> >covered_end_pfn);
> 
> - if (((unsigned long)pg >= cur_start_pgp) &&
> - ((unsigned long)pg < cur_end_pgp)) {
> - /*
> -  * This frame is currently backed; online the
> -  * page.
> -  */
> - __online_page_set_limits(pg);
> - __online_page_increment_counters(pg);
> - __online_page_free(pg);
> + /* The page is not backed. */
> + if (((unsigned long)pg < cur_start_pgp) ||
> + ((unsigned long)pg >= cur_end_pgp))
> + continue;
> +
> + /* Check for gaps. */
> + list_for_each_entry(gap, >gap_list, list) {
> + cur_start_pgp = (unsigned long)
> + pfn_to_page(gap->start_pfn);
> + cur_end_pgp = (unsigned long)
> + pfn_to_page(gap->end_pfn);
> + if (((unsigned long)pg >= cur_start_pgp) &&
> + ((unsigned long)pg < cur_end_pgp)) {
> + is_gap = true;
> + break;
> + }
>   }
> +
> + if (is_gap)
> + break;
> +
> + /* This frame is currently backed; online the page. */
> + __online_page_set_limits(pg);
> + __online_page_increment_counters(pg);
> + __online_page_free(pg);
> + break;
>   }
>  }
> 

We may need to add similar logic to check for gaps in hv_bring_pgs_online().

[...]
>  static unsigned long handle_pg_range(unsigned long pg_start, @@ -834,13
> +881,19 @@ static unsigned long process_hot_add(unsigned long pg_start,
>   unsigned long rg_size)
>  {
>   struct hv_hotadd_state *ha_region = NULL;
> + int covered;
> 
>   if (pfn_cnt == 0)
>   return 0;
> 
> - if (!dm_device.host_specified_ha_region)
> - if (pfn_covered(pg_start, pfn_cnt))
> + if (!dm_device.host_specified_ha_region) {
> + covered = pfn_covered(pg_start, pfn_cnt);
> + if (covered < 0)
> + return 0;

If the hot-add pages aren't covered by any region, then shouldn't it fall 
through instead of returning?
That way the new ha_region can be added to the list and we hot-add the pages 
accordingly.

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


Re: Building a subdirectory ignores parent subdir-ccflags

2016-08-15 Thread Michal Marek
Dne 15.8.2016 v 23:29 Joe Perches napsal(a):
> On Mon, 2016-08-15 at 14:14 -0700, Joe Perches wrote:
>> On Mon, 2016-08-15 at 23:04 +0200, Greg Kroah-Hartman wrote:
>>> On Mon, Aug 15, 2016 at 12:33:23PM -0700, Joe Perches wrote:
 Start to rationalize include paths in source code files.
>> []
 diff --git a/drivers/staging/lustre/Makefile 
 b/drivers/staging/lustre/Makefile
>> []
 @@ -1,2 +1,5 @@
 +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include/
 +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/
 +
  obj-$(CONFIG_LNET)+= lnet/
  obj-$(CONFIG_LUSTRE_FS)   += lustre/
>>> This is good, but does this break the subdir make command:
>>> make M=drivers/staging/lustre/foo_dir/
>>> ?
>> hmm, yeah, it does.  Oh well, nevermind for awhile.
>>> I remember the last time I tried to clean this up, it took a while...
>> It seems like something the build tools should
>> handle correctly now, but I'll look at it.
> 
> Perhaps making a specific directory should also walk up
> any parent directory Makefiles looking for subdir flags.
> 
> Is that unreasonable?  Any suggestions?

I suggest to do make drivers/staging/lustre/. If building the lustre
subdirectories is going to be a common use case, then you can propagate
the subdir-ccflags-y assignment down to the individual Makefiles.

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


Re: [PATCH 19/58] staging: lustre: llite: add md_op_data parameter to ll_get_dir_page

2016-08-15 Thread James Simmons

> > From: wang di 
> > 
> > Pass in struct md_op_data for ll_get_dir_page function.
> > 
> > Signed-off-by: wang di 
> > Reviewed-on: http://review.whamcloud.com/7043
> > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
> > Reviewed-by: John L. Hammond 
> > Reviewed-by: Jinshan Xiong 
> > Reviewed-by: Andreas Dilger 
> > Reviewed-by: Oleg Drokin 
> > Signed-off-by: James Simmons 
> > ---
> >  drivers/staging/lustre/lustre/llite/dir.c  |8 
> >  .../staging/lustre/lustre/llite/llite_internal.h   |4 ++--
> >  drivers/staging/lustre/lustre/llite/statahead.c|   15 +++
> >  3 files changed, 17 insertions(+), 10 deletions(-)
> 
> This patch fails to apply, so I have to stop here in the patch series.
> 
> So I'm guesing your second patch series also will fail to apply, so can
> you resend all of the outstanding patches you have sent me after
> rebasing on my staging-testing branch?

Do you mind if I combine them into one series? Also I have a few more 
patches I like to include. Is it okay to add those as well?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: lustre: Add include path to Makefile

2016-08-15 Thread Joe Perches
On Mon, 2016-08-15 at 23:04 +0200, Greg Kroah-Hartman wrote:
> On Mon, Aug 15, 2016 at 12:33:23PM -0700, Joe Perches wrote:
> > Start to rationalize include paths in source code files.
[]
> > diff --git a/drivers/staging/lustre/Makefile 
> > b/drivers/staging/lustre/Makefile
[]
> > @@ -1,2 +1,5 @@
> > +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include/
> > +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/
> > +
> >  obj-$(CONFIG_LNET) += lnet/
> >  obj-$(CONFIG_LUSTRE_FS)+= lustre/
> This is good, but does this break the subdir make command:
>   make M=drivers/staging/lustre/foo_dir/
> ?

hmm, yeah, it does.  Oh well, nevermind for awhile.

> I remember the last time I tried to clean this up, it took a while...

It seems like something the build tools should
handle correctly now, but I'll look at it.

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


Building a subdirectory ignores parent subdir-ccflags (was: Re: [PATCH 1/2] staging: lustre: Add include path to Makefile)

2016-08-15 Thread Joe Perches
On Mon, 2016-08-15 at 14:14 -0700, Joe Perches wrote:
> On Mon, 2016-08-15 at 23:04 +0200, Greg Kroah-Hartman wrote:
> > On Mon, Aug 15, 2016 at 12:33:23PM -0700, Joe Perches wrote:
> > > Start to rationalize include paths in source code files.
> []
> > > diff --git a/drivers/staging/lustre/Makefile 
> > > b/drivers/staging/lustre/Makefile
> []
> > > @@ -1,2 +1,5 @@
> > > +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include/
> > > +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/
> > > +
> > >  obj-$(CONFIG_LNET)   += lnet/
> > >  obj-$(CONFIG_LUSTRE_FS)  += lustre/
> > This is good, but does this break the subdir make command:
> > make M=drivers/staging/lustre/foo_dir/
> > ?
> hmm, yeah, it does.  Oh well, nevermind for awhile.
> > I remember the last time I tried to clean this up, it took a while...
> It seems like something the build tools should
> handle correctly now, but I'll look at it.

Perhaps making a specific directory should also walk up
any parent directory Makefiles looking for subdir flags.

Is that unreasonable?  Any suggestions?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [lustre-devel] [PATCH 1/2] staging: lustre: Add include path to Makefile

2016-08-15 Thread James Simmons

> On Mon, Aug 15, 2016 at 12:33:23PM -0700, Joe Perches wrote:
> > Start to rationalize include paths in source code files.
> > 
> > Signed-off-by: Joe Perches 
> > ---
> >  drivers/staging/lustre/Makefile | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/staging/lustre/Makefile 
> > b/drivers/staging/lustre/Makefile
> > index 95ffe33..9d00237 100644
> > --- a/drivers/staging/lustre/Makefile
> > +++ b/drivers/staging/lustre/Makefile
> > @@ -1,2 +1,5 @@
> > +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include/
> > +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/
> > +
> >  obj-$(CONFIG_LNET) += lnet/
> >  obj-$(CONFIG_LUSTRE_FS)+= lustre/
> 
> This is good, but does this break the subdir make command:
>   make M=drivers/staging/lustre/foo_dir/
> ?
> 
> I remember the last time I tried to clean this up, it took a while...

It breaks make M=drivers/staging/lustre/foo_dir
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: lustre: Add include path to Makefile

2016-08-15 Thread Greg Kroah-Hartman
On Mon, Aug 15, 2016 at 12:33:23PM -0700, Joe Perches wrote:
> Start to rationalize include paths in source code files.
> 
> Signed-off-by: Joe Perches 
> ---
>  drivers/staging/lustre/Makefile | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/staging/lustre/Makefile b/drivers/staging/lustre/Makefile
> index 95ffe33..9d00237 100644
> --- a/drivers/staging/lustre/Makefile
> +++ b/drivers/staging/lustre/Makefile
> @@ -1,2 +1,5 @@
> +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include/
> +subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/
> +
>  obj-$(CONFIG_LNET)   += lnet/
>  obj-$(CONFIG_LUSTRE_FS)  += lustre/

This is good, but does this break the subdir make command:
make M=drivers/staging/lustre/foo_dir/
?

I remember the last time I tried to clean this up, it took a while...

thanks,

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


[PATCH 0/2] staging: lustre: #include neatening

2016-08-15 Thread Joe Perches
Make it a bit easier to grep and help a future move out of staging.

Joe Perches (2):
  staging: lustre: Add include path to Makefile
  staging: lustre: Remove .. paths from '#include "' uses

 drivers/staging/lustre/Makefile |  3 +++
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h |  6 +++---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h |  8 
 drivers/staging/lustre/lnet/libcfs/debug.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/fail.c   |  2 +-
 drivers/staging/lustre/lnet/libcfs/hash.c   |  2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c |  2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_lock.c|  2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_mem.c |  2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_string.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c|  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c |  4 ++--
 drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c|  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c|  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-module.c |  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c   |  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/module.c | 10 +-
 drivers/staging/lustre/lnet/libcfs/prng.c   |  2 +-
 drivers/staging/lustre/lnet/libcfs/tracefile.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/tracefile.h  |  2 +-
 drivers/staging/lustre/lnet/libcfs/workitem.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/acceptor.c |  2 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c   |  4 ++--
 drivers/staging/lustre/lnet/lnet/config.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-eq.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-md.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-me.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-move.c |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-msg.c  |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-ptl.c  |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-socket.c   |  4 ++--
 drivers/staging/lustre/lnet/lnet/lo.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/module.c   |  4 ++--
 drivers/staging/lustre/lnet/lnet/net_fault.c|  4 ++--
 drivers/staging/lustre/lnet/lnet/nidstrings.c   |  4 ++--
 drivers/staging/lustre/lnet/lnet/peer.c |  4 ++--
 drivers/staging/lustre/lnet/lnet/router.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/router_proc.c  |  4 ++--
 drivers/staging/lustre/lnet/selftest/conctl.c   |  6 +++---
 drivers/staging/lustre/lnet/selftest/conrpc.c   |  4 ++--
 drivers/staging/lustre/lnet/selftest/conrpc.h   |  8 
 drivers/staging/lustre/lnet/selftest/console.c  |  4 ++--
 drivers/staging/lustre/lnet/selftest/console.h  |  8 
 drivers/staging/lustre/lnet/selftest/rpc.h  |  2 +-
 drivers/staging/lustre/lnet/selftest/selftest.h | 10 +-
 drivers/staging/lustre/lustre/fid/fid_internal.h|  2 +-
 drivers/staging/lustre/lustre/fid/fid_lib.c |  2 +-
 drivers/staging/lustre/lustre/fid/fid_request.c |  2 +-
 drivers/staging/lustre/lustre/fid/lproc_fid.c   |  2 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c   |  2 +-
 drivers/staging/lustre/lustre/fld/fld_internal.h|  2 +-
 drivers/staging/lustre/lustre/fld/fld_request.c |  2 +-
 drivers/staging/lustre/lustre/fld/lproc_fld.c   |  2 +-
 drivers/staging/lustre/lustre/include/interval_tree.h   |  2 +-
 drivers/staging/lustre/lustre/include/linux/lustre_lite.h   |  2 +-
 drivers/staging/lustre/lustre/include/lu_object.h   |  2 +-
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h   |  4 ++--
 drivers/staging/lustre/lustre/include/lustre_disk.h |  4 ++--
 drivers/staging/lustre/lustre/include/lustre_fid.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_fld.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_handles.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_lib.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_mds.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_net.h  |  6 +++---
 drivers/staging/lustre/lustre/include/obd_cksum.h   |  4 ++--
 

Re: [PATCH net v2 0/5] hv_netvsc: fixes for VF removal path

2016-08-15 Thread David Miller
From: Vitaly Kuznetsov 
Date: Mon, 15 Aug 2016 17:48:38 +0200

> Kernel crash is reported after VF is removed and detached from netvsc
> device. Turns out we have multiple different (but related) issues on the
> VF removal path which I'm trying to address with PATCHes 2-5 of this
> series. PATCH1 is required to support the change.
> 
> Changes since v1:
> - Re-arrange patches in the series to not introduce new issues [David Miller]
> - Add PATCH5 which fixes a new issue I discovered while testing.
> - Add Haiyang' A-b tags to PATCH1-4
> 
> With regards to Stephen's suggestion: I believe that switching to using RCU
> and eliminating vf_use_cnt/vf_inject is the right thing to do long-term, we
> can either put this on top of this series or do it later in net-next.

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


[PATCH 2/2] staging: lustre: Remove .. paths from '#include "' uses

2016-08-15 Thread Joe Perches
Make the include paths a bit easier to find and more
compatible to a future move out of the staging tree.

Signed-off-by: Joe Perches 
---
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h |  6 +++---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h |  8 
 drivers/staging/lustre/lnet/libcfs/debug.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/fail.c   |  2 +-
 drivers/staging/lustre/lnet/libcfs/hash.c   |  2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_cpu.c |  2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_lock.c|  2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_mem.c |  2 +-
 drivers/staging/lustre/lnet/libcfs/libcfs_string.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-cpu.c|  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-crypto.c |  4 ++--
 drivers/staging/lustre/lnet/libcfs/linux/linux-curproc.c|  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-debug.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-mem.c|  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-module.c |  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-prim.c   |  2 +-
 drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/module.c | 10 +-
 drivers/staging/lustre/lnet/libcfs/prng.c   |  2 +-
 drivers/staging/lustre/lnet/libcfs/tracefile.c  |  2 +-
 drivers/staging/lustre/lnet/libcfs/tracefile.h  |  2 +-
 drivers/staging/lustre/lnet/libcfs/workitem.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/acceptor.c |  2 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c   |  4 ++--
 drivers/staging/lustre/lnet/lnet/config.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-eq.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-md.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-me.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-move.c |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-msg.c  |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-ptl.c  |  2 +-
 drivers/staging/lustre/lnet/lnet/lib-socket.c   |  4 ++--
 drivers/staging/lustre/lnet/lnet/lo.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/module.c   |  4 ++--
 drivers/staging/lustre/lnet/lnet/net_fault.c|  4 ++--
 drivers/staging/lustre/lnet/lnet/nidstrings.c   |  4 ++--
 drivers/staging/lustre/lnet/lnet/peer.c |  4 ++--
 drivers/staging/lustre/lnet/lnet/router.c   |  2 +-
 drivers/staging/lustre/lnet/lnet/router_proc.c  |  4 ++--
 drivers/staging/lustre/lnet/selftest/conctl.c   |  6 +++---
 drivers/staging/lustre/lnet/selftest/conrpc.c   |  4 ++--
 drivers/staging/lustre/lnet/selftest/conrpc.h   |  8 
 drivers/staging/lustre/lnet/selftest/console.c  |  4 ++--
 drivers/staging/lustre/lnet/selftest/console.h  |  8 
 drivers/staging/lustre/lnet/selftest/rpc.h  |  2 +-
 drivers/staging/lustre/lnet/selftest/selftest.h | 10 +-
 drivers/staging/lustre/lustre/fid/fid_internal.h|  2 +-
 drivers/staging/lustre/lustre/fid/fid_lib.c |  2 +-
 drivers/staging/lustre/lustre/fid/fid_request.c |  2 +-
 drivers/staging/lustre/lustre/fid/lproc_fid.c   |  2 +-
 drivers/staging/lustre/lustre/fld/fld_cache.c   |  2 +-
 drivers/staging/lustre/lustre/fld/fld_internal.h|  2 +-
 drivers/staging/lustre/lustre/fld/fld_request.c |  2 +-
 drivers/staging/lustre/lustre/fld/lproc_fld.c   |  2 +-
 drivers/staging/lustre/lustre/include/interval_tree.h   |  2 +-
 drivers/staging/lustre/lustre/include/linux/lustre_lite.h   |  2 +-
 drivers/staging/lustre/lustre/include/lu_object.h   |  2 +-
 drivers/staging/lustre/lustre/include/lustre/lustre_idl.h   |  4 ++--
 drivers/staging/lustre/lustre/include/lustre_disk.h |  4 ++--
 drivers/staging/lustre/lustre/include/lustre_fid.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_fld.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_handles.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_lib.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_mds.h  |  2 +-
 drivers/staging/lustre/lustre/include/lustre_net.h  |  6 +++---
 drivers/staging/lustre/lustre/include/obd_cksum.h   |  4 ++--
 drivers/staging/lustre/lustre/include/obd_support.h |  2 +-
 drivers/staging/lustre/lustre/ldlm/l_lock.c |  2 +-
 

[PATCH 1/2] staging: lustre: Add include path to Makefile

2016-08-15 Thread Joe Perches
Start to rationalize include paths in source code files.

Signed-off-by: Joe Perches 
---
 drivers/staging/lustre/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/lustre/Makefile b/drivers/staging/lustre/Makefile
index 95ffe33..9d00237 100644
--- a/drivers/staging/lustre/Makefile
+++ b/drivers/staging/lustre/Makefile
@@ -1,2 +1,5 @@
+subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/include/
+subdir-ccflags-y += -I$(srctree)/drivers/staging/lustre/lustre/include/
+
 obj-$(CONFIG_LNET) += lnet/
 obj-$(CONFIG_LUSTRE_FS)+= lustre/
-- 
2.8.0.rc4.16.g56331f8

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


Re: [PATCH 2/9] staging: most: hdm-usb: fix race between enqueue and most_stop_enqueue

2016-08-15 Thread Greg KH
On Mon, Jul 18, 2016 at 05:25:28PM +0200, Christian Gromm wrote:
> The "broken in pipe" handler of the USB-HDM calls most_stop_enqueue() to
> stop the MBO traffic before returning all MBOs back to the Mostcore.  As
> the enqueue() call from the Mostcore may run in parallel with the
> most_stop_enqueue(), the HDM may run into the inconsistent state and
> crash the kernel.
> 
> This patch synchronizes enqueue(), most_stop_enqueue() and
> most_resume_enqueue() with a mutex, hence avoiding the race condition.
> 
> Signed-off-by: Andrey Shvetsov 
> Signed-off-by: Christian Gromm 
> ---
>  drivers/staging/most/hdm-usb/hdm_usb.c |  3 +-
>  drivers/staging/most/mostcore/core.c   | 53 
> --
>  2 files changed, 38 insertions(+), 18 deletions(-)

Doesn't apply to my tree anymore.  Can you fix this up and resend it and
the rest in this series so I can apply them?

thanks,

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


[PATCH] hv: make mmio resource local

2016-08-15 Thread Stephen Hemminger
From: Stephen Hemminger 

This fixes a sparse warning because hyperv_mmio resources
are only used in this one file and should be static.

Signed-off-by: Stephen Hemminger 

--- a/drivers/hv/vmbus_drv.c2016-08-05 15:19:55.0 -0700
+++ b/drivers/hv/vmbus_drv.c2016-08-15 10:39:30.436494786 -0700
@@ -105,8 +105,8 @@ static struct notifier_block hyperv_pani
 
 static const char *fb_mmio_name = "fb_range";
 static struct resource *fb_mmio;
-struct resource *hyperv_mmio;
-DEFINE_SEMAPHORE(hyperv_mmio_lock);
+static struct resource *hyperv_mmio;
+static DEFINE_SEMAPHORE(hyperv_mmio_lock);
 
 static int vmbus_exists(void)
 {
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-15 Thread Greg KH
On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
> The dgnc_block_til_ready() is only used in dgnc_tty_open().
> The unit data(struct un_t) was stored into tty->driver_data in 
> dgnc_tty_open().
> And also tty and un were tested about NULL so these variables doesn't
> need to check for NULL in dgnc_block_til_ready().
> 
> Signed-off-by: Daeseok Youn 
> ---
> RESEND: This patch was not merged for a long time, if there is any reason
> why this patch could NOT be merged into staging tree, let me know.
> There were no comment for this patch.
> I cannot understand why this patch have to wait long time to merge.
> And I also sent emails to mailing-lists for reminding this patch...
> please let me know, what is the problem to merge this patch into staging tree.

Please note, staging patches are at the bottom of my priority queue.
Combined with a vacation, conferences, and a merge window and there are
a lot of pending staging patches in my to-review queue.

thanks for your patience.

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


Re: [PATCH 07/15] lustre: ->kss_scratch... are unused now

2016-08-15 Thread Greg Kroah-Hartman
On Sat, Jul 23, 2016 at 02:37:04AM -0400, Oleg Drokin wrote:
> From: Al Viro 
> 
> Signed-off-by: Al Viro 
> ---
>  drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 4 
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h 
> b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
> index d5efb42..84a915c 100644
> --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
> +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
> @@ -86,10 +86,6 @@ struct ksock_sched {   /* per 
> scheduler state */
>   int kss_nconns; /* # connections assigned to
>* this scheduler */
>   struct ksock_sched_info *kss_info;  /* owner of it */
> - union {
> - struct bio_vec  kss_scratch_bvec[LNET_MAX_IOV];
> - struct kvec kss_scratch_iov[LNET_MAX_IOV];

kss_scratch_iov is still being used in the tree :(

Oleg, can you fix this up based on the current staging-testing branch
and resend the rest of this series?

Also, whenever you forward on patches to me, be sure to add your
signed-off-by to it, you forgot to do that on Al's patches...

thanks,

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


Re: [PATCH] hv: mark hv_driver read only after init

2016-08-15 Thread Stephen Hemminger
On Mon, 15 Aug 2016 09:11:38 -0700
Kees Cook  wrote:

> On Mon, Aug 15, 2016 at 8:41 AM, Stephen Hemminger
>  wrote:
> > On Fri, 12 Aug 2016 20:05:27 -0700
> > Kees Cook  wrote:
> >  
> >> On Fri, Aug 12, 2016 at 4:35 PM, Stephen Hemminger
> >>  wrote:  
> >> >
> >> > For hardening, the driver structure containing function pointers can
> >> > be marked read only after initial registration is done.  
> >>
> >> Yay more __ro_after_init! (Minor nit below...)
> >>
> >> Also, I wonder if there's a way to do build-time section checking,
> >> e.g. adding "is this hv_driver marked __ro_after_init?" in
> >> __vmbus_driver_register...  
> >
> > Is there a macro or tool to check this?  
> 
> There isn't, no. That's what I was suggesting might be useful to create. :)
> 
> -Kees
> 

Maybe a sparse annotation like __rcu?
I am not a sparse expert maybe someone else is.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 19/58] staging: lustre: llite: add md_op_data parameter to ll_get_dir_page

2016-08-15 Thread Greg Kroah-Hartman
On Thu, Jul 21, 2016 at 10:44:12PM -0400, James Simmons wrote:
> From: wang di 
> 
> Pass in struct md_op_data for ll_get_dir_page function.
> 
> Signed-off-by: wang di 
> Reviewed-on: http://review.whamcloud.com/7043
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3531
> Reviewed-by: John L. Hammond 
> Reviewed-by: Jinshan Xiong 
> Reviewed-by: Andreas Dilger 
> Reviewed-by: Oleg Drokin 
> Signed-off-by: James Simmons 
> ---
>  drivers/staging/lustre/lustre/llite/dir.c  |8 
>  .../staging/lustre/lustre/llite/llite_internal.h   |4 ++--
>  drivers/staging/lustre/lustre/llite/statahead.c|   15 +++
>  3 files changed, 17 insertions(+), 10 deletions(-)

This patch fails to apply, so I have to stop here in the patch series.

So I'm guesing your second patch series also will fail to apply, so can
you resend all of the outstanding patches you have sent me after
rebasing on my staging-testing branch?

thanks,

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


Re: [PATCH] hv: mark hv_driver read only after init

2016-08-15 Thread Kees Cook
On Mon, Aug 15, 2016 at 8:41 AM, Stephen Hemminger
 wrote:
> On Fri, 12 Aug 2016 20:05:27 -0700
> Kees Cook  wrote:
>
>> On Fri, Aug 12, 2016 at 4:35 PM, Stephen Hemminger
>>  wrote:
>> >
>> > For hardening, the driver structure containing function pointers can
>> > be marked read only after initial registration is done.
>>
>> Yay more __ro_after_init! (Minor nit below...)
>>
>> Also, I wonder if there's a way to do build-time section checking,
>> e.g. adding "is this hv_driver marked __ro_after_init?" in
>> __vmbus_driver_register...
>
> Is there a macro or tool to check this?

There isn't, no. That's what I was suggesting might be useful to create. :)

-Kees

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


Re: [PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent

2016-08-15 Thread Vitaly Kuznetsov
KY Srinivasan  writes:

>> -Original Message-
>> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
>> Sent: Thursday, August 11, 2016 2:17 AM
>> To: KY Srinivasan 
>> Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Haiyang Zhang
>> 
>> Subject: Re: [PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs persistent
>> 
>> KY Srinivasan  writes:
>> 
>> >> -Original Message-
>> >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
>> >> Sent: Tuesday, August 9, 2016 1:46 AM
>> >> To: de...@linuxdriverproject.org
>> >> Cc: linux-ker...@vger.kernel.org; Haiyang Zhang
>> >> ; KY Srinivasan 
>> >> Subject: [PATCH 0/2] Drivers: hv: vmbus: make bus ids in sysfs
>> >> persistent
>> >>
>> >> Bus ids for VMBus devices in /sys/bus/vmbus/devices/ are not
>> >> guaranteed to be persistent across reboot or kernel restart and this
>> >> causes problems for some tools. E.g. kexec tools use these ids to identify
>> NIC on kdump.
>> >> Fix the issue by using relid from channel offer as the unique id
>> >> instead of an auto incremented counter.
>> >
>> > Relids are not persistent. It is only valid between a channel offer
>> > message and a relid released message (or an unload or initiate contact
>> > message, which invalidates all channels). This is an opaque number
>> > that the root generates and uses to track channels. There is no
>> > guarantee that the same type of channel (networking, storage, etc)
>> > will get the same relid on each reboot.
>> >
>> 
>> Thanks for the info,
>> 
>> can we use device_id (offermsg.offer.if_instance.b) instead?
>
> I think you could; I am going to verify and get back to you on this.

Thanks!

> Sometime back I removed all the non-determinism in the vmbus device
> ID generation. Now, the current scheme of generating the device IDs does
> result in persistent IDs across boot (as long as the host presents the devices
> to the guest in the same order across boots). Do you have this fix?

Yes, I think I do. The issue I'm trying to address happens rearly on
kdump when we get devices present to us in a different order.

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


RE: [PATCH net v2 5/5] hv_netvsc: fix bonding devices check in netvsc_netdev_event()

2016-08-15 Thread Haiyang Zhang


> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Monday, August 15, 2016 11:49 AM
> To: net...@vger.kernel.org
> Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Haiyang
> Zhang ; KY Srinivasan ;
> Stephen Hemminger 
> Subject: [PATCH net v2 5/5] hv_netvsc: fix bonding devices check in
> netvsc_netdev_event()
> 
> Bonding driver sets IFF_BONDING on both master (the bonding device) and
> slave (the real NIC) devices and in netvsc_netdev_event() we want to skip
> master devices only. Currently, there is an uncertainty when a slave
> interface is removed: if bonding module comes first in netdev_chain it
> clears IFF_BONDING flag on the netdev and netvsc_netdev_event()
> correctly
> handles NETDEV_UNREGISTER event, but in case netvsc comes first on the
> chain it sees the device with IFF_BONDING still attached and skips it. As
> we still hold vf_netdev pointer to the device we crash on the next inject.
> 
> Signed-off-by: Vitaly Kuznetsov 

Thanks!

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


[PATCH] staging: wilc1000: correctly check if associatedsta has not been found

2016-08-15 Thread Colin King
From: Colin Ian King 

The current check for associatedsta being set to -1 to indicate it has
not been found is not working because associatedsta is initialized to
zero and will never be -1.  Fix this by initializing it to ~0 and checking
for ~0 instead.

Signed-off-by: Colin Ian King 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 9092600..2c2e8ac 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1191,7 +1191,7 @@ static int get_station(struct wiphy *wiphy, struct 
net_device *dev,
struct wilc_priv *priv;
struct wilc_vif *vif;
u32 i = 0;
-   u32 associatedsta = 0;
+   u32 associatedsta = ~0;
u32 inactive_time = 0;
priv = wiphy_priv(wiphy);
vif = netdev_priv(dev);
@@ -1204,7 +1204,7 @@ static int get_station(struct wiphy *wiphy, struct 
net_device *dev,
}
}
 
-   if (associatedsta == -1) {
+   if (associatedsta == ~0) {
netdev_err(dev, "sta required is not associated\n");
return -ENOENT;
}
-- 
2.8.1

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


[PATCH net v2 5/5] hv_netvsc: fix bonding devices check in netvsc_netdev_event()

2016-08-15 Thread Vitaly Kuznetsov
Bonding driver sets IFF_BONDING on both master (the bonding device) and
slave (the real NIC) devices and in netvsc_netdev_event() we want to skip
master devices only. Currently, there is an uncertainty when a slave
interface is removed: if bonding module comes first in netdev_chain it
clears IFF_BONDING flag on the netdev and netvsc_netdev_event() correctly
handles NETDEV_UNREGISTER event, but in case netvsc comes first on the
chain it sees the device with IFF_BONDING still attached and skips it. As
we still hold vf_netdev pointer to the device we crash on the next inject.

Signed-off-by: Vitaly Kuznetsov 
---
 drivers/net/hyperv/netvsc_drv.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 62a4e6e..3ba29fc 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1482,8 +1482,13 @@ static int netvsc_netdev_event(struct notifier_block 
*this,
 {
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
 
-   /* Avoid Vlan, Bonding dev with same MAC registering as VF */
-   if (event_dev->priv_flags & (IFF_802_1Q_VLAN | IFF_BONDING))
+   /* Avoid Vlan dev with same MAC registering as VF */
+   if (event_dev->priv_flags & IFF_802_1Q_VLAN)
+   return NOTIFY_DONE;
+
+   /* Avoid Bonding master dev with same MAC registering as VF */
+   if (event_dev->priv_flags & IFF_BONDING &&
+   event_dev->flags & IFF_MASTER)
return NOTIFY_DONE;
 
switch (event) {
-- 
2.7.4

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


[PATCH net v2 0/5] hv_netvsc: fixes for VF removal path

2016-08-15 Thread Vitaly Kuznetsov
Kernel crash is reported after VF is removed and detached from netvsc
device. Turns out we have multiple different (but related) issues on the
VF removal path which I'm trying to address with PATCHes 2-5 of this
series. PATCH1 is required to support the change.

Changes since v1:
- Re-arrange patches in the series to not introduce new issues [David Miller]
- Add PATCH5 which fixes a new issue I discovered while testing.
- Add Haiyang' A-b tags to PATCH1-4

With regards to Stephen's suggestion: I believe that switching to using RCU
and eliminating vf_use_cnt/vf_inject is the right thing to do long-term, we
can either put this on top of this series or do it later in net-next.

Vitaly Kuznetsov (5):
  hv_netvsc: don't lose VF information
  hv_netvsc: avoid deadlocks between rtnl lock and vf_use_cnt wait
  hv_netvsc: reset vf_inject on VF removal
  hv_netvsc: protect module refcount by checking
net_device_ctx->vf_netdev
  hv_netvsc: fix bonding devices check in netvsc_netdev_event()

 drivers/net/hyperv/hyperv_net.h |  24 -
 drivers/net/hyperv/netvsc.c |  19 +++-
 drivers/net/hyperv/netvsc_drv.c | 105 +++-
 3 files changed, 66 insertions(+), 82 deletions(-)

-- 
2.7.4

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


[PATCH net v2 4/5] hv_netvsc: protect module refcount by checking net_device_ctx->vf_netdev

2016-08-15 Thread Vitaly Kuznetsov
We're not guaranteed to see NETDEV_REGISTER/NETDEV_UNREGISTER notifications
only once per VF but we increase/decrease module refcount unconditionally.
Check vf_netdev to make sure we don't take/release it twice. We presume
that only one VF per netvsc device may exist.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: Haiyang Zhang 
---
 drivers/net/hyperv/netvsc_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 2c90883..62a4e6e 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1193,7 +1193,7 @@ static int netvsc_register_vf(struct net_device 
*vf_netdev)
 
net_device_ctx = netdev_priv(ndev);
netvsc_dev = net_device_ctx->nvdev;
-   if (netvsc_dev == NULL)
+   if (!netvsc_dev || net_device_ctx->vf_netdev)
return NOTIFY_DONE;
 
netdev_info(ndev, "VF registering: %s\n", vf_netdev->name);
@@ -1312,7 +1312,7 @@ static int netvsc_unregister_vf(struct net_device 
*vf_netdev)
 
net_device_ctx = netdev_priv(ndev);
netvsc_dev = net_device_ctx->nvdev;
-   if (netvsc_dev == NULL)
+   if (!netvsc_dev || !net_device_ctx->vf_netdev)
return NOTIFY_DONE;
netdev_info(ndev, "VF unregistering: %s\n", vf_netdev->name);
netvsc_inject_disable(net_device_ctx);
-- 
2.7.4

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


[PATCH net v2 3/5] hv_netvsc: reset vf_inject on VF removal

2016-08-15 Thread Vitaly Kuznetsov
We reset vf_inject on VF going down (netvsc_vf_down()) but we don't on
VF removal (netvsc_unregister_vf()) so vf_inject stays 'true' while
vf_netdev is already NULL and we're trying to inject packets into NULL
net device in netvsc_recv_callback() causing kernel to crash.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: Haiyang Zhang 
---
 drivers/net/hyperv/netvsc_drv.c | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 70317fa..2c90883 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1205,6 +1205,19 @@ static int netvsc_register_vf(struct net_device 
*vf_netdev)
return NOTIFY_OK;
 }
 
+static void netvsc_inject_enable(struct net_device_context *net_device_ctx)
+{
+   net_device_ctx->vf_inject = true;
+}
+
+static void netvsc_inject_disable(struct net_device_context *net_device_ctx)
+{
+   net_device_ctx->vf_inject = false;
+
+   /* Wait for currently active users to drain out. */
+   while (atomic_read(_device_ctx->vf_use_cnt) != 0)
+   udelay(50);
+}
 
 static int netvsc_vf_up(struct net_device *vf_netdev)
 {
@@ -1227,7 +1240,7 @@ static int netvsc_vf_up(struct net_device *vf_netdev)
return NOTIFY_DONE;
 
netdev_info(ndev, "VF up: %s\n", vf_netdev->name);
-   net_device_ctx->vf_inject = true;
+   netvsc_inject_enable(net_device_ctx);
 
/*
 * Open the device before switching data path.
@@ -1270,14 +1283,7 @@ static int netvsc_vf_down(struct net_device *vf_netdev)
return NOTIFY_DONE;
 
netdev_info(ndev, "VF down: %s\n", vf_netdev->name);
-   net_device_ctx->vf_inject = false;
-   /*
-* Wait for currently active users to
-* drain out.
-*/
-
-   while (atomic_read(_device_ctx->vf_use_cnt) != 0)
-   udelay(50);
+   netvsc_inject_disable(net_device_ctx);
netvsc_switch_datapath(ndev, false);
netdev_info(ndev, "Data path switched from VF: %s\n", vf_netdev->name);
rndis_filter_close(netvsc_dev);
@@ -1309,7 +1315,7 @@ static int netvsc_unregister_vf(struct net_device 
*vf_netdev)
if (netvsc_dev == NULL)
return NOTIFY_DONE;
netdev_info(ndev, "VF unregistering: %s\n", vf_netdev->name);
-
+   netvsc_inject_disable(net_device_ctx);
net_device_ctx->vf_netdev = NULL;
module_put(THIS_MODULE);
return NOTIFY_OK;
-- 
2.7.4

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


[PATCH net v2 1/5] hv_netvsc: don't lose VF information

2016-08-15 Thread Vitaly Kuznetsov
struct netvsc_device is not suitable for storing VF information as this
structure is being destroyed on MTU change / set channel operation (see
rndis_filter_device_remove()). Move all VF related stuff to struct
net_device_context which is persistent.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: Haiyang Zhang 
---
 drivers/net/hyperv/hyperv_net.h | 19 
 drivers/net/hyperv/netvsc.c | 19 +++-
 drivers/net/hyperv/netvsc_drv.c | 49 +++--
 3 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 467fb8b..3b3ecf2 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -647,7 +647,7 @@ struct netvsc_reconfig {
 struct garp_wrk {
struct work_struct dwrk;
struct net_device *netdev;
-   struct netvsc_device *netvsc_dev;
+   struct net_device_context *net_device_ctx;
 };
 
 /* The context of the netvsc device  */
@@ -678,6 +678,15 @@ struct net_device_context {
 
/* the device is going away */
bool start_remove;
+
+   /* State to manage the associated VF interface. */
+   struct net_device *vf_netdev;
+   bool vf_inject;
+   atomic_t vf_use_cnt;
+   /* 1: allocated, serial number is valid. 0: not allocated */
+   u32 vf_alloc;
+   /* Serial number of the VF to team with */
+   u32 vf_serial;
 };
 
 /* Per netvsc device */
@@ -733,15 +742,7 @@ struct netvsc_device {
u32 max_pkt; /* max number of pkt in one send, e.g. 8 */
u32 pkt_align; /* alignment bytes, e.g. 8 */
 
-   /* 1: allocated, serial number is valid. 0: not allocated */
-   u32 vf_alloc;
-   /* Serial number of the VF to team with */
-   u32 vf_serial;
atomic_t open_cnt;
-   /* State to manage the associated VF interface. */
-   bool vf_inject;
-   struct net_device *vf_netdev;
-   atomic_t vf_use_cnt;
 };
 
 static inline struct netvsc_device *
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 20e0917..410fb8e8 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -77,13 +77,9 @@ static struct netvsc_device *alloc_net_device(void)
init_waitqueue_head(_device->wait_drain);
net_device->destroy = false;
atomic_set(_device->open_cnt, 0);
-   atomic_set(_device->vf_use_cnt, 0);
net_device->max_pkt = RNDIS_MAX_PKT_DEFAULT;
net_device->pkt_align = RNDIS_PKT_ALIGN_DEFAULT;
 
-   net_device->vf_netdev = NULL;
-   net_device->vf_inject = false;
-
return net_device;
 }
 
@@ -1106,16 +1102,16 @@ static void netvsc_send_table(struct hv_device *hdev,
nvscdev->send_table[i] = tab[i];
 }
 
-static void netvsc_send_vf(struct netvsc_device *nvdev,
+static void netvsc_send_vf(struct net_device_context *net_device_ctx,
   struct nvsp_message *nvmsg)
 {
-   nvdev->vf_alloc = nvmsg->msg.v4_msg.vf_assoc.allocated;
-   nvdev->vf_serial = nvmsg->msg.v4_msg.vf_assoc.serial;
+   net_device_ctx->vf_alloc = nvmsg->msg.v4_msg.vf_assoc.allocated;
+   net_device_ctx->vf_serial = nvmsg->msg.v4_msg.vf_assoc.serial;
 }
 
 static inline void netvsc_receive_inband(struct hv_device *hdev,
-struct netvsc_device *nvdev,
-struct nvsp_message *nvmsg)
+struct net_device_context *net_device_ctx,
+struct nvsp_message *nvmsg)
 {
switch (nvmsg->hdr.msg_type) {
case NVSP_MSG5_TYPE_SEND_INDIRECTION_TABLE:
@@ -1123,7 +1119,7 @@ static inline void netvsc_receive_inband(struct hv_device 
*hdev,
break;
 
case NVSP_MSG4_TYPE_SEND_VF_ASSOCIATION:
-   netvsc_send_vf(nvdev, nvmsg);
+   netvsc_send_vf(net_device_ctx, nvmsg);
break;
}
 }
@@ -1136,6 +1132,7 @@ static void netvsc_process_raw_pkt(struct hv_device 
*device,
   struct vmpacket_descriptor *desc)
 {
struct nvsp_message *nvmsg;
+   struct net_device_context *net_device_ctx = netdev_priv(ndev);
 
nvmsg = (struct nvsp_message *)((unsigned long)
desc + (desc->offset8 << 3));
@@ -1150,7 +1147,7 @@ static void netvsc_process_raw_pkt(struct hv_device 
*device,
break;
 
case VM_PKT_DATA_INBAND:
-   netvsc_receive_inband(device, net_device, nvmsg);
+   netvsc_receive_inband(device, net_device_ctx, nvmsg);
break;
 
default:
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 41bd952..794139b 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -658,20 +658,19 @@ int netvsc_recv_callback(struct hv_device *device_obj,

[PATCH net v2 2/5] hv_netvsc: avoid deadlocks between rtnl lock and vf_use_cnt wait

2016-08-15 Thread Vitaly Kuznetsov
Here is a deadlock scenario:
- netvsc_vf_up() schedules netvsc_notify_peers() work and quits.
- netvsc_vf_down() runs before netvsc_notify_peers() gets executed. As it
  is being executed from netdev notifier chain we hold rtnl lock when we
  get here.
- we enter while (atomic_read(_device_ctx->vf_use_cnt) != 0) loop and
  wait till netvsc_notify_peers() drops vf_use_cnt.
- netvsc_notify_peers() starts on some other CPU but netdev_notify_peers()
  will hang on rtnl_lock().
- deadlock!

Instead of introducing additional synchronization I suggest we drop
gwrk.dwrk completely and call NETDEV_NOTIFY_PEERS directly. As we're
acting under rtnl lock this is legitimate.

Signed-off-by: Vitaly Kuznetsov 
Acked-by: Haiyang Zhang 
---
Changes since v1:
- Move the patch ahead in the series to avoid introducing new blocking
  issues and solving them later in the series. [David Miller]
---
 drivers/net/hyperv/hyperv_net.h |  7 ---
 drivers/net/hyperv/netvsc_drv.c | 33 +
 2 files changed, 5 insertions(+), 35 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 3b3ecf2..591af71 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -644,12 +644,6 @@ struct netvsc_reconfig {
u32 event;
 };
 
-struct garp_wrk {
-   struct work_struct dwrk;
-   struct net_device *netdev;
-   struct net_device_context *net_device_ctx;
-};
-
 /* The context of the netvsc device  */
 struct net_device_context {
/* point back to our device context */
@@ -667,7 +661,6 @@ struct net_device_context {
 
struct work_struct work;
u32 msg_enable; /* debug level */
-   struct garp_wrk gwrk;
 
struct netvsc_stats __percpu *tx_stats;
struct netvsc_stats __percpu *rx_stats;
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 794139b..70317fa 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -1151,17 +1151,6 @@ static void netvsc_free_netdev(struct net_device *netdev)
free_netdev(netdev);
 }
 
-static void netvsc_notify_peers(struct work_struct *wrk)
-{
-   struct garp_wrk *gwrk;
-
-   gwrk = container_of(wrk, struct garp_wrk, dwrk);
-
-   netdev_notify_peers(gwrk->netdev);
-
-   atomic_dec(>net_device_ctx->vf_use_cnt);
-}
-
 static struct net_device *get_netvsc_net_device(char *mac)
 {
struct net_device *dev, *found = NULL;
@@ -1253,15 +1242,8 @@ static int netvsc_vf_up(struct net_device *vf_netdev)
 
netif_carrier_off(ndev);
 
-   /*
-* Now notify peers. We are scheduling work to
-* notify peers; take a reference to prevent
-* the VF interface from vanishing.
-*/
-   atomic_inc(_device_ctx->vf_use_cnt);
-   net_device_ctx->gwrk.netdev = vf_netdev;
-   net_device_ctx->gwrk.net_device_ctx = net_device_ctx;
-   schedule_work(_device_ctx->gwrk.dwrk);
+   /* Now notify peers through VF device. */
+   call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, vf_netdev);
 
return NOTIFY_OK;
 }
@@ -1300,13 +1282,9 @@ static int netvsc_vf_down(struct net_device *vf_netdev)
netdev_info(ndev, "Data path switched from VF: %s\n", vf_netdev->name);
rndis_filter_close(netvsc_dev);
netif_carrier_on(ndev);
-   /*
-* Notify peers.
-*/
-   atomic_inc(_device_ctx->vf_use_cnt);
-   net_device_ctx->gwrk.netdev = ndev;
-   net_device_ctx->gwrk.net_device_ctx = net_device_ctx;
-   schedule_work(_device_ctx->gwrk.dwrk);
+
+   /* Now notify peers through netvsc device. */
+   call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, ndev);
 
return NOTIFY_OK;
 }
@@ -1378,7 +1356,6 @@ static int netvsc_probe(struct hv_device *dev,
 
INIT_DELAYED_WORK(_device_ctx->dwork, netvsc_link_change);
INIT_WORK(_device_ctx->work, do_set_multicast);
-   INIT_WORK(_device_ctx->gwrk.dwrk, netvsc_notify_peers);
 
spin_lock_init(_device_ctx->lock);
INIT_LIST_HEAD(_device_ctx->reconfig_events);
-- 
2.7.4

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


Re: [PATCH] hv: mark hv_driver read only after init

2016-08-15 Thread Stephen Hemminger
On Fri, 12 Aug 2016 20:05:27 -0700
Kees Cook  wrote:

> On Fri, Aug 12, 2016 at 4:35 PM, Stephen Hemminger
>  wrote:
> >
> > For hardening, the driver structure containing function pointers can
> > be marked read only after initial registration is done.  
> 
> Yay more __ro_after_init! (Minor nit below...)
> 
> Also, I wonder if there's a way to do build-time section checking,
> e.g. adding "is this hv_driver marked __ro_after_init?" in
> __vmbus_driver_register...

Is there a macro or tool to check this?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Linaro-mm-sig] [RESEND][PATCH 0/5] Ion cleanup

2016-08-15 Thread Sumit Semwal
Hi Laura,

On 14 August 2016 at 14:17, Benjamin Gaignard
 wrote:
> This series of patches look good for me, thanks for the clean up
>
> Reviewed-by: Benjamin Gaignard 
>
> 2016-08-08 18:52 GMT+02:00 Laura Abbott :
>> I never saw any feedback or action on these patches so this is a resend.
>> Probably hit the window when everyone was busy/traveling.
>>
Looks good to me; please feel free to apply my
Reviewed-by: Sumit Semwal 

>> ---
>>
>> Hi,
>>
>> This is some clean up of old Ion interfaces and APIs. These are interfaces 
>> that
>> mostly existed before dma_buf was well integrated into the kernel along with
>> reservations for board files.
>>
>> If there are objections to deletion I expect it to turn into a discussion 
>> about
>> what other APIs need to be extended.
>>
>> Thanks,
>> Laura
>>
Best,
Sumit.

>> Laura Abbott (5):
>>   staging: android: ion: Get rid of ion_sg_table
>>   staging: android: ion: Drop ion_phys interface
>>   staging: android: ion: Get rid of map_dma/unmap_dma
>>   staging: android: ion: Drop ion_carveout_allocate definitions
>>   staging: android: ion: Get rid of ion_reserve
>>
>>  drivers/staging/android/ion/ion.c   | 103 
>> ++--
>>  drivers/staging/android/ion/ion.h   |  41 --
>>  drivers/staging/android/ion/ion_carveout_heap.c |  33 +---
>>  drivers/staging/android/ion/ion_chunk_heap.c|  17 +---
>>  drivers/staging/android/ion/ion_cma_heap.c  |  34 +---
>>  drivers/staging/android/ion/ion_priv.h  |  30 +--
>>  drivers/staging/android/ion/ion_system_heap.c   |  44 +-
>>  7 files changed, 19 insertions(+), 283 deletions(-)
>>
>> --
>> 2.5.5
>>
>> ___
>> Linaro-mm-sig mailing list
>> linaro-mm-...@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/linaro-mm-sig
>
>
>
> --
> Benjamin Gaignard
>
> Graphic Study Group
>
> Linaro.org │ Open source software for ARM SoCs
>
> Follow Linaro: Facebook | Twitter | Blog



-- 
Thanks and regards,

Sumit Semwal
Linaro Mobile Group - Kernel Team Lead
Linaro.org │ Open source software for ARM SoCs
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] android: binder: fix dangling pointer comparison

2016-08-15 Thread Greg Kroah-Hartman
On Thu, Jun 16, 2016 at 12:45:33AM +0200, Jann Horn wrote:
> If /dev/binder is opened and the opener process then e.g. calls execve,
> proc->vma_vm_mm will still point to the location of the now-freed
> mm_struct. If the process then calls ioctl(binder_fd, ...), the dangling
> proc->vma_vm_mm pointer will be compared to current->mm.
> 
> Let the binder take a reference to the mm_struct to avoid this.
> 
> v2: use the right refcounter
> 
> Fixes: a906d6931f3ccaf7de805643190765ddd7378e27

Nit, the proper way to do this is:

Fixes: a906d6931f3c ("android: binder: Sanity check at binder ioctl")

You can get that by doing:
git show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n" 
a906d6931f3ccaf7de805643190765ddd7378e27

Also, I'm guessing this should go to the stable kernels that include the
above patch?

thanks,

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


Re: [PATCH] Staging: android: ion_cma_heap: Fixed a extra blank line coding style issue

2016-08-15 Thread Greg KH
On Mon, Jun 06, 2016 at 08:34:36AM -0700, Akshay Shipurkar wrote:
> Fixed a coding style issue.

What coding style issue was fixed here?

be specific please.

thanks,

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


Re: [PATCH] android: binder: fix dangling pointer comparison

2016-08-15 Thread Greg Kroah-Hartman
On Sat, Jun 18, 2016 at 02:12:32PM +0200, Jann Horn wrote:
> On Sat, Jun 18, 2016 at 11:19 AM, ZhaoJunmin Zhao(Junmin)
>  wrote:
> > 在 2016/6/16 6:39, Jann Horn 写道:
> >> On Thu, Jun 16, 2016 at 12:31 AM, Arve Hjønnevåg  wrote:
> >>> On Wed, Jun 15, 2016 at 3:09 PM, Jann Horn  wrote:
>  If /dev/binder is opened and the opener process then e.g. calls execve,
>  proc->vma_vm_mm will still point to the location of the now-freed
>  mm_struct. If the process then calls ioctl(binder_fd, ...), the dangling
>  proc->vma_vm_mm pointer will be compared to current->mm.
> 
>  Let the binder take a reference to the mm_struct to avoid this.
> 
>  In the current code, the BUG_ON() will never trigger; it's just there
>  in case someone changes the conditions under which get_task_mm() can
>  fail. Just WARN_ON() wouldn't work because of the mmput(), and I don't
>  want to complicate the code with a dead error handling code path.
>  (If the BUG_ON() is unacceptable, I'd replace the get_task_mm() with
>  a direct refcount increment or just omit the BUG_ON().)
> 
>  This shouldn't cause additional memory usage in a well-behaved system
>  because you're not supposed to keep binder fds open over fork() or
>  execve().
> 
> [...]
> >>> Does this work? In the past, holding a reference to a task's mm while
> >>> the driver is open would prevent vma close which in turn would prevent
> >>> release of the fd.
> >> Ah, right, mm_struct has two refcounters. I think that should be
> >> atomic_inc(>mm->mm_count) / mmdrop() instead.
> > Hi Jann Horn:
> >   In android platform, the libbinder use the O_CLOEXEC flag:
> >   static int open_driver()
> >   {
> > int fd = open("/dev/binder", O_RDWR | O_CLOEXEC);
> > ...
> > return fd;
> >   }
> >   So I think you don't need to consider the case:
> >   "If the process then calls ioctl(binder_fd, ...), the dangling
> >proc->vma_vm_mm pointer will be compared to current->mm."
> 
> It is the kernel's job to behave in a reasonable way even if
> unprivileged userland code does weird things it isn't supposed to do.

The binder userspace code is "privileged" and "trusted".  If it were
not, bad bad things would happen to your machine.  That's why you should
never run binder on a machine that is not an Android machine.

thanks,

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


Re: [PATCH] staging: android: sw_sync: checkpatch fixes

2016-08-15 Thread Greg Kroah-Hartman
On Wed, Aug 10, 2016 at 09:16:12PM +0200, Johanna Abrahamsson wrote:
> This patch fixes the checkpatch.pl check:
> 
> CHECK: Alignment should match open parenthesis
> 
> Signed-off-by: Johanna Abrahamsson 
> ---
>  drivers/staging/android/sw_sync.c | 6 +++---

This file has now moved in the tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/1] Remove checkpatch.pl cleanups todo

2016-08-15 Thread Greg KH
On Sat, Jul 30, 2016 at 03:13:38PM +0200, Matthias Beyer wrote:
> Signed-off-by: Matthias Beyer 

I can't take patches without any changelog comments in them :(

Please put the info you put in the 0/1 email in here.

And for a single patch, you never need a 0/1 email.

thanks,

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


Re: [PATCH] Staging:android: fix alignment match open paranthesis

2016-08-15 Thread Greg KH
On Mon, Aug 01, 2016 at 08:50:27PM +0530, ksourav wrote:
> This is a patch to fix alignment should match open paranthesis
> warning given by checkpatch.pl in files sw_sync.c and sync_debug.c
> 
> Signed-off-by: ksourav 

I need a "full" name for a signed-off-by line, please.

thanks,

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


Re: [PATCH] Staging: android: ion: fixed a kzalloc coding style issue.

2016-08-15 Thread Greg KH
On Thu, May 26, 2016 at 01:31:14PM +0530, Shubham Bansal wrote:
> Fixed a coding style issue. Issue reported by checkpatch.pl.

What coding style issue was fixed?

Be specific please.

thanks,

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


Re: [PATCH] Staging: android: modify memory allocation style in ion_cma_heap.c

2016-08-15 Thread Greg KH
On Sun, May 22, 2016 at 08:37:02PM +0200, Ben Marsh wrote:
> Modify memory allocation style in ion_cma_heap.c in order to silence a
> checkpatch.pl warning

What warning?  Be specific please.

thanks,

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


Re: [PATCH] Staging: android: fix coding style warning

2016-08-15 Thread Greg KH
On Sun, May 22, 2016 at 10:52:15PM -0500, Jaime Arrocha wrote:
> From: Jaime Arrocha 
> 
> Fixed checkpatch.pl warning about 'line over 80 characters'.
> 
> Signed-off-by: Jaime Arrocha 
> ---
>  drivers/staging/android/ion/ion.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

Someone sent this before you did, sorry.

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


Re: [PATCH] Staging: android: ion: fixed a kzalloc coding style issue.

2016-08-15 Thread Greg KH
On Sun, May 15, 2016 at 06:56:05AM +0530, Shubham Bansal wrote:
> Fixed a coding style issue. Issue reported by checkpatch.pl.
> 
> Signed-off-by: Shubham Bansal 
> ---
>  drivers/staging/android/ion/ion.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Doesn't apply to the tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: don't print skb->dev->name if skb is null

2016-08-15 Thread Colin King
From: Colin Ian King 

A null pointer dereference will occur when skb is null and
skb->dev->name is printed.  Replace the skb->dev->name with
plain text "ks_wlan" to fix this.

Signed-off-by: Colin Ian King 
---
 drivers/staging/ks7010/ks_hostif.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index a8822fe..e8a2564 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -481,8 +481,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
netif_rx(skb);
} else {
printk(KERN_WARNING
-  "%s: Memory squeeze, dropping packet.\n",
-  skb->dev->name);
+  "ks_wlan: Memory squeeze, dropping packet.\n");
priv->nstats.rx_dropped++;
}
break;
@@ -517,8 +516,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
netif_rx(skb);
} else {
printk(KERN_WARNING
-  "%s: Memory squeeze, dropping packet.\n",
-  skb->dev->name);
+  "ks_wlan: Memory squeeze, dropping packet.\n");
priv->nstats.rx_dropped++;
}
break;
-- 
2.8.1

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


Re: [RESEND][PATCH 0/5] Ion cleanup

2016-08-15 Thread Greg Kroah-Hartman
On Mon, Aug 08, 2016 at 09:52:53AM -0700, Laura Abbott wrote:
> I never saw any feedback or action on these patches so this is a resend.
> Probably hit the window when everyone was busy/traveling.

Yes, sorry about that, the old ones are still in my queue, but I'll take
these now!

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


[PATCH] staging: rts5208: Change data type to unsigned int.

2016-08-15 Thread Louie Lu
This patch fixes a minor checkpatch warning:

"WARNING: Prefer 'unsigned int' to bare use of 'unsigned'"

Signed-off-by: Louie Lu 
---
 drivers/staging/rts5208/rtsx_scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/rtsx_scsi.c 
b/drivers/staging/rts5208/rtsx_scsi.c
index d203104..b300387 100644
--- a/drivers/staging/rts5208/rtsx_scsi.c
+++ b/drivers/staging/rts5208/rtsx_scsi.c
@@ -1521,7 +1521,7 @@ static int write_host_reg(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
 
 static int set_variable(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 {
-   unsigned lun = SCSI_LUN(srb);
+   unsigned int lun = SCSI_LUN(srb);
 
if (srb->cmnd[3] == 1) {
/* Variable Clock */
-- 
2.8.2

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


Re: [RFC 2/2] netvsc: use RCU for VF net device reference

2016-08-15 Thread Vitaly Kuznetsov
Stephen Hemminger  writes:

> Rather than keeping a pointer, a flag, and reference count, use RCU and 
> existing
> device reference count to protect the synthetic to VF relationship.

Thanks! I like the idea. Some nitpicks below ...

>
> One other change is that injected packets must be accounted for on the 
> synthetic
> device otherwise the statistics will be lost. The VF device driver (for most 
> devices)
> creates the statistics based on device registers and therefore would ignore 
> any direct
> manipulation of network device stats.
>
> Also, rx_dropped is not atomic_long.
>
> Signed-off-by: Stephen Hemminger 
>
> --- a/drivers/net/hyperv/hyperv_net.h 2016-08-13 11:25:59.764085593 -0700
> +++ b/drivers/net/hyperv/hyperv_net.h 2016-08-13 11:25:59.736085464 -0700
> @@ -689,6 +689,9 @@ struct netvsc_device {
>   wait_queue_head_t wait_drain;
>   bool destroy;
>
> + /* State to manage the associated VF interface. */
> + struct net_device *vf_netdev __rcu;
> +
>   /* Receive buffer allocated by us but manages by NetVSP */
>   void *recv_buf;
>   u32 recv_buf_size;
> @@ -739,10 +742,6 @@ struct netvsc_device {
>   /* Serial number of the VF to team with */
>   u32 vf_serial;
>   atomic_t open_cnt;
> - /* State to manage the associated VF interface. */
> - bool vf_inject;
> - struct net_device *vf_netdev;
> - atomic_t vf_use_cnt;
>  };
>
>  static inline struct netvsc_device *
> --- a/drivers/net/hyperv/netvsc.c 2016-08-13 11:25:59.764085593 -0700
> +++ b/drivers/net/hyperv/netvsc.c 2016-08-13 11:25:59.736085464 -0700
> @@ -77,13 +77,10 @@ static struct netvsc_device *alloc_net_d
>   init_waitqueue_head(_device->wait_drain);
>   net_device->destroy = false;
>   atomic_set(_device->open_cnt, 0);
> - atomic_set(_device->vf_use_cnt, 0);
> +
>   net_device->max_pkt = RNDIS_MAX_PKT_DEFAULT;
>   net_device->pkt_align = RNDIS_PKT_ALIGN_DEFAULT;
>
> - net_device->vf_netdev = NULL;
> - net_device->vf_inject = false;
> -
>   return net_device;
>  }
>
> --- a/drivers/net/hyperv/netvsc_drv.c 2016-08-13 11:25:59.764085593 -0700
> +++ b/drivers/net/hyperv/netvsc_drv.c 2016-08-13 11:31:47.733685146 -0700
> @@ -668,59 +668,45 @@ int netvsc_recv_callback(struct hv_devic
>  {
>   struct net_device *net = hv_get_drvdata(device_obj);
>   struct net_device_context *net_device_ctx = netdev_priv(net);
> - struct sk_buff *skb;
> - struct sk_buff *vf_skb;
> - struct netvsc_stats *rx_stats;
> + struct netvsc_stats *rx_stats = this_cpu_ptr(net_device_ctx->rx_stats);
>   struct netvsc_device *netvsc_dev = net_device_ctx->nvdev;
> - u32 bytes_recvd = packet->total_data_buflen;
> - int ret = 0;
> + struct net_device *vf_netdev;
> + struct sk_buff *skb;
>
>   if (!net || net->reg_state != NETREG_REGISTERED)
>   return NVSP_STAT_FAIL;
>
> - if (READ_ONCE(netvsc_dev->vf_inject)) {
> - atomic_inc(_dev->vf_use_cnt);
> - if (!READ_ONCE(netvsc_dev->vf_inject)) {
> - /*
> -  * We raced; just move on.
> -  */
> - atomic_dec(_dev->vf_use_cnt);
> - goto vf_injection_done;
> - }
> + vf_netdev = rcu_dereference(netvsc_dev->vf_netdev);
> + if (vf_netdev) {
> + /* Inject this packet into the VF interface.  On
> +  * Hyper-V, multicast and broadcast packets are only
> +  * delivered on the synthetic interface (after
> +  * subjecting these to policy filters on the
> +  * host). Deliver these via the VF interface in the
> +  * guest if up, otherwise drop.
> +  */
> + if (!netif_running(vf_netdev))
> + goto drop;

Why drop? In case VF is not running I guess it would be better to
receive the packet through netvsc interface.

>
> - /*
> -  * Inject this packet into the VF inerface.
> -  * On Hyper-V, multicast and brodcast packets
> -  * are only delivered on the synthetic interface
> -  * (after subjecting these to policy filters on
> -  * the host). Deliver these via the VF interface
> -  * in the guest.
> + /* Account for this on the synthetic interface
> +  * otherwise likely to be not accounted for since
> +  * device statistics on the VF are driver dependent.
>*/
> - vf_skb = netvsc_alloc_recv_skb(netvsc_dev->vf_netdev, packet,
> -csum_info, *data, vlan_tci);
> - if (vf_skb != NULL) {
> - ++netvsc_dev->vf_netdev->stats.rx_packets;
> - netvsc_dev->vf_netdev->stats.rx_bytes += bytes_recvd;
> - netif_receive_skb(vf_skb);

Re: [PATCH] Staging: rtl8723au: os_intfs: fixed case statement is variable issue

2016-08-15 Thread Johannes Berg
On Sun, 2016-08-14 at 05:23 -0700, Joe Perches wrote:
> 
> Maybe this test should be sparse version checked after
> sparse is updated.

*If* sparse ever gets updated :) I don't think it's been updated much
lately.
That said, I'm not even sure how, and what version, etc. so obviously
that'd have to be done after the fact. But since nobody will ever
compile the kernel with sparse's code generator, it also doesn't matter
anyway.

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