1. 01 Apr, 2020 3 commits
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Fix kernel panic observed on soft HBA unplug · cc41f11a
      Sreekanth Reddy authored
      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: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      cc41f11a
    • Stanley Chu's avatar
      scsi: ufs: set device as active power mode after resetting device · 1764fa2a
      Stanley Chu authored
      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: default avatarCan Guo <cang@codeaurora.org>
      Reviewed-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
      Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      1764fa2a
    • Wu Bo's avatar
      scsi: iscsi: Report unbind session event when the target has been removed · 13e60d3b
      Wu Bo authored
      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: default avatarLee Duncan <lduncan@suse.com>
      Signed-off-by: default avatarWu Bo <wubo40@huawei.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      13e60d3b
  2. 29 Mar, 2020 18 commits
  3. 27 Mar, 2020 19 commits