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]
Message-ID: <20080520094647.ZZRA012@mailhub.coreip.homeip.net>
Date:	Tue, 20 May 2008 09:54:16 -0400
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Pau Oliva Fora <pau@...ack.org>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	linux-input@...r.kernel.org
Subject: Re: [PATCH] Add support for HTC Shift Touchscreen

On Tue, May 20, 2008 at 01:02:34PM +0200, Pau Oliva Fora wrote:
> Dmitry Torokhov wrote:
>> On Tue, May 20, 2008 at 01:08:44AM +0200, Pau Oliva Fora wrote:
>>> +
>>> +static int htcpen_open(struct input_dev *dev)
>>> +{
>>> +	outb_p(DEVICE_ENABLE, HTCPEN_PORT_INIT);
>>> +	return 0;
>>> +}
>>> +
>>> +static void htcpen_close(struct input_dev *dev)
>>> +{
>>> +	free_irq(HTCPEN_IRQ, dev);
>>> +}
>>> +
>>
>> No, this will not work.. next time you open the device you won't have
>> IRQ anymore. You need the opposite of outb_p(DEVICE_ENABLE,
>> HTCPEN_PORT_INIT); here.
>>
>
> It is actually working; it also works after suspend/resume without any
> issues.
>

You need to close the device. Making evdev a module and unloading it
should do the trick (you don't use tsdev, do you?).

> I currently do not know a safe way of disabling the device, as HTC did
> not offer any specifications or datasheet when I requested, so everything
> in the driver has been reverse engineered.
>
> Let me know if you think it's ok to leave it as is, otherwise I'll try
> to find the proper way to disable the device (it should not be much
> different than the way of enabling it).

If you can't find the way to disable device then you need to revert to
the old way, with enabling it in _probe() and freein irq in _remove(),
you just need to make sure that you free_irq() first and then call
input_unregister_device().

Also, like Andrey said, we might consider using DMI table so we dont
poke IO ports on random boxes. Oh, and one more thing, you need to
reserve the IO ports your driver is using with request_region.

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