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  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:	Fri, 4 Apr 2008 19:51:24 -0700
From:	David Brownell <>
To:	Trent Piepho <>
Cc:	Jean Delvare <>,
	Linux Kernel list <>
Subject: Re: [patch/rfc 2/4] pcf875x I2C GPIO expander driver

On Friday 04 April 2008, Trent Piepho wrote:
> >> +    if (test_bit(FLAG_IS_OUT, &gdesc->flags)) {
> >> +            return -EINVAL;
> >> +            /* strcpy(buf, "-1\n"); return 4; */ /* Or this? */
> >
> > Why not just return gpio_get_value(n) in all cases?

That's the right answer...

> > User might want to 
> > know which value is currently being output.
> I thought the gpiolib layer didn't let you read an output, but I see that's
> not the case now.  Maybe it's changed since the first revision?  I've changed
> this to call gpio_get_value(n) for outputs too.

I don't recall ever disallowing reading output values ... the
exact behavior is platform-specific, though it "should" be the
value actually sensed at the pin, which might not be the same
as what's being driven.

> Though for the MPC8572 GPIO driver I wrote, it doesn't support reading
> outputs.  The hardware doesn't allow it (IMHO, a design flaw), and working
> around this significantly slows down GPIO functions.

Then don't worry about it.  Any portable code can't rely on
being able to do that.

- Dave

> What I'm trying to do 
> with the GPIO lines is going to be slower than desired no matter how fast I
> make the gpio code (which is almost entirely responsible for the final speed),
> so slowing down reads by a factor of four or more just to read back outputs
> isn't desirable.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists