Skip to contentSkip to conversation

cpufreq: return EEXIST instead of EBUSY for second registering

PATCH Applied Yinghai Lu 3 participants 10 messages Sep 19, 2013 – Sep 20, 2013 CPU frequency scaling framework

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 cpufreq: return EEXIST instead of EBUSY for second registering

System that cpu support intel_pstate, acpi_cpufreq fail to load, and udev keep trying until trace get filled up and kernel crash.

The root cause is driver return ret from cpufreq_register_driver and when some other driver take over before, it would return EBUSY, then udev will keep trying...

cpufreq_register_driver should return EEXIST instead. then system could boot without appending intel_pstate=disable and still use intel_pstate.

---
 drivers/cpufreq/cpufreq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq.c +1 -1
Index: linux-2.6/drivers/cpufreq/cpufreq.c
===================================================================
@@ -2104,7 +2104,7 @@ int cpufreq_register_driver(struct cpufr
 	write_lock_irqsave(&cpufreq_driver_lock, flags);
 	if (cpufreq_driver) {
 		write_unlock_irqrestore(&cpufreq_driver_lock, flags);
-		return -EBUSY;
+		return -EEXIST;
 	}
 	cpufreq_driver = driver_data;
 	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Yinghai Lu

System that cpu support intel_pstate, acpi_cpufreq fail to load, and udev keep trying until trace get filled up and kernel crash.

The root cause is driver return ret from cpufreq_register_driver and when some other driver take over before, it would return EBUSY, then udev will keep trying...

Quoted 5 lines

cpufreq_register_driver should return EEXIST instead. then system could boot without appending intel_pstate=disable and still use intel_pstate.

#2 lore raw
Quoted 9 lines · Viresh Kumar
Quoted 8 lines · Yinghai Lu

System that cpu support intel_pstate, acpi_cpufreq fail to load, and udev keep trying until trace get filled up and kernel crash.

The root cause is driver return ret from cpufreq_register_driver and when some other driver take over before, it would return EBUSY, then udev will keep trying...

Quoted 7 lines
Quoted 5 lines

cpufreq_register_driver should return EEXIST instead. then system could boot without appending intel_pstate=disable and still use intel_pstate.

Applied, thanks!

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
author
#3 lore raw
Quoted 14 lines · Rafael J. Wysocki
Quoted 13 lines · Viresh Kumar
Quoted 12 lines · Yinghai Lu

System that cpu support intel_pstate, acpi_cpufreq fail to load, and udev keep trying until trace get filled up and kernel crash.

The root cause is driver return ret from cpufreq_register_driver and when some other driver take over before, it would return EBUSY, then udev will keep trying...

cpufreq_register_driver should return EEXIST instead. then system could boot without appending intel_pstate=disable and still use intel_pstate.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Applied, thanks!

Sorry, looks like this one is not enough.

please let me know if you prefer me send addon patch or revised one.

Thanks

Yinghai

maintainer
#4 lore raw
Quoted 4 lines · Yinghai Lu

Sorry, looks like this one is not enough.

please let me know if you prefer me send addon patch or revised one.

Atleast you can let us know what the problem is? And then we can decide on that.. But anyway, you can send a new patch based over latest linux-next (which will have your original patch), and then leave it onto Rafael to merge it or have two patches.. (though I am quite sure he will not drop anything now, unless its too screwed.., at worst he might revert it..)..

author
#5 lore raw
Quoted 6 lines · Viresh Kumar
Quoted 4 lines · Yinghai Lu

Sorry, looks like this one is not enough.

please let me know if you prefer me send addon patch or revised one.

Quoted 6 lines

Atleast you can let us know what the problem is? And then we can decide on that.. But anyway, you can send a new patch based over latest linux-next (which will have your original patch), and then leave it onto Rafael to merge it or have two patches.. (though I am quite sure he will not drop anything now, unless its too screwed.., at worst he might revert it..)..

looks like the crash is intermittent..., so i thought that patch fixed the problem.
but later I found other suspicious print out.

please check new one:

https://patchwork.kernel.org/patch/2915181/

Thanks

Yinghai

#6 lore raw
Quoted 3 lines · Yinghai Lu
Quoted 2 lines · Viresh Kumar
Quoted 1 line · Yinghai Lu

Sorry, looks like this one is not enough.

Well, I've already applied this one and it makes sense to me anyway.

Quoted 10 lines
Quoted 9 lines
Quoted 2 lines

please let me know if you prefer me send addon patch or revised one.

Atleast you can let us know what the problem is? And then we can decide on that.. But anyway, you can send a new patch based over latest linux-next (which will have your original patch), and then leave it onto Rafael to merge it or have two patches.. (though I am quite sure he will not drop anything now, unless its too screwed.., at worst he might revert it..)..

Quoted 3 lines

looks like the crash is intermittent..., so i thought that patch fixed the problem.
but later I found other suspicious print out.

So, does it mean that the $subject patch fixes the issue for you to some extent, but more changes are necessary to make it go away completely?

Quoted 3 lines

please check new one:

https://patchwork.kernel.org/patch/2915181/

I see.

I *think* we can just drop the module requesting stuff entirely, because it doesn't seem to work anyway and udev is handling this for us.

Thanks,
Rafael

author
#7 lore raw
Quoted 6 lines · Rafael J. Wysocki
Quoted 3 lines · Yinghai Lu
Quoted 2 lines · Viresh Kumar
Quoted 1 line · Yinghai Lu

Sorry, looks like this one is not enough.

Well, I've already applied this one and it makes sense to me anyway.

you can keep that.

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 3 lines

please let me know if you prefer me send addon patch or revised one.

Atleast you can let us know what the problem is? And then we can decide on that.. But anyway, you can send a new patch based over latest linux-next (which will have your original patch), and then leave it onto Rafael to merge it or have two patches.. (though I am quite sure he will not drop anything now, unless its too screwed.., at worst he might revert it..)..

Quoted 6 lines
Quoted 3 lines

looks like the crash is intermittent..., so i thought that patch fixed the problem.
but later I found other suspicious print out.

So, does it mean that the $subject patch fixes the issue for you to some extent, but more changes are necessary to make it go away completely?

yes.

Quoted 9 lines
Quoted 4 lines

please check new one:

https://patchwork.kernel.org/patch/2915181/

I see.

I *think* we can just drop the module requesting stuff entirely, because it doesn't seem to work anyway and udev is handling this for us.

looks some nehalem/westmere based system may need it when they have several SSDTs. will double check that.

Thanks

Yinghai

author
#8 lore raw
Quoted 4 lines · Yinghai Lu
Quoted 3 lines

I *think* we can just drop the module requesting stuff entirely, because it doesn't seem to work anyway and udev is handling this for us.

Yes. looks like acpi_processor_load_module() is not needed. udev will do the work.

#9 lore raw
Quoted 7 lines · Yinghai Lu
Quoted 4 lines · Yinghai Lu
Quoted 3 lines

I *think* we can just drop the module requesting stuff entirely, because it doesn't seem to work anyway and udev is handling this for us.

Yes. looks like acpi_processor_load_module() is not needed. udev will do the work.

OK, I'll cut a patch to drop that stuff.

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.