linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Schspa Shi <schspa@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	opendmb@gmail.com, Florian Fainelli <f.fainelli@gmail.com>,
	Hoan Tran <hoan@os.amperecomputing.com>,
	Serge Semin <fancer.lancer@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] gpio: use raw spinlock for gpio chip shadowed data
Date: Sat, 16 Apr 2022 11:30:19 +0300	[thread overview]
Message-ID: <CAHp75Veo30c0BWb4Fykgvd-czSnEXsyA8wyMTeKQdS49=e5-nw@mail.gmail.com> (raw)
In-Reply-To: <20220415165505.30383-1-schspa@gmail.com>

On Sat, Apr 16, 2022 at 3:45 AM Schspa Shi <schspa@gmail.com> wrote:
>
> In case of PREEMPT_RT, there is a raw_spinlock -> spinlock dependency
> as the lockdep report shows.
>
> __irq_set_handler
>   irq_get_desc_buslock
>     __irq_get_desc_lock
>       raw_spin_lock_irqsave(&desc->lock, *flags);  // raw spinlock get here
>   __irq_do_set_handler
>     mask_ack_irq
>       dwapb_irq_ack
>         spin_lock_irqsave(&gc->bgpio_lock, flags); // sleep able spinlock
>   irq_put_desc_busunlock
>
> Replace with a raw lock to avoid BUGs. This lock is only used to access
> registers, and It's safe to replace with the raw lock without bad
> influence.

> [   15.090359][    T1] =============================
> [   15.090365][    T1] [ BUG: Invalid wait context ]
> [   15.090373][    T1] 5.10.59-rt52-00983-g186a6841c682-dirty #3 Not tainted
> [   15.090386][    T1] -----------------------------

Please, reduce this very noise traceback to the point, usually it
takes ~3-5 lines only.

...

>  drivers/gpio/gpio-amdpt.c                 | 10 +++----
>  drivers/gpio/gpio-brcmstb.c               | 12 ++++----
>  drivers/gpio/gpio-cadence.c               | 12 ++++----
>  drivers/gpio/gpio-dwapb.c                 | 36 +++++++++++------------
>  drivers/gpio/gpio-grgpio.c                | 30 +++++++++----------
>  drivers/gpio/gpio-hlwd.c                  | 18 ++++++------
>  drivers/gpio/gpio-idt3243x.c              | 12 ++++----
>  drivers/gpio/gpio-ixp4xx.c                |  4 +--
>  drivers/gpio/gpio-loongson1.c             |  8 ++---
>  drivers/gpio/gpio-menz127.c               |  8 ++---
>  drivers/gpio/gpio-mlxbf2.c                | 18 ++++++------
>  drivers/gpio/gpio-mmio.c                  | 22 +++++++-------
>  drivers/gpio/gpio-sifive.c                | 12 ++++----
>  drivers/gpio/gpio-tb10x.c                 |  4 +--
>  drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c |  8 ++---
>  include/linux/gpio/driver.h               |  2 +-

Looking into the code I think we can't easily (without too much
additional churn) to split this to the series of patches. But I leave
this up to the maintainers to decide.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2022-04-16  8:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 16:55 [PATCH] gpio: use raw spinlock for gpio chip shadowed data Schspa Shi
2022-04-16  8:30 ` Andy Shevchenko [this message]
2022-04-17 16:51   ` [PATCH v2 01/15] " Schspa Shi
2022-04-17 16:51     ` [PATCH v2 02/15] pinctrl: nuvoton: npcm7xx: use raw_spin_lock_irqsave for bgpio_lock Schspa Shi
2022-04-17 16:51     ` [PATCH v2 03/15] gpio: tb10x: use raw lock " Schspa Shi
2022-04-17 16:51     ` [PATCH v2 04/15] gpio: sifive: " Schspa Shi
2022-04-17 16:51     ` [PATCH v2 05/15] gpio: mlxbf2: " Schspa Shi
2022-04-17 16:51     ` [PATCH v2 06/15] gpio: menz127: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 07/15] gpio: loongson1: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 08/15] gpio: ixp4xx: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 09/15] gpio: idt3243x: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 10/15] gpio: hlwd: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 11/15] gpio: grgpio: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 12/15] gpio: dwapb: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 13/15] gpio: cadence: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 14/15] gpio: brcmstb: " Schspa Shi
2022-04-17 16:52     ` [PATCH v2 15/15] gpio: amdpt: " Schspa Shi
     [not found]     ` <CAHp75Vc8HwheQVOpcn_Lxk-bOOMLybr=m6OdO7mJ-vE9xywBLg@mail.gmail.com>
2022-04-18  3:07       ` [PATCH] gpio: use raw spinlock for gpio chip shadowed data Schspa Shi
2022-04-18 11:38         ` Andy Shevchenko
2022-04-18 11:39           ` Andy Shevchenko
2022-04-18 15:43             ` Schspa Shi
2022-04-18 19:01               ` Bartosz Golaszewski
2022-04-19  1:28                 ` [PATCH v3] " Schspa Shi
2022-04-19  8:22                   ` Andy Shevchenko
2022-04-19 21:57                   ` Linus Walleij
2022-04-19 22:30                   ` Doug Berger
2022-04-20  9:37                   ` Serge Semin
2022-04-25 10:15                   ` Bartosz Golaszewski

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='CAHp75Veo30c0BWb4Fykgvd-czSnEXsyA8wyMTeKQdS49=e5-nw@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=f.fainelli@gmail.com \
    --cc=fancer.lancer@gmail.com \
    --cc=hoan@os.amperecomputing.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=schspa@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).