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: <5768EEAD.10004@yifangdigital.com>
Date:	Tue, 21 Jun 2016 15:37:17 +0800
From:	ghzhong <ghzhong@...angdigital.com>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	Jiri Kosina <jikos@...nel.org>,
	Benjamin Tissoires <benjamin.tissoires@...hat.com>,
	Dmitry Torokhov <dtor@...omium.org>,
	Benson Leung <bleung@...omium.org>,
	Andrew Duggan <aduggan@...aptics.com>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: i2c-hid: set power sleep before shutdown

On 06/20/2016 06:39 PM, Mika Westerberg wrote:
> On Sat, Jun 18, 2016 at 06:50:30PM +0800, Guohua Zhong wrote:
>> Add i2c_hid_shutdown for i2c-hid driver to send suspend cmd &
>> disable irq before device shutdown.
>>
>> Some HW design is that the power to i2c hid device won't down
>> after device shutdown. Also the i2c-hid driver do not send suspend
>> cmd to the hid i2c device and disable its irq before shutdown.So
>> if We touch the touchscreen or some other i2c hid device ,the power
>> consumtion will be go up even when the device is in shutdown state.
>>
>> Though the root cause maybe a HW issue. But it seems that it is a
>> good pratice to set power sleep for i2c-hid device before shutdown.
>>
>> Signed-off-by: Guohua Zhong <ghzhong@...angdigital.com>
>> ---
>>   drivers/hid/i2c-hid/i2c-hid.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
>> index 2e021ba..d6ea97b 100644
>> --- a/drivers/hid/i2c-hid/i2c-hid.c
>> +++ b/drivers/hid/i2c-hid/i2c-hid.c
>> @@ -1106,6 +1106,12 @@ static int i2c_hid_remove(struct i2c_client *client)
>>   	return 0;
>>   }
>>   
>> +static void i2c_hid_shutdown(struct i2c_client *client)
>> +{
>> +	i2c_hid_set_power(client, I2C_HID_PWR_SLEEP);
>> +	disable_irq(client->irq);
> Why not free_irq() instead?
Oh, you are right, the free_irq is better.
>
>> +}
>> +
>>   #ifdef CONFIG_PM_SLEEP
>>   static int i2c_hid_suspend(struct device *dev)
>>   {
>> @@ -1230,7 +1236,7 @@ static struct i2c_driver i2c_hid_driver = {
>>   
>>   	.probe		= i2c_hid_probe,
>>   	.remove		= i2c_hid_remove,
>> -
>> +	.shutdown	= i2c_hid_shutdown,
>>   	.id_table	= i2c_hid_id_table,
>>   };
>>   
>> -- 
>> 1.9.1
>>
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ