[PATCH] powerpc: cputime: fix a compile warning
From: Yanjiang JinThis patch is to avoid the below warning: kernel/sched/cpuacct.c:298:25: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'long unsigned int' [-Wformat=] Signed-off-by: Yanjiang Jin --- arch/powerpc/include/asm/cputime.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index 4f60db0..4423e97 100644 --- a/arch/powerpc/include/asm/cputime.h +++ b/arch/powerpc/include/asm/cputime.h @@ -228,7 +228,8 @@ static inline cputime_t clock_t_to_cputime(const unsigned long clk) return (__force cputime_t) ct; } -#define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct)) +#define cputime64_to_clock_t(ct) \ + (__force u64)(cputime_to_clock_t((cputime_t)(ct))) /* * PPC64 uses PACA which is task independent for storing accounting data while -- 1.9.1
[PATCH] fsldma: t4240qds: drop "SG" CAP for DMA3
From: Yanjiang JinT4240QDS DMA controller uses the external DMA control signals to start or restart a paused DMA transfer, acknowledge a DMA transfer in progress and also indicates a transfer completion. "scatterlist copy" depends on these signals. But as "T4240 Reference Manual" shown: "The external DMA control signals are available on DMA1 and DMA2. They are not supported by DMA3." So add an of_node property "fsl,external-dma-control-signals" to only DMA1 and DMA2, it can prevent DMA3 from doing DMA_SG operations. Else we would get the below errors during doing dmatest: modprobe dmatest run=1 iterations=42 dmatest: Started 1 threads using dma2chan0 fsl-elo-dma ffe102300.dma: chan0: Transfer Error! fsl-elo-dma ffe102300.dma: chan0: irq: unhandled sr 0x0080 dmatest: dma2chan0-sg0: dstbuf[0x3954] not copied! Expected d8, got 2b dmatest: dma2chan7-sg0: dstbuf[0x1c51] not copied! Expected df, got 2e dmatest: dma2chan7-sg0: 1301 errors suppressed dmatest: dma2chan7-sg0: result #42: 'data error' with src_off=0xf21 dst_off=0x1c32 len=0x535 (1333) dmatest: dma2chan7-sg0: summary 42 tests, 42 failures 2952 iops 23968 KB/s Signed-off-by: Yanjiang Jin --- arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 6 ++ drivers/dma/fsldma.c| 11 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi index 68c4ead..155997d 100644 --- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi @@ -1029,7 +1029,13 @@ }; /include/ "elo3-dma-0.dtsi" + dma@100300 { + fsl,external-dma-control-signals; + }; /include/ "elo3-dma-1.dtsi" + dma@101300 { + fsl,external-dma-control-signals; + }; /include/ "elo3-dma-2.dtsi" /include/ "qoriq-espi-0.dtsi" diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 51c75bf..f7054f4 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -1354,12 +1354,19 @@ static int fsldma_of_probe(struct platform_device *op) fdev->irq = irq_of_parse_and_map(op->dev.of_node, 0); dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask); - dma_cap_set(DMA_SG, fdev->common.cap_mask); + dma_cap_set(DMA_SLAVE, fdev->common.cap_mask); + + if (of_get_property(op->dev.of_node, + "fsl,external-dma-control-signals", NULL)) { + dma_cap_set(DMA_SG, fdev->common.cap_mask); + fdev->common.device_prep_dma_sg = fsl_dma_prep_sg; + } else + dma_cap_clear(DMA_SG, fdev->common.cap_mask); + fdev->common.device_alloc_chan_resources = fsl_dma_alloc_chan_resources; fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; - fdev->common.device_prep_dma_sg = fsl_dma_prep_sg; fdev->common.device_tx_status = fsl_tx_status; fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending; fdev->common.device_config = fsl_dma_device_config; -- 1.9.1
[PATCH] fsl: mpc85xx: call k(un)map_atomic other than k(un)map
From: Yanjiang Jin yanjiang@windriver.com The k(un)map function may be called in atomic context in the function map_and_flush(), so use k(un)map_atomic to replace it, else we would get the below warning during kdump: BUG: sleeping function called from invalid context at include/linux/highmem.h:58 in_atomic(): 1, irqs_disabled(): 1, pid: 736, name: sh INFO: lockdep is turned off. irq event stamp: 0 hardirqs last enabled at (0): [ (null)] (null) hardirqs last disabled at (0): [c0066d1c] .copy_process.part.44+0x50c/0x1360 softirqs last enabled at (0): [c0066d1c] .copy_process.part.44+0x50c/0x1360 softirqs last disabled at (0): [ (null)] (null) CPU: 1 PID: 736 Comm: sh Tainted: G D W3.10.62-ltsi-WR6.0.0.0_standard #2 Call Trace: [c000f47cf120] [c000b150] .show_stack+0x170/0x290 (unreliable) [c000f47cf210] [c0b71334] .dump_stack+0x28/0x3c [c000f47cf280] [c00bb5d8] .__might_sleep+0x1a8/0x270 [c000f47cf310] [c00440cc] .map_and_flush+0x4c/0xc0 [c000f47cf390] [c00441cc] .mpc85xx_smp_machine_kexec+0x8c/0xec0 [c000f47cf420] [c002ae00] .machine_kexec+0x60/0x90 [c000f47cf4b0] [c010957c] .crash_kexec+0x8c/0x100 [c000f47cf6a0] [c0015df8] .die+0x348/0x450 [c000f47cf740] [c002f3a0] .bad_page_fault+0xe0/0x130 [c000f47cf7c0] [c001f3e4] storage_fault_common+0x40/0x44 Signed-off-by: Yanjiang Jin yanjiang@windriver.com --- arch/powerpc/platforms/85xx/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index d7c1e69..8631ac5 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c @@ -360,10 +360,10 @@ static void mpc85xx_smp_kexec_down(void *arg) static void map_and_flush(unsigned long paddr) { struct page *page = pfn_to_page(paddr PAGE_SHIFT); - unsigned long kaddr = (unsigned long)kmap(page); + unsigned long kaddr = (unsigned long)kmap_atomic(page); flush_dcache_range(kaddr, kaddr + PAGE_SIZE); - kunmap(page); + kunmap_atomic((void *)kaddr); } /** -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] ppc: mm: free memory after creating kmem cache
From: Yanjiang Jin yanjiang@windriver.com kmem_cache_create()-kmem_cache_create_memcg()-kstrdup() allocates new space and copy name's content, so it is safe to free name memory after calling kmem_cache_create(). Else kmemleak would report the below warning: unreferenced object 0xc000f9002160 (size 16): comm swapper/0, pid 0, jiffies 4294892296 (age 1386.640s) hex dump (first 16 bytes): 70 67 74 61 62 6c 65 2d 32 5e 39 00 de ad be ef pgtable-2^9. backtrace: [c04e03ec] .kvasprintf+0x5c/0xa0 [c04e045c] .kasprintf+0x2c/0x50 [c002e36c] .pgtable_cache_add+0xac/0x100 [c002e3e4] .pgtable_cache_init+0x24/0x80 [c0c6c67c] .start_kernel+0x228/0x4c8 [c594] .start_here_common+0x24/0x90 Signed-off-by: Yanjiang Jin yanjiang@windriver.com --- arch/powerpc/mm/init_64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index a90b9c4..fe0631f 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c @@ -129,6 +129,7 @@ void pgtable_cache_add(unsigned shift, void (*ctor)(void *)) align = max_t(unsigned long, align, minalign); name = kasprintf(GFP_KERNEL, pgtable-2^%d, shift); new = kmem_cache_create(name, table_size, align, 0, ctor); + kfree(name); pgtable_cache[shift - 1] = new; pr_debug(Allocated pgtable cache for order %d\n, shift); } -- 1.9.1 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev