[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMjpGUc0TqqEFNXcg7m6K6Zc8GCYe1BgOHvZt4Cb35GHJ5=1fQ@mail.gmail.com>
Date: Mon, 24 Oct 2011 05:14:30 -0400
From: Mike Frysinger <vapier.adi@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Grant Likely <grant.likely@...retlab.ca>,
Linus Walleij <linus.ml.walleij@...il.com>,
Stephen Warren <swarren@...dia.com>,
Sascha Hauer <s.hauer@...gutronix.de>,
Barry Song <21cnbao@...il.com>, linux-kernel@...r.kernel.org,
Joe Perches <joe@...ches.com>,
Russell King <linux@....linux.org.uk>,
Linaro Dev <linaro-dev@...ts.linaro.org>,
Lee Jones <lee.jones@...aro.org>,
David Brown <davidb@...eaurora.org>,
linux-arm-kernel@...ts.infradead.org,
Stijn Devriendt <highguy@...il.com>
Subject: Re: [PATCH] drivers: create a pin control subsystem v8
On Mon, Oct 24, 2011 at 03:26, Linus Walleij wrote:
> On Sat, Oct 22, 2011 at 7:44 PM, Mike Frysinger wrote:
>> On Tue, Oct 4, 2011 at 16:35, Grant Likely wrote:
>>> On Sat, Oct 01, 2011 at 12:39:21PM +0200, Linus Walleij wrote:
>>>> 2011/9/30 Grant Likely:
>>>> > I'm not convinced that the sysfs approach is
>>>> > actually the right interface here (I'm certainly not a fan of the gpio
>>>> > sysfs i/f), and I'd rather not be putting in unneeded stuff until the
>>>> > userspace i/f is hammered out.
>>>>
>>>> Actually, thinking about it I cannot see what would be wrong
>>>> with /dev/gpio0 & friends in the first place.
>>>>
>>>> Using sysfs as swiss army knife for custom I/O does not
>>>> seem like it would be long-term viable so thanks for this
>>>> observation, and I think we need /dev/gpio* put on some
>>>> mental roadmap somewhere.
>>>
>>> Agreed. I don't want to be in the situation we are now with GPIO,
>>> where every time I look at the sysfs interface I shudder.
>>
>> the problem with that is it doesn't scale. if i have a device with
>> over 150 GPIOs on the SoC itself (obviously GPIO expanders can make
>> that much bigger), i don't want to see 150+ device nodes in /dev/.
>> that's a pretty big waste. sysfs only allocates/frees resources when
>> userspace actually wants to utilize a GPIO.
>
> I was more thinking along the lines of one device per GPIO controller,
> then you ioctl() to ask /dev/gpio0 how many pins it has or so.
that brings its own set of trade offs. this might be OK from a
debugging point of view, but it means security wise we have to grant
access on a per-gpiochip basis instead of a per-gpio basis. i think
the sysfs interface has this granularity of support already as the
root user can chmod/chown the files after exporting them.
Grant suggested we extend UIO to export GPIOs. this would be a good
trade off i think -- sysfs is a good on-the-fly debugging/scripting
interface, but UIO gets us the performance. sysfs overhead can be
mitigated by using pwrite/pread, but without pwritev/preadv, we're
stuck with 1-transition-per-syscall.
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists