lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50FB8986.9010205@nvidia.com>
Date:	Sun, 20 Jan 2013 15:07:02 +0900
From:	Alex Courbot <acourbot@...dia.com>
To:	Steven King <sfking@...dc.com>
CC:	Greg Ungerer <gerg@...inux.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Arnd Bergmann <arnd@...db.de>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Grant Likely <grant.likely@...retlab.ca>,
	Guenter Roeck <linux@...ck-us.net>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-arch <linux-arch@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"devicetree-discuss@...ts.ozlabs.org" 
	<devicetree-discuss@...ts.ozlabs.org>, <gnurou@...il.com>
Subject: Re: [PATCH 0/4] gpio: introduce descriptor-based interface

Hi Steven,

On 01/18/2013 01:50 AM, Steven King wrote:
> Well, my concern is the small, single chip platforms with limited ram and
> speeds measured in MHz.  My goal was that these platforms that had very basic
> gpio needs, no offboard gpio, just toggling a few pins for spi or whatever,
> could do that without pulling in a bunch of code they dont need.  I realize
> that for x86 or arm people with their giga Hz cpus with gigabytes of ram, its
> no big deal, but my little 60 MHz coldfire v2s with only 16 megs of ram (and
> even more constraining, 2 megs of flash) need all the help they can get.

Running readelf on gpiolib.o built for Tegra, here are the footprints:

.text: 9412B
.data: 260B
.bss: 12312B
.rodata: 268B

Total: 22252B or 22KB.

... of which more than half is the BSS section which consists of a 
static array of 1024 GPIO descriptors, an arbitrary number that you can 
tune and is way too large even for Tegra (but we have to use these 
gigabytes somehow). Say you only need to use 256 GPIOs and .bss is down 
to ~3KB, for a total overhead of 15kB or 0.09% of your 16MB which, in 
perspective, suddenly seem gigantic. :)

If you are concerned about the additional indirection that GPIOlib 
introduces and the potential slowdown for bitbanging, you can always 
define custom gpio_set_value() and gpio_get_value() macros to shortcut 
GPIOlib when the GPIO is in the range you want performance for.

> I haven't been keeping up with the kernel list of late, can someone point me
> to what''s being discussed so I can see what were talking about here?

Arnd explained it already, but basically we'd like to consolidate the 
GPIO subsystem around GPIOlib and introduce safer interfaces (while 
preserving backward compatibility). Good progress in that direction 
would be achieved if all users of the GENERIC_GPIO interface relied on 
GPIOlib (making GENERIC_GPIO require GPIOLIB).

Actually the question of switching to GPIOlib is only worth being asked 
if you are making use of drivers that require GENERIC_GPIO. If this is 
not the case and your GPIOs are only used by your own platform code, you 
can always give up using defining GENERIC_GPIO and continue implementing 
them your own way.

Thanks,
Alex.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ