All of lore.kernel.org
 help / color / mirror / Atom feed
From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Kirkwood: fix unused mvsdio gpio pins
Date: Sat, 23 Mar 2013 16:25:54 +0100	[thread overview]
Message-ID: <514DC982.3010706@gmail.com> (raw)
In-Reply-To: <20130323161744.5d13c570@skate>

On 03/23/2013 04:17 PM, Thomas Petazzoni wrote:
> On Sat, 23 Mar 2013 13:56:58 +0100, Sebastian Hesselbarth wrote:
>> mvsdio_platform_data allows to pass card detect and write protect gpio
>> numbers to the driver. Some kirkwood boards don't use both pins as
>> they are not connected, and don't set the corresponding value in
>> platform_data.
>>
>> This will leave the unset values in platform_data initialized as 0,
>> which is in fact a valid gpio pin. mvsdio will grab that pin and
>> configure it as gpio, which in turn breaks nand controller as mpp0
>> also carries nand_io2.
>>
>> This patch fixes the above by initializing unused gpio functions in
>> the platform_data with an invalid (-1) value.
>>
>> Signed-off-by: Sebastian Hesselbarth<sebastian.hesselbarth@gmail.com>
>> Reported-by: Soeren Moch<smoch@web.de>
>
> This somewhat "conflicts" with the patch I've submitted on the mvsdio
> driver to exclude 0 as a valid GPIO, see
> http://lists.infradead.org/pipermail/linux-arm-kernel/2013-March/157157.html.
> This patch ensures that the mvsdio driver behaves as it was behaving
> before 3.9 as far as legacy probing is concerned.

Thomas,

I understand that you proposed patch fixes mvsdio grab mpp0 by accident.
But what if you have a kirkwood board where cd-gpio _is_ connected to mpp0?

Not that there is one I know of, but IMHO the only useful patch is to
set passed values to an invalid gpio number.

> That said, I have nothing against explicitly setting those GPIO values
> to an invalid value. Maybe -EINVAL would make more sense than just -1 ?

Every invalid gpio number will be sufficient. But -EINVAL doesn't make
more sense than -1 does. Having no cd-gpio is not an "Invalid argument".

Sebastian

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@arm.linux.org.uk>,
	Jason Cooper <jason@lakedaemon.net>,
	linux-kernel@vger.kernel.org, Soeren Moch <smoch@web.de>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: Kirkwood: fix unused mvsdio gpio pins
Date: Sat, 23 Mar 2013 16:25:54 +0100	[thread overview]
Message-ID: <514DC982.3010706@gmail.com> (raw)
In-Reply-To: <20130323161744.5d13c570@skate>

On 03/23/2013 04:17 PM, Thomas Petazzoni wrote:
> On Sat, 23 Mar 2013 13:56:58 +0100, Sebastian Hesselbarth wrote:
>> mvsdio_platform_data allows to pass card detect and write protect gpio
>> numbers to the driver. Some kirkwood boards don't use both pins as
>> they are not connected, and don't set the corresponding value in
>> platform_data.
>>
>> This will leave the unset values in platform_data initialized as 0,
>> which is in fact a valid gpio pin. mvsdio will grab that pin and
>> configure it as gpio, which in turn breaks nand controller as mpp0
>> also carries nand_io2.
>>
>> This patch fixes the above by initializing unused gpio functions in
>> the platform_data with an invalid (-1) value.
>>
>> Signed-off-by: Sebastian Hesselbarth<sebastian.hesselbarth@gmail.com>
>> Reported-by: Soeren Moch<smoch@web.de>
>
> This somewhat "conflicts" with the patch I've submitted on the mvsdio
> driver to exclude 0 as a valid GPIO, see
> http://lists.infradead.org/pipermail/linux-arm-kernel/2013-March/157157.html.
> This patch ensures that the mvsdio driver behaves as it was behaving
> before 3.9 as far as legacy probing is concerned.

Thomas,

I understand that you proposed patch fixes mvsdio grab mpp0 by accident.
But what if you have a kirkwood board where cd-gpio _is_ connected to mpp0?

Not that there is one I know of, but IMHO the only useful patch is to
set passed values to an invalid gpio number.

> That said, I have nothing against explicitly setting those GPIO values
> to an invalid value. Maybe -EINVAL would make more sense than just -1 ?

Every invalid gpio number will be sufficient. But -EINVAL doesn't make
more sense than -1 does. Having no cd-gpio is not an "Invalid argument".

Sebastian

  reply	other threads:[~2013-03-23 15:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 12:56 [PATCH] ARM: Kirkwood: fix unused mvsdio gpio pins Sebastian Hesselbarth
2013-03-23 12:56 ` Sebastian Hesselbarth
2013-03-23 15:17 ` Thomas Petazzoni
2013-03-23 15:17   ` Thomas Petazzoni
2013-03-23 15:25   ` Sebastian Hesselbarth [this message]
2013-03-23 15:25     ` Sebastian Hesselbarth
2013-03-23 16:30     ` Thomas Petazzoni
2013-03-23 16:30       ` Thomas Petazzoni
2013-03-23 17:33       ` Sebastian Hesselbarth
2013-03-23 17:33         ` Sebastian Hesselbarth
2013-03-28 17:00 ` Jason Cooper
2013-03-28 17:00   ` Jason Cooper

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=514DC982.3010706@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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.