On Fri, Jul 24, 2015 at 12:00:19PM -0400, Benjamin Romer wrote:
> From: Neil Horman <nhor...@redhat.com>
> 
> Missed this in my initial review.  The usage counter that guards against
> kthread task is horribly racy.  The atomic is self consistent, but theres
> nothing that prevents the service_resp_queue function from re-incrementing
> it immediately after the check in disable_with_timeout is complete.  Its
> just a improper usage of atomics as a serialization mechanism.
> 
> Instead use kthread_park to pause the thread in its activity so that
> buffers can be properly freed without racing against usage in
> service_resp_queue
> 
> Signed-off-by: Neil Horman <nhor...@redhat.com>
> Signed-off-by: Benjamin Romer <benjamin.ro...@unisys.com>
> ---
>  drivers/staging/unisys/visornic/visornic_main.c | 23 ++++++-----------------
>  kernel/kthread.c                                |  4 ++++

Sorry, staging drivers can not modify other parts of the kernel.  Adding
exports for these kthread functions needs to happen as a "real" patch
that the kthread maintainer accepts, I can't take this.

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

Reply via email to