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: <570B6248.6080905@ti.com>
Date:	Mon, 11 Apr 2016 11:37:28 +0300
From:	Grygorii Strashko <grygorii.strashko@...com>
To:	Chanwoo Choi <cw00.choi@...sung.com>,
	Roger Quadros <rogerq@...com>, <myungjoo.ham@...sung.com>
CC:	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] extcon: usb-gpio: Don't miss event during
 suspend/resume

On 04/11/2016 03:31 AM, Chanwoo Choi wrote:
> Hi Roger,
> 
> On 2016년 04월 08일 16:34, Roger Quadros wrote:
>> Pin state might have changed during suspend/resume while
>> our interrupts were disabled and if device doesn't support wakeup.
>>
>> Scan for change during resume for such case.
>>
>> Signed-off-by: Roger Quadros <rogerq@...com>
>> ---
>> v2:
>> - only check for state change during resume if device wakeup is not supported
>>
>>   drivers/extcon/extcon-usb-gpio.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
>> index bc61d11..118f8ab 100644
>> --- a/drivers/extcon/extcon-usb-gpio.c
>> +++ b/drivers/extcon/extcon-usb-gpio.c
>> @@ -185,6 +185,8 @@ static int usb_extcon_resume(struct device *dev)
>>   	int ret = 0;
>>   
>>   	enable_irq(info->id_irq);
>> +	if (!device_may_wakeup(dev))
>> +		usb_extcon_detect_cable(&info->wq_detcable.work);
> 
> The device_may_wakeup() check the following two states:
> - dev->power.can_wakeup - device_init_wakeup() function set the this field.
> - dev->power.wakeup - device_wakeup_enable() function set the this field.
> 
> The probe function of extcon-usb-gpio.c always call the 'device_init_wakeup(dev,true).
> But, anywhere in extcon-usb-gpio.c don't handle the device_wakeup_enable() for dev->power.wakeup.


device_init_wakeup()
 |-> device_wakeup_enable()

> 
> In the extcon-usb-gpio.c, device_may_wakeup(dev) return always 'false'.
> If you use the only device_may_wakeup(),
> device_may_wakeup() is not able to check whether interrupt is wakeup source or not.
> 

This check is correct and it also will take into account wake up settings changes
which can be made through sysfs: /sys/.../devX/power/wakeup

-- 
regards,
-grygorii

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ