1. 06 Apr, 2017 10 commits
  2. 05 Apr, 2017 2 commits
  3. 04 Apr, 2017 1 commit
    • Arnd Bergmann's avatar
      scsi: advansys: fix uninitialized data access · 44a5b977
      Arnd Bergmann authored
      gcc-7.0.1 now warns about a previously unnoticed access of uninitialized
      struct members:
      
      drivers/scsi/advansys.c: In function 'AscMsgOutSDTR':
      drivers/scsi/advansys.c:3860:26: error: '*((void *)&sdtr_buf+5)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
               ((ushort)s_buffer[i + 1] << 8) | s_buffer[i]);
                                ^
      drivers/scsi/advansys.c:3860:26: error: '*((void *)&sdtr_buf+7)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      drivers/scsi/advansys.c:3860:26: error: '*((void *)&sdtr_buf+5)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      drivers/scsi/advansys.c:3860:26: error: '*((void *)&sdtr_buf+7)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      The code has existed in this exact form at least since v2.6.12, and the
      warning seems correct. This uses named initializers to ensure we
      initialize all members of the structure.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      44a5b977
  4. 30 Mar, 2017 12 commits
  5. 28 Mar, 2017 13 commits
  6. 23 Mar, 2017 2 commits
    • Brian King's avatar
      16a20b52
    • Brian King's avatar
      scsi: ipr: Fix SATA EH hang · ef97d8ae
      Brian King authored
      This patch fixes a hang that can occur in ATA EH with ipr. With ipr's
      usage of libata, commands should never end up on ap->eh_done_q. The
      timeout function we use for ipr, even for SATA devices, is
      scsi_times_out, so ATA_QCFLAG_EH_SCHEDULED never gets set for ipr and EH
      is driven completely by ipr and SCSI. The SCSI EH thread ends up calling
      ipr's eh_device_reset_handler, which then calls
      ata_std_error_handler. This ends up calling ipr_sata_reset, which issues
      a reset to the device. This should result in all pending commands
      getting failed back and having ata_qc_complete called for them, which
      should end up clearing ATA_QCFLAG_FAILED as qc->flags gets zeroed in
      ata_qc_free.  This ensures that when we end up in ata_eh_finish, we
      don't do anything more with the command.
      
      On adapters that only support a single interrupt and when running with
      two MSI-X vectors or less, the adapter firmware guarantees that
      responses to all outstanding commands are sent back prior to sending the
      response to the SATA reset command.  On newer adapters supporting
      multiple HRRQs, however, this can no longer be guaranteed, since the
      command responses and reset response may be processed on different
      HRRQs.
      
      If ipr returns from ipr_sata_reset before the outstanding command was
      returned, this sends us down the path of __ata_eh_qc_complete which then
      moves the associated scsi_cmd from the work_q in
      scsi_eh_bus_device_reset to ap->eh_done_q, which then will sit there
      forever and we will be wedged.
      
      This patch fixes this up by ensuring that any outstanding commands are
      flushed before returning from eh_device_reset_handler for a SATA device.
      Reported-by: default avatarDavid Jeffery <djeffery@redhat.com>
      Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Reviewed-by: default avatarWendy Xiong <wenxiong@linux.vnet.ibm.com>
      Tested-by: default avatarWendy Xiong <wenxiong@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      ef97d8ae