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:	Tue, 8 Mar 2011 12:13:09 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Grant Likely <grant.likely@...retlab.ca>
Cc:	Peter Tyser <ptyser@...-inc.com>, linux-kernel@...r.kernel.org,
	Alek Du <alek.du@...el.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	Eric Miao <eric.y.miao@...il.com>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Joe Perches <joe@...ches.com>
Subject: Re: [PATCH v5 2/4] gpiolib: Add ability to get GPIO direction

> I don't object to a callback hook.  My objection is how it is bodged
> on to work around limitations to the direction being cached in the
> flags variable.  I want to see a solution that either depends entirely
> on the callback, or completely fixes the problems with the cached
> value by allowing the driver to update it.

Doing it all by callback might actually fix a lot of the problems because
it can handle all kinds of 'unknowns'. If the callbacks for set/get
optionally pass a char buffer as well even the /proc interface just comes
out in the wash as the device can return a string to populate the status
or to be parsed (obviously with most h/w using the default method which
is in/out)

However who then does the enforcement of gpio_foo calls if the flag is
not cached, does that end up in each driver or is there still a cache of
some form ?

Not sure updating the interface is that hard either - we've done it
before with other layers simply by starting off with

	if (foo->ops->method)
		foo->ops->method(foo, bar);
	else {
		old fixed method + glue
	}

(or by forcing foo->ops->method on init to point to a default handler,
but that breaks making ops const)

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