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: <4F6086E3.2060906@samsung.com>
Date:	Wed, 14 Mar 2012 20:54:11 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:	linux-input@...r.kernel.org, sameo@...ux.intel.com,
	broonie@...nsource.wolfsonmicro.com, linux-kernel@...r.kernel.org,
	kyungmin.park@...sung.com, myungjoo.ham@...sung.com
Subject: Re: [PATCH v3 2/2] input: add driver support for MAX8997-haptic

On 03/14/2012 05:46 PM, Dmitry Torokhov wrote:
> Hi Chanwoo,
> 
> On Mon, Mar 12, 2012 at 05:31:21PM +0900, Chanwoo Choi wrote:
>> +
>> +static int __devexit max8997_haptic_remove(struct platform_device *pdev)
>> +{
>> +	struct max8997_haptic *chip = platform_get_drvdata(pdev);
>> +
>> +	destroy_work_on_stack(&chip->work);
> 
> This does not make sense because:
> 
> - chip->work is not on stack
> - even if you "destroy" work nothing stops play effect to schedule a new
>   one - you need to cancel work in close method.
> 
Agreed, I will fix it.

>> +	input_unregister_device(chip->input_dev);
>> +	regulator_put(chip->regulator);
>> +
>> +	if (chip->mode == MAX8997_EXTERNAL_MODE)
>> +		pwm_free(chip->pwm);
>> +
>> +	kfree(chip);
>> +
>> +	return 0;
>> +}
>> +
>> +static int max8997_haptic_suspend(struct device *dev)
>> +{
>> +	struct platform_device *pdev = to_platform_device(dev);
>> +	struct max8997_haptic *chip = platform_get_drvdata(pdev);
>> +	struct input_dev *input_dev = chip->input_dev;
>> +	unsigned long flags;
>> +
>> +	spin_lock_irqsave(&input_dev->event_lock, flags);
>> +	max8997_haptic_enable(chip, false);
>> +	spin_unlock_irqrestore(&input_dev->event_lock, flags);
>> +
> 
> This is not proper locking between playing effect and suspend. Now that
> you are using workqueue you need to synchronize access with it, not with
> play_effect method.
> 
> Does the following patch work for you?
You're right. As you said, I face with the kernel panic when enter
suspend state
while testing max8997-haptic by using fftest at once.

Previously, I  tested for each operation of max8997-haptic and
suspend/resume.
I will fix it according to your comment.

Thank you for your comment.

Best Regards,
Chanwoo Choi
--
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