hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hv/ring_buffer.c
....@@ -246,6 +246,19 @@
246246 mutex_unlock(&ring_info->ring_buffer_mutex);
247247 }
248248
249
+/*
250
+ * Check if the ring buffer spinlock is available to take or not; used on
251
+ * atomic contexts, like panic path (see the Hyper-V framebuffer driver).
252
+ */
253
+
254
+bool hv_ringbuffer_spinlock_busy(struct vmbus_channel *channel)
255
+{
256
+ struct hv_ring_buffer_info *rinfo = &channel->outbound;
257
+
258
+ return spin_is_locked(&rinfo->ring_lock);
259
+}
260
+EXPORT_SYMBOL_GPL(hv_ringbuffer_spinlock_busy);
261
+
249262 /* Write to the ring buffer. */
250263 int hv_ringbuffer_write(struct vmbus_channel *channel,
251264 const struct kvec *kv_list, u32 kv_count)