linux/arch/mips/mm
Jerin Jacob d451e73496 MIPS: DMA: Fix BUG due to smp_processor_id() in preemptible code
The use of current_cpu_type() in cpu_is_noncoherent_r10000() is not preemption-safe.
Use boot_cpu_type() instead to make it preemption-safe.

<log>
/ # insmod mtd_readtest.ko dev=4
mtd_readtest: MTD device: 4
mtd_readtest: MTD device size 996671488, eraseblock size 524288, page size 4096, count of eraseblocks 1901, pages per eraseblock 128, OOB size 224
mtd_readtest: scanning for bad eraseblocks
mtd_readtest: scanned 1901 eraseblocks, 0 are bad
mtd_readtest: testing page read
BUG: using smp_processor_id() in preemptible [00000000] code: insmod/99
caller is mips_dma_sync_single_for_cpu+0x2c/0x128
CPU: 2 PID: 99 Comm: insmod Not tainted 3.10.4 #67
Stack : 00000006 69735f63 00000000 00000000 00000000 00000000 808273d6 00000032
          80820000 00000002 8d700000 8de48fa0 00000000 00000000 00000000 00000000
          00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          00000000 00000000 00000000 8d6afb00 8d6afb24 80721f24 807b9927 8012c130
          80820000 80721f24 00000002 00000063 8de48fa0 8082333c 807b98e6 8d6afaa0
          ...
Call Trace:
[<80109984>] show_stack+0x64/0x7c
[<80666230>] dump_stack+0x20/0x2c
[<803a2210>] debug_smp_processor_id+0xe0/0xf0
[<801116f0>] mips_dma_sync_single_for_cpu+0x2c/0x128
[<8043456c>] nand_plat_read_page+0x16c/0x234
[<8042fad4>] nand_do_read_ops+0x194/0x480
[<804301dc>] nand_read+0x50/0x7c
[<804261c8>] part_read+0x70/0xc0
[<804231dc>] mtd_read+0x80/0xe4
[<c0431354>] init_module+0x354/0x6f8 [mtd_readtest]
[<8010057c>] do_one_initcall+0x140/0x1a4
[<80176d7c>] load_module+0x1b5c/0x2258
[<8017752c>] SyS_init_module+0xb4/0xec
[<8010f3fc>] stack_done+0x20/0x44

BUG: using smp_processor_id() in preemptible [00000000] code: insmod/99
</log>

Signed-off-by: Jerin Jacob <jerinjacobk@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5800/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-09-06 19:07:11 +02:00
..
c-octeon.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
c-r3k.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
c-r4k.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
c-tx39.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
cache.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
cerr-sb1.c MIPS: Sibyte: Fix build for SIBYTE_BW_TRACE on BCM1x55 and BCM1x80. 2013-06-21 18:07:02 +02:00
cex-gen.S MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cex-oct.S MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
cex-sb1.S MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
dma-default.c MIPS: DMA: Fix BUG due to smp_processor_id() in preemptible code 2013-09-06 19:07:11 +02:00
extable.c MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
fault.c MIPS: Implement HAVE_CONTEXT_TRACKING. 2013-06-10 18:02:30 +02:00
gup.c MIPS: Fix get_user_page_fast() for mips with cache alias 2013-08-26 15:26:48 +02:00
highmem.c MIPS: Highmem: Fix build error if CONFIG_DEBUG_HIGHMEM is disabled 2012-12-13 18:15:27 +01:00
hugetlbpage.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
init.c MIPS: Export copy_from_user_page() (needed by lustre) 2013-09-05 19:59:34 +02:00
ioremap.c MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
Makefile MIPS: Move generated code to .text for microMIPS 2013-07-01 15:10:56 +02:00
mmap.c mm: remove free_area_cache 2013-07-10 18:11:34 -07:00
page-funcs.S MIPS: Refactor 'clear_page' and 'copy_page' functions. 2012-07-19 11:23:43 +02:00
page.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
pgtable-32.c MIPS: Limit fixrange_init() to the FIXMAP region 2011-07-25 17:26:54 +01:00
pgtable-64.c MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
sc-ip22.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
sc-mips.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
sc-r5k.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
sc-rm7k.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
tlb-funcs.S MIPS: Move generated code to .text for microMIPS 2013-07-01 15:10:56 +02:00
tlb-r3k.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
tlb-r4k.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
tlb-r8k.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
tlbex-fault.S MIPS: Don't include <asm/page.h> unnecessarily. 2012-12-28 17:04:04 +01:00
tlbex.c Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2013-07-19 15:10:01 -07:00
uasm-micromips.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
uasm-mips.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00
uasm.c MIPS: Delete __cpuinit/__CPUINIT usage from MIPS code 2013-07-14 19:36:51 -04:00