File powerpc-utils-bug-911679_dlpar_memory.patch of Package powerpc-utils.140
Commit 493bfdda30b61be46d7d71e5e7bb05df9334ba81 should have removed
some endian conversions included in previous commit. Unfortunately,
they were not removed, causing problems when hotplugging memory.
This patch removes those endian conversions.
Signed-off-by: Thomas Falcon <tlfalcon@...>
---
src/drmgr/drslot_chrp_mem.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
Index: powerpc-utils-1.2.22/src/drmgr/drslot_chrp_mem.c
===================================================================
--- powerpc-utils-1.2.22.orig/src/drmgr/drslot_chrp_mem.c
+++ powerpc-utils-1.2.22/src/drmgr/drslot_chrp_mem.c
@@ -298,13 +298,8 @@ get_dynamic_reconfig_lmbs(struct lmb_lis
for (i = 0; i < num_entries; i++) {
struct dr_node *lmb;
- /* convert for LE systems */
- drmem->address = be64toh(drmem->address);
- drmem->drc_index = be32toh(drmem->drc_index);
- drmem->flags = be32toh(drmem->flags);
-
for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) {
- if (lmb->drc_index == drmem->drc_index)
+ if (lmb->drc_index == be32toh(drmem->drc_index))
break;
}
@@ -317,9 +312,9 @@ get_dynamic_reconfig_lmbs(struct lmb_lis
sprintf(lmb->ofdt_path, DYNAMIC_RECONFIG_MEM);
lmb->lmb_size = lmb_sz;
- lmb->lmb_address = drmem->address;
+ lmb->lmb_address = be64toh(drmem->address);
- if (drmem->flags & DRMEM_ASSIGNED) {
+ if (be32toh(drmem->flags) & DRMEM_ASSIGNED) {
found++;
lmb->is_owned = 1;
@@ -576,19 +571,15 @@ update_drconf_node(struct dr_node *lmb,
for (i = 0; i < entries; i++) {
- /* convert for LE systems */
- drmem->drc_index = be32toh(drmem->drc_index);
- drmem->flags = be32toh(drmem->flags);
-
- if (drmem->drc_index != lmb->drc_index) {
+ if (be32toh(drmem->drc_index) != lmb->drc_index) {
drmem++;
continue;
}
if (action == ADD)
- drmem->flags |= DRMEM_ASSIGNED;
+ drmem->flags |= be32toh(DRMEM_ASSIGNED);
else
- drmem->flags &= ~DRMEM_ASSIGNED;
+ drmem->flags &= be32toh(~DRMEM_ASSIGNED);
break;
}