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] [day] [month] [year] [list]
Date:	Mon, 15 Dec 2014 17:42:27 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Jaewon Kim <jaewon02.kim@...sung.com>
Cc:	Kukjin Kim <kgene.kim@...sung.com>, linux-kernel@...r.kernel.org,
	linux-samsung-soc@...r.kernel.org, linux-input@...r.kernel.org,
	Chanwoo Choi <cw00.choi@...sung.com>,
	Hyunhee Kim <hyunhee.kim@...sung.com>
Subject: Re: [PATCH v6 1/2] Input: add regulator haptic driver

On Tue, Dec 16, 2014 at 10:09:25AM +0900, Jaewon Kim wrote:
> Hi Dmitry,
> 
> 2014년 12월 14일 04:56에 Dmitry Torokhov 이(가) 쓴 글:
> >Hi Jaewon,
> >
> >On Fri, Dec 12, 2014 at 07:32:28PM +0900, Jaewon Kim wrote:
...
> >>+static int __maybe_unused regulator_haptic_suspend(struct device *dev)
> >>+{
> >>+	struct platform_device *pdev = to_platform_device(dev);
> >>+	struct regulator_haptic *haptic = platform_get_drvdata(pdev);
> >>+
> >>+	mutex_lock(&haptic->mutex);
> >>+	if (haptic->enabled) {
> >>+		regulator_haptic_enable(haptic, false);
> >>+		haptic->suspend_state = true;
> >Why do we only set suspend_state if an effect was playing? I think we
> >should always indicate that the device is suspended so that we do not
> >try to start playing another effect - while it is true that normally
> >effects are played by request from userspace which should be frozen by
> >now, it is theoretically possible to trigger an effect from kernel as
> >well.
> 
> This variable name seems to make you confuse.
> I used this variable to restore the old state.
> 
> When kernel is entering suspend state while the motor is vibrating,
> I store vibrating state for vibrate again after escape suspend state.
> 
> 
> I will change variable name to "suspend_restore".
> And prevent to start playing effect  when kernel entering suspend state.

You do not need to save if haptic was playing or not - on resume, if
haptic->magnitude != 0 you need to restart playing, otherwise leave it
off.

Thanks.

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