Skip to content

Commit 7fed891

Browse files
committed
Merge tag 'gpio-fixes-for-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio fix from Bartosz Golaszewski: - convert regular spinlock to raw spinlock in gpio-xilinx to avoid a lockdep splat * tag 'gpio-fixes-for-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: xilinx: Convert gpio_lock to raw spinlock
2 parents 5e74b9b + 9860370 commit 7fed891

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

drivers/gpio/gpio-xilinx.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct xgpio_instance {
6565
DECLARE_BITMAP(state, 64);
6666
DECLARE_BITMAP(last_irq_read, 64);
6767
DECLARE_BITMAP(dir, 64);
68-
spinlock_t gpio_lock; /* For serializing operations */
68+
raw_spinlock_t gpio_lock; /* For serializing operations */
6969
int irq;
7070
DECLARE_BITMAP(enable, 64);
7171
DECLARE_BITMAP(rising_edge, 64);
@@ -179,14 +179,14 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
179179
struct xgpio_instance *chip = gpiochip_get_data(gc);
180180
int bit = xgpio_to_bit(chip, gpio);
181181

182-
spin_lock_irqsave(&chip->gpio_lock, flags);
182+
raw_spin_lock_irqsave(&chip->gpio_lock, flags);
183183

184184
/* Write to GPIO signal and set its direction to output */
185185
__assign_bit(bit, chip->state, val);
186186

187187
xgpio_write_ch(chip, XGPIO_DATA_OFFSET, bit, chip->state);
188188

189-
spin_unlock_irqrestore(&chip->gpio_lock, flags);
189+
raw_spin_unlock_irqrestore(&chip->gpio_lock, flags);
190190
}
191191

192192
/**
@@ -210,15 +210,15 @@ static void xgpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
210210
bitmap_remap(hw_mask, mask, chip->sw_map, chip->hw_map, 64);
211211
bitmap_remap(hw_bits, bits, chip->sw_map, chip->hw_map, 64);
212212

213-
spin_lock_irqsave(&chip->gpio_lock, flags);
213+
raw_spin_lock_irqsave(&chip->gpio_lock, flags);
214214

215215
bitmap_replace(state, chip->state, hw_bits, hw_mask, 64);
216216

217217
xgpio_write_ch_all(chip, XGPIO_DATA_OFFSET, state);
218218

219219
bitmap_copy(chip->state, state, 64);
220220

221-
spin_unlock_irqrestore(&chip->gpio_lock, flags);
221+
raw_spin_unlock_irqrestore(&chip->gpio_lock, flags);
222222
}
223223

224224
/**
@@ -236,13 +236,13 @@ static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
236236
struct xgpio_instance *chip = gpiochip_get_data(gc);
237237
int bit = xgpio_to_bit(chip, gpio);
238238

239-
spin_lock_irqsave(&chip->gpio_lock, flags);
239+
raw_spin_lock_irqsave(&chip->gpio_lock, flags);
240240

241241
/* Set the GPIO bit in shadow register and set direction as input */
242242
__set_bit(bit, chip->dir);
243243
xgpio_write_ch(chip, XGPIO_TRI_OFFSET, bit, chip->dir);
244244

245-
spin_unlock_irqrestore(&chip->gpio_lock, flags);
245+
raw_spin_unlock_irqrestore(&chip->gpio_lock, flags);
246246

247247
return 0;
248248
}
@@ -265,7 +265,7 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
265265
struct xgpio_instance *chip = gpiochip_get_data(gc);
266266
int bit = xgpio_to_bit(chip, gpio);
267267

268-
spin_lock_irqsave(&chip->gpio_lock, flags);
268+
raw_spin_lock_irqsave(&chip->gpio_lock, flags);
269269

270270
/* Write state of GPIO signal */
271271
__assign_bit(bit, chip->state, val);
@@ -275,7 +275,7 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
275275
__clear_bit(bit, chip->dir);
276276
xgpio_write_ch(chip, XGPIO_TRI_OFFSET, bit, chip->dir);
277277

278-
spin_unlock_irqrestore(&chip->gpio_lock, flags);
278+
raw_spin_unlock_irqrestore(&chip->gpio_lock, flags);
279279

280280
return 0;
281281
}
@@ -398,7 +398,7 @@ static void xgpio_irq_mask(struct irq_data *irq_data)
398398
int bit = xgpio_to_bit(chip, irq_offset);
399399
u32 mask = BIT(bit / 32), temp;
400400

401-
spin_lock_irqsave(&chip->gpio_lock, flags);
401+
raw_spin_lock_irqsave(&chip->gpio_lock, flags);
402402

403403
__clear_bit(bit, chip->enable);
404404

@@ -408,7 +408,7 @@ static void xgpio_irq_mask(struct irq_data *irq_data)
408408
temp &= ~mask;
409409
xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, temp);
410410
}
411-
spin_unlock_irqrestore(&chip->gpio_lock, flags);
411+
raw_spin_unlock_irqrestore(&chip->gpio_lock, flags);
412412

413413
gpiochip_disable_irq(&chip->gc, irq_offset);
414414
}
@@ -428,7 +428,7 @@ static void xgpio_irq_unmask(struct irq_data *irq_data)
428428

429429
gpiochip_enable_irq(&chip->gc, irq_offset);
430430

431-
spin_lock_irqsave(&chip->gpio_lock, flags);
431+
raw_spin_lock_irqsave(&chip->gpio_lock, flags);
432432

433433
__set_bit(bit, chip->enable);
434434

@@ -447,7 +447,7 @@ static void xgpio_irq_unmask(struct irq_data *irq_data)
447447
xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, val);
448448
}
449449

450-
spin_unlock_irqrestore(&chip->gpio_lock, flags);
450+
raw_spin_unlock_irqrestore(&chip->gpio_lock, flags);
451451
}
452452

453453
/**
@@ -512,7 +512,7 @@ static void xgpio_irqhandler(struct irq_desc *desc)
512512

513513
chained_irq_enter(irqchip, desc);
514514

515-
spin_lock(&chip->gpio_lock);
515+
raw_spin_lock(&chip->gpio_lock);
516516

517517
xgpio_read_ch_all(chip, XGPIO_DATA_OFFSET, all);
518518

@@ -529,7 +529,7 @@ static void xgpio_irqhandler(struct irq_desc *desc)
529529
bitmap_copy(chip->last_irq_read, all, 64);
530530
bitmap_or(all, rising, falling, 64);
531531

532-
spin_unlock(&chip->gpio_lock);
532+
raw_spin_unlock(&chip->gpio_lock);
533533

534534
dev_dbg(gc->parent, "IRQ rising %*pb falling %*pb\n", 64, rising, 64, falling);
535535

@@ -620,7 +620,7 @@ static int xgpio_probe(struct platform_device *pdev)
620620
bitmap_set(chip->hw_map, 0, width[0]);
621621
bitmap_set(chip->hw_map, 32, width[1]);
622622

623-
spin_lock_init(&chip->gpio_lock);
623+
raw_spin_lock_init(&chip->gpio_lock);
624624

625625
chip->gc.base = -1;
626626
chip->gc.ngpio = bitmap_weight(chip->hw_map, 64);

0 commit comments

Comments
 (0)