[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201210065013.29348-1-troy_lee@aspeedtech.com>
Date: Thu, 10 Dec 2020 14:50:13 +0800
From: Troy Lee <troy_lee@...eedtech.com>
To: <openbmc@...ts.ozlabs.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Joel Stanley <joel@....id.au>,
Andrew Jeffery <andrew@...id.au>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"moderated list:ARM/ASPEED MACHINE SUPPORT"
<linux-arm-kernel@...ts.infradead.org>,
"moderated list:ARM/ASPEED MACHINE SUPPORT"
<linux-aspeed@...ts.ozlabs.org>,
open list <linux-kernel@...r.kernel.org>
CC: <leetroy@...il.com>, <troy_lee@...eedtech.com>,
<ryan_chen@...eedtech.com>, <chiawei_wang@...eedtech.com>
Subject: [PATCH] gpio: aspeed: Lock GPIO pin used as IRQ
GPIO pins can be used as IRQ indicators. When they do,
those pins should be flaged with locks to avoid kernel
warning message.
Signed-off-by: Chia-Wei, Wang <chiawei_wang@...eedtech.com>
Signed-off-by: Troy Lee <troy_lee@...eedtech.com>
---
drivers/gpio/gpio-aspeed.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index b966f5e28ebf..f5b3e1d89fbf 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -651,6 +651,13 @@ static int aspeed_gpio_set_type(struct irq_data *d, unsigned int type)
aspeed_gpio_copro_release(gpio, offset);
spin_unlock_irqrestore(&gpio->lock, flags);
+ rc = gpiochip_lock_as_irq(&gpio->chip, d->hwirq);
+ if (rc) {
+ dev_err(gpio->chip.parent, "unable to lock GPIO %lu as IRQ\n",
+ d->hwirq);
+ return rc;
+ }
+
irq_set_handler_locked(d, handler);
return 0;
--
2.17.1
Powered by blists - more mailing lists