Skip to content

Commit bf23aba

Browse files
committed
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
2 parents 3eb07d2 + e0bf304 commit bf23aba

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

arch/mips/bcm63xx/dev-enet.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ static struct platform_device bcm63xx_enet_shared_device = {
7070

7171
static int shared_device_registered;
7272

73+
static u64 enet_dmamask = DMA_BIT_MASK(32);
74+
7375
static struct resource enet0_res[] = {
7476
{
7577
.start = -1, /* filled at runtime */
@@ -99,6 +101,8 @@ static struct platform_device bcm63xx_enet0_device = {
99101
.resource = enet0_res,
100102
.dev = {
101103
.platform_data = &enet0_pd,
104+
.dma_mask = &enet_dmamask,
105+
.coherent_dma_mask = DMA_BIT_MASK(32),
102106
},
103107
};
104108

@@ -131,6 +135,8 @@ static struct platform_device bcm63xx_enet1_device = {
131135
.resource = enet1_res,
132136
.dev = {
133137
.platform_data = &enet1_pd,
138+
.dma_mask = &enet_dmamask,
139+
.coherent_dma_mask = DMA_BIT_MASK(32),
134140
},
135141
};
136142

@@ -157,6 +163,8 @@ static struct platform_device bcm63xx_enetsw_device = {
157163
.resource = enetsw_res,
158164
.dev = {
159165
.platform_data = &enetsw_pd,
166+
.dma_mask = &enet_dmamask,
167+
.coherent_dma_mask = DMA_BIT_MASK(32),
160168
},
161169
};
162170

arch/mips/kernel/cmpxchg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ unsigned long __xchg_small(volatile void *ptr, unsigned long val, unsigned int s
5454
unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
5555
unsigned long new, unsigned int size)
5656
{
57-
u32 mask, old32, new32, load32;
57+
u32 mask, old32, new32, load32, load;
5858
volatile u32 *ptr32;
5959
unsigned int shift;
60-
u8 load;
6160

6261
/* Check that ptr is naturally aligned */
6362
WARN_ON((unsigned long)ptr & (size - 1));

arch/mips/kernel/setup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ static void __init bootmem_init(void)
384384
init_initrd();
385385
reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end));
386386

387-
memblock_reserve(PHYS_OFFSET, reserved_end << PAGE_SHIFT);
387+
memblock_reserve(PHYS_OFFSET,
388+
(reserved_end << PAGE_SHIFT) - PHYS_OFFSET);
388389

389390
/*
390391
* max_low_pfn is not a number of pages. The number of pages

arch/mips/lantiq/xway/vmmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ static int vmmc_probe(struct platform_device *pdev)
3131
dma_addr_t dma;
3232

3333
cp1_base =
34-
(void *) CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE,
35-
&dma, GFP_ATOMIC));
34+
(void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE,
35+
&dma, GFP_KERNEL));
3636

3737
gpio_count = of_gpio_count(pdev->dev.of_node);
3838
while (gpio_count > 0) {

0 commit comments

Comments
 (0)