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]
Date:	Thu, 16 Oct 2008 10:06:21 -0700
From:	David Brownell <david-b@...bell.net>
To:	avorontsov@...mvista.com
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [patch] gpiolib: fix oops in gpio_get_value_cansleep()

On Thursday 16 October 2008, Anton Vorontsov wrote:
> > -     return chip->get(chip, gpio - chip->base);
> > +     return chip->get ? chip->get(chip, gpio - chip->base) : 0;
> 
> Why don't we check the .set in the gpio_set_value? Because
> we must always call gpio_direction_output()?

Yes.  The output driver needs to be explicitly enabled,
to avoid misbehaving electic circuitry.


> It is not exactly the 
> same we work with the input direction.. is this documented anywhere?

In Documentation/gpio.txt since the very first versions.

See the section on "Spinlock-Safe GPIO access", where
special cases for reading the value of output GPIOs are
desribed.  Other aspects are mentioned in other spots.

For example, open drain signals -- as used with I2C and
other protocols -- only drive the "low" signal level,
and if code wants a "high" level it's got to verify that
nobody else is driving that shared line to low.  By
reading it back, even though it's configured as output.

- Dave


--
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