devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Dylan Reid <dgreid@chromium.org>,
	ALSA Development Mailing List <alsa-devel@alsa-project.org>,
	jay.xu@rock-chips.com,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	sonnyrao@chromium.org,
	Kuninori Morimoto <kuninori.morimoto.gx@gmail.com>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH] ASoC: simple-card: Add mic and hp detect gpios.
Date: Wed, 8 Oct 2014 16:05:59 +0900	[thread overview]
Message-ID: <CAAVeFuJB=bF3g2czT1ed1UX85R_hBXqFAKdeLJcASRcXQujFJw@mail.gmail.com> (raw)
In-Reply-To: <20141007163654.GJ4609@sirena.org.uk>

On Wed, Oct 8, 2014 at 1:36 AM, Mark Brown <broonie@kernel.org> wrote:
> On Tue, Oct 07, 2014 at 03:10:01PM +0200, Geert Uytterhoeven wrote:
>> On Tue, Oct 7, 2014 at 2:38 PM, Mark Brown <broonie@kernel.org> wrote:
>
>> > The fix here is to not allow 0 as a GPIO in the core code (which
>> > should've been there already).
>
>> Unfortunately it's not there.
>
>> And it's not as simple as changing the definition of gpio_is_valid()
>> (crash in gpio_get_value()):
>
>>     gpiochip_add: GPIOs 0..211 (r8a7740_pfc) failed to register
>>     sh-pfc pfc-r8a7740: failed to init GPIO chip, ignoring...
>>     sh-pfc pfc-r8a7740: r8a7740_pfc support registered
>>     Unable to handle kernel NULL pointer dereference at virtual address 0000004c
>
> Right, obviously it's not going to work if the platform actually uses 0
> as a valid GPIO.
>
>> Quoting Linus (https://lkml.org/lkml/2014/9/4/464):
>> "Fixing the old global GPIO numberspace API is a waste of time IMO".
>
>> Hence I've just sent a patch to initialize the GPIO numbers with -ENOENT.
>
> I do think it's worth renumbering the platforms since it's *relatively*
> little work per platform compared to completing the gpiod transition.

But transition to gpiod is the way to ultimately fix this issue, as
well as many others. Not to mention that renumbering GPIOs will
certainly make a few users of the GPIO sysfs (another abomination,
agreed) unhappy. I can only recommend switching drivers to gpiod when
such issues are spotted.

  reply	other threads:[~2014-10-08  7:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 21:25 [PATCH] ASoC: simple-card: Add mic and hp detect gpios Dylan Reid
     [not found] ` <1412198720-2326-1-git-send-email-dgreid-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2014-10-02 15:53   ` Mark Brown
2014-10-07 12:32     ` Geert Uytterhoeven
2014-10-07 12:38       ` Mark Brown
2014-10-07 13:10         ` Geert Uytterhoeven
2014-10-07 16:36           ` Mark Brown
2014-10-08  7:05             ` Alexandre Courbot [this message]
2014-10-08  8:50               ` Linus Walleij
2014-10-08 11:40                 ` Mark Brown
2014-10-02 16:25   ` [alsa-devel] " Lars-Peter Clausen
     [not found]     ` <542D7C73.20801-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2014-10-02 16:57       ` Dylan Reid
2014-10-22  6:44   ` Jianqun

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='CAAVeFuJB=bF3g2czT1ed1UX85R_hBXqFAKdeLJcASRcXQujFJw@mail.gmail.com' \
    --to=gnurou@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dgreid@chromium.org \
    --cc=geert@linux-m68k.org \
    --cc=jay.xu@rock-chips.com \
    --cc=kuninori.morimoto.gx@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=sonnyrao@chromium.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).