Re: [PATCH] cpuidle: fix unremovable issue for module driver
From: Rafael J. Wysocki <hidden>
Date: 2013-07-30 13:23:36
Also in:
linux-pm
On Tuesday, July 30, 2013 01:19:46 PM Daniel Lezcano wrote:
On 07/30/2013 12:48 PM, Wang Dongsheng-B40534 wrote:quoted
quoted
-----Original Message----- From: Daniel Lezcano [mailto:daniel.lezcano@linaro.org] Sent: Tuesday, July 30, 2013 5:28 PM To: Wang Dongsheng-B40534 Cc: rjw@sisk.pl; linux-pm@vger.kernel.org; linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] cpuidle: fix unremovable issue for module driver On 07/30/2013 08:55 AM, Dongsheng Wang wrote:quoted
From: Wang Dongsheng <redacted> After __cpuidle_register_device, the cpu incs are added up, but decs are not, thus the module refcount is not match. So the module "exit" function can not be executed when we do remove operation. Move module_put into __cpuidle_register_device to fix it.Sorry, I still don't get it :/ register->module_get unregister->module_put you change it by: register->module_get register->module_put unregister->none which is wrong.module_get->set per cpu incs=1 module_put->set per cpu decs=1 module_refcount-> incs - decs; "unregister" usually call in module->exit function. But if module_refcount is not zero, the module->exit() cannot be executed.Ok, IIUC, the refcount is decremented in the unregister function but this one is never called because the refcount is not zero. Funny, that means the module format was *never* used at all as it does not work. I am wondering if we shouldn't just remove the module support for cpuidle. Rafael ?
That would be the simplest thing to do and possibly the most correct one too, but I need to double check how inte_idle/ACPI idle interactions depend on that. Thanks, Rafael -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.