pinctrl: exynos: Add spinlocks to irq_mask and irq_unmask
The patch:
1984695
pinctrl: samsung: Protect bank registers with a spinlock
...added spinlocks to protect many accesses. However, the irq_mask
and irq_unmask functions still do an unprotected read/modify/write.
Add the spinlock there.
Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Родитель
ce06f40740
Коммит
5ae8cf7980
|
@ -56,10 +56,15 @@ static void exynos_gpio_irq_unmask(struct irq_data *irqd)
|
|||
struct samsung_pinctrl_drv_data *d = bank->drvdata;
|
||||
unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
|
||||
unsigned long mask;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&bank->slock, flags);
|
||||
|
||||
mask = readl(d->virt_base + reg_mask);
|
||||
mask &= ~(1 << irqd->hwirq);
|
||||
writel(mask, d->virt_base + reg_mask);
|
||||
|
||||
spin_unlock_irqrestore(&bank->slock, flags);
|
||||
}
|
||||
|
||||
static void exynos_gpio_irq_mask(struct irq_data *irqd)
|
||||
|
@ -68,10 +73,15 @@ static void exynos_gpio_irq_mask(struct irq_data *irqd)
|
|||
struct samsung_pinctrl_drv_data *d = bank->drvdata;
|
||||
unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
|
||||
unsigned long mask;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&bank->slock, flags);
|
||||
|
||||
mask = readl(d->virt_base + reg_mask);
|
||||
mask |= 1 << irqd->hwirq;
|
||||
writel(mask, d->virt_base + reg_mask);
|
||||
|
||||
spin_unlock_irqrestore(&bank->slock, flags);
|
||||
}
|
||||
|
||||
static void exynos_gpio_irq_ack(struct irq_data *irqd)
|
||||
|
@ -264,10 +274,15 @@ static void exynos_wkup_irq_unmask(struct irq_data *irqd)
|
|||
struct samsung_pinctrl_drv_data *d = b->drvdata;
|
||||
unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
|
||||
unsigned long mask;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&b->slock, flags);
|
||||
|
||||
mask = readl(d->virt_base + reg_mask);
|
||||
mask &= ~(1 << irqd->hwirq);
|
||||
writel(mask, d->virt_base + reg_mask);
|
||||
|
||||
spin_unlock_irqrestore(&b->slock, flags);
|
||||
}
|
||||
|
||||
static void exynos_wkup_irq_mask(struct irq_data *irqd)
|
||||
|
@ -276,10 +291,15 @@ static void exynos_wkup_irq_mask(struct irq_data *irqd)
|
|||
struct samsung_pinctrl_drv_data *d = b->drvdata;
|
||||
unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
|
||||
unsigned long mask;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&b->slock, flags);
|
||||
|
||||
mask = readl(d->virt_base + reg_mask);
|
||||
mask |= 1 << irqd->hwirq;
|
||||
writel(mask, d->virt_base + reg_mask);
|
||||
|
||||
spin_unlock_irqrestore(&b->slock, flags);
|
||||
}
|
||||
|
||||
static void exynos_wkup_irq_ack(struct irq_data *irqd)
|
||||
|
|
Загрузка…
Ссылка в новой задаче