Эх сурвалжийг харах

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
Linus Torvalds 11 жил өмнө
parent
commit
e8a91e0e87

+ 4 - 2
arch/powerpc/kernel/rtas_flash.c

@@ -611,17 +611,19 @@ static void rtas_flash_firmware(int reboot_type)
 	for (f = flist; f; f = next) {
 	for (f = flist; f; f = next) {
 		/* Translate data addrs to absolute */
 		/* Translate data addrs to absolute */
 		for (i = 0; i < f->num_blocks; i++) {
 		for (i = 0; i < f->num_blocks; i++) {
-			f->blocks[i].data = (char *)__pa(f->blocks[i].data);
+			f->blocks[i].data = (char *)cpu_to_be64(__pa(f->blocks[i].data));
 			image_size += f->blocks[i].length;
 			image_size += f->blocks[i].length;
+			f->blocks[i].length = cpu_to_be64(f->blocks[i].length);
 		}
 		}
 		next = f->next;
 		next = f->next;
 		/* Don't translate NULL pointer for last entry */
 		/* Don't translate NULL pointer for last entry */
 		if (f->next)
 		if (f->next)
-			f->next = (struct flash_block_list *)__pa(f->next);
+			f->next = (struct flash_block_list *)cpu_to_be64(__pa(f->next));
 		else
 		else
 			f->next = NULL;
 			f->next = NULL;
 		/* make num_blocks into the version/length field */
 		/* make num_blocks into the version/length field */
 		f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
 		f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
+		f->num_blocks = cpu_to_be64(f->num_blocks);
 	}
 	}
 
 
 	printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);
 	printk(KERN_ALERT "FLASH: flash image is %ld bytes\n", image_size);

+ 3 - 3
arch/powerpc/perf/core-book3s.c

@@ -1307,6 +1307,9 @@ static void power_pmu_enable(struct pmu *pmu)
  out_enable:
  out_enable:
 	pmao_restore_workaround(ebb);
 	pmao_restore_workaround(ebb);
 
 
+	if (ppmu->flags & PPMU_ARCH_207S)
+		mtspr(SPRN_MMCR2, 0);
+
 	mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]);
 	mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]);
 
 
 	mb();
 	mb();
@@ -1315,9 +1318,6 @@ static void power_pmu_enable(struct pmu *pmu)
 
 
 	write_mmcr0(cpuhw, mmcr0);
 	write_mmcr0(cpuhw, mmcr0);
 
 
-	if (ppmu->flags & PPMU_ARCH_207S)
-		mtspr(SPRN_MMCR2, 0);
-
 	/*
 	/*
 	 * Enable instruction sampling if necessary
 	 * Enable instruction sampling if necessary
 	 */
 	 */

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

@@ -249,7 +249,7 @@ static void elog_work_fn(struct work_struct *work)
 
 
 	rc = opal_get_elog_size(&id, &size, &type);
 	rc = opal_get_elog_size(&id, &size, &type);
 	if (rc != OPAL_SUCCESS) {
 	if (rc != OPAL_SUCCESS) {
-		pr_err("ELOG: Opal log read failed\n");
+		pr_err("ELOG: OPAL log info read failed\n");
 		return;
 		return;
 	}
 	}
 
 
@@ -257,7 +257,7 @@ static void elog_work_fn(struct work_struct *work)
 	log_id = be64_to_cpu(id);
 	log_id = be64_to_cpu(id);
 	elog_type = be64_to_cpu(type);
 	elog_type = be64_to_cpu(type);
 
 
-	BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
+	WARN_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
 
 
 	if (elog_size >= OPAL_MAX_ERRLOG_SIZE)
 	if (elog_size >= OPAL_MAX_ERRLOG_SIZE)
 		elog_size  =  OPAL_MAX_ERRLOG_SIZE;
 		elog_size  =  OPAL_MAX_ERRLOG_SIZE;