On Tue, Jun 04, 2019 at 04:23:06PM +0800, Ming Lei wrote: > Hi, > > Guenter reported scsi boot issue caused by commit c3288dd8c232 > ("scsi: core: avoid pre-allocating big SGL for data"). > > Turns out there are at least two issues. > > The 1st patch fixes issue in case that NO_SG_CHAIN on some ARCHs, > such as alpha, arm and parisc. > > The 2nd patch makes esp scsi working with SG_CHAIN. >
Both patches applied on top of next-20190604. Results on alpha: Waiting for root device /dev/sda... ------------[ cut here ]------------ WARNING: CPU: 0 PID: 7 at mm/slab.h:359 kmem_cache_free+0x120/0x2a0 virt_to_cache: Object is not a Slab page! Modules linked in: CPU: 0 PID: 7 Comm: ksoftirqd/0 Not tainted 5.2.0-rc3-next-20190604-00002-gab1fef861ee2 #1 fffffc000787fb38 fffffc0007d12658 fffffc0000333d50 fffffc00004205b0 fffffc0000333dd8 fffffc0007eb82a8 fffffc00003c3234 fffffc0000eedb20 0000000000000080 0000000000000001 0000000000000167 fffffc00004205b0 fffffc00004205b0 fffffc0007d908f8 fffffc0000cbe231 fffffc000787fbf8 0000000000000018 0000000000000000 fffffc00006d8e38 fffffc0007d908f8 0000000000000000 fffffc0000b8d610 0000000000000001 000000000000005a Trace: [<fffffc0000333d50>] __warn+0x160/0x190 [<fffffc00004205b0>] kmem_cache_free+0x120/0x2a0 [<fffffc0000333dd8>] warn_slowpath_fmt+0x58/0x70 [<fffffc00003c3234>] mempool_free_slab+0x24/0x40 [<fffffc00004205b0>] kmem_cache_free+0x120/0x2a0 [<fffffc00004205b0>] kmem_cache_free+0x120/0x2a0 [<fffffc00006d8e38>] bio_free+0x98/0xc0 [<fffffc00003c3234>] mempool_free_slab+0x24/0x40 [<fffffc00003c3158>] mempool_free+0x48/0x100 [<fffffc00007a459c>] sg_pool_free+0x9c/0xd0 [<fffffc00007a4500>] sg_pool_free+0x0/0xd0 [<fffffc000070d350>] __sg_free_table+0xb0/0xf0 [<fffffc00007a44e8>] sg_free_table_chained+0x48/0x60 [<fffffc0000889130>] scsi_mq_uninit_cmd+0xc0/0xd0 [<fffffc00008891d4>] scsi_end_request+0x94/0x270 [<fffffc0000889550>] scsi_io_completion+0xd0/0x740 [<fffffc000087f274>] scsi_finish_command+0x104/0x160 [<fffffc000087f1b0>] scsi_finish_command+0x40/0x160 [<fffffc0000888d4c>] scsi_softirq_done+0x18c/0x1c0 [<fffffc00006e9a2c>] blk_done_softirq+0xbc/0xf0 [<fffffc0000338008>] run_ksoftirqd+0x48/0x80 [<fffffc000035f654>] smpboot_thread_fn+0x184/0x230 [<fffffc000035afb8>] kthread+0x168/0x1d0 [<fffffc000035f4d0>] smpboot_thread_fn+0x0/0x230 [<fffffc00003119e8>] ret_from_kernel_thread+0x18/0x20 [<fffffc000035ae50>] kthread+0x0/0x1d0 ---[ end trace 1fadf5f1c983cdae ]--- scsi 0:0:0:0: Direct-Access QEMU QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5 sd 0:0:0:0: Power-on or device reset occurred sd 0:0:0:0: [sda] 20480 512-byte logical blocks: (10.5 MB/10.0 MiB) random: crng init done sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA sd 0:0:0:0: [sda] Attached SCSI disk EXT4-fs (sda): mounted filesystem without journal. Opts: (null) VFS: Mounted root (ext4 filesystem) readonly on device 8:0. Unable to handle kernel paging request at virtual address 0000000000000000 kworker/0:1H(45): Oops 1 pc = [<fffffc0000b7f760>] ra = [<fffffc000088a41c>] ps = 0000 Tainted: G W pc is at loop+0x0/0x10 ra is at scsi_queue_rq+0x6fc/0xaa0 v0 = 0000000000000000 t0 = 0000000000000060 t1 = 0000000000000004 t2 = 000000000000000c t3 = 0000980100000028 t4 = 0000000000000000 t5 = 0000000000000060 t6 = fffffc0007eb83d4 t7 = fffffc0007ed0000 s0 = 0000000000000000 s1 = fffffc0007eb82c0 s2 = fffffc0007d72998 s3 = fffffc0007dd2b28 s4 = fffffc0007eb83d0 s5 = fffffc000782a328 s6 = fffffc000782a328 a0 = 0000000000000000 a1 = 0000000000000000 a2 = 0000000000000000 a3 = 0000000000000000 a4 = 0000000000000000 a5 = fffffc0007edbeb0 t8 = fffffc0007eb83d3 t9 = 0000000000000002 t10= fffffc0007d12068 t11= 0000000000000000 pv = fffffc0000b7f6e0 at = 0000000000000000 gp = fffffc0000ee88d8 sp = 00000000f0901f3d Disabling lock debugging due to kernel taint Trace: [<fffffc00006eef94>] blk_mq_dispatch_rq_list+0x454/0x810 [<fffffc00006eef1c>] blk_mq_dispatch_rq_list+0x3dc/0x810 [<fffffc00006f5f94>] blk_mq_do_dispatch_sched+0xc4/0x170 [<fffffc00006f5f30>] blk_mq_do_dispatch_sched+0x60/0x170 [<fffffc00006f5f60>] blk_mq_do_dispatch_sched+0x90/0x170 [<fffffc00006f6a20>] blk_mq_sched_dispatch_requests+0x140/0x220 [<fffffc00006ed2bc>] __blk_mq_run_hw_queue+0x6c/0x250 [<fffffc0000350a90>] process_one_work+0x1f0/0x520 [<fffffc0000351310>] worker_thread+0x60/0x750 [<fffffc000035afb8>] kthread+0x168/0x1d0 [<fffffc00003512b0>] worker_thread+0x0/0x750 [<fffffc00003119e8>] ret_from_kernel_thread+0x18/0x20 [<fffffc000035ae50>] kthread+0x0/0x1d0 On the plus side, boot tests test are passing with m68k and sparc, so "scsi: esp: make it working on SG_CHAIN" seems to work. Guenter