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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ0PZbR_N+=51AkcP5ijP31ka7G7EXbL8hSzK+umd_W6HPP2gg@mail.gmail.com>
Date:	Wed, 30 Nov 2011 15:58:54 +0900
From:	MyungJoo Ham <myungjoo.ham@...il.com>
To:	Greg KH <gregkh@...e.de>
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	NeilBrown <neilb@...e.de>,
	Linus Walleij <linus.walleij@...aro.org>,
	Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
	Mike Lockwood <lockwood@...roid.com>,
	Arve Hjønnevåg <arve@...roid.com>,
	Kyungmin Park <kyungmin.park@...sung.com>,
	Donggeun Kim <dg77.kim@...sung.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Kalle Komierowski <karl.komierowski@...ricsson.com>,
	Johan PALSSON <johan.palsson@...ricsson.com>,
	Daniel WILLERUD <daniel.willerud@...ricsson.com>
Subject: Re: [RFC PATCH 0/3] introduce: Multistate Switch Class

On Wed, Nov 30, 2011 at 3:35 PM, Greg KH <gregkh@...e.de> wrote:
> On Mon, Nov 28, 2011 at 01:04:46AM -0800, Dmitry Torokhov wrote:
>> On Mon, Nov 28, 2011 at 04:27:13PM +0900, Greg KH wrote:
>> > On Mon, Nov 28, 2011 at 12:31:14PM +1100, NeilBrown wrote:
>> > >
>> > >  My own thought is that this deserves a new device class which allows easy
>> > >  hook-up of in-kernel signalling using notifications and which can be
>> > >  exported as input devices in much the same way the 'gpio' devices can be
>> > >  exported via gpio_keys.  The switch could also optionally be exported through
>> > >  sysfs much like gpio can be exported through sysfs.
>> >
>> > That might also work, but again, odds are the HID spec already defines
>> > this type of "switch", so why recreate it as a different type of device?
>>
>> HID does not map 1:1 on input. There are items in HID that are better
>> served by other subsystems.
>
> Ok fair enough.
>
> So, how do you want this type of interface to look like, uevents only?
>
> Or something like gpio?
>
> Actually, why can't we just use gpio as-is here and just treat these
> devices as "generic" i/o "pins"?
>
> thanks,
>
> greg k-h

For userspace, GPIO should work.

For device drivers, I'm not sure.

In order to work for device drives, a GPIO event (GPIO Input goes L->H
or H->L) should trigger events in other device drivers. The GPIO value
can be set by the external-connector/multistate-switch driver
(notifier) based on its own interrupts.

Then, with a GPIO X representing the one status of many at a notifier,
a notifier device can set L/H value of GPIO X according to the cable
state based on the interrupts from the port. However, for a device
(charger, hdmi, sound, or anything) being connected to that cable, how
does it get the changed state without polling? Are we generating an
interrupt of GPIO X at the interrupt handler of the notifier?

Assuming that it is possible, this means that each cable status is fed
to only one callback via IRQ subsystem unlike the notifier chain that
allows multiple callbacks registered. Another concern is that this
method may create a lengthy interrupt handling context where we could
use simple notifier chains. The work struct at the interrupt handler
of switch device (notifier) will now invoking a series of interrupts
instead of calling notify.

- We need uevent + notify-chain.


Cheers!
MyungJoo
-- 
MyungJoo Ham, Ph.D.
Mobile Software Platform Lab, DMC Business, Samsung Electronics
--
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