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: <20071115095123.3f595b62@dhcp-255-175.norway.atmel.com>
Date:	Thu, 15 Nov 2007 09:51:23 +0100
From:	Haavard Skinnemoen <hskinnemoen@...el.com>
To:	David Brownell <david-b@...bell.net>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel list <linux-kernel@...r.kernel.org>,
	Florian Fainelli <florian.fainelli@...ecomint.eu>,
	Ingo Molnar <mingo@...e.hu>,
	Nick Piggin <nickpiggin@...oo.com.au>
Subject: Re: [patch 2.6.24-rc2 1/3] generic gpio -- gpio_chip support

On Thu, 15 Nov 2007 00:20:33 -0800
David Brownell <david-b@...bell.net> wrote:

> > >   - gpio_direction_input()/gpio_direction_output() implicitly
> > >     request the pins, if they weren't already requested.  
> > 
> > Eek, that's completely wrong. Allowing to access a resource _before_
> > it is assigned and then doing the assignment implicit is a really bad
> > idea.  
> 
> This is an artifact of making the GPIO interface easy to adopt,
> by letting all the initial adopters wrap "legacy" SOC-specific
> GPIO interfaces instead of creating a bunch of new platform code.

It's still ok for platforms that do not use gpiolib to provide NOP
gpio_request() and gpio_free() functions if they don't care about
tracking gpio usage. That doesn't mean we shouldn't require all drivers
to use those calls -- if they are implemented as empty inlines, it
won't cost anything to call them.

I'd rather speed up the gpio_direction_* functions a bit by removing
the implicit gpio_request() since they may be called a lot more
frequently and, as you pointed out, possibly from atomic context.

HÃ¥vard
-
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