Re: [PATCH 05/10] staging: unisys: added spinlock comments visorchannel_funcs

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

 



On Wed, Oct 22, 2014 at 05:52:25PM -0400, Erik Arfvidson wrote:
> This patch adds comment documentation to visorchannel_tag struct
> 
> Signed-off-by: Erik Arfvidson <erik.arfvidson@xxxxxxxxxx>
> Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
> ---
>  drivers/staging/unisys/visorchannel/visorchannel_funcs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
> index 01a44c5..48e28e3 100644
> --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
> +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c
> @@ -34,8 +34,8 @@ struct VISORCHANNEL_Tag {
>  	uuid_le guid;
>  	ulong size;
>  	BOOL needs_lock;
> -	spinlock_t insert_lock;
> -	spinlock_t remove_lock;
> +	spinlock_t insert_lock; /* insert lock for visorchannel queue */
> +	spinlock_t remove_lock; /* remove lock for visorchannel queue */

The locking here is sort of weird and these comments aren't enough to
help me understand.

When is needs_lock true/false?  How can it possibly work with separate
remove/insert locks?  Doessn't that mean removing and inserting at the
same time is racy?

regards,
dan carpenter

_______________________________________________
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