linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Brian Norris <briannorris@chromium.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Jianqun Xu <jay.xu@rock-chips.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: Drop CONFIG_DEBUG_GPIO
Date: Mon, 14 Mar 2022 23:22:46 +0100	[thread overview]
Message-ID: <CACRpkdb-W10YAQff_dTUL7B-DH01Z9nn7cE71Zv5xjALtDGQ1g@mail.gmail.com> (raw)
In-Reply-To: <CAMRc=McbY6vK_M9fP7Hzg8LE9ANOZKN49hmBFn92YFH+2ToM8w@mail.gmail.com>

On Mon, Mar 14, 2022 at 4:00 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> On Fri, Mar 11, 2022 at 12:09 AM Brian Norris <briannorris@chromium.org> wrote:
> >
> > CONFIG_DEBUG_GPIO has existed since the introduction of gpiolib, but its
> > Kconfig description and motivation seem to have been off-base for quite
> > some time.
> >
> > Description: it says nothing about enabling extra printk()s. But -DDEBUG
> > does just that; it turns on every dev_dbg()/pr_debug() that would
> > otherwise be silent.
> >
> > Purpose: might_sleep() and WARN_ON() should have very low overhead, and
> > anyway, there's a separate CONFIG_DEBUG_ATOMIC_SLEEP for the
> > might_sleep() overhead.
> >
> > Additionally, the conflated purpose (extra debug checks, and extra
> > printing) makes for a mixed bag for users. In particular, some drivers
> > can be extra-spammy with -DDEBUG -- e.g., with the Rockchip GPIO driver
> > getting moved out of drivers/pinctrl/ in commit 936ee2675eee
> > ("gpio/rockchip: add driver for rockchip gpio"), now some dev_dbg()
> > calls are enabled in its IRQ handler.
> >
> > Altogether, it seems like CONFIG_DEBUG_GPIO isn't serving any good
> > purpose and should just be removed. It can be supplanted by dynamic
> > debug (which post-dates gpiolib) and atomic-debug facilities.
> >
> > Signed-off-by: Brian Norris <briannorris@chromium.org>
> > ---
> >
>
> I like it. It's true we don't see many of those DEBUG constructs
> anymore nowadays and overhead for might_sleep() and WARN_ON() is
> negligible.

I agree.  I have something similar for pinctrl, maybe that needs to
go too.

Yours,
Linus Walleij

  reply	other threads:[~2022-03-14 22:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 23:09 [PATCH] gpio: Drop CONFIG_DEBUG_GPIO Brian Norris
2022-03-14 15:00 ` Bartosz Golaszewski
2022-03-14 22:22   ` Linus Walleij [this message]
2022-03-14 22:34     ` Brian Norris
2022-03-22 13:14       ` Geert Uytterhoeven
2022-03-22 14:39   ` Andy Shevchenko
2022-03-22 14:37 ` Andy Shevchenko
2022-03-22 14:49   ` Bartosz Golaszewski
2022-03-22 14:59     ` Andy Shevchenko
2022-03-22 16:31       ` Brian Norris
2022-03-23 15:11         ` Bartosz Golaszewski
2022-03-23 20:44         ` 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=CACRpkdb-W10YAQff_dTUL7B-DH01Z9nn7cE71Zv5xjALtDGQ1g@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=briannorris@chromium.org \
    --cc=jay.xu@rock-chips.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@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 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).