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]
Date:	Mon, 23 Dec 2013 15:36:19 +0800
From:	Barry Song <21cnbao@...il.com>
To:	Chanwoo Choi <cw00.choi@...sung.com>
Cc:	rjying <rjying@...il.com>, MyungJoo Ham <myungjoo.ham@...sung.com>,
	LKML <linux-kernel@...r.kernel.org>,
	RongJun Ying <Rongjun.Ying@....com>,
	Binghua Duan <Binghua.Duan@....com>
Subject: Re: [PATCH 1/1] extcon: gpio: Add power resume support

2013/12/23 Chanwoo Choi <cw00.choi@...sung.com>:
> On 12/23/2013 03:10 PM, Barry Song wrote:
>> 2013/12/23 Chanwoo Choi <cw00.choi@...sung.com>:
>>> On 12/20/2013 05:09 PM, rjying wrote:
>>>> From: Rongjun Ying <rongjun.ying@....com>
>>>>
>>>> After system resume, need send extcon uevent to userspace
>>>
>>> Why did extcon send uevent after wakeup from suspend?
>>>
>>> If extcon cable is attatched or detached on suspend state,
>>> Kernel can detect the interrupt about changed state of extcon.
>>
>> irq controller has lost power in suspend, so there is no pending interrupt.
>> and HW will not pend any interrupt when we hotplug cable during sleep.
>
> No, SoC in suspend state must maintain the minimum power under 1mA
> if completed the power-optimization on suspend state.
>
> If user insert USB cable to target, the external interrupt connected to
> USB port is happened. And kernel would be waked up from suspend state
> to operate proper interrupt handler of external interrupt.

no. not every USB supports that. that depends on the power domain design of SoC.

>
> Also,
> Input subsystem used gpio-keys driver for power button..
> If user press power button in suspend state, target would be waked up from suspend state.
> It is same case both extcon gpio and gpio-keys of input subsystem.

no. it depends on the SoC design. many SoC only support 1 special key
which can work as ON-KEY as wakeup source. and this kind of keys might
not be GPIO at all.
there is a special power domain which is still open for it.

>
>>
>>> So, kernel would execute proper operation about interrupt
>>> after wakeup from suspend state.
>>
>> kernel only save/restore the register status of gpio, how could it
>> know whether there is a pending interrupt if the HW doesn't do it?
>>
>>>
>>> I think it isn't necessary.
>>>
>>> Thanks,
>>> Chanwoo Choi
>>>
>>>>
>>>> Change-Id: I32a9e1c6646035f95765bba79a7acaccb8ce45a7
>>>>
>>>> Signed-off-by: Rongjun Ying <rongjun.ying@....com>
>>>> ---
>>>>  drivers/extcon/extcon-gpio.c |   17 +++++++++++++++++
>>>>  1 files changed, 17 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
>>>> index 7e0dff5..d916522 100644
>>>> --- a/drivers/extcon/extcon-gpio.c
>>>> +++ b/drivers/extcon/extcon-gpio.c
>>>> @@ -159,12 +159,29 @@ static int gpio_extcon_remove(struct platform_device *pdev)
>>>>       return 0;
>>>>  }
>>>>
>>>> +#ifdef CONFIG_PM_SLEEP
>>>> +static int gpio_extcon_resume(struct device *dev)
>>>> +{
>>>> +     struct gpio_extcon_data *extcon_data;
>>>> +
>>>> +     extcon_data = dev_get_drvdata(dev);
>>>> +     queue_delayed_work(system_power_efficient_wq, &extcon_data->work,
>>>> +                           extcon_data->debounce_jiffies);
>>>> +     return 0;
>>>> +}
>>>> +#endif
>>>> +
>>>> +static const struct dev_pm_ops gpio_extcon_pm_ops = {
>>>> +     SET_SYSTEM_SLEEP_PM_OPS(NULL, gpio_extcon_resume)
>>>> +};
>>>> +
>>>>  static struct platform_driver gpio_extcon_driver = {
>>>>       .probe          = gpio_extcon_probe,
>>>>       .remove         = gpio_extcon_remove,
>>>>       .driver         = {
>>>>               .name   = "extcon-gpio",
>>>>               .owner  = THIS_MODULE,
>>>> +             .pm = &gpio_extcon_pm_ops,
>>>>       },
>>>>  };
>>>>
>>>>
>>>
>>
>> -barry

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