From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core patches for 2.6.10-rc1
Date: Fri, 22 Oct 2004 16:09:32 -0700 [thread overview]
Message-ID: <1098486572164@kroah.com> (raw)
In-Reply-To: <10984865712455@kroah.com>
ChangeSet 1.2021, 2004/10/22 14:29:57-07:00, akpm@osdl.org
[PATCH] remove cpu_run_sbin_hotplug()
From: Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com>
Remove cpu_run_sbin_hotplug() - use kobject_hotplug() instead.
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/base/cpu.c | 2 ++
include/linux/kobject_uevent.h | 1 +
kernel/cpu.c | 35 -----------------------------------
lib/kobject_uevent.c | 2 ++
4 files changed, 5 insertions(+), 35 deletions(-)
diff -Nru a/drivers/base/cpu.c b/drivers/base/cpu.c
--- a/drivers/base/cpu.c 2004-10-22 15:59:52 -07:00
+++ b/drivers/base/cpu.c 2004-10-22 15:59:52 -07:00
@@ -32,6 +32,8 @@
switch (buf[0]) {
case '0':
ret = cpu_down(cpu->sysdev.id);
+ if (!ret)
+ kobject_hotplug(&dev->kobj, KOBJ_OFFLINE);
break;
case '1':
ret = cpu_up(cpu->sysdev.id);
diff -Nru a/include/linux/kobject_uevent.h b/include/linux/kobject_uevent.h
--- a/include/linux/kobject_uevent.h 2004-10-22 15:59:52 -07:00
+++ b/include/linux/kobject_uevent.h 2004-10-22 15:59:52 -07:00
@@ -22,6 +22,7 @@
KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* a sysfs attribute file has changed */
KOBJ_MOUNT = (__force kobject_action_t) 0x04, /* mount event for block devices */
KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices */
+ KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* offline event for hotplug devices */
};
diff -Nru a/kernel/cpu.c b/kernel/cpu.c
--- a/kernel/cpu.c 2004-10-22 15:59:52 -07:00
+++ b/kernel/cpu.c 2004-10-22 15:59:52 -07:00
@@ -57,34 +57,6 @@
write_unlock_irq(&tasklist_lock);
}
-/* Notify userspace when a cpu event occurs, by running '/sbin/hotplug
- * cpu' with certain environment variables set. */
-static int cpu_run_sbin_hotplug(unsigned int cpu, const char *action)
-{
- char *argv[3], *envp[6], cpu_str[12], action_str[32], devpath_str[40];
- int i;
-
- sprintf(cpu_str, "CPU=%d", cpu);
- sprintf(action_str, "ACTION=%s", action);
- sprintf(devpath_str, "DEVPATH=devices/system/cpu/cpu%d", cpu);
-
- i = 0;
- argv[i++] = hotplug_path;
- argv[i++] = "cpu";
- argv[i] = NULL;
-
- i = 0;
- /* minimal command environment */
- envp[i++] = "HOME=/";
- envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
- envp[i++] = cpu_str;
- envp[i++] = action_str;
- envp[i++] = devpath_str;
- envp[i] = NULL;
-
- return call_usermodehelper(argv[0], argv, envp, 0);
-}
-
/* Take this CPU down. */
static int take_cpu_down(void *unused)
{
@@ -170,8 +142,6 @@
check_for_tasks(cpu);
- cpu_run_sbin_hotplug(cpu, "offline");
-
out_thread:
err = kthread_stop(p);
out_allowed:
@@ -179,11 +149,6 @@
out:
unlock_cpu_hotplug();
return err;
-}
-#else
-static inline int cpu_run_sbin_hotplug(unsigned int cpu, const char *action)
-{
- return 0;
}
#endif /*CONFIG_HOTPLUG_CPU*/
diff -Nru a/lib/kobject_uevent.c b/lib/kobject_uevent.c
--- a/lib/kobject_uevent.c 2004-10-22 15:59:52 -07:00
+++ b/lib/kobject_uevent.c 2004-10-22 15:59:52 -07:00
@@ -36,6 +36,8 @@
return "mount";
case KOBJ_UMOUNT:
return "umount";
+ case KOBJ_OFFLINE:
+ return "offline";
default:
return NULL;
}
next prev parent reply other threads:[~2004-10-22 23:18 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-22 23:09 [BK PATCH] Driver Core patches for 2.6.10-rc1 Greg KH
2004-10-22 23:09 ` [PATCH] " Greg KH
2004-10-22 23:09 ` Greg KH
2004-10-22 23:09 ` Greg KH
2004-10-22 23:09 ` Greg KH
2004-10-22 23:09 ` Greg KH [this message]
2004-10-22 23:09 ` Greg KH
2004-10-22 23:09 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2004-11-01 21:54 [BK PATCH] " Greg KH
2004-11-01 21:57 ` [PATCH] " Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-01 21:57 ` Greg KH
2004-11-02 22:32 ` Russell King
2004-11-07 15:28 ` Russell King
2004-11-10 1:37 ` Greg KH
2004-11-10 2:57 ` Paul Mackerras
2004-11-10 8:36 ` Russell King
2004-11-10 21:36 ` Paul Mackerras
2004-11-11 0:00 ` Nigel Cunningham
2004-11-11 20:52 ` Russell King
2004-11-12 0:28 ` Greg KH
2004-11-01 23:44 ` Pozsar Balazs
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=1098486572164@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.