From: Andrew Davis <afd@ti.com>
To: Judith Mendez <jm@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: <linux-omap@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Bin Liu <b-liu@ti.com>,
<linux-serial@vger.kernel.org>
Subject: Re: [PATCH RESEND 1/2] gpio: omap: Add omap_gpio_disable/enable_irq calls
Date: Fri, 11 Oct 2024 14:07:39 -0500 [thread overview]
Message-ID: <89091165-74d1-442a-ab34-8e70f1a2d65b@ti.com> (raw)
In-Reply-To: <20241011173356.870883-2-jm@ti.com>
On 10/11/24 12:33 PM, Judith Mendez wrote:
> Add omap_gpio_disable_irq and omap_gpio_enable_irq
> calls in gpio-omap.
>
> Currently, kernel cannot disable gpio interrupts in
> case of a irq storm, so add omap_gpio_disable_irq
> so that interrupts can be disabled/enabled.
>
> Signed-off-by: Bin Liu <b-liu@ti.com>
> Signed-off-by: Judith Mendez <jm@ti.com>
> ---
> drivers/gpio/gpio-omap.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 76d5d87e9681..913e6ece1238 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -711,6 +711,31 @@ static void omap_gpio_unmask_irq(struct irq_data *d)
> raw_spin_unlock_irqrestore(&bank->lock, flags);
> }
>
> +static void omap_gpio_set_irq(struct irq_data *d, bool enable)
> +{
> + struct gpio_bank *bank = omap_irq_data_get_bank(d);
> + unsigned int offset = d->hwirq;
> + unsigned long flags;
> +
> + raw_spin_lock_irqsave(&bank->lock, flags);
> + omap_set_gpio_irqenable(bank, offset, enable);
> + raw_spin_unlock_irqrestore(&bank->lock, flags);
> +}
> +
> +static void omap_gpio_disable_irq(struct irq_data *d)
> +{
> + bool enable = 1;
> +
> + omap_gpio_set_irq(d, !enable);
Seems like an odd way to make "false", why not:
omap_gpio_set_irq(d, false);
Andrew
> +}
> +
> +static void omap_gpio_enable_irq(struct irq_data *d)
> +{
> + bool enable = 1;
> +
> + omap_gpio_set_irq(d, enable);
> +}
> +
> static void omap_gpio_irq_print_chip(struct irq_data *d, struct seq_file *p)
> {
> struct gpio_bank *bank = omap_irq_data_get_bank(d);
> @@ -723,6 +748,8 @@ static const struct irq_chip omap_gpio_irq_chip = {
> .irq_shutdown = omap_gpio_irq_shutdown,
> .irq_mask = omap_gpio_mask_irq,
> .irq_unmask = omap_gpio_unmask_irq,
> + .irq_disable = omap_gpio_disable_irq,
> + .irq_enable = omap_gpio_enable_irq,
> .irq_set_type = omap_gpio_irq_type,
> .irq_set_wake = omap_gpio_wake_enable,
> .irq_bus_lock = omap_gpio_irq_bus_lock,
> @@ -737,6 +764,8 @@ static const struct irq_chip omap_gpio_irq_chip_nowake = {
> .irq_shutdown = omap_gpio_irq_shutdown,
> .irq_mask = omap_gpio_mask_irq,
> .irq_unmask = omap_gpio_unmask_irq,
> + .irq_disable = omap_gpio_disable_irq,
> + .irq_enable = omap_gpio_enable_irq,
> .irq_set_type = omap_gpio_irq_type,
> .irq_bus_lock = omap_gpio_irq_bus_lock,
> .irq_bus_sync_unlock = gpio_irq_bus_sync_unlock,
next prev parent reply other threads:[~2024-10-11 19:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 17:33 [PATCH RESEND 0/2] Misc OMAP GPIO/UART fixes Judith Mendez
2024-10-11 17:33 ` [PATCH RESEND 1/2] gpio: omap: Add omap_gpio_disable/enable_irq calls Judith Mendez
2024-10-11 19:07 ` Andrew Davis [this message]
2024-10-17 18:38 ` Judith Mendez
2024-10-11 17:33 ` [PATCH RESEND 2/2] serial: 8250: omap: Move pm_runtime_get_sync Judith Mendez
2024-10-12 0:19 ` Kevin Hilman
2024-10-12 8:03 ` Greg KH
2024-10-17 18:47 ` Judith Mendez
2024-10-12 12:27 ` Andreas Kemnade
[not found] ` <4297747A-8AB9-4E50-93FF-723672B6471C@gmail.com>
2024-10-14 15:22 ` Andreas Kemnade
2024-10-11 22:52 ` [PATCH RESEND 0/2] Misc OMAP GPIO/UART fixes Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=89091165-74d1-442a-ab34-8e70f1a2d65b@ti.com \
--to=afd@ti.com \
--cc=b-liu@ti.com \
--cc=brgl@bgdev.pl \
--cc=jm@ti.com \
--cc=khilman@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=ssantosh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®