1. 14 4月, 2020 2 次提交
  2. 04 4月, 2020 1 次提交
  3. 02 4月, 2020 2 次提交
  4. 01 4月, 2020 7 次提交
    • K
      scsi: bnx2fc: fix boolreturn.cocci warnings · 60f537d5
      kbuild test robot 提交于
      drivers/scsi/bnx2fc/bnx2fc_hwi.c:1019:9-10: WARNING: return of 0/1 in function 'bnx2fc_pending_work' with return type bool
      
       Return statements in functions returning bool should use
       true/false instead of 1/0.
      
      Generated by: scripts/coccinelle/misc/boolreturn.cocci
      
      Fixes: 77331115 ("scsi: bnx2fc: Process the RQE with CQE in interrupt context")
      CC: Javed Hasan <jhasan@marvell.com>
      Acked-by: NJaved Hasan <jhasan@marvell.com>
      Signed-off-by: Nkbuild test robot <lkp@intel.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      60f537d5
    • H
      scsi: aacraid: do not overwrite retval in aac_reset_adapter() · 4e6c78d1
      Hannes Reinecke 提交于
      'retval' got assigned a value twice, causing the original value to be lost.
      
      Link: https://lore.kernel.org/r/20200331084111.95039-1-hare@suse.de
      Fixes: 3d3ca53b ("scsi: aacraid: use scsi_host_(block,unblock) to block I/O")
      Reported-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      4e6c78d1
    • B
      scsi: sr: Fix sr_block_release() · 72655c0e
      Bart Van Assche 提交于
      This patch fixes the following two complaints:
      
      WARNING: CPU: 3 PID: 1326 at kernel/locking/mutex-debug.c:103 mutex_destroy+0x74/0x80
      Modules linked in: scsi_debug sd_mod t10_pi brd scsi_transport_iscsi af_packet crct10dif_pclmul sg aesni_intel glue_helper virtio_balloon button crypto_simd cryptd intel_agp intel_gtt agpgart ip_tables x_tables ipv6 nf_defrag_ipv6 autofs4 ext4 crc16 mbcache jbd2 hid_generic usbhid hid sr_mod cdrom ata_generic pata_acpi virtio_blk virtio_net net_failover failover ata_piix xhci_pci ahci libahci xhci_hcd i2c_piix4 libata virtio_pci usbcore i2c_core virtio_ring scsi_mod usb_common virtio [last unloaded: scsi_debug]
      CPU: 3 PID: 1326 Comm: systemd-udevd Not tainted 5.6.0-rc1-dbg+ #1
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      RIP: 0010:mutex_destroy+0x74/0x80
      Call Trace:
       sr_kref_release+0xb9/0xd0 [sr_mod]
       scsi_cd_put+0x79/0x90 [sr_mod]
       sr_block_release+0x54/0x70 [sr_mod]
       __blkdev_put+0x2ce/0x3c0
       blkdev_put+0x68/0x220
       blkdev_close+0x4d/0x60
       __fput+0x170/0x3b0
       ____fput+0x12/0x20
       task_work_run+0xa2/0xf0
       exit_to_usermode_loop+0xeb/0xf0
       do_syscall_64+0x2be/0x300
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x7fa16d40aab7
      
      BUG: KASAN: use-after-free in __mutex_unlock_slowpath+0x98/0x420
      Read of size 8 at addr ffff8881c6e4f4b0 by task systemd-udevd/1326
      
      CPU: 3 PID: 1326 Comm: systemd-udevd Tainted: G        W         5.6.0-rc1-dbg+ #1
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      Call Trace:
       dump_stack+0xa5/0xe6
       print_address_description.constprop.0+0x46/0x60
       __kasan_report.cold+0x7b/0x94
       kasan_report+0x16/0x20
       check_memory_region+0x140/0x1b0
       __kasan_check_read+0x15/0x20
       __mutex_unlock_slowpath+0x98/0x420
       mutex_unlock+0x16/0x20
       sr_block_release+0x5c/0x70 [sr_mod]
       __blkdev_put+0x2ce/0x3c0
      hardirqs last  enabled at (1875522): [<ffffffff81bb0696>] _raw_spin_unlock_irqrestore+0x56/0x70
       blkdev_put+0x68/0x220
       blkdev_close+0x4d/0x60
       __fput+0x170/0x3b0
       ____fput+0x12/0x20
       task_work_run+0xa2/0xf0
       exit_to_usermode_loop+0xeb/0xf0
       do_syscall_64+0x2be/0x300
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      RIP: 0033:0x7fa16d40aab7
      
      Allocated by task 3201:
       save_stack+0x23/0x90
       __kasan_kmalloc.constprop.0+0xcf/0xe0
       kasan_kmalloc+0xd/0x10
       kmem_cache_alloc_trace+0x161/0x3c0
       sr_probe+0x12f/0xb60 [sr_mod]
       really_probe+0x183/0x5d0
       driver_probe_device+0x13f/0x1a0
       __device_attach_driver+0xe6/0x150
       bus_for_each_drv+0x101/0x160
       __device_attach+0x183/0x230
       device_initial_probe+0x17/0x20
       bus_probe_device+0x110/0x130
       device_add+0xb7b/0xd40
       scsi_sysfs_add_sdev+0xe8/0x360 [scsi_mod]
       scsi_probe_and_add_lun+0xdc4/0x14c0 [scsi_mod]
       __scsi_scan_target+0x12d/0x850 [scsi_mod]
       scsi_scan_channel+0xcd/0xe0 [scsi_mod]
       scsi_scan_host_selected+0x182/0x190 [scsi_mod]
       store_scan+0x1e9/0x200 [scsi_mod]
       dev_attr_store+0x42/0x60
       sysfs_kf_write+0x8b/0xb0
       kernfs_fop_write+0x158/0x250
       __vfs_write+0x4c/0x90
       vfs_write+0x145/0x2c0
       ksys_write+0xd7/0x180
       __x64_sys_write+0x47/0x50
       do_syscall_64+0x6f/0x300
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Freed by task 1326:
       save_stack+0x23/0x90
       __kasan_slab_free+0x13a/0x190
       kasan_slab_free+0x12/0x20
       kfree+0x109/0x410
       sr_kref_release+0xc1/0xd0 [sr_mod]
       scsi_cd_put+0x79/0x90 [sr_mod]
       sr_block_release+0x54/0x70 [sr_mod]
       __blkdev_put+0x2ce/0x3c0
       blkdev_put+0x68/0x220
       blkdev_close+0x4d/0x60
       __fput+0x170/0x3b0
       ____fput+0x12/0x20
       task_work_run+0xa2/0xf0
       exit_to_usermode_loop+0xeb/0xf0
       do_syscall_64+0x2be/0x300
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Link: https://lore.kernel.org/r/20200330025151.10535-1-bvanassche@acm.org
      Fixes: 51a85881 ("scsi: sr: get rid of sr global mutex")
      Cc: Merlijn Wajer <merlijn@archive.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: <stable@kernel.org>
      Acked-by: NMerlijn Wajer <merlijn@archive.org>
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      72655c0e
    • A
      scsi: aic7xxx: Remove more FreeBSD-specific code · 0d2b5951
      Alex Dewar 提交于
      Remove additional code for FreeBSD in aic7xxx_core.c, which is unneeded
      since commit cca6cb8a ("scsi: aic7xxx: Fix build using bare-metal
      toolchain").
      
      Link: https://lore.kernel.org/r/20200327191102.78554-1-alex.dewar@gmx.co.ukSuggested-by: NMartin Petersen <martin.petersen@oracle.com>
      Signed-off-by: NAlex Dewar <alex.dewar@gmx.co.uk>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      0d2b5951
    • S
      scsi: mpt3sas: Fix kernel panic observed on soft HBA unplug · cc41f11a
      Sreekanth Reddy 提交于
      Generic protection fault type kernel panic is observed when user performs
      soft (ordered) HBA unplug operation while IOs are running on drives
      connected to HBA.
      
      When user performs ordered HBA removal operation, the kernel calls PCI
      device's .remove() call back function where driver is flushing out all the
      outstanding SCSI IO commands with DID_NO_CONNECT host byte and also unmaps
      sg buffers allocated for these IO commands.
      
      However, in the ordered HBA removal case (unlike of real HBA hot removal),
      HBA device is still alive and hence HBA hardware is performing the DMA
      operations to those buffers on the system memory which are already unmapped
      while flushing out the outstanding SCSI IO commands and this leads to
      kernel panic.
      
      Don't flush out the outstanding IOs from .remove() path in case of ordered
      removal since HBA will be still alive in this case and it can complete the
      outstanding IOs. Flush out the outstanding IOs only in case of 'physical
      HBA hot unplug' where there won't be any communication with the HBA.
      
      During shutdown also it is possible that HBA hardware can perform DMA
      operations on those outstanding IO buffers which are completed with
      DID_NO_CONNECT by the driver from .shutdown(). So same above fix is applied
      in shutdown path as well.
      
      It is safe to drop the outstanding commands when HBA is inaccessible such
      as when permanent PCI failure happens, when HBA is in non-operational
      state, or when someone does a real HBA hot unplug operation. Since driver
      knows that HBA is inaccessible during these cases, it is safe to drop the
      outstanding commands instead of waiting for SCSI error recovery to kick in
      and clear these outstanding commands.
      
      Link: https://lore.kernel.org/r/1585302763-23007-1-git-send-email-sreekanth.reddy@broadcom.com
      Fixes: c666d3be ("scsi: mpt3sas: wait for and flush running commands on shutdown/unload")
      Cc: stable@vger.kernel.org #v4.14.174+
      Signed-off-by: NSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      cc41f11a
    • S
      scsi: ufs: set device as active power mode after resetting device · 1764fa2a
      Stanley Chu 提交于
      Currently ufshcd driver assumes that bInitPowerMode parameter is not
      changed by any vendors thus device power mode can be set as "Active" during
      initialization.
      
      According to UFS JEDEC specification, device power mode shall be "Active"
      after HW Reset is triggered if the bInitPowerMode parameter in Device
      Descriptor is default value.
      
      By above description, we can set device power mode as "Active" after device
      reset is triggered by vendor's callback. With this change, the link startup
      performance can be improved in some cases by not setting link_startup_again
      as true in ufshcd_link_startup().
      
      Link: https://lore.kernel.org/r/20200327095835.10293-1-stanley.chu@mediatek.comReviewed-by: NCan Guo <cang@codeaurora.org>
      Reviewed-by: NAsutosh Das <asutoshd@codeaurora.org>
      Signed-off-by: NStanley Chu <stanley.chu@mediatek.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      1764fa2a
    • W
      scsi: iscsi: Report unbind session event when the target has been removed · 13e60d3b
      Wu Bo 提交于
      If the daemon is restarted or crashes while logging out of a session, the
      unbind session event sent by the kernel is not processed and is lost.  When
      the daemon starts again, the session can't be unbound because the daemon is
      waiting for the event message. However, the kernel has already logged out
      and the event will not be resent.
      
      When iscsid restart is complete, logout session reports error:
      
      Logging out of session [sid: 6, target: iqn.xxxxx, portal: xx.xx.xx.xx,3260]
      iscsiadm: Could not logout of [sid: 6, target: iscsiadm -m node iqn.xxxxx, portal: xx.xx.xx.xx,3260].
      iscsiadm: initiator reported error (9 - internal error)
      iscsiadm: Could not logout of all requested sessions
      
      Make sure the unbind event is emitted.
      
      [mkp: commit desc and applied by hand since patch was mangled]
      
      Link: https://lore.kernel.org/r/4eab1771-2cb3-8e79-b31c-923652340e99@huawei.comReviewed-by: NLee Duncan <lduncan@suse.com>
      Signed-off-by: NWu Bo <wubo40@huawei.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      13e60d3b
  5. 30 3月, 2020 13 次提交
  6. 29 3月, 2020 1 次提交
  7. 27 3月, 2020 14 次提交