All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Alexandre Courbot <gnurou@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: Do not accept gpio chip additions before gpiolib initialization
Date: Wed, 30 Mar 2016 02:16:02 -0700	[thread overview]
Message-ID: <56FB9952.1030503@roeck-us.net> (raw)
In-Reply-To: <CAAVeFuJZuOWAeG7q=WaZj0f6ch9zmOHvBZReYDnqbFQLsP7G5Q@mail.gmail.com>

On 03/30/2016 01:37 AM, Alexandre Courbot wrote:
> On Wed, Mar 30, 2016 at 3:20 AM, Guenter Roeck <linux@roeck-us.net> wrote:
>> Since commit ff2b13592299 ("gpio: make the gpiochip a real device"),
>> attempts to add a gpio chip prior to gpiolib initialization cause the
>> system to crash. Dump a warning to the console and return an error
>> if the situation is encountered.
>
> Mmm I see the problem but this could seriously delay the availability
> of some GPIOs that are useful for early system boot.
>
> I have not followed the GPIO device patches as closely as I should
> have, but shouldn't you be able to register a GPIO chip without
> immediately presenting it to user-space, for internal kernel needs? If
> gpiolib is not initialized, then device-related operations would be
> skipped, and gpiolib_dev_init() could then parse the list of
> registered chips and fix them up when it gets called.
>
> Again, I'm speaking without real knowledge here, but that pattern
> seems more resilent to me.
>
You are absolutely right, but my knowledge of gpiolib is not good enough
to make that change. See this as a band-gap; it is better than just crashing.

Guenter


  reply	other threads:[~2016-03-30  9:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 18:20 [PATCH] gpio: Do not accept gpio chip additions before gpiolib initialization Guenter Roeck
2016-03-30  8:37 ` Alexandre Courbot
2016-03-30  9:16   ` Guenter Roeck [this message]
2016-03-31  5:57     ` Alexandre Courbot
2016-03-31 12:48       ` Guenter Roeck
2016-03-31 15:59 ` Guenter Roeck

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=56FB9952.1030503@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --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 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.