[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120105154515.6e40fadf.akpm@linux-foundation.org>
Date: Thu, 5 Jan 2012 15:45:15 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Greg KH <greg@...ah.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
Kay Sievers <kay.sievers@...y.org>,
Michael Holzheu <holzheu@...ux.vnet.ibm.com>
Subject: Re: linux-next: build failure after merge of the akpm tree
On Thu, 5 Jan 2012 15:19:58 -0800
Greg KH <greg@...ah.com> wrote:
> On Thu, Jan 05, 2012 at 06:29:37PM +1100, Stephen Rothwell wrote:
> > Hi Andrew,
> >
> > After merging the akpm tree, today's linux-next build (powerpc
> > ppc64_defconfig) failed like this:
> >
> > drivers/base/memory.c: In function 'memory_block_change_state':
> > drivers/base/memory.c:306:22: error: 'struct memory_block' has no member named 'sysdev'
> > drivers/base/memory.c:309:22: error: 'struct memory_block' has no member named 'sysdev'
> >
> > Caused by commit 2691cc121386 ("kdump: add udev events for memory
> > online/offline") interacting with commit 10fbcf4c6cb1 ("convert 'memory'
> > sysdev_class to a regular subsystem") from the driver-core tree.
>
> I can't recall this kdump patch coming through before, have I seen it?
I carefully added you to the Nov 22 commit email cc list :(
> creating new uevents is not something to be done lightly, has this been
> tested with the existing userspace tools to make sure it doesn't cause
> problems?
Seems to be covered in the changelog:
From: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
Subject: kdump: add udev events for memory online/offline
Currently no udev events for memory hotplug "online" and "offline" are
generated:
# udevadm monitor
# echo offline > /sys/devices/system/memory/memory4/state
==> No event
When kdump is loaded, kexec detects the current memory configuration and
stores it in the pre-allocated ELF core header. Therefore, for kdump it
is necessary to reload the kdump kernel with kexec when the memory
configuration changes (e.g. for online/offline hotplug memory).
In order to do this automatically, udev rules should be used. This kernel
patch adds udev events for "online" and "offline". Together with this
kernel patch, the following udev rules for online/offline have to be added
to "/etc/udev/rules.d/98-kexec.rules":
SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"
Signed-off-by: Michael Holzheu <holzheu@...ux.vnet.ibm.com>
Cc: Heiko Carstens <heiko.carstens@...ibm.com>
Cc: Vivek Goyal <vgoyal@...hat.com>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: Kay Sievers <kay.sievers@...y.org>
Cc: Dave Hansen <haveblue@...ibm.com>
Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
Cc: Greg KH <greg@...ah.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
drivers/base/memory.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff -puN drivers/base/memory.c~kdump-add-udev-events-for-memory-online-offline drivers/base/memory.c
--- a/drivers/base/memory.c~kdump-add-udev-events-for-memory-online-offline
+++ a/drivers/base/memory.c
@@ -313,11 +313,22 @@ static int memory_block_change_state(str
ret = memory_block_action(mem->start_section_nr, to_state);
- if (ret)
+ if (ret) {
mem->state = from_state_req;
- else
- mem->state = to_state;
+ goto out;
+ }
+ mem->state = to_state;
+ switch (mem->state) {
+ case MEM_OFFLINE:
+ kobject_uevent(&mem->sysdev.kobj, KOBJ_OFFLINE);
+ break;
+ case MEM_ONLINE:
+ kobject_uevent(&mem->sysdev.kobj, KOBJ_ONLINE);
+ break;
+ default:
+ break;
+ }
out:
mutex_unlock(&mem->state_mutex);
return ret;
_
--
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