Skip to content

Commit e8a91e0

Browse files
committed
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
2 parents 64aa90f + 396a343 commit e8a91e0

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

arch/powerpc/kernel/rtas_flash.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,17 +611,19 @@ static void rtas_flash_firmware(int reboot_type)
611611
for (f = flist; f; f = next) {
612612
/* Translate data addrs to absolute */
613613
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));
615615
image_size += f->blocks[i].length;
616+
f->blocks[i].length = cpu_to_be64(f->blocks[i].length);
616617
}
617618
next = f->next;
618619
/* Don't translate NULL pointer for last entry */
619620
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));
621622
else
622623
f->next = NULL;
623624
/* make num_blocks into the version/length field */
624625
f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
626+
f->num_blocks = cpu_to_be64(f->num_blocks);
625627
}
626628

627629
printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);

arch/powerpc/perf/core-book3s.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,9 @@ static void power_pmu_enable(struct pmu *pmu)
13071307
out_enable:
13081308
pmao_restore_workaround(ebb);
13091309

1310+
if (ppmu->flags & PPMU_ARCH_207S)
1311+
mtspr(SPRN_MMCR2, 0);
1312+
13101313
mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]);
13111314

13121315
mb();
@@ -1315,9 +1318,6 @@ static void power_pmu_enable(struct pmu *pmu)
13151318

13161319
write_mmcr0(cpuhw, mmcr0);
13171320

1318-
if (ppmu->flags & PPMU_ARCH_207S)
1319-
mtspr(SPRN_MMCR2, 0);
1320-
13211321
/*
13221322
* Enable instruction sampling if necessary
13231323
*/

arch/powerpc/platforms/powernv/opal-elog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,15 @@ static void elog_work_fn(struct work_struct *work)
249249

250250
rc = opal_get_elog_size(&id, &size, &type);
251251
if (rc != OPAL_SUCCESS) {
252-
pr_err("ELOG: Opal log read failed\n");
252+
pr_err("ELOG: OPAL log info read failed\n");
253253
return;
254254
}
255255

256256
elog_size = be64_to_cpu(size);
257257
log_id = be64_to_cpu(id);
258258
elog_type = be64_to_cpu(type);
259259

260-
BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
260+
WARN_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
261261

262262
if (elog_size >= OPAL_MAX_ERRLOG_SIZE)
263263
elog_size = OPAL_MAX_ERRLOG_SIZE;

0 commit comments

Comments
 (0)