• Finn Thain's avatar
    m68k: mac: Don't call via_flush_cache() on Mac IIfx · bcc44f6b
    Finn Thain authored
    There is no VIA2 chip on the Mac IIfx, so don't call via_flush_cache().
    This avoids a boot crash which appeared in v5.4.
    
    printk: console [ttyS0] enabled
    printk: bootconsole [debug0] disabled
    printk: bootconsole [debug0] disabled
    Calibrating delay loop... 9.61 BogoMIPS (lpj=48064)
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
    Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
    devtmpfs: initialized
    random: get_random_u32 called from bucket_table_alloc.isra.27+0x68/0x194 with crng_init=0
    clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    futex hash table entries: 256 (order: -1, 3072 bytes, linear)
    NET: Registered protocol family 16
    Data read fault at 0x00000000 in Super Data (pc=0x8a6a)
    BAD KERNEL BUSERR
    Oops: 00000000
    Modules linked in:
    PC: [<00008a6a>] via_flush_cache+0x12/0x2c
    SR: 2700  SP: 01c1fe3c  a2: 01c24000
    d0: 00001119    d1: 0000000c    d2: 00012000    d3: 0000000f
    d4: 01c06840    d5: 00033b92    a0: 00000000    a1: 00000000
    Process swapper (pid: 1, task=01c24000)
    Frame format=B ssw=0755 isc=0200 isb=fff7 daddr=00000000 dobuf=01c1fed0
    baddr=00008a6e dibuf=0000004e ver=f
    Stack from 01c1fec4:
            01c1fed0 00007d7e 00010080 01c1fedc 0000792e 00000001 01c1fef4 00006b40
            01c80000 00040000 00000006 00000003 01c1ff1c 004a545e 004ff200 00040000
            00000000 00000003 01c06840 00033b92 004a5410 004b6c88 01c1ff84 000021e2
            00000073 00000003 01c06840 00033b92 0038507a 004bb094 004b6ca8 004b6c88
            004b6ca4 004b6c88 000021ae 00020002 00000000 01c0685d 00000000 01c1ffb4
            0049f938 00409c85 01c06840 0045bd40 00000073 00000002 00000002 00000000
    Call Trace: [<00007d7e>] mac_cache_card_flush+0x12/0x1c
     [<00010080>] fix_dnrm+0x2/0x18
     [<0000792e>] cache_push+0x46/0x5a
     [<00006b40>] arch_dma_prep_coherent+0x60/0x6e
     [<00040000>] switched_to_dl+0x76/0xd0
     [<004a545e>] dma_atomic_pool_init+0x4e/0x188
     [<00040000>] switched_to_dl+0x76/0xd0
     [<00033b92>] parse_args+0x0/0x370
     [<004a5410>] dma_atomic_pool_init+0x0/0x188
     [<000021e2>] do_one_initcall+0x34/0x1be
     [<00033b92>] parse_args+0x0/0x370
     [<0038507a>] strcpy+0x0/0x1e
     [<000021ae>] do_one_initcall+0x0/0x1be
     [<00020002>] do_proc_dointvec_conv+0x54/0x74
     [<0049f938>] kernel_init_freeable+0x126/0x190
     [<0049f94c>] kernel_init_freeable+0x13a/0x190
     [<004a5410>] dma_atomic_pool_init+0x0/0x188
     [<00041798>] complete+0x0/0x3c
     [<000b9b0c>] kfree+0x0/0x20a
     [<0038df98>] schedule+0x0/0xd0
     [<0038d604>] kernel_init+0x0/0xda
     [<0038d610>] kernel_init+0xc/0xda
     [<0038d604>] kernel_init+0x0/0xda
     [<00002d38>] ret_from_kernel_thread+0xc/0x14
    Code: 0000 2079 0048 10da 2279 0048 10c8 d3c8 <1011> 0200 fff7 1280 d1f9 0048 10c8 1010 0000 0008 1080 4e5e 4e75 4e56 0000 2039
    Disabling lock debugging due to kernel taint
    Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
    
    Thanks to Stan Johnson for capturing the console log and running git
    bisect.
    
    Git bisect said commit 8e3a68fb ("dma-mapping: make
    dma_atomic_pool_init self-contained") is the first "bad" commit. I don't
    know why. Perhaps mach_l2_flush first became reachable with that commit.
    
    Fixes: 1da177e4 ("Linux-2.6.12-rc2")
    Reported-and-tested-by: default avatarStan Johnson <userm57@yahoo.com>
    Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
    Cc: Joshua Thompson <funaho@jurai.org>
    Link: https://lore.kernel.org/r/b8bbeef197d6b3898e82ed0d231ad08f575a4b34.1589949122.git.fthain@telegraphics.com.auSigned-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
    bcc44f6b
via.c 16.9 KB