1. 15 Mar, 2022 2 commits
    • David Jeffery's avatar
      scsi: fnic: Finish scsi_cmnd before dropping the spinlock · 733ab7e1
      David Jeffery authored
      When aborting a SCSI command through fnic, there is a race with the fnic
      interrupt handler which can result in the SCSI command and its request
      being completed twice. If the interrupt handler claims the command by
      setting CMD_SP to NULL first, the abort handler assumes the interrupt
      handler has completed the command and returns SUCCESS, causing the request
      for the scsi_cmnd to be re-queued.
      
      But the interrupt handler may not have finished the command yet. After it
      drops the spinlock protecting CMD_SP, it does memory cleanup before finally
      calling scsi_done() to complete the scsi_cmnd. If the call to scsi_done
      occurs after the abort handler finishes and re-queues the request, the
      completion of the scsi_cmnd will advance and try to double complete a
      request already queued for retry.
      
      This patch fixes the issue by moving scsi_done() and any other use of
      scsi_cmnd to before the spinlock is released by the interrupt handler.
      
      Link: https://lore.kernel.org/r/20220311184359.2345319-1-djeffery@redhat.comReviewed-by: default avatarLaurence Oberman <loberman@redhat.com>
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarDavid Jeffery <djeffery@redhat.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      733ab7e1
    • Matt Lupfer's avatar
      scsi: mpt3sas: Page fault in reply q processing · 69ad4ef8
      Matt Lupfer authored
      A page fault was encountered in mpt3sas on a LUN reset error path:
      
      [  145.763216] mpt3sas_cm1: Task abort tm failed: handle(0x0002),timeout(30) tr_method(0x0) smid(3) msix_index(0)
      [  145.778932] scsi 1:0:0:0: task abort: FAILED scmd(0x0000000024ba29a2)
      [  145.817307] scsi 1:0:0:0: attempting device reset! scmd(0x0000000024ba29a2)
      [  145.827253] scsi 1:0:0:0: [sg1] tag#2 CDB: Receive Diagnostic 1c 01 01 ff fc 00
      [  145.837617] scsi target1:0:0: handle(0x0002), sas_address(0x500605b0000272b9), phy(0)
      [  145.848598] scsi target1:0:0: enclosure logical id(0x500605b0000272b8), slot(0)
      [  149.858378] mpt3sas_cm1: Poll ReplyDescriptor queues for completion of smid(0), task_type(0x05), handle(0x0002)
      [  149.875202] BUG: unable to handle page fault for address: 00000007fffc445d
      [  149.885617] #PF: supervisor read access in kernel mode
      [  149.894346] #PF: error_code(0x0000) - not-present page
      [  149.903123] PGD 0 P4D 0
      [  149.909387] Oops: 0000 [#1] PREEMPT SMP NOPTI
      [  149.917417] CPU: 24 PID: 3512 Comm: scsi_eh_1 Kdump: loaded Tainted: G S         O      5.10.89-altav-1 #1
      [  149.934327] Hardware name: DDN           200NVX2             /200NVX2-MB          , BIOS ATHG2.2.02.01 09/10/2021
      [  149.951871] RIP: 0010:_base_process_reply_queue+0x4b/0x900 [mpt3sas]
      [  149.961889] Code: 0f 84 22 02 00 00 8d 48 01 49 89 fd 48 8d 57 38 f0 0f b1 4f 38 0f 85 d8 01 00 00 49 8b 45 10 45 31 e4 41 8b 55 0c 48 8d 1c d0 <0f> b6 03 83 e0 0f 3c 0f 0f 85 a2 00 00 00 e9 e6 01 00 00 0f b7 ee
      [  149.991952] RSP: 0018:ffffc9000f1ebcb8 EFLAGS: 00010246
      [  150.000937] RAX: 0000000000000055 RBX: 00000007fffc445d RCX: 000000002548f071
      [  150.011841] RDX: 00000000ffff8881 RSI: 0000000000000001 RDI: ffff888125ed50d8
      [  150.022670] RBP: 0000000000000000 R08: 0000000000000000 R09: c0000000ffff7fff
      [  150.033445] R10: ffffc9000f1ebb68 R11: ffffc9000f1ebb60 R12: 0000000000000000
      [  150.044204] R13: ffff888125ed50d8 R14: 0000000000000080 R15: 34cdc00034cdea80
      [  150.054963] FS:  0000000000000000(0000) GS:ffff88dfaf200000(0000) knlGS:0000000000000000
      [  150.066715] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  150.076078] CR2: 00000007fffc445d CR3: 000000012448a006 CR4: 0000000000770ee0
      [  150.086887] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  150.097670] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  150.108323] PKRU: 55555554
      [  150.114690] Call Trace:
      [  150.120497]  ? printk+0x48/0x4a
      [  150.127049]  mpt3sas_scsih_issue_tm.cold.114+0x2e/0x2b3 [mpt3sas]
      [  150.136453]  mpt3sas_scsih_issue_locked_tm+0x86/0xb0 [mpt3sas]
      [  150.145759]  scsih_dev_reset+0xea/0x300 [mpt3sas]
      [  150.153891]  scsi_eh_ready_devs+0x541/0x9e0 [scsi_mod]
      [  150.162206]  ? __scsi_host_match+0x20/0x20 [scsi_mod]
      [  150.170406]  ? scsi_try_target_reset+0x90/0x90 [scsi_mod]
      [  150.178925]  ? blk_mq_tagset_busy_iter+0x45/0x60
      [  150.186638]  ? scsi_try_target_reset+0x90/0x90 [scsi_mod]
      [  150.195087]  scsi_error_handler+0x3a5/0x4a0 [scsi_mod]
      [  150.203206]  ? __schedule+0x1e9/0x610
      [  150.209783]  ? scsi_eh_get_sense+0x210/0x210 [scsi_mod]
      [  150.217924]  kthread+0x12e/0x150
      [  150.224041]  ? kthread_worker_fn+0x130/0x130
      [  150.231206]  ret_from_fork+0x1f/0x30
      
      This is caused by mpt3sas_base_sync_reply_irqs() using an invalid reply_q
      pointer outside of the list_for_each_entry() loop. At the end of the full
      list traversal the pointer is invalid.
      
      Move the _base_process_reply_queue() call inside of the loop.
      
      Link: https://lore.kernel.org/r/d625deae-a958-0ace-2ba3-0888dd0a415b@ddn.com
      Fixes: 711a923c ("scsi: mpt3sas: Postprocessing of target and LUN reset")
      Cc: stable@vger.kernel.org
      Acked-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMatt Lupfer <mlupfer@ddn.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      69ad4ef8
  2. 15 Feb, 2022 2 commits
  3. 11 Feb, 2022 1 commit
  4. 08 Feb, 2022 2 commits
  5. 31 Jan, 2022 7 commits
  6. 25 Jan, 2022 16 commits
  7. 23 Jan, 2022 6 commits
    • Linus Torvalds's avatar
      Linux 5.17-rc1 · e783362e
      Linus Torvalds authored
      e783362e
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v5.17-2022-01-22' of... · 40c84321
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull more perf tools updates from Arnaldo Carvalho de Melo:
      
       - Fix printing 'phys_addr' in 'perf script'.
      
       - Fix failure to add events with 'perf probe' in ppc64 due to not
         removing leading dot (ppc64 ABIv1).
      
       - Fix cpu_map__item() python binding building.
      
       - Support event alias in form foo-bar-baz, add pmu-events and
         parse-event tests for it.
      
       - No need to setup affinities when starting a workload or attaching to
         a pid.
      
       - Use path__join() to compose a path instead of ad-hoc snprintf()
         equivalent.
      
       - Override attr->sample_period for non-libpfm4 events.
      
       - Use libperf cpumap APIs instead of accessing the internal state
         directly.
      
       - Sync x86 arch prctl headers and files changed by the new
         set_mempolicy_home_node syscall with the kernel sources.
      
       - Remove duplicate include in cpumap.h.
      
       - Remove redundant err variable.
      
      * tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf tools: Remove redundant err variable
        perf test: Add parse-events test for aliases with hyphens
        perf test: Add pmu-events test for aliases with hyphens
        perf parse-events: Support event alias in form foo-bar-baz
        perf evsel: Override attr->sample_period for non-libpfm4 events
        perf cpumap: Remove duplicate include in cpumap.h
        perf cpumap: Migrate to libperf cpumap api
        perf python: Fix cpu_map__item() building
        perf script: Fix printing 'phys_addr' failure issue
        tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall
        tools headers UAPI: Sync x86 arch prctl headers with the kernel sources
        perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename)
        perf evlist: No need to setup affinities when disabling events for pid targets
        perf evlist: No need to setup affinities when enabling events for pid targets
        perf stat: No need to setup affinities when starting a workload
        perf affinity: Allow passing a NULL arg to affinity__cleanup()
        perf probe: Fix ppc64 'perf probe add events failed' case
      40c84321
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 67bfce0e
      Linus Torvalds authored
      Pull ftrace fix from Steven Rostedt:
       "Fix s390 breakage from sorting mcount tables.
      
        The latest merge of the tracing tree sorts the mcount table at build
        time. But s390 appears to do things differently (like always) and
        replaces the sorted table back to the original unsorted one. As the
        ftrace algorithm depends on it being sorted, bad things happen when it
        is not, and s390 experienced those bad things.
      
        Add a new config to tell the boot if the mcount table is sorted or
        not, and allow s390 to opt out of it"
      
      * tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        ftrace: Fix assuming build time sort works for s390
      67bfce0e
    • Steven Rostedt (Google)'s avatar
      ftrace: Fix assuming build time sort works for s390 · 6b9b6413
      Steven Rostedt (Google) authored
      To speed up the boot process, as mcount_loc needs to be sorted for ftrace
      to work properly, sorting it at build time is more efficient than boot up
      and can save milliseconds of time. Unfortunately, this change broke s390
      as it will modify the mcount_loc location after the sorting takes place
      and will put back the unsorted locations. Since the sorting is skipped at
      boot up if it is believed that it was sorted at run time, ftrace can crash
      as its algorithms are dependent on the list being sorted.
      
      Add a new config BUILDTIME_MCOUNT_SORT that is set when
      BUILDTIME_TABLE_SORT but not if S390 is set. Use this config to determine
      if sorting should take place at boot up.
      
      Link: https://lore.kernel.org/all/yt9dee51ctfn.fsf@linux.ibm.com/
      
      Fixes: 72b3942a ("scripts: ftrace - move the sort-processing in ftrace_init")
      Reported-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Tested-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      6b9b6413
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.17' of... · 473aec0e
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Bring include/uapi/linux/nfc.h into the UAPI compile-test coverage
      
       - Revert the workaround of CONFIG_CC_IMPLICIT_FALLTHROUGH
      
       - Fix build errors in certs/Makefile
      
      * tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty
        certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI
        Revert "Makefile: Do not quote value for CONFIG_CC_IMPLICIT_FALLTHROUGH"
        usr/include/Makefile: add linux/nfc.h to the compile-test coverage
      473aec0e
    • Linus Torvalds's avatar
      Merge tag 'bitmap-5.17-rc1' of git://github.com/norov/linux · 3689f9f8
      Linus Torvalds authored
      Pull bitmap updates from Yury Norov:
      
       - introduce for_each_set_bitrange()
      
       - use find_first_*_bit() instead of find_next_*_bit() where possible
      
       - unify for_each_bit() macros
      
      * tag 'bitmap-5.17-rc1' of git://github.com/norov/linux:
        vsprintf: rework bitmap_list_string
        lib: bitmap: add performance test for bitmap_print_to_pagebuf
        bitmap: unify find_bit operations
        mm/percpu: micro-optimize pcpu_is_populated()
        Replace for_each_*_bit_from() with for_each_*_bit() where appropriate
        find: micro-optimize for_each_{set,clear}_bit()
        include/linux: move for_each_bit() macros from bitops.h to find.h
        cpumask: replace cpumask_next_* with cpumask_first_* where appropriate
        tools: sync tools/bitmap with mother linux
        all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate
        cpumask: use find_first_and_bit()
        lib: add find_first_and_bit()
        arch: remove GENERIC_FIND_FIRST_BIT entirely
        include: move find.h from asm_generic to linux
        bitops: move find_bit_*_le functions from le.h to find.h
        bitops: protect find_first_{,zero}_bit properly
      3689f9f8
  8. 22 Jan, 2022 4 commits