powerpc+of: Add of node/property notification chain for adds and removes
This patch moves the notification chain for updates to the device tree from the powerpc/pseries code to the base OF code. This makes this functionality available to all architectures. Additionally the notification chain is updated to allow notifications for property add/remove/update. To make this work a pointer to a new struct (of_prop_reconfig) is passed to the routines in the notification chain. The of_prop_reconfig property contains a pointer to the node containing the property and a pointer to the property itself. In the case of property updates, the property pointer refers to the new property. Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:

committed by
Benjamin Herrenschmidt

parent
f594972083
commit
1cf3d8b3d2
@@ -23,12 +23,12 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/sched.h> /* for idle_task_exit */
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/of.h>
|
||||
#include <asm/prom.h>
|
||||
#include <asm/rtas.h>
|
||||
#include <asm/firmware.h>
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/vdso_datapage.h>
|
||||
#include <asm/pSeries_reconfig.h>
|
||||
#include <asm/xics.h>
|
||||
#include "plpar_wrappers.h"
|
||||
#include "offline_states.h"
|
||||
@@ -333,10 +333,10 @@ static int pseries_smp_notifier(struct notifier_block *nb,
|
||||
int err = 0;
|
||||
|
||||
switch (action) {
|
||||
case PSERIES_RECONFIG_ADD:
|
||||
case OF_RECONFIG_ATTACH_NODE:
|
||||
err = pseries_add_processor(node);
|
||||
break;
|
||||
case PSERIES_RECONFIG_REMOVE:
|
||||
case OF_RECONFIG_DETACH_NODE:
|
||||
pseries_remove_processor(node);
|
||||
break;
|
||||
}
|
||||
@@ -399,7 +399,7 @@ static int __init pseries_cpu_hotplug_init(void)
|
||||
|
||||
/* Processors can be added/removed only on LPAR */
|
||||
if (firmware_has_feature(FW_FEATURE_LPAR)) {
|
||||
pSeries_reconfig_notifier_register(&pseries_smp_nb);
|
||||
of_reconfig_notifier_register(&pseries_smp_nb);
|
||||
cpu_maps_update_begin();
|
||||
if (cede_offline_enabled && parse_cede_parameters() == 0) {
|
||||
default_offline_state = CPU_STATE_INACTIVE;
|
||||
|
Reference in New Issue
Block a user