Просмотр исходного кода

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

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc: Add missing sparsemem.h include
  powerpc/pci: mmap anonymous memory when legacy_mem doesn't exist
  powerpc/cell: Add missing #include for oprofile
  powerpc/ftrace: Fix math to calculate offset in TOC
  powerpc: Don't emulate mr. instructions
  powerpc/fsl-booke: Fix mapping functions to use phys_addr_t
  arch/powerpc: Eliminate double sizeof
  powerpc/cpm2: Fix set interrupt type
  powerpc/83xx: Fix TSEC0 workability on MPC8313E-RDB boards
  powerpc/83xx: Fix missing #{address,size}-cells in mpc8313erdb.dts
  powerpc/83xx: Build breakage for CONFIG_PM but no CONFIG_SUSPEND
Linus Torvalds 16 лет назад
Родитель
Сommit
c36c63c511

+ 4 - 7
arch/powerpc/boot/dts/mpc8313erdb.dts

@@ -191,7 +191,8 @@
 			interrupts = <37 0x8 36 0x8 35 0x8>;
 			interrupts = <37 0x8 36 0x8 35 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
 			tbi-handle = < &tbi0 >;
 			tbi-handle = < &tbi0 >;
-			phy-handle = < &phy1 >;
+			/* Vitesse 7385 isn't on the MDIO bus */
+			fixed-link = <1 1 1000 0 0>;
 			fsl,magic-packet;
 			fsl,magic-packet;
 
 
 			mdio@24520 {
 			mdio@24520 {
@@ -199,12 +200,6 @@
 				#size-cells = <0>;
 				#size-cells = <0>;
 				compatible = "fsl,gianfar-mdio";
 				compatible = "fsl,gianfar-mdio";
 				reg = <0x24520 0x20>;
 				reg = <0x24520 0x20>;
-				phy1: ethernet-phy@1 {
-					interrupt-parent = <&ipic>;
-					interrupts = <19 0x8>;
-					reg = <0x1>;
-					device_type = "ethernet-phy";
-				};
 				phy4: ethernet-phy@4 {
 				phy4: ethernet-phy@4 {
 					interrupt-parent = <&ipic>;
 					interrupt-parent = <&ipic>;
 					interrupts = <20 0x8>;
 					interrupts = <20 0x8>;
@@ -219,6 +214,8 @@
 		};
 		};
 
 
 		enet1: ethernet@25000 {
 		enet1: ethernet@25000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
 			cell-index = <1>;
 			cell-index = <1>;
 			device_type = "network";
 			device_type = "network";
 			model = "eTSEC";
 			model = "eTSEC";

+ 1 - 1
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig

@@ -651,7 +651,7 @@ CONFIG_CICADA_PHY=y
 # CONFIG_NATIONAL_PHY is not set
 # CONFIG_NATIONAL_PHY is not set
 # CONFIG_STE10XP is not set
 # CONFIG_STE10XP is not set
 # CONFIG_LSI_ET1011C_PHY is not set
 # CONFIG_LSI_ET1011C_PHY is not set
-# CONFIG_FIXED_PHY is not set
+CONFIG_FIXED_PHY=y
 # CONFIG_MDIO_BITBANG is not set
 # CONFIG_MDIO_BITBANG is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 CONFIG_MII=y

+ 3 - 2
arch/powerpc/kernel/ftrace.c

@@ -195,8 +195,9 @@ __ftrace_make_nop(struct module *mod,
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
-	offset = (unsigned)((unsigned short)jmp[0]) << 16 |
-		(unsigned)((unsigned short)jmp[1]);
+	/* The bottom half is signed extended */
+	offset = ((unsigned)((unsigned short)jmp[0]) << 16) +
+		(int)((short)jmp[1]);
 
 
 	DEBUGP(" %x ", offset);
 	DEBUGP(" %x ", offset);
 
 

+ 15 - 2
arch/powerpc/kernel/pci-common.c

@@ -561,8 +561,21 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus,
 		 (unsigned long long)(offset + size - 1));
 		 (unsigned long long)(offset + size - 1));
 
 
 	if (mmap_state == pci_mmap_mem) {
 	if (mmap_state == pci_mmap_mem) {
-		if ((offset + size) > hose->isa_mem_size)
-			return -ENXIO;
+		/* Hack alert !
+		 *
+		 * Because X is lame and can fail starting if it gets an error trying
+		 * to mmap legacy_mem (instead of just moving on without legacy memory
+		 * access) we fake it here by giving it anonymous memory, effectively
+		 * behaving just like /dev/zero
+		 */
+		if ((offset + size) > hose->isa_mem_size) {
+			printk(KERN_DEBUG
+			       "Process %s (pid:%d) mapped non-existing PCI legacy memory for 0%04x:%02x\n",
+			       current->comm, current->pid, pci_domain_nr(bus), bus->number);
+			if (vma->vm_flags & VM_SHARED)
+				return shmem_zero_setup(vma);
+			return 0;
+		}
 		offset += hose->isa_mem_phys;
 		offset += hose->isa_mem_phys;
 	} else {
 	} else {
 		unsigned long io_offset = (unsigned long)hose->io_base_virt - _IO_BASE;
 		unsigned long io_offset = (unsigned long)hose->io_base_virt - _IO_BASE;

+ 2 - 0
arch/powerpc/lib/sstep.c

@@ -172,6 +172,8 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 			}
 			}
 			break;
 			break;
 		case 0x378:	/* orx */
 		case 0x378:	/* orx */
+			if (instr & 1)
+				break;
 			rs = (instr >> 21) & 0x1f;
 			rs = (instr >> 21) & 0x1f;
 			rb = (instr >> 11) & 0x1f;
 			rb = (instr >> 11) & 0x1f;
 			if (rs == rb) {		/* mr */
 			if (rs == rb) {		/* mr */

+ 2 - 2
arch/powerpc/mm/fsl_booke_mmu.c

@@ -73,7 +73,7 @@ extern unsigned int tlbcam_index;
 /*
 /*
  * Return PA for this VA if it is mapped by a CAM, or 0
  * Return PA for this VA if it is mapped by a CAM, or 0
  */
  */
-unsigned long v_mapped_by_tlbcam(unsigned long va)
+phys_addr_t v_mapped_by_tlbcam(unsigned long va)
 {
 {
 	int b;
 	int b;
 	for (b = 0; b < tlbcam_index; ++b)
 	for (b = 0; b < tlbcam_index; ++b)
@@ -85,7 +85,7 @@ unsigned long v_mapped_by_tlbcam(unsigned long va)
 /*
 /*
  * Return VA for a given PA or 0 if not mapped
  * Return VA for a given PA or 0 if not mapped
  */
  */
-unsigned long p_mapped_by_tlbcam(unsigned long pa)
+unsigned long p_mapped_by_tlbcam(phys_addr_t pa)
 {
 {
 	int b;
 	int b;
 	for (b = 0; b < tlbcam_index; ++b)
 	for (b = 0; b < tlbcam_index; ++b)

+ 2 - 2
arch/powerpc/mm/pgtable_32.c

@@ -61,8 +61,8 @@ void setbat(int index, unsigned long virt, phys_addr_t phys,
 
 
 #ifdef HAVE_TLBCAM
 #ifdef HAVE_TLBCAM
 extern unsigned int tlbcam_index;
 extern unsigned int tlbcam_index;
-extern unsigned long v_mapped_by_tlbcam(unsigned long va);
-extern unsigned long p_mapped_by_tlbcam(unsigned long pa);
+extern phys_addr_t v_mapped_by_tlbcam(unsigned long va);
+extern unsigned long p_mapped_by_tlbcam(phys_addr_t pa);
 #else /* !HAVE_TLBCAM */
 #else /* !HAVE_TLBCAM */
 #define v_mapped_by_tlbcam(x)	(0UL)
 #define v_mapped_by_tlbcam(x)	(0UL)
 #define p_mapped_by_tlbcam(x)	(0UL)
 #define p_mapped_by_tlbcam(x)	(0UL)

+ 1 - 0
arch/powerpc/oprofile/cell/spu_profiler.c

@@ -16,6 +16,7 @@
 #include <linux/smp.h>
 #include <linux/smp.h>
 #include <linux/slab.h>
 #include <linux/slab.h>
 #include <asm/cell-pmu.h>
 #include <asm/cell-pmu.h>
+#include <asm/time.h>
 #include "pr_util.h"
 #include "pr_util.h"
 
 
 #define SCALE_SHIFT 14
 #define SCALE_SHIFT 14

+ 1 - 1
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c

@@ -186,7 +186,7 @@ out_unmap_regs:
 	iounmap(priv->regs);
 	iounmap(priv->regs);
 out_free_bootmem:
 out_free_bootmem:
 	free_bootmem((unsigned long)priv,
 	free_bootmem((unsigned long)priv,
-	             sizeof(sizeof(struct pq2ads_pci_pic)));
+	             sizeof(struct pq2ads_pci_pic));
 	of_node_put(np);
 	of_node_put(np);
 out_unmap_irq:
 out_unmap_irq:
 	irq_dispose_mapping(irq);
 	irq_dispose_mapping(irq);

+ 1 - 0
arch/powerpc/platforms/pseries/hotplug-memory.c

@@ -14,6 +14,7 @@
 #include <asm/firmware.h>
 #include <asm/firmware.h>
 #include <asm/machdep.h>
 #include <asm/machdep.h>
 #include <asm/pSeries_reconfig.h>
 #include <asm/pSeries_reconfig.h>
+#include <asm/sparsemem.h>
 
 
 static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size)
 static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size)
 {
 {

+ 1 - 1
arch/powerpc/sysdev/cpm2_pic.c

@@ -165,7 +165,7 @@ static int cpm2_set_irq_type(unsigned int virq, unsigned int flow_type)
 			edibit = (14 - (src - CPM2_IRQ_EXT1));
 			edibit = (14 - (src - CPM2_IRQ_EXT1));
 	else
 	else
 		if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0)
 		if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0)
-			edibit = (31 - (src - CPM2_IRQ_PORTC15));
+			edibit = (31 - (CPM2_IRQ_PORTC0 - src));
 		else
 		else
 			return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL;
 			return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL;
 
 

+ 1 - 1
arch/powerpc/sysdev/ipic.c

@@ -890,7 +890,7 @@ unsigned int ipic_get_irq(void)
 	return irq_linear_revmap(primary_ipic->irqhost, irq);
 	return irq_linear_revmap(primary_ipic->irqhost, irq);
 }
 }
 
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_SUSPEND
 static struct {
 static struct {
 	u32 sicfr;
 	u32 sicfr;
 	u32 siprr[2];
 	u32 siprr[2];