Re: [PATCH 1/7] staging: unisys: visornic: fix serialization mechanism around usage atomic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 24, 2015 at 01:35:51PM -0700, Greg KH wrote:
> On Fri, Jul 24, 2015 at 12:00:19PM -0400, Benjamin Romer wrote:
> > From: Neil Horman <nhorman@xxxxxxxxxx>
> > 
> > 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 <nhorman@xxxxxxxxxx>
> > Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
> > ---
> >  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

Thats fine, we can split out the kthread_park exports and propose them on lkml
separately. 

Thanks
Neil

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux