Patch "ntb: perf test: fix address space confusion" has been added to the 4.5-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
ntb: perf test: fix address space confusion
to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ntb-perf-test-fix-address-space-confusion.patch
and it can be found in the queue-4.5 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
1985a88107b5330b2a911ad4d279e1bd7e4deb24Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <[email protected]>
Date: Tue, 26 Jan 2016 10:31:45 +0100
Subject: ntb: perf test: fix address space confusion
From: Arnd Bergmann <[email protected]>
commit 1985a88107b5330b2a911ad4d279e1bd7e4deb24 upstream.
The ntb driver assigns between pointers an __iomem tokens, and also casts them to 64-bit integers, which results in compiler warnings on 32-bit systems:
drivers/ntb/test/ntb_perf.c: In function 'perf_copy':drivers/ntb/test/ntb_perf.c:213:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
vbase = (u64)(u64 *)mw->vbase;
^
drivers/ntb/test/ntb_perf.c:214:14: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
dst_vaddr = (u64)(u64 *)dst;
^This adds __iomem annotations where needed and changes the temporary variables to iomem pointers to avoid casting them to u64. I did not see the problem in linux-next earlier, but it show showed up in 4.5-rc1.
--- drivers/ntb/test/ntb_perf.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/ntb/test/ntb_perf.c +11 -10
@@ -178,7 +178,7 @@ static void perf_copy_callback(void *datatomic_dec (&pctx->dma_sync); } -static ssize_t perf_copy (struct pthr_ctx *pctx,char *dst, +static ssize_t perf_copy (struct pthr_ctx *pctx,char __iomem *dst,char *src,size_t size) {struct perf_ctx *perf = pctx->perf;
@@ -189,7 +189,8 @@ static ssize_t perf_copy(struct pthr_ctxdma_cookie_t cookie;size_t src_off, dst_off;struct perf_mw *mw = &perf->mw; -u64 vbase, dst_vaddr; +void __iomem *vbase; +void __iomem *dst_vaddr;dma_addr_t dst_phys;int retries =0 ;
@@ -204,14 +205,14 @@ static ssize_t perf_copy(struct pthr_ctx } device = chan->device; - src_off = (size_t )src & ~PAGE_MASK ; - dst_off = (size_t )dst & ~PAGE_MASK ; + src_off = (uintptr_t )src & ~PAGE_MASK ; + dst_off = (uintptr_t __force )dst & ~PAGE_MASK ;if (!is_dma_copy_aligned (device, src_off, dst_off, size))return -ENODEV ; - vbase = (u64 )(u64 *)mw->vbase; - dst_vaddr = (u64 )(u64 *)dst; + vbase = mw->vbase; + dst_vaddr = dst; dst_phys = mw->phys_addr + (dst_vaddr - vbase); unmap =dmaengine_get_unmap_data (device->dev,1 ,GFP_NOWAIT );
@@ -261,13 +262,13 @@ err_get_unmap:return 0 ; } -static int perf_move_data (struct pthr_ctx *pctx,char *dst,char *src, +static int perf_move_data (struct pthr_ctx *pctx,char __iomem *dst,char *src,u64 buf_size,u64 win_size,u64 total) {int chunks, total_chunks, i;int copied_chunks =0 ;u64 copied =0 , result; -char *tmp = dst; +char __iomem *tmp = dst;u64 perf, diff_us;ktime_t kstart, kstop, kdiff;
@@ -324,7 +325,7 @@ static int ntb_perf_thread(void *data)struct perf_ctx *perf = pctx->perf;struct pci_dev *pdev = perf->ntb->pdev;struct perf_mw *mw = &perf->mw; -char *dst; +char __iomem *dst;u64 win_size, buf_size, total;void *src;int rc, node, i;
@@ -364,7 +365,7 @@ static int ntb_perf_thread(void *data)if (buf_size >MAX_TEST_SIZE ) buf_size =MAX_TEST_SIZE ; - dst = (char *)mw->vbase; + dst = (char __iomem *)mw->vbase;atomic_inc (&perf->tsync);while (atomic_read (&perf->tsync) != perf->perf_threads)
Patches currently in stable-queue which might be from [email protected] are
queue-4.5/misc-bmp085-enable-building-as-a-module.patch queue-4.5/xen-kconfig-don-t-select-input_xen_kbddev_frontend.patch queue-4.5/regulator-s5m8767-fix-get_register-error-handling.patch queue-4.5/asm-generic-futex-re-enable-preemption-in-futex_atomic_cmpxchg_inatomic.patch queue-4.5/ntb-perf-test-fix-address-space-confusion.patch queue-4.5/paride-make-verbose-parameter-an-int-again.patch queue-4.5/asoc-s3c24xx-use-const-snd_soc_component_driver-pointer.patch queue-4.5/scsi_dh-force-modular-build-if-scsi-is-a-module.patch