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
| ||
|
Message-Id: <200804041951.24653.david-b@pacbell.net> Date: Fri, 4 Apr 2008 19:51:24 -0700 From: David Brownell <david-b@...bell.net> To: Trent Piepho <tpiepho@...escale.com> Cc: Jean Delvare <khali@...ux-fr.org>, Linux Kernel list <linux-kernel@...r.kernel.org> 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 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