From 775f43facfe89af605d77a9669aa311b5b95cd07 Mon Sep 17 00:00:00 2001 From: Andrea Parri (Microsoft) Date: Wed, 17 Jun 2020 18:46:42 +0200 Subject: Drivers: hv: vmbus: Remove the lock field from the vmbus_channel struct The spinlock is (now) *not used to protect test-and-set accesses to attributes of the structure or sc_list operations. There is, AFAICT, a distinct lack of {WRITE,READ}_ONCE()s in the handling of channel->state, but the changes below do not seem to make things "worse". ;-) Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20200617164642.37393-9-parri.andrea@gmail.com Reviewed-by: Michael Kelley Signed-off-by: Wei Liu --- drivers/hv/channel.c | 6 +----- drivers/hv/channel_mgmt.c | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/hv') diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 8848d1548b3f..3ebda7707e46 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -129,12 +129,8 @@ static int __vmbus_open(struct vmbus_channel *newchannel, send_pages = newchannel->ringbuffer_send_offset; recv_pages = newchannel->ringbuffer_pagecount - send_pages; - spin_lock_irqsave(&newchannel->lock, flags); - if (newchannel->state != CHANNEL_OPEN_STATE) { - spin_unlock_irqrestore(&newchannel->lock, flags); + if (newchannel->state != CHANNEL_OPEN_STATE) return -EINVAL; - } - spin_unlock_irqrestore(&newchannel->lock, flags); newchannel->state = CHANNEL_OPENING_STATE; newchannel->onchannel_callback = onchannelcallback; diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 92f8bb2077a9..591106cf58fc 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -317,7 +317,6 @@ static struct vmbus_channel *alloc_channel(void) return NULL; spin_lock_init(&channel->sched_lock); - spin_lock_init(&channel->lock); init_completion(&channel->rescind_event); INIT_LIST_HEAD(&channel->sc_list); -- cgit v1.2.3