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] [day] [month] [year] [list]
Message-Id: <1245231404.2668.9.camel@linux-51e8.site>
Date:	Wed, 17 Jun 2009 19:36:44 +1000
From:	Ben Nizette <bn@...sdigital.com>
To:	Alek Du <alek.du@...el.com>
Cc:	Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Ben Dooks <ben-linux@...ff.org>,
	Florian Fainelli <florian@...nwrt.org>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: Re: [PATCH v2] gpiolib: Add gpio_debounce and gpio_alt_func
	features to GPIOLIB

On Wed, 2009-06-17 at 14:59 +0800, Alek Du wrote:
> Changes from v1:
> 
> Removed gpio_detect since we should do that with irq_chip.set_type function.
> 
> 
> From 6b3c9398acf338c263170fcb74c0b2b345ad5369 Mon Sep 17 00:00:00 2001
> From: Alek Du <alek.du@...el.com>
> Date: Wed, 17 Jun 2009 14:50:51 +0800
> Subject: [PATCH] GPIO: Add gpio_debounce and gpio_alt_func features to GPIOLIB
> 
> Add gpio_debounce and gpio_alt_func features to GPIOLIB:
> * gpio_debounce is to adjust signal HW debounce value (need HW support)
> * gpio_alt_func is to set GPIO as alternative function (need HW support)


Please justify the existence of these functions, particularly, who's
supposed to actually call them?  There's no real changelogging here.

First the hardware debounce call.  Hardware debounce functionality
varies massively between chips.  Therefore a driver cannot depend on any
particular behaviour unless it already knows what platform it's running
on.  If it knows the platform it can access the functions directly and
the interface needs no abstraction.  If the driver doesn't know the
platform it can't get any value from the call.  Worse, people are going
to start /expecting/ some behaviour from the call and wonder why their
driver fails subtly on slightly different systems.

Who's supposed to set the alternate functions?  As I see it, only the
board code.  The driver shouldn't ever have to do this itself, all the
pin mux'ing should be done well before the driver needs to access its
pins.  Even if the driver does need to set up it's own pins then it
needs to know /which/ alternate function it is which once again requires
platform knowledge.  If it requires platform knowledge it should be done
in platform code, not driver code, or can at least be done with
non-abstracted calls.

These both seem like needless feature creep and misdirection to me.

	--Ben.


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