Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

Pull powerpc fixes from Ben Herrenschmidt:
"Here are 3 more small powerpc fixes that should still go into .16.

One is a recent regression (MMCR2 business), the other is a trivial
endian fix without which FW updates won't work on LE in IBM machines,
and the 3rd one turns a BUG_ON into a WARN_ON which is definitely a
LOT more friendly especially when the whole thing is about retrieving
error logs ..."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
powerpc: Fix endianness of flash_block_list in rtas_flash
powerpc/powernv: Change BUG_ON to WARN_ON in elog code
powerpc/perf: Fix MMCR2 handling for EBB

+9 -7
+4 -2
arch/powerpc/kernel/rtas_flash.c
··· 611 611 for (f = flist; f; f = next) { 612 612 /* Translate data addrs to absolute */ 613 613 for (i = 0; i < f->num_blocks; i++) { 614 - f->blocks[i].data = (char *)__pa(f->blocks[i].data); 614 + f->blocks[i].data = (char *)cpu_to_be64(__pa(f->blocks[i].data)); 615 615 image_size += f->blocks[i].length; 616 + f->blocks[i].length = cpu_to_be64(f->blocks[i].length); 616 617 } 617 618 next = f->next; 618 619 /* Don't translate NULL pointer for last entry */ 619 620 if (f->next) 620 - f->next = (struct flash_block_list *)__pa(f->next); 621 + f->next = (struct flash_block_list *)cpu_to_be64(__pa(f->next)); 621 622 else 622 623 f->next = NULL; 623 624 /* make num_blocks into the version/length field */ 624 625 f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16); 626 + f->num_blocks = cpu_to_be64(f->num_blocks); 625 627 } 626 628 627 629 printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);
+3 -3
arch/powerpc/perf/core-book3s.c
··· 1307 1307 out_enable: 1308 1308 pmao_restore_workaround(ebb); 1309 1309 1310 + if (ppmu->flags & PPMU_ARCH_207S) 1311 + mtspr(SPRN_MMCR2, 0); 1312 + 1310 1313 mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]); 1311 1314 1312 1315 mb(); ··· 1317 1314 ppmu->config_bhrb(cpuhw->bhrb_filter); 1318 1315 1319 1316 write_mmcr0(cpuhw, mmcr0); 1320 - 1321 - if (ppmu->flags & PPMU_ARCH_207S) 1322 - mtspr(SPRN_MMCR2, 0); 1323 1317 1324 1318 /* 1325 1319 * Enable instruction sampling if necessary
+2 -2
arch/powerpc/platforms/powernv/opal-elog.c
··· 249 249 250 250 rc = opal_get_elog_size(&id, &size, &type); 251 251 if (rc != OPAL_SUCCESS) { 252 - pr_err("ELOG: Opal log read failed\n"); 252 + pr_err("ELOG: OPAL log info read failed\n"); 253 253 return; 254 254 } 255 255 ··· 257 257 log_id = be64_to_cpu(id); 258 258 elog_type = be64_to_cpu(type); 259 259 260 - BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE); 260 + WARN_ON(elog_size > OPAL_MAX_ERRLOG_SIZE); 261 261 262 262 if (elog_size >= OPAL_MAX_ERRLOG_SIZE) 263 263 elog_size = OPAL_MAX_ERRLOG_SIZE;