1. 08 8月, 2019 31 次提交
  2. 31 7月, 2019 9 次提交
    • Q
      scsi: qla2xxx: Reject EH_{abort|device_reset|target_request} · 7f4374e6
      Quinn Tran 提交于
      Reject eh_{abort|device_reset|target_reset} when rport is being torn down
      or chip is down.
      Signed-off-by: NQuinn Tran <quinn.tran@cavium.com>
      Signed-off-by: NHimanshu Madhani <hmadhani@marvell.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      7f4374e6
    • Q
      scsi: qla2xxx: Skip FW dump on LOOP initialization error · 5e5402c1
      Quinn Tran 提交于
      Firmware dump captured during LOOP Init error does not yield any
      significant information.  This patch removes call to trigger firmware dump
      collection during Loop Initialization.
      Signed-off-by: NQuinn Tran <qutran@marvell.com>
      Signed-off-by: NHimanshu Madhani <hmadhani@marvell.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      5e5402c1
    • Q
      scsi: qla2xxx: Use Correct index for Q-Pair array · 178235f4
      Quinn Tran 提交于
      For target mode, the default number of Q-Pairs allowed to use is 2. If the
      number of Q-Pairs allocated is lower than the default Q-Pairs, then lower
      value should be the set as default.
      
      [mkp: typo]
      Signed-off-by: NQuinn Tran <qutran@marvell.com>
      Signed-off-by: NHimanshu Madhani <hmadhani@marvell.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      178235f4
    • Q
      scsi: qla2xxx: Fix abort timeout race condition. · 0c6df590
      Quinn Tran 提交于
      If an abort times out, the Abort IOCB completion and Abort timer can race
      against each other. This patch provides unique error code for timer path to
      allow proper cleanup.
      
      [mkp: typo]
      Signed-off-by: NQuinn Tran <qutran@marvell.com>
      Signed-off-by: NHimanshu Madhani <hmadhani@marvell.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      0c6df590
    • Q
      scsi: qla2xxx: Fix different size DMA Alloc/Unmap · d376dbda
      Quinn Tran 提交于
      [   17.177276] qla2xxx 0000:05:00.0: DMA-API: device driver frees DMA memory
          with different size [device address=0x00000006198b0000] [map size=32784 bytes]
          [unmap size=8208 bytes]
      [   17.177390] RIP: 0010:check_unmap+0x7a2/0x1750
      [   17.177425] Call Trace:
      [   17.177438]  debug_dma_free_coherent+0x1b5/0x2d5
      [   17.177470]  dma_free_attrs+0x7f/0x140
      [   17.177489]  qla24xx_sp_unmap+0x1e2/0x610 [qla2xxx]
      [   17.177509]  qla24xx_async_gnnft_done+0x9c6/0x17d0 [qla2xxx]
      [   17.177535]  qla2x00_do_work+0x514/0x2200 [qla2xxx]
      
      Fixes: b5f3bc39 ("scsi: qla2xxx: Fix inconsistent DMA mem alloc/free")
      Signed-off-by: NQuinn Tran <qutran@marvell.com>
      Signed-off-by: NHimanshu Madhani <hmadhani@marvell.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      d376dbda
    • H
      scsi: qla2xxx: Fix DMA unmap leak · 5d328de6
      Himanshu Madhani 提交于
      With debug kernel we see following wanings indicating memory leak.
      
      [28809.523959] WARNING: CPU: 3 PID: 6790 at lib/dma-debug.c:978
      dma_debug_device_change+0x166/0x1d0
      [28809.523964] pci 0000:0c:00.6: DMA-API: device driver has pending DMA
      allocations while released from device [count=5]
      [28809.523964] One of leaked entries details: [device
      address=0x00000002aefe4000] [size=8208 bytes] [mapped with DMA_BIDIRECTIONAL]
      [mapped as coherent]
      
      Fix this by unmapping DMA memory.
      Signed-off-by: NQuinn Tran <qutran@marvell.com>
      Signed-off-by: NHimanshu Madhani <hmadhani@marvell.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      5d328de6
    • M
      scsi: mpt3sas: support target smid for [abort|query] task · 8f55c307
      Minwoo Im 提交于
      We can request task management IOCTL command(MPI2_FUNCTION_SCSI_TASK_MGMT)
      to /dev/mpt3ctl.  If the given task_type is either abort task or query
      task, it may need a field named "Initiator Port Transfer Tag to Manage" in
      the IU.
      
      Current code does not support to check target IPTT tag from the tm_request.
      This patch introduces to check TaskMID given from the userspace as a target
      tag.  We have a rule of relationship between
      (struct request *req->tag) and smid in mpt3sas_base.c:
      
      3318 u16
      3319 mpt3sas_base_get_smid_scsiio(struct MPT3SAS_ADAPTER *ioc, u8 cb_idx,
      3320         struct scsi_cmnd *scmd)
      3321 {
      3322         struct scsiio_tracker *request = scsi_cmd_priv(scmd);
      3323         unsigned int tag = scmd->request->tag;
      3324         u16 smid;
      3325
      3326         smid = tag + 1;
      
      So if we want to abort a request tagged #X, then we can pass (X + 1) to
      this IOCTL handler.  Otherwise, user space just can pass 0 TaskMID to abort
      the first outstanding smid which is legacy behaviour.
      
      Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
      Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
      Cc: Sathya Prakash <sathya.prakash@broadcom.com>
      Cc: James E.J. Bottomley <jejb@linux.ibm.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: MPT-FusionLinux.pdl@broadcom.com
      Signed-off-by: NMinwoo Im <minwoo.im@samsung.com>
      Acked-by: NSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: NMinwoo Im <minwoo.im.dev@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      8f55c307
    • G
      scsi: ibmvscsi_tgt: Mark expected switch fall-throughs · 9fba647c
      Gustavo A. R. Silva 提交于
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warnings (Building: powerpc allyesconfig):
      
      drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_adapter_info':
      drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1582:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (connection_broken(vscsi))
            ^
      drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1584:2: note: here
        default:
        ^~~~~~~
      drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function 'ibmvscsis_ping_response':
      drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2494:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
         vscsi->flags |= CLIENT_FAILED;
      drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2495:2: note: here
        case H_DROPPED:
        ^~~~
      drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2496:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
         vscsi->flags |= RESPONSE_Q_DOWN;
      drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:2497:2: note: here
        case H_REMOTE_PARM:
        ^~~~
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NBryant G. Ly <bly@catalogicsoftware.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      9fba647c
    • G
      scsi: cxlflash: Mark expected switch fall-throughs · 657bd277
      Gustavo A. R. Silva 提交于
      Mark switch cases where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      drivers/scsi/cxlflash/main.c: In function 'send_afu_cmd':
      drivers/scsi/cxlflash/main.c:2347:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (rc) {
            ^
      drivers/scsi/cxlflash/main.c:2357:2: note: here
        case -EAGAIN:
        ^~~~
      drivers/scsi/cxlflash/main.c: In function 'term_intr':
      drivers/scsi/cxlflash/main.c:754:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (index == PRIMARY_HWQ)
            ^
      drivers/scsi/cxlflash/main.c:756:2: note: here
        case UNMAP_TWO:
        ^~~~
      drivers/scsi/cxlflash/main.c:757:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 2, hwq);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/cxlflash/main.c:758:2: note: here
        case UNMAP_ONE:
        ^~~~
      drivers/scsi/cxlflash/main.c:759:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         cfg->ops->unmap_afu_irq(hwq->ctx_cookie, 1, hwq);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/cxlflash/main.c:760:2: note: here
        case FREE_IRQ:
        ^~~~
      drivers/scsi/cxlflash/main.c: In function 'cxlflash_remove':
      drivers/scsi/cxlflash/main.c:975:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         cxlflash_release_chrdev(cfg);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/cxlflash/main.c:976:2: note: here
        case INIT_STATE_SCSI:
        ^~~~
      drivers/scsi/cxlflash/main.c:978:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         scsi_remove_host(cfg->host);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/cxlflash/main.c:979:2: note: here
        case INIT_STATE_AFU:
        ^~~~
      drivers/scsi/cxlflash/main.c:980:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         term_afu(cfg);
         ^~~~~~~~~~~~~
      drivers/scsi/cxlflash/main.c:981:2: note: here
        case INIT_STATE_PCI:
        ^~~~
      drivers/scsi/cxlflash/main.c:983:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
         pci_disable_device(pdev);
         ^~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/cxlflash/main.c:984:2: note: here
        case INIT_STATE_NONE:
        ^~~~
      drivers/scsi/cxlflash/main.c: In function 'num_hwqs_store':
      drivers/scsi/cxlflash/main.c:3018:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (cfg->state == STATE_NORMAL)
            ^
      drivers/scsi/cxlflash/main.c:3020:2: note: here
        default:
        ^~~~~~~
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Acked-by: NMatthew R. Ochs <mrochs@linux.ibm.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      657bd277