.. | .. |
---|
246 | 246 | mutex_unlock(&ring_info->ring_buffer_mutex); |
---|
247 | 247 | } |
---|
248 | 248 | |
---|
| 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 | + |
---|
249 | 262 | /* Write to the ring buffer. */ |
---|
250 | 263 | int hv_ringbuffer_write(struct vmbus_channel *channel, |
---|
251 | 264 | const struct kvec *kv_list, u32 kv_count) |
---|