[PATCH 11/17] s390: Add airq_iv_lock
From: Matthew Wilcox (Oracle)
Date: Thu Apr 08 2021 - 22:59:45 EST
Allow lockdep to track the airq bit spin locks.
Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
arch/s390/include/asm/airq.h | 5 +++--
drivers/s390/cio/airq.c | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/s390/include/asm/airq.h b/arch/s390/include/asm/airq.h
index 01936fdfaddb..d281340de14a 100644
--- a/arch/s390/include/asm/airq.h
+++ b/arch/s390/include/asm/airq.h
@@ -26,6 +26,7 @@ struct airq_struct {
int register_adapter_interrupt(struct airq_struct *airq);
void unregister_adapter_interrupt(struct airq_struct *airq);
+extern struct iv_lock airq_iv_lock;
/* Adapter interrupt bit vector */
struct airq_iv {
@@ -72,13 +73,13 @@ static inline unsigned long airq_iv_end(struct airq_iv *iv)
static inline void airq_iv_lock(struct airq_iv *iv, unsigned long bit)
{
const unsigned long be_to_le = BITS_PER_LONG - 1;
- bit_spin_lock(bit ^ be_to_le, iv->bitlock);
+ bit_spin_lock(bit ^ be_to_le, iv->bitlock, &airq_iv_lock);
}
static inline void airq_iv_unlock(struct airq_iv *iv, unsigned long bit)
{
const unsigned long be_to_le = BITS_PER_LONG - 1;
- bit_spin_unlock(bit ^ be_to_le, iv->bitlock);
+ bit_spin_unlock(bit ^ be_to_le, iv->bitlock, &airq_iv_lock);
}
static inline void airq_iv_set_data(struct airq_iv *iv, unsigned long bit,
diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c
index cb466ed7eb5e..6e850661957c 100644
--- a/drivers/s390/cio/airq.c
+++ b/drivers/s390/cio/airq.c
@@ -31,6 +31,9 @@ static struct hlist_head airq_lists[MAX_ISC+1];
static struct dma_pool *airq_iv_cache;
+DEFINE_SPLIT_LOCK(airq_iv_lock);
+EXPORT_SYMBOL(airq_iv_lock);
+
/**
* register_adapter_interrupt() - register adapter interrupt handler
* @airq: pointer to adapter interrupt descriptor
--
2.30.2