All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Serge Semin <fancer.lancer@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2 08/14] gpio: dwapb: Convert to use IRQ core provided macros
Date: Thu, 16 Apr 2020 14:00:32 +0200	[thread overview]
Message-ID: <d4840691-72d6-316c-a66f-a44d422b07cb@siemens.com> (raw)
In-Reply-To: <20200416110135.dieh6gctkh3bwyiz@mobilestation>

On 16.04.20 13:01, Serge Semin wrote:
> On Thu, Apr 16, 2020 at 01:39:11PM +0300, Andy Shevchenko wrote:
>> On Wed, Apr 15, 2020 at 08:53:09PM +0300, Serge Semin wrote:
>>> On Wed, Apr 15, 2020 at 05:15:28PM +0300, Andy Shevchenko wrote:
>>>> IRQ core provides macros such as IRQ_RETVAL().
>>>> Convert code to use them.
>>
>>> BTW Forgot to mention. Irrelevantly to this patch just so you know seeing
>>> you are from Intel and this part is being utilized by the Intel Quark SoC.
>>> dwapb_irq_handler_mfd() handler will cause a problem in RT-patched kernel
>>> (I've seen such issue in another GPIO-driver). So if PREEMP_RT_FULL patch
>>> is applied and the FULL-RT scheduler is enabled all interrupt handlers
>>> specified by request_irq()-based methods will be handled by a kernel thread,
>>> while generic_handle_irq() is supposed to be called from the atomic context
>>> only (with interrupts disabled). As a result an ugly stack dump will be printed
>>> to the kernel log by the next code:
>>> https://elixir.bootlin.com/linux/latest/source/kernel/irq/handle.c#L152
>>>
>>> A way to fix this is described in Documentation/driver-api/gpio/driver.rst
>>
>> There is patch from Siemens to fix that [1]. I dunno if they are going to upstream it.
>> Jan?
>>
>> [1]: https://github.com/siemens/meta-iot2000/blob/master/meta-iot2000-bsp/recipes-kernel/linux/patches/rt-0002-gpio-dwapb-Work-around-RT-full-s-enforced-IRQ-thread.patch
> 
> Just to note I wouldn't accept that patch as it is, because it's applied to all
> types of IRQ handlers supported by the driver. The chained cascaded IRQ
> handlers won't be converted to the kernel threads in RT-patched kernels [1], so
> using the wa-lock is redundant in that case. One of the ways to fix it is
> to have a conditional wa_lock acquisition depended on the irq_shared flag
> state. Alternatively we could create a dedicated handlers for each types of
> the IRQs.

Yeah, never had the time to dig into details. Also, that patch was only 
tested on one particular device with one particular kernel series 
(4.4-cip-rt). That's why it's a "workaround", not a fix.

Jan

> 
> [1] Documentation/driver-api/gpio/driver.rst
> 
> Regards,
> -Sergey
> 
>>
>> -- 
>> With Best Regards,
>> Andy Shevchenko
>>
>>
-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2020-04-16 12:08 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 14:15 [PATCH v2 00/14] gpio: dwapb: Clean up the driver and a fix Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 01/14] gpio: dwapb: Append MODULE_ALIAS for platform driver Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 02/14] gpio: dwapb: Refactor IRQ handler to use bit operations Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 03/14] gpio: dwapb: Use chained IRQ prologue and epilogue Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 04/14] gpio: dwapb: set default handler to be handle_bad_irq() Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 05/14] gpio: dwapb: Deduplicate IRQ resource management Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 06/14] gpio: dwapb: Convert to use irqd_to_hwirq() Andy Shevchenko
2020-04-15 15:18   ` Serge Semin
2020-04-15 14:15 ` [PATCH v2 07/14] gpio: dwapb: Use device_get_match_data() to simplify code Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 08/14] gpio: dwapb: Convert to use IRQ core provided macros Andy Shevchenko
2020-04-15 17:53   ` Serge Semin
2020-04-16 10:39     ` Andy Shevchenko
2020-04-16 11:01       ` Serge Semin
2020-04-16 12:00         ` Jan Kiszka [this message]
2020-04-15 14:15 ` [PATCH v2 09/14] gpio: dwapb: Switch to more usual pattern of RMW in dwapb_gpio_set_debounce() Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 10/14] gpio: dwapb: Drop bogus BUG_ON()s Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 11/14] gpio: dwapb: Drop of_match_ptr() & ACPI_PTR() calls Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 12/14] gpio: dwapb: Split out dwapb_get_irq() helper Andy Shevchenko
2020-04-15 14:15 ` [PATCH v2 13/14] gpio: dwapb: Use positive conditional in dwapb_configure_irqs() Andy Shevchenko
2020-04-15 16:37   ` Serge Semin
2020-04-16 11:53     ` Linus Walleij
2020-04-16 13:48       ` Serge Semin
2020-04-17 10:42         ` Linus Walleij
2020-04-17 12:56           ` Andy Shevchenko
2020-04-17 20:53           ` Serge Semin
2020-04-15 14:15 ` [PATCH v2 14/14] gpio: dwapb: Amend indentation in some cases Andy Shevchenko
2020-04-15 17:15   ` Serge Semin
2020-04-16 10:56     ` Andy Shevchenko
2020-04-16 11:06       ` Serge Semin
2020-04-16 12:14         ` Linus Walleij
2020-04-16 13:37           ` Serge Semin
2020-04-16 13:59             ` Linus Walleij
2020-04-16 14:09             ` Andy Shevchenko
2020-04-16  7:26 ` [PATCH v2 00/14] gpio: dwapb: Clean up the driver and a fix Linus Walleij

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=d4840691-72d6-316c-a66f-a44d422b07cb@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=fancer.lancer@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.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.