All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: greybus-dev@lists.linaro.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Alex Elder <elder@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Hans de Goede <hdegoede@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>, Johan Hovold <johan@kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	UNGLinuxDriver@microchip.com, Wolfram Sang <wsa@kernel.org>,
	Woojung Huh <woojung.huh@microchip.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Michael Below <below@judiz.de>,
	Salvatore Bonaccorso <carnil@debian.org>,
	Oleksandr Natalenko <oleksandr@natalenko.name>
Subject: [PATCH v4 2/7] i2c: core: Use generic_handle_irq_safe() in i2c_handle_smbus_host_notify().
Date: Fri, 11 Feb 2022 19:14:55 +0100	[thread overview]
Message-ID: <20220211181500.1856198-3-bigeasy@linutronix.de> (raw)
In-Reply-To: <20220211181500.1856198-1-bigeasy@linutronix.de>

The i2c-i801 driver invokes i2c_handle_smbus_host_notify() from his
interrupt service routine. On PREEMPT_RT i2c-i801's handler is forced
threaded with enabled interrupts which leads to a warning by
handle_irq_event_percpu() assuming that irq_default_primary_handler()
enabled interrupts.

i2c-i801's interrupt handler can't be made non-threaded because the
interrupt line is shared with other devices.

Use generic_handle_irq_safe() which can invoked with disabled and enabled
interrupts.

Reported-by: Michael Below <below@judiz.de>
Link: https://bugs.debian.org/1002537
Cc: Salvatore Bonaccorso <carnil@debian.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Acked-by: Wolfram Sang <wsa@kernel.org>
---
 drivers/i2c/i2c-core-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 2c59dd748a49f..3f9e5303b6163 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1424,7 +1424,7 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr)
 	if (irq <= 0)
 		return -ENXIO;
 
-	generic_handle_irq(irq);
+	generic_handle_irq_safe(irq);
 
 	return 0;
 }
-- 
2.34.1


  parent reply	other threads:[~2022-02-11 18:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 18:14 [PATCH v4 0/7] Provide and use generic_handle_irq_safe() where appropriate Sebastian Andrzej Siewior
2022-02-11 18:14 ` [PATCH v4 1/7] genirq: Provide generic_handle_irq_safe() Sebastian Andrzej Siewior
2022-02-21 11:19   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-11 18:14 ` Sebastian Andrzej Siewior [this message]
2022-02-23 13:21   ` [PATCH v4 2/7] i2c: core: Use generic_handle_irq_safe() in i2c_handle_smbus_host_notify() Wolfram Sang
2022-02-25 22:26     ` Sebastian Andrzej Siewior
2022-03-01 15:06       ` Wolfram Sang
2022-02-11 18:14 ` [PATCH v4 3/7] i2c: cht-wc: Use generic_handle_irq_safe() Sebastian Andrzej Siewior
2022-02-23 13:21   ` Wolfram Sang
2022-02-11 18:14 ` [PATCH v4 4/7] misc: hi6421-spmi-pmic: " Sebastian Andrzej Siewior
2022-03-02 21:35   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-11 18:14 ` [PATCH v4 5/7] mfd: ezx-pcap: " Sebastian Andrzej Siewior
2022-03-02 21:35   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-11 18:14 ` [PATCH v4 6/7] net: usb: lan78xx: " Sebastian Andrzej Siewior
2022-03-02 21:35   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-11 18:15 ` [PATCH v4 7/7] staging: greybus: gpio: " Sebastian Andrzej Siewior
2022-03-02 21:35   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-15 14:36 ` [PATCH v4 0/7] Provide and use generic_handle_irq_safe() where appropriate Lee Jones
2022-02-15 14:50   ` Sebastian Andrzej Siewior
2022-02-15 15:16     ` Lee Jones
2022-02-15 15:33       ` Sebastian Andrzej Siewior
2022-02-15 15:42         ` Lee Jones
2022-02-15 15:46           ` Sebastian Andrzej Siewior
2022-02-21  9:57           ` Thomas Gleixner
2022-02-21 11:33             ` Thomas Gleixner
2022-02-21 12:38               ` Lee Jones
2022-02-23 13:19               ` Wolfram Sang

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=20220211181500.1856198-3-bigeasy@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=arnd@arndb.de \
    --cc=below@judiz.de \
    --cc=carnil@debian.org \
    --cc=davem@davemloft.net \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=hdegoede@redhat.com \
    --cc=johan@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oleksandr@natalenko.name \
    --cc=rmfrfs@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=woojung.huh@microchip.com \
    --cc=wsa@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.