|
@@ -445,7 +445,8 @@ static int dlpar_offline_cpu(struct device_node *dn)
|
|
int rc = 0;
|
|
int rc = 0;
|
|
unsigned int cpu;
|
|
unsigned int cpu;
|
|
int len, nthreads, i;
|
|
int len, nthreads, i;
|
|
- const u32 *intserv;
|
|
|
|
|
|
+ const __be32 *intserv;
|
|
|
|
+ u32 thread;
|
|
|
|
|
|
intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len);
|
|
intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", &len);
|
|
if (!intserv)
|
|
if (!intserv)
|
|
@@ -455,8 +456,9 @@ static int dlpar_offline_cpu(struct device_node *dn)
|
|
|
|
|
|
cpu_maps_update_begin();
|
|
cpu_maps_update_begin();
|
|
for (i = 0; i < nthreads; i++) {
|
|
for (i = 0; i < nthreads; i++) {
|
|
|
|
+ thread = be32_to_cpu(intserv[i]);
|
|
for_each_present_cpu(cpu) {
|
|
for_each_present_cpu(cpu) {
|
|
- if (get_hard_smp_processor_id(cpu) != intserv[i])
|
|
|
|
|
|
+ if (get_hard_smp_processor_id(cpu) != thread)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
if (get_cpu_current_state(cpu) == CPU_STATE_OFFLINE)
|
|
if (get_cpu_current_state(cpu) == CPU_STATE_OFFLINE)
|
|
@@ -478,14 +480,14 @@ static int dlpar_offline_cpu(struct device_node *dn)
|
|
* Upgrade it's state to CPU_STATE_OFFLINE.
|
|
* Upgrade it's state to CPU_STATE_OFFLINE.
|
|
*/
|
|
*/
|
|
set_preferred_offline_state(cpu, CPU_STATE_OFFLINE);
|
|
set_preferred_offline_state(cpu, CPU_STATE_OFFLINE);
|
|
- BUG_ON(plpar_hcall_norets(H_PROD, intserv[i])
|
|
|
|
|
|
+ BUG_ON(plpar_hcall_norets(H_PROD, thread)
|
|
!= H_SUCCESS);
|
|
!= H_SUCCESS);
|
|
__cpu_die(cpu);
|
|
__cpu_die(cpu);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
if (cpu == num_possible_cpus())
|
|
if (cpu == num_possible_cpus())
|
|
printk(KERN_WARNING "Could not find cpu to offline "
|
|
printk(KERN_WARNING "Could not find cpu to offline "
|
|
- "with physical id 0x%x\n", intserv[i]);
|
|
|
|
|
|
+ "with physical id 0x%x\n", thread);
|
|
}
|
|
}
|
|
cpu_maps_update_done();
|
|
cpu_maps_update_done();
|
|
|
|
|
|
@@ -497,15 +499,15 @@ out:
|
|
static ssize_t dlpar_cpu_release(const char *buf, size_t count)
|
|
static ssize_t dlpar_cpu_release(const char *buf, size_t count)
|
|
{
|
|
{
|
|
struct device_node *dn;
|
|
struct device_node *dn;
|
|
- const u32 *drc_index;
|
|
|
|
|
|
+ u32 drc_index;
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
dn = of_find_node_by_path(buf);
|
|
dn = of_find_node_by_path(buf);
|
|
if (!dn)
|
|
if (!dn)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- drc_index = of_get_property(dn, "ibm,my-drc-index", NULL);
|
|
|
|
- if (!drc_index) {
|
|
|
|
|
|
+ rc = of_property_read_u32(dn, "ibm,my-drc-index", &drc_index);
|
|
|
|
+ if (rc) {
|
|
of_node_put(dn);
|
|
of_node_put(dn);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -516,7 +518,7 @@ static ssize_t dlpar_cpu_release(const char *buf, size_t count)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- rc = dlpar_release_drc(*drc_index);
|
|
|
|
|
|
+ rc = dlpar_release_drc(drc_index);
|
|
if (rc) {
|
|
if (rc) {
|
|
of_node_put(dn);
|
|
of_node_put(dn);
|
|
return rc;
|
|
return rc;
|
|
@@ -524,7 +526,7 @@ static ssize_t dlpar_cpu_release(const char *buf, size_t count)
|
|
|
|
|
|
rc = dlpar_detach_node(dn);
|
|
rc = dlpar_detach_node(dn);
|
|
if (rc) {
|
|
if (rc) {
|
|
- dlpar_acquire_drc(*drc_index);
|
|
|
|
|
|
+ dlpar_acquire_drc(drc_index);
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|