Commit bf23aba1 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mips_fixes_5.0_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS fixes from Paul Burton:
 "A few more MIPS fixes:

   - Fix 16b cmpxchg() operations which could erroneously fail if bits
     15:8 of the old value are non-zero. In practice I'm not aware of
     any actual users of 16b cmpxchg() on MIPS, but this fixes the
     support for it was was introduced in v4.13.

   - Provide a struct device to dma_alloc_coherent for Lantiq XWAY
     systems with a "Voice MIPS Macro Core" (VMMC) device.

   - Provide DMA masks for BCM63xx ethernet devices, fixing a regression
     introduced in v4.19.

   - Fix memblock reservation for the kernel when the system has a
     non-zero PHYS_OFFSET, correcting the memblock conversion performed
     in v4.20"

* tag 'mips_fixes_5.0_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
  MIPS: fix memory setup for platforms with PHYS_OFFSET != 0
  MIPS: BCM63XX: provide DMA masks for ethernet devices
  MIPS: lantiq: pass struct device to DMA API functions
  MIPS: fix truncation in __cmpxchg_small for short values
parents 3eb07d20 e0bf304e
...@@ -70,6 +70,8 @@ static struct platform_device bcm63xx_enet_shared_device = { ...@@ -70,6 +70,8 @@ static struct platform_device bcm63xx_enet_shared_device = {
static int shared_device_registered; static int shared_device_registered;
static u64 enet_dmamask = DMA_BIT_MASK(32);
static struct resource enet0_res[] = { static struct resource enet0_res[] = {
{ {
.start = -1, /* filled at runtime */ .start = -1, /* filled at runtime */
...@@ -99,6 +101,8 @@ static struct platform_device bcm63xx_enet0_device = { ...@@ -99,6 +101,8 @@ static struct platform_device bcm63xx_enet0_device = {
.resource = enet0_res, .resource = enet0_res,
.dev = { .dev = {
.platform_data = &enet0_pd, .platform_data = &enet0_pd,
.dma_mask = &enet_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
}, },
}; };
...@@ -131,6 +135,8 @@ static struct platform_device bcm63xx_enet1_device = { ...@@ -131,6 +135,8 @@ static struct platform_device bcm63xx_enet1_device = {
.resource = enet1_res, .resource = enet1_res,
.dev = { .dev = {
.platform_data = &enet1_pd, .platform_data = &enet1_pd,
.dma_mask = &enet_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
}, },
}; };
...@@ -157,6 +163,8 @@ static struct platform_device bcm63xx_enetsw_device = { ...@@ -157,6 +163,8 @@ static struct platform_device bcm63xx_enetsw_device = {
.resource = enetsw_res, .resource = enetsw_res,
.dev = { .dev = {
.platform_data = &enetsw_pd, .platform_data = &enetsw_pd,
.dma_mask = &enet_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
}, },
}; };
......
...@@ -54,10 +54,9 @@ unsigned long __xchg_small(volatile void *ptr, unsigned long val, unsigned int s ...@@ -54,10 +54,9 @@ unsigned long __xchg_small(volatile void *ptr, unsigned long val, unsigned int s
unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old, unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
unsigned long new, unsigned int size) unsigned long new, unsigned int size)
{ {
u32 mask, old32, new32, load32; u32 mask, old32, new32, load32, load;
volatile u32 *ptr32; volatile u32 *ptr32;
unsigned int shift; unsigned int shift;
u8 load;
/* Check that ptr is naturally aligned */ /* Check that ptr is naturally aligned */
WARN_ON((unsigned long)ptr & (size - 1)); WARN_ON((unsigned long)ptr & (size - 1));
......
...@@ -384,7 +384,8 @@ static void __init bootmem_init(void) ...@@ -384,7 +384,8 @@ static void __init bootmem_init(void)
init_initrd(); init_initrd();
reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end)); reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end));
memblock_reserve(PHYS_OFFSET, reserved_end << PAGE_SHIFT); memblock_reserve(PHYS_OFFSET,
(reserved_end << PAGE_SHIFT) - PHYS_OFFSET);
/* /*
* max_low_pfn is not a number of pages. The number of pages * max_low_pfn is not a number of pages. The number of pages
......
...@@ -31,8 +31,8 @@ static int vmmc_probe(struct platform_device *pdev) ...@@ -31,8 +31,8 @@ static int vmmc_probe(struct platform_device *pdev)
dma_addr_t dma; dma_addr_t dma;
cp1_base = cp1_base =
(void *) CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE, (void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE,
&dma, GFP_ATOMIC)); &dma, GFP_KERNEL));
gpio_count = of_gpio_count(pdev->dev.of_node); gpio_count = of_gpio_count(pdev->dev.of_node);
while (gpio_count > 0) { while (gpio_count > 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment