mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH] cpufreq: return EEXIST instead of EBUSY for second registering
Date: Wed, 18 Sep 2013 21:05:20 -0700	[thread overview]
Message-ID: <1379563520-7221-1-git-send-email-yinghai@kernel.org> (raw)

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.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/cpufreq/cpufreq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-2.6.orig/drivers/cpufreq/cpufreq.c
+++ 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);

             reply	other threads:[~2013-09-19  4:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19  4:05 Yinghai Lu [this message]
2013-09-19  4:08 ` Viresh Kumar
2013-09-19 22:37   ` Rafael J. Wysocki
2013-09-20  1:31     ` Yinghai Lu
2013-09-20  4:23       ` Viresh Kumar
2013-09-20  5:30         ` Yinghai Lu
2013-09-20 13:30           ` Rafael J. Wysocki
2013-09-20 17:12             ` Yinghai Lu
2013-09-20 19:30               ` Yinghai Lu
2013-09-20 20:16                 ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379563520-7221-1-git-send-email-yinghai@kernel.org \
    --to=yinghai@kernel.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®