diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-01 12:33:46 -0400 |
commit | 0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch) | |
tree | 41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /arch/powerpc/platforms | |
parent | aa877175e7a9982233ed8f10cb4bfddd78d82741 (diff) | |
parent | 3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff) |
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/iommu.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-irqchip.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/opal.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 32 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-memory.c | 26 |
6 files changed, 45 insertions, 26 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 5be15cff758d..2975754c65ea 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -496,8 +496,10 @@ spufs_mkgang(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
496 | gang = alloc_spu_gang(); | 496 | gang = alloc_spu_gang(); |
497 | SPUFS_I(inode)->i_ctx = NULL; | 497 | SPUFS_I(inode)->i_ctx = NULL; |
498 | SPUFS_I(inode)->i_gang = gang; | 498 | SPUFS_I(inode)->i_gang = gang; |
499 | if (!gang) | 499 | if (!gang) { |
500 | ret = -ENOMEM; | ||
500 | goto out_iput; | 501 | goto out_iput; |
502 | } | ||
501 | 503 | ||
502 | inode->i_op = &simple_dir_inode_operations; | 504 | inode->i_op = &simple_dir_inode_operations; |
503 | inode->i_fop = &simple_dir_operations; | 505 | inode->i_fop = &simple_dir_operations; |
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c index 309d9ccccd50..c61667e8bb06 100644 --- a/arch/powerpc/platforms/pasemi/iommu.c +++ b/arch/powerpc/platforms/pasemi/iommu.c | |||
@@ -187,6 +187,11 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev) | |||
187 | if (dev->vendor == 0x1959 && dev->device == 0xa007 && | 187 | if (dev->vendor == 0x1959 && dev->device == 0xa007 && |
188 | !firmware_has_feature(FW_FEATURE_LPAR)) { | 188 | !firmware_has_feature(FW_FEATURE_LPAR)) { |
189 | dev->dev.archdata.dma_ops = &dma_direct_ops; | 189 | dev->dev.archdata.dma_ops = &dma_direct_ops; |
190 | /* | ||
191 | * Set the coherent DMA mask to prevent the iommu | ||
192 | * being used unnecessarily | ||
193 | */ | ||
194 | dev->dev.coherent_dma_mask = DMA_BIT_MASK(44); | ||
190 | return; | 195 | return; |
191 | } | 196 | } |
192 | #endif | 197 | #endif |
diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c index e505223b4ec5..ed8bba68a162 100644 --- a/arch/powerpc/platforms/powernv/opal-irqchip.c +++ b/arch/powerpc/platforms/powernv/opal-irqchip.c | |||
@@ -228,7 +228,8 @@ int __init opal_event_init(void) | |||
228 | } | 228 | } |
229 | 229 | ||
230 | /* Install interrupt handler */ | 230 | /* Install interrupt handler */ |
231 | rc = request_irq(virq, opal_interrupt, 0, "opal", NULL); | 231 | rc = request_irq(virq, opal_interrupt, IRQF_TRIGGER_LOW, |
232 | "opal", NULL); | ||
232 | if (rc) { | 233 | if (rc) { |
233 | irq_dispose_mapping(virq); | 234 | irq_dispose_mapping(virq); |
234 | pr_warn("Error %d requesting irq %d (0x%x)\n", | 235 | pr_warn("Error %d requesting irq %d (0x%x)\n", |
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 8b4fc68cebcb..6c9a65b52e63 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c | |||
@@ -399,6 +399,7 @@ static int opal_recover_mce(struct pt_regs *regs, | |||
399 | 399 | ||
400 | if (!(regs->msr & MSR_RI)) { | 400 | if (!(regs->msr & MSR_RI)) { |
401 | /* If MSR_RI isn't set, we cannot recover */ | 401 | /* If MSR_RI isn't set, we cannot recover */ |
402 | pr_err("Machine check interrupt unrecoverable: MSR(RI=0)\n"); | ||
402 | recovered = 0; | 403 | recovered = 0; |
403 | } else if (evt->disposition == MCE_DISPOSITION_RECOVERED) { | 404 | } else if (evt->disposition == MCE_DISPOSITION_RECOVERED) { |
404 | /* Platform corrected itself */ | 405 | /* Platform corrected itself */ |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 6b9528307f62..fd9444f9fb0c 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -111,10 +111,17 @@ static int __init iommu_setup(char *str) | |||
111 | } | 111 | } |
112 | early_param("iommu", iommu_setup); | 112 | early_param("iommu", iommu_setup); |
113 | 113 | ||
114 | static inline bool pnv_pci_is_mem_pref_64(unsigned long flags) | 114 | static inline bool pnv_pci_is_m64(struct pnv_phb *phb, struct resource *r) |
115 | { | 115 | { |
116 | return ((flags & (IORESOURCE_MEM_64 | IORESOURCE_PREFETCH)) == | 116 | /* |
117 | (IORESOURCE_MEM_64 | IORESOURCE_PREFETCH)); | 117 | * WARNING: We cannot rely on the resource flags. The Linux PCI |
118 | * allocation code sometimes decides to put a 64-bit prefetchable | ||
119 | * BAR in the 32-bit window, so we have to compare the addresses. | ||
120 | * | ||
121 | * For simplicity we only test resource start. | ||
122 | */ | ||
123 | return (r->start >= phb->ioda.m64_base && | ||
124 | r->start < (phb->ioda.m64_base + phb->ioda.m64_size)); | ||
118 | } | 125 | } |
119 | 126 | ||
120 | static struct pnv_ioda_pe *pnv_ioda_init_pe(struct pnv_phb *phb, int pe_no) | 127 | static struct pnv_ioda_pe *pnv_ioda_init_pe(struct pnv_phb *phb, int pe_no) |
@@ -229,7 +236,7 @@ static void pnv_ioda_reserve_dev_m64_pe(struct pci_dev *pdev, | |||
229 | sgsz = phb->ioda.m64_segsize; | 236 | sgsz = phb->ioda.m64_segsize; |
230 | for (i = 0; i <= PCI_ROM_RESOURCE; i++) { | 237 | for (i = 0; i <= PCI_ROM_RESOURCE; i++) { |
231 | r = &pdev->resource[i]; | 238 | r = &pdev->resource[i]; |
232 | if (!r->parent || !pnv_pci_is_mem_pref_64(r->flags)) | 239 | if (!r->parent || !pnv_pci_is_m64(phb, r)) |
233 | continue; | 240 | continue; |
234 | 241 | ||
235 | start = _ALIGN_DOWN(r->start - base, sgsz); | 242 | start = _ALIGN_DOWN(r->start - base, sgsz); |
@@ -1877,7 +1884,7 @@ static void pnv_pci_phb3_tce_invalidate(struct pnv_ioda_pe *pe, bool rm, | |||
1877 | unsigned shift, unsigned long index, | 1884 | unsigned shift, unsigned long index, |
1878 | unsigned long npages) | 1885 | unsigned long npages) |
1879 | { | 1886 | { |
1880 | __be64 __iomem *invalidate = pnv_ioda_get_inval_reg(pe->phb, false); | 1887 | __be64 __iomem *invalidate = pnv_ioda_get_inval_reg(pe->phb, rm); |
1881 | unsigned long start, end, inc; | 1888 | unsigned long start, end, inc; |
1882 | 1889 | ||
1883 | /* We'll invalidate DMA address in PE scope */ | 1890 | /* We'll invalidate DMA address in PE scope */ |
@@ -2863,7 +2870,7 @@ static void pnv_pci_ioda_fixup_iov_resources(struct pci_dev *pdev) | |||
2863 | res = &pdev->resource[i + PCI_IOV_RESOURCES]; | 2870 | res = &pdev->resource[i + PCI_IOV_RESOURCES]; |
2864 | if (!res->flags || res->parent) | 2871 | if (!res->flags || res->parent) |
2865 | continue; | 2872 | continue; |
2866 | if (!pnv_pci_is_mem_pref_64(res->flags)) { | 2873 | if (!pnv_pci_is_m64(phb, res)) { |
2867 | dev_warn(&pdev->dev, "Don't support SR-IOV with" | 2874 | dev_warn(&pdev->dev, "Don't support SR-IOV with" |
2868 | " non M64 VF BAR%d: %pR. \n", | 2875 | " non M64 VF BAR%d: %pR. \n", |
2869 | i, res); | 2876 | i, res); |
@@ -2958,7 +2965,7 @@ static void pnv_ioda_setup_pe_res(struct pnv_ioda_pe *pe, | |||
2958 | index++; | 2965 | index++; |
2959 | } | 2966 | } |
2960 | } else if ((res->flags & IORESOURCE_MEM) && | 2967 | } else if ((res->flags & IORESOURCE_MEM) && |
2961 | !pnv_pci_is_mem_pref_64(res->flags)) { | 2968 | !pnv_pci_is_m64(phb, res)) { |
2962 | region.start = res->start - | 2969 | region.start = res->start - |
2963 | phb->hose->mem_offset[0] - | 2970 | phb->hose->mem_offset[0] - |
2964 | phb->ioda.m32_pci_base; | 2971 | phb->ioda.m32_pci_base; |
@@ -3083,9 +3090,12 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus, | |||
3083 | bridge = bridge->bus->self; | 3090 | bridge = bridge->bus->self; |
3084 | } | 3091 | } |
3085 | 3092 | ||
3086 | /* We fail back to M32 if M64 isn't supported */ | 3093 | /* |
3087 | if (phb->ioda.m64_segsize && | 3094 | * We fall back to M32 if M64 isn't supported. We enforce the M64 |
3088 | pnv_pci_is_mem_pref_64(type)) | 3095 | * alignment for any 64-bit resource, PCIe doesn't care and |
3096 | * bridges only do 64-bit prefetchable anyway. | ||
3097 | */ | ||
3098 | if (phb->ioda.m64_segsize && (type & IORESOURCE_MEM_64)) | ||
3089 | return phb->ioda.m64_segsize; | 3099 | return phb->ioda.m64_segsize; |
3090 | if (type & IORESOURCE_MEM) | 3100 | if (type & IORESOURCE_MEM) |
3091 | return phb->ioda.m32_segsize; | 3101 | return phb->ioda.m32_segsize; |
@@ -3125,7 +3135,7 @@ static void pnv_pci_fixup_bridge_resources(struct pci_bus *bus, | |||
3125 | w = NULL; | 3135 | w = NULL; |
3126 | if (r->flags & type & IORESOURCE_IO) | 3136 | if (r->flags & type & IORESOURCE_IO) |
3127 | w = &hose->io_resource; | 3137 | w = &hose->io_resource; |
3128 | else if (pnv_pci_is_mem_pref_64(r->flags) && | 3138 | else if (pnv_pci_is_m64(phb, r) && |
3129 | (type & IORESOURCE_PREFETCH) && | 3139 | (type & IORESOURCE_PREFETCH) && |
3130 | phb->ioda.m64_segsize) | 3140 | phb->ioda.m64_segsize) |
3131 | w = &hose->mem_resources[1]; | 3141 | w = &hose->mem_resources[1]; |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 43f7beb2902d..76ec104e88be 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -320,19 +320,6 @@ static int dlpar_remove_device_tree_lmb(struct of_drconf_cell *lmb) | |||
320 | return dlpar_update_device_tree_lmb(lmb); | 320 | return dlpar_update_device_tree_lmb(lmb); |
321 | } | 321 | } |
322 | 322 | ||
323 | static struct memory_block *lmb_to_memblock(struct of_drconf_cell *lmb) | ||
324 | { | ||
325 | unsigned long section_nr; | ||
326 | struct mem_section *mem_sect; | ||
327 | struct memory_block *mem_block; | ||
328 | |||
329 | section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr)); | ||
330 | mem_sect = __nr_to_section(section_nr); | ||
331 | |||
332 | mem_block = find_memory_block(mem_sect); | ||
333 | return mem_block; | ||
334 | } | ||
335 | |||
336 | #ifdef CONFIG_MEMORY_HOTREMOVE | 323 | #ifdef CONFIG_MEMORY_HOTREMOVE |
337 | static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size) | 324 | static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size) |
338 | { | 325 | { |
@@ -420,6 +407,19 @@ static bool lmb_is_removable(struct of_drconf_cell *lmb) | |||
420 | 407 | ||
421 | static int dlpar_add_lmb(struct of_drconf_cell *); | 408 | static int dlpar_add_lmb(struct of_drconf_cell *); |
422 | 409 | ||
410 | static struct memory_block *lmb_to_memblock(struct of_drconf_cell *lmb) | ||
411 | { | ||
412 | unsigned long section_nr; | ||
413 | struct mem_section *mem_sect; | ||
414 | struct memory_block *mem_block; | ||
415 | |||
416 | section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr)); | ||
417 | mem_sect = __nr_to_section(section_nr); | ||
418 | |||
419 | mem_block = find_memory_block(mem_sect); | ||
420 | return mem_block; | ||
421 | } | ||
422 | |||
423 | static int dlpar_remove_lmb(struct of_drconf_cell *lmb) | 423 | static int dlpar_remove_lmb(struct of_drconf_cell *lmb) |
424 | { | 424 | { |
425 | struct memory_block *mem_block; | 425 | struct memory_block *mem_block; |