1. 12 Jan, 2017 3 commits
  2. 10 Jan, 2017 2 commits
    • Dave Jones's avatar
      scsi: qla2xxx: Fix apparent cut-n-paste error. · c3c42394
      Dave Jones authored
      Commit 093df737 ("scsi: qla2xxx: Fix Target mode handling with
      Multiqueue changes.") introduces two bodies of code that look similar
      but with s/req/rsp/ in the second instance.  But in one case, it looks
      like this conversion was missed.
      Signed-off-by: default avatarDave Jones <davej@codemonkey.org.uk>
      Reviewed-by: default avatarLaurence Oberman <loberman@redhat.com>
      Acked-by: default avatarQuinn Tran <Quinn.Tran@cavium.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      c3c42394
    • Milan P. Gandhi's avatar
      scsi: qla2xxx: Get mutex lock before checking optrom_state · c7702b8c
      Milan P. Gandhi authored
      There is a race condition with qla2xxx optrom functions where one thread
      might modify optrom buffer, optrom_state while other thread is still
      reading from it.
      
      In couple of crashes, it was found that we had successfully passed the
      following 'if' check where we confirm optrom_state to be
      QLA_SREADING. But by the time we acquired mutex lock to proceed with
      memory_read_from_buffer function, some other thread/process had already
      modified that option rom buffer and optrom_state from QLA_SREADING to
      QLA_SWAITING. Then we got ha->optrom_buffer 0x0 and crashed the system:
      
              if (ha->optrom_state != QLA_SREADING)
                      return 0;
      
              mutex_lock(&ha->optrom_mutex);
              rval = memory_read_from_buffer(buf, count, &off, ha->optrom_buffer,
                  ha->optrom_region_size);
              mutex_unlock(&ha->optrom_mutex);
      
      With current optrom function we get following crash due to a race
      condition:
      
      [ 1479.466679] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [ 1479.466707] IP: [<ffffffff81326756>] memcpy+0x6/0x110
      [...]
      [ 1479.473673] Call Trace:
      [ 1479.474296]  [<ffffffff81225cbc>] ? memory_read_from_buffer+0x3c/0x60
      [ 1479.474941]  [<ffffffffa01574dc>] qla2x00_sysfs_read_optrom+0x9c/0xc0 [qla2xxx]
      [ 1479.475571]  [<ffffffff8127e76b>] read+0xdb/0x1f0
      [ 1479.476206]  [<ffffffff811fdf9e>] vfs_read+0x9e/0x170
      [ 1479.476839]  [<ffffffff811feb6f>] SyS_read+0x7f/0xe0
      [ 1479.477466]  [<ffffffff816964c9>] system_call_fastpath+0x16/0x1b
      
      Below patch modifies qla2x00_sysfs_read_optrom,
      qla2x00_sysfs_write_optrom functions to get the mutex_lock before
      checking ha->optrom_state to avoid similar crashes.
      
      The patch was applied and tested and same crashes were no longer
      observed again.
      Tested-by: default avatarMilan P. Gandhi <mgandhi@redhat.com>
      Signed-off-by: default avatarMilan P. Gandhi <mgandhi@redhat.com>
      Reviewed-by: default avatarLaurence Oberman <loberman@redhat.com>
      Acked-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      c7702b8c
  3. 06 Jan, 2017 3 commits
  4. 20 Dec, 2016 2 commits
  5. 14 Dec, 2016 30 commits
    • Wei Fang's avatar
      scsi: avoid a permanent stop of the scsi device's request queue · d2a14525
      Wei Fang authored
      A race between scanning and fc_remote_port_delete() may result in a
      permanent stop if the device gets blocked before scsi_sysfs_add_sdev()
      and unblocked after.  The reason is that blocking a device sets both the
      SDEV_BLOCKED state and the QUEUE_FLAG_STOPPED.  However,
      scsi_sysfs_add_sdev() unconditionally sets SDEV_RUNNING which causes the
      device to be ignored by scsi_target_unblock() and thus never have its
      QUEUE_FLAG_STOPPED cleared leading to a device which is apparently
      running but has a stopped queue.
      
      We actually have two places where SDEV_RUNNING is set: once in
      scsi_add_lun() which respects the blocked flag and once in
      scsi_sysfs_add_sdev() which doesn't.  Since the second set is entirely
      spurious, simply remove it to fix the problem.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatarZengxi Chen <chenzengxi@huawei.com>
      Signed-off-by: default avatarWei Fang <fangwei1@huawei.com>
      Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      d2a14525
    • Adam Manzanares's avatar
      scsi: mpt3sas: Recognize and act on iopriority info · 307d9075
      Adam Manzanares authored
      This patch adds support for request iopriority handling in the mpt3sas
      layer. This works only when a ATA device is behind the SATL. The ATA
      device also has to indicate that it supports command priorities in the
      identify information that is pulled from the SATL.
      Signed-off-by: default avatarAdam Manzanares <adam.manzanares@wdc.com>
      Acked-by: default avatarSreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      307d9075
    • Quinn Tran's avatar
      scsi: qla2xxx: Fix Target mode handling with Multiqueue changes. · 093df737
      Quinn Tran authored
      - Fix race condition between dpc_thread accessing Multiqueue resources
        and qla2x00_remove_one thread trying to free resource.
      - Fix out of order free for Multiqueue resources. Also, Multiqueue
        interrupts needs a workqueue. Interrupt needed to stop before
        the wq can be destroyed.
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      093df737
    • Michael Hernandez's avatar
      scsi: qla2xxx: Add Block Multi Queue functionality. · 5601236b
      Michael Hernandez authored
      Tell the SCSI layer how many hardware queues we have based on the number
      of max queue pairs created. The number of max queue pairs created will
      depend on number of MSI-X vector count.
      
      This feature can be turned on via CONFIG_SCSI_MQ_DEFAULT or passing
      scsi_mod.use_blk_mq=Y as a parameter to the kernel
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Signed-off-by: default avatarSawan Chandak <sawan.chandak@cavium.com>
      Signed-off-by: default avatarMichael Hernandez <michael.hernandez@cavium.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      5601236b
    • Michael Hernandez's avatar
      scsi: qla2xxx: Add multiple queue pair functionality. · d7459527
      Michael Hernandez authored
      Replaced existing multiple queue functionality with framework
      that allows for the creation of pairs of request and response queues,
      either at start of day or dynamically.
      
      Queue pair creation depend on module parameter "ql2xmqsupport",
      which need to be enabled to create queue pair.
      Signed-off-by: default avatarSawan Chandak <sawan.chandak@cavium.com>
      Signed-off-by: default avatarMichael Hernandez <michael.hernandez@cavium.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Acked-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      d7459527
    • Michael Hernandez's avatar
      scsi: qla2xxx: Utilize pci_alloc_irq_vectors/pci_free_irq_vectors calls. · 4fa18345
      Michael Hernandez authored
      Replaces the old pci_enable_msi[x]* and pci_disable_msi[x] calls.
      Signed-off-by: default avatarMichael Hernandez <michael.hernandez@cavium.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      4fa18345
    • himanshu.madhani@cavium.com's avatar
      scsi: qla2xxx: Only allow operational MBX to proceed during RESET. · 77ddb94a
      himanshu.madhani@cavium.com authored
      This patch is allowing only ROM mailbox command which are
      necessary to initialize chip after a reset has been issued.
      In a target environment, there could be a user space daemon
      which can issue statistics and other management mailbox command
      which are non-critical. This patch will timeout non critical
      mailbox commands immediately rather than waiting for timeout,
      if driver detects that chip reset has been issued or chip reset
      is in progress.
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: default avatarGiridhar Malavali <giridhar.malavali@cavium.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      77ddb94a
    • Amit Kushwaha's avatar
      scsi: hpsa: remove memory allocate failure message · 7e8a9486
      Amit Kushwaha authored
      This patch cleanup warning reported by checkpatch.pl WARNING: Possible
      unnecessary 'out of memory' message With no available memory, a warn on
      message already gets printed by page alloc apis and modified goto use if
      memory unallocated.
      Signed-off-by: default avatarAmit Kushwaha <kushwaha.a@samsung.com>
      Acked-by: default avatarDon Brace <don.brace@microsemi.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      7e8a9486
    • adam radford's avatar
      scsi: Update 3ware driver email addresses · 2c9bce5b
      adam radford authored
      This change updates the 3ware drivers (3w-xxxx, 3w-9xxx, 3w-sas) email
      addresses from linuxraid@lsi.com to aradford@gmail.com, since the old
      email address doesn't exist.
      
      This patch was updated to remove www.lsi.com text.
      
      [mkp: applied by hand]
      Signed-off-by: default avatarAdam Radford <aradford@gmail.com>
      Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      2c9bce5b
    • Steffen Maier's avatar
      scsi: zfcp: fix rport unblock race with LUN recovery · 6f2ce1c6
      Steffen Maier authored
      It is unavoidable that zfcp_scsi_queuecommand() has to finish requests
      with DID_IMM_RETRY (like fc_remote_port_chkready()) during the time
      window when zfcp detected an unavailable rport but
      fc_remote_port_delete(), which is asynchronous via
      zfcp_scsi_schedule_rport_block(), has not yet blocked the rport.
      
      However, for the case when the rport becomes available again, we should
      prevent unblocking the rport too early.  In contrast to other FCP LLDDs,
      zfcp has to open each LUN with the FCP channel hardware before it can
      send I/O to a LUN.  So if a port already has LUNs attached and we
      unblock the rport just after port recovery, recoveries of LUNs behind
      this port can still be pending which in turn force
      zfcp_scsi_queuecommand() to unnecessarily finish requests with
      DID_IMM_RETRY.
      
      This also opens a time window with unblocked rport (until the followup
      LUN reopen recovery has finished).  If a scsi_cmnd timeout occurs during
      this time window fc_timed_out() cannot work as desired and such command
      would indeed time out and trigger scsi_eh. This prevents a clean and
      timely path failover.  This should not happen if the path issue can be
      recovered on FC transport layer such as path issues involving RSCNs.
      
      Fix this by only calling zfcp_scsi_schedule_rport_register(), to
      asynchronously trigger fc_remote_port_add(), after all LUN recoveries as
      children of the rport have finished and no new recoveries of equal or
      higher order were triggered meanwhile.  Finished intentionally includes
      any recovery result no matter if successful or failed (still unblock
      rport so other successful LUNs work).  For simplicity, we check after
      each finished LUN recovery if there is another LUN recovery pending on
      the same port and then do nothing.  We handle the special case of a
      successful recovery of a port without LUN children the same way without
      changing this case's semantics.
      
      For debugging we introduce 2 new trace records written if the rport
      unblock attempt was aborted due to still unfinished or freshly triggered
      recovery. The records are only written above the default trace level.
      
      Benjamin noticed the important special case of new recovery that can be
      triggered between having given up the erp_lock and before calling
      zfcp_erp_action_cleanup() within zfcp_erp_strategy().  We must avoid the
      following sequence:
      
      ERP thread                 rport_work      other context
      -------------------------  --------------  --------------------------------
      port is unblocked, rport still blocked,
       due to pending/running ERP action,
       so ((port->status & ...UNBLOCK) != 0)
       and (port->rport == NULL)
      unlock ERP
      zfcp_erp_action_cleanup()
      case ZFCP_ERP_ACTION_REOPEN_LUN:
      zfcp_erp_try_rport_unblock()
      ((status & ...UNBLOCK) != 0) [OLD!]
                                                 zfcp_erp_port_reopen()
                                                 lock ERP
                                                 zfcp_erp_port_block()
                                                 port->status clear ...UNBLOCK
                                                 unlock ERP
                                                 zfcp_scsi_schedule_rport_block()
                                                 port->rport_task = RPORT_DEL
                                                 queue_work(rport_work)
                                 zfcp_scsi_rport_work()
                                 (port->rport_task != RPORT_ADD)
                                 port->rport_task = RPORT_NONE
                                 zfcp_scsi_rport_block()
                                 if (!port->rport) return
      zfcp_scsi_schedule_rport_register()
      port->rport_task = RPORT_ADD
      queue_work(rport_work)
                                 zfcp_scsi_rport_work()
                                 (port->rport_task == RPORT_ADD)
                                 port->rport_task = RPORT_NONE
                                 zfcp_scsi_rport_register()
                                 (port->rport == NULL)
                                 rport = fc_remote_port_add()
                                 port->rport = rport;
      
      Now the rport was erroneously unblocked while the zfcp_port is blocked.
      This is another situation we want to avoid due to scsi_eh
      potential. This state would at least remain until the new recovery from
      the other context finished successfully, or potentially forever if it
      failed.  In order to close this race, we take the erp_lock inside
      zfcp_erp_try_rport_unblock() when checking the status of zfcp_port or
      LUN.  With that, the possible corresponding rport state sequences would
      be: (unblock[ERP thread],block[other context]) if the ERP thread gets
      erp_lock first and still sees ((port->status & ...UNBLOCK) != 0),
      (block[other context],NOP[ERP thread]) if the ERP thread gets erp_lock
      after the other context has already cleard ...UNBLOCK from port->status.
      
      Since checking fields of struct erp_action is unsafe because they could
      have been overwritten (re-used for new recovery) meanwhile, we only
      check status of zfcp_port and LUN since these are only changed under
      erp_lock elsewhere. Regarding the check of the proper status flags (port
      or port_forced are similar to the shown adapter recovery):
      
      [zfcp_erp_adapter_shutdown()]
      zfcp_erp_adapter_reopen()
       zfcp_erp_adapter_block()
        * clear UNBLOCK ---------------------------------------+
       zfcp_scsi_schedule_rports_block()                       |
       write_lock_irqsave(&adapter->erp_lock, flags);-------+  |
       zfcp_erp_action_enqueue()                            |  |
        zfcp_erp_setup_act()                                |  |
         * set ERP_INUSE -----------------------------------|--|--+
       write_unlock_irqrestore(&adapter->erp_lock, flags);--+  |  |
      .context-switch.                                         |  |
      zfcp_erp_thread()                                        |  |
       zfcp_erp_strategy()                                     |  |
        write_lock_irqsave(&adapter->erp_lock, flags);------+  |  |
        ...                                                 |  |  |
        zfcp_erp_strategy_check_target()                    |  |  |
         zfcp_erp_strategy_check_adapter()                  |  |  |
          zfcp_erp_adapter_unblock()                        |  |  |
           * set UNBLOCK -----------------------------------|--+  |
        zfcp_erp_action_dequeue()                           |     |
         * clear ERP_INUSE ---------------------------------|-----+
        ...                                                 |
        write_unlock_irqrestore(&adapter->erp_lock, flags);-+
      
      Hence, we should check for both UNBLOCK and ERP_INUSE because they are
      interleaved.  Also we need to explicitly check ERP_FAILED for the link
      down case which currently does not clear the UNBLOCK flag in
      zfcp_fsf_link_down_info_eval().
      Signed-off-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
      Fixes: 8830271c ("[SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport")
      Fixes: a2fa0aed ("[SCSI] zfcp: Block FC transport rports early on errors")
      Fixes: 5f852be9 ("[SCSI] zfcp: Fix deadlock between zfcp ERP and SCSI")
      Fixes: 338151e0 ("[SCSI] zfcp: make use of fc_remote_port_delete when target port is unavailable")
      Fixes: 3859f6a2 ("[PATCH] zfcp: add rports to enable scsi_add_device to work again")
      Cc: <stable@vger.kernel.org> #2.6.32+
      Reviewed-by: default avatarBenjamin Block <bblock@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      6f2ce1c6
    • Steffen Maier's avatar
      scsi: zfcp: do not trace pure benign residual HBA responses at default level · 56d23ed7
      Steffen Maier authored
      Since quite a while, Linux issues enough SCSI commands per scsi_device
      which successfully return with FCP_RESID_UNDER, FSF_FCP_RSP_AVAILABLE,
      and SAM_STAT_GOOD.  This floods the HBA trace area and we cannot see
      other and important HBA trace records long enough.
      
      Therefore, do not trace HBA response errors for pure benign residual
      under counts at the default trace level.
      
      This excludes benign residual under count combined with other validity
      bits set in FCP_RSP_IU, such as FCP_SNS_LEN_VAL.  For all those other
      cases, we still do want to see both the HBA record and the corresponding
      SCSI record by default.
      Signed-off-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
      Fixes: a54ca0f6 ("[SCSI] zfcp: Redesign of the debug tracing for HBA records.")
      Cc: <stable@vger.kernel.org> #2.6.37+
      Reviewed-by: default avatarBenjamin Block <bblock@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      56d23ed7
    • Benjamin Block's avatar
      scsi: zfcp: fix use-after-"free" in FC ingress path after TMF · dac37e15
      Benjamin Block authored
      When SCSI EH invokes zFCP's callbacks for eh_device_reset_handler() and
      eh_target_reset_handler(), it expects us to relent the ownership over
      the given scsi_cmnd and all other scsi_cmnds within the same scope - LUN
      or target - when returning with SUCCESS from the callback ('release'
      them).  SCSI EH can then reuse those commands.
      
      We did not follow this rule to release commands upon SUCCESS; and if
      later a reply arrived for one of those supposed to be released commands,
      we would still make use of the scsi_cmnd in our ingress tasklet. This
      will at least result in undefined behavior or a kernel panic because of
      a wrong kernel pointer dereference.
      
      To fix this, we NULLify all pointers to scsi_cmnds (struct zfcp_fsf_req
      *)->data in the matching scope if a TMF was successful. This is done
      under the locks (struct zfcp_adapter *)->abort_lock and (struct
      zfcp_reqlist *)->lock to prevent the requests from being removed from
      the request-hashtable, and the ingress tasklet from making use of the
      scsi_cmnd-pointer in zfcp_fsf_fcp_cmnd_handler().
      
      For cases where a reply arrives during SCSI EH, but before we get a
      chance to NULLify the pointer - but before we return from the callback
      -, we assume that the code is protected from races via the CAS operation
      in blk_complete_request() that is called in scsi_done().
      
      The following stacktrace shows an example for a crash resulting from the
      previous behavior:
      
      Unable to handle kernel pointer dereference at virtual kernel address fffffee17a672000
      Oops: 0038 [#1] SMP
      CPU: 2 PID: 0 Comm: swapper/2 Not tainted
      task: 00000003f7ff5be0 ti: 00000003f3d38000 task.ti: 00000003f3d38000
      Krnl PSW : 0404d00180000000 00000000001156b0 (smp_vcpu_scheduled+0x18/0x40)
                 R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 EA:3
      Krnl GPRS: 000000200000007e 0000000000000000 fffffee17a671fd8 0000000300000015
                 ffffffff80000000 00000000005dfde8 07000003f7f80e00 000000004fa4e800
                 000000036ce8d8f8 000000036ce8d9c0 00000003ece8fe00 ffffffff969c9e93
                 00000003fffffffd 000000036ce8da10 00000000003bf134 00000003f3b07918
      Krnl Code: 00000000001156a2: a7190000        lghi    %r1,0
                 00000000001156a6: a7380015        lhi    %r3,21
                #00000000001156aa: e32050000008    ag    %r2,0(%r5)
                >00000000001156b0: 482022b0        lh    %r2,688(%r2)
                 00000000001156b4: ae123000        sigp    %r1,%r2,0(%r3)
                 00000000001156b8: b2220020        ipm    %r2
                 00000000001156bc: 8820001c        srl    %r2,28
                 00000000001156c0: c02700000001    xilf    %r2,1
      Call Trace:
      ([<0000000000000000>] 0x0)
       [<000003ff807bdb8e>] zfcp_fsf_fcp_cmnd_handler+0x3de/0x490 [zfcp]
       [<000003ff807be30a>] zfcp_fsf_req_complete+0x252/0x800 [zfcp]
       [<000003ff807c0a48>] zfcp_fsf_reqid_check+0xe8/0x190 [zfcp]
       [<000003ff807c194e>] zfcp_qdio_int_resp+0x66/0x188 [zfcp]
       [<000003ff80440c64>] qdio_kick_handler+0xdc/0x310 [qdio]
       [<000003ff804463d0>] __tiqdio_inbound_processing+0xf8/0xcd8 [qdio]
       [<0000000000141fd4>] tasklet_action+0x9c/0x170
       [<0000000000141550>] __do_softirq+0xe8/0x258
       [<000000000010ce0a>] do_softirq+0xba/0xc0
       [<000000000014187c>] irq_exit+0xc4/0xe8
       [<000000000046b526>] do_IRQ+0x146/0x1d8
       [<00000000005d6a3c>] io_return+0x0/0x8
       [<00000000005d6422>] vtime_stop_cpu+0x4a/0xa0
      ([<0000000000000000>] 0x0)
       [<0000000000103d8a>] arch_cpu_idle+0xa2/0xb0
       [<0000000000197f94>] cpu_startup_entry+0x13c/0x1f8
       [<0000000000114782>] smp_start_secondary+0xda/0xe8
       [<00000000005d6efe>] restart_int_handler+0x56/0x6c
       [<0000000000000000>] 0x0
      Last Breaking-Event-Address:
       [<00000000003bf12e>] arch_spin_lock_wait+0x56/0xb0
      Suggested-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Block <bblock@linux.vnet.ibm.com>
      Fixes: ea127f97 ("[PATCH] s390 (7/7): zfcp host adapter.") (tglx/history.git)
      Cc: <stable@vger.kernel.org> #2.6.32+
      Signed-off-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      dac37e15
    • Varun Prakash's avatar
      scsi: libcxgbi: return error if interface is not up · 165ae50e
      Varun Prakash authored
      Do not post hw active open cmd if IFF_UP is not set or link is down on
      the interface, return -ENETDOWN in this case.
      Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      165ae50e
    • Varun Prakash's avatar
      scsi: cxgb4i: libcxgbi: add missing module_put() · 1fe1fdb0
      Varun Prakash authored
      Add module_put() in cxgbi_sock_act_open_req_arp_failure() to release
      module reference in case of arp failure, also check return value of
      try_module_get() before posting active open hw cmd.
      Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      1fe1fdb0
    • Varun Prakash's avatar
      scsi: cxgb4i: libcxgbi: cxgb4: add T6 iSCSI completion feature · 44830d8f
      Varun Prakash authored
      T6 adapters reduce number of completions to host by generating single
      completion for all the directly placed(DDP) iSCSI pdus in a sequence.
      
      This patch adds new structure for completion hw cmd (struct
      cpl_rx_iscsi_cmp) and implements T6 completion feature.
      Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      44830d8f
    • Varun Prakash's avatar
      scsi: cxgb4i: libcxgbi: add active open cmd for T6 adapters · 586be7cb
      Varun Prakash authored
      Add T6 active open cmd to open active connections on T6 adapters.
      Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      586be7cb
    • Varun Prakash's avatar
      scsi: cxgb4i: use cxgb4_tp_smt_idx() to get smt_idx · e0eed8ab
      Varun Prakash authored
      cxgb4_tp_smt_idx() is defined in cxgb4 driver, it returns smt_idx for
      T4,T5,T6 adapters.
      Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      e0eed8ab
    • Manish Rangankar's avatar
      scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework. · ace7f46b
      Manish Rangankar authored
      The QLogic FastLinQ Driver for iSCSI (qedi) is the iSCSI specific module
      for 41000 Series Converged Network Adapters by QLogic.
      
      This patch consists of following changes:
      
        - MAINTAINERS Makefile and Kconfig changes for qedi,
        - PCI driver registration,
        - iSCSI host level initialization,
        - Debugfs and log level infrastructure.
      
      The following indiviual changes are merged into this commit:
      
        qedi: Add LL2 iSCSI interface for offload iSCSI.
        qedi: Add support for iSCSI session management.
        qedi: Add support for data path.
      Signed-off-by: default avatarNilesh Javali <nilesh.javali@cavium.com>
      Signed-off-by: default avatarAdheer Chandravanshi <adheer.chandravanshi@qlogic.com>
      Signed-off-by: default avatarChad Dupuis <chad.dupuis@cavium.com>
      Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@cavium.com>
      Signed-off-by: default avatarArun Easi <arun.easi@cavium.com>
      Signed-off-by: default avatarManish Rangankar <manish.rangankar@cavium.com>
      Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      ace7f46b
    • Linus Torvalds's avatar
      Merge tag 'dm-4.10-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm · 775a2e29
      Linus Torvalds authored
      Pull device mapper updates from Mike Snitzer:
      
       - various fixes and improvements to request-based DM and DM multipath
      
       - some locking improvements in DM bufio
      
       - add Kconfig option to disable the DM block manager's extra locking
         which mainly serves as a developer tool
      
       - a few bug fixes to DM's persistent-data
      
       - a couple changes to prepare for multipage biovec support in the block
         layer
      
       - various improvements and cleanups in the DM core, DM cache, DM raid
         and DM crypt
      
       - add ability to have DM crypt use keys from the kernel key retention
         service
      
       - add a new "error_writes" feature to the DM flakey target, reads are
         left unchanged in this mode
      
      * tag 'dm-4.10-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (40 commits)
        dm flakey: introduce "error_writes" feature
        dm cache policy smq: use hash_32() instead of hash_32_generic()
        dm crypt: reject key strings containing whitespace chars
        dm space map: always set ev if sm_ll_mutate() succeeds
        dm space map metadata: skip useless memcpy in metadata_ll_init_index()
        dm space map metadata: fix 'struct sm_metadata' leak on failed create
        Documentation: dm raid: define data_offset status field
        dm raid: fix discard support regression
        dm raid: don't allow "write behind" with raid4/5/6
        dm mpath: use hw_handler_params if attached hw_handler is same as requested
        dm crypt: add ability to use keys from the kernel key retention service
        dm array: remove a dead assignment in populate_ablock_with_values()
        dm ioctl: use offsetof() instead of open-coding it
        dm rq: simplify use_blk_mq initialization
        dm: use blk_set_queue_dying() in __dm_destroy()
        dm bufio: drop the lock when doing GFP_NOIO allocation
        dm bufio: don't take the lock in dm_bufio_shrink_count
        dm bufio: avoid sleeping while holding the dm_bufio lock
        dm table: simplify dm_table_determine_type()
        dm table: an 'all_blk_mq' table must be loaded for a blk-mq DM device
        ...
      775a2e29
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md · 2a4c32ed
      Linus Torvalds authored
      Pull MD updates from Shaohua Li:
      
       - a raid5 writeback cache feature.
      
         The goal is to aggregate writes to make full stripe write and reduce
         read-modify-write. It's helpful for workload which does sequential
         write and follows fsync for example. This feature is experimental and
         off by default right now.
      
       - FAILFAST support.
      
         This fails IOs to broken raid disks quickly, so can improve latency.
         It's mainly for DASD storage, but some patches help normal raid array
         too.
      
       - support bad block for raid array with external metadata
      
       - AVX2 instruction support for raid6 parity calculation
      
       - normalize MD info output
      
       - add missing blktrace
      
       - other bug fixes
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md: (66 commits)
        md: separate flags for superblock changes
        md: MD_RECOVERY_NEEDED is set for mddev->recovery
        md: takeover should clear unrelated bits
        md/r5cache: after recovery, increase journal seq by 10000
        md/raid5-cache: fix crc in rewrite_data_only_stripes()
        md/raid5-cache: no recovery is required when create super-block
        md: fix refcount problem on mddev when stopping array.
        md/r5cache: do r5c_update_log_state after log recovery
        md/raid5-cache: adjust the write position of the empty block if no data blocks
        md/r5cache: run_no_space_stripes() when R5C_LOG_CRITICAL == 0
        md/raid5: limit request size according to implementation limits
        md/raid5-cache: do not need to set STRIPE_PREREAD_ACTIVE repeatedly
        md/raid5-cache: remove the unnecessary next_cp_seq field from the r5l_log
        md/raid5-cache: release the stripe_head at the appropriate location
        md/raid5-cache: use ring add to prevent overflow
        md/raid5-cache: remove unnecessary function parameters
        raid5-cache: don't set STRIPE_R5C_PARTIAL_STRIPE flag while load stripe into cache
        raid5-cache: add another check conditon before replaying one stripe
        md/r5cache: enable IRQs on error path
        md/r5cache: handle alloc_page failure
        ...
      2a4c32ed
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · b9f98bd4
      Linus Torvalds authored
      Pull another MMC update from Ulf Hansson:
       "Here's a second pull request for MMC for v4.10.
      
        As a matter of fact it's only one change that moves some mmc files
        around. I thought it was a good idea to get this into v4.10, as it
        gives us a nice and fresh base for v4.11. Summary:
      
        MMC core:
      
         - Move files from the card directory to the core directory to enable
           future clean-ups of the generic mmc header files and interfaces"
      
      * tag 'mmc-v4.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: block: Move files to core
      b9f98bd4
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · a829a844
      Linus Torvalds authored
      Pull SCSI updates from James Bottomley:
       "This update includes the usual round of major driver updates (ncr5380,
        lpfc, hisi_sas, megaraid_sas, ufs, ibmvscsis, mpt3sas).
      
        There's also an assortment of minor fixes, mostly in error legs or
        other not very user visible stuff. The major change is the
        pci_alloc_irq_vectors replacement for the old pci_msix_.. calls; this
        effectively makes IRQ mapping generic for the drivers and allows
        blk_mq to use the information"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (256 commits)
        scsi: qla4xxx: switch to pci_alloc_irq_vectors
        scsi: hisi_sas: support deferred probe for v2 hw
        scsi: megaraid_sas: switch to pci_alloc_irq_vectors
        scsi: scsi_devinfo: remove synchronous ALUA for NETAPP devices
        scsi: be2iscsi: set errno on error path
        scsi: be2iscsi: set errno on error path
        scsi: hpsa: fallback to use legacy REPORT PHYS command
        scsi: scsi_dh_alua: Fix RCU annotations
        scsi: hpsa: use %phN for short hex dumps
        scsi: hisi_sas: fix free'ing in probe and remove
        scsi: isci: switch to pci_alloc_irq_vectors
        scsi: ipr: Fix runaway IRQs when falling back from MSI to LSI
        scsi: dpt_i2o: double free on error path
        scsi: cxlflash: Migrate scsi command pointer to AFU command
        scsi: cxlflash: Migrate IOARRIN specific routines to function pointers
        scsi: cxlflash: Cleanup queuecommand()
        scsi: cxlflash: Cleanup send_tmf()
        scsi: cxlflash: Remove AFU command lock
        scsi: cxlflash: Wait for active AFU commands to timeout upon tear down
        scsi: cxlflash: Remove private command pool
        ...
      a829a844
    • Linus Torvalds's avatar
      Merge tag 'configfs-for-4.10' of git://git.infradead.org/users/hch/configfs · 84b60791
      Linus Torvalds authored
      Pull configfs update from Christoph Hellwig:
       "Just one simple change from Andrzej to drop the pointless return value
        from the ->drop_link method"
      
      * tag 'configfs-for-4.10' of git://git.infradead.org/users/hch/configfs:
        fs: configfs: don't return anything from drop_link
      84b60791
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 5084fdf0
      Linus Torvalds authored
      Pull ext4 updates from Ted Ts'o:
       "This merge request includes the dax-4.0-iomap-pmd branch which is
        needed for both ext4 and xfs dax changes to use iomap for DAX. It also
        includes the fscrypt branch which is needed for ubifs encryption work
        as well as ext4 encryption and fscrypt cleanups.
      
        Lots of cleanups and bug fixes, especially making sure ext4 is robust
        against maliciously corrupted file systems --- especially maliciously
        corrupted xattr blocks and a maliciously corrupted superblock. Also
        fix ext4 support for 64k block sizes so it works well on ppcle. Fixed
        mbcache so we don't miss some common xattr blocks that can be merged"
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (86 commits)
        dax: Fix sleep in atomic contex in grab_mapping_entry()
        fscrypt: Rename FS_WRITE_PATH_FL to FS_CTX_HAS_BOUNCE_BUFFER_FL
        fscrypt: Delay bounce page pool allocation until needed
        fscrypt: Cleanup page locking requirements for fscrypt_{decrypt,encrypt}_page()
        fscrypt: Cleanup fscrypt_{decrypt,encrypt}_page()
        fscrypt: Never allocate fscrypt_ctx on in-place encryption
        fscrypt: Use correct index in decrypt path.
        fscrypt: move the policy flags and encryption mode definitions to uapi header
        fscrypt: move non-public structures and constants to fscrypt_private.h
        fscrypt: unexport fscrypt_initialize()
        fscrypt: rename get_crypt_info() to fscrypt_get_crypt_info()
        fscrypto: move ioctl processing more fully into common code
        fscrypto: remove unneeded Kconfig dependencies
        MAINTAINERS: fscrypto: recommend linux-fsdevel for fscrypto patches
        ext4: do not perform data journaling when data is encrypted
        ext4: return -ENOMEM instead of success
        ext4: reject inodes with negative size
        ext4: remove another test in ext4_alloc_file_blocks()
        Documentation: fix description of ext4's block_validity mount option
        ext4: fix checks for data=ordered and journal_async_commit options
        ...
      5084fdf0
    • Linus Torvalds's avatar
      Merge tag 'for-f2fs-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs · 09cb6464
      Linus Torvalds authored
      Pull f2fs updates from Jaegeuk Kim:
       "This patch series contains several performance tuning patches
        regarding to the IO submission flow, in addition to supporting new
        features such as a ZBC-base drive and multiple devices.
      
        It also includes some major bug fixes such as:
         - checkpoint version control
         - fdatasync-related roll-forward recovery routine
         - memory boundary or null-pointer access in corner cases
         - missing error cases
      
        It has various minor clean-up patches as well"
      
      * tag 'for-f2fs-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (66 commits)
        f2fs: fix a missing size change in f2fs_setattr
        f2fs: fix to access nullified flush_cmd_control pointer
        f2fs: free meta pages if sanity check for ckpt is failed
        f2fs: detect wrong layout
        f2fs: call sync_fs when f2fs is idle
        Revert "f2fs: use percpu_counter for # of dirty pages in inode"
        f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage
        f2fs: do not activate auto_recovery for fallocated i_size
        f2fs: fix to determine start_cp_addr by sbi->cur_cp_pack
        f2fs: fix 32-bit build
        f2fs: set ->owner for debugfs status file's file_operations
        f2fs: fix incorrect free inode count in ->statfs
        f2fs: drop duplicate header timer.h
        f2fs: fix wrong AUTO_RECOVER condition
        f2fs: do not recover i_size if it's valid
        f2fs: fix fdatasync
        f2fs: fix to account total free nid correctly
        f2fs: fix an infinite loop when flush nodes in cp
        f2fs: don't wait writeback for datas during checkpoint
        f2fs: fix wrong written_valid_blocks counting
        ...
      09cb6464
    • Linus Torvalds's avatar
      Merge tag 'dlm-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm · 19d37ce2
      Linus Torvalds authored
      Pull dlm fixes from David Teigland:
       "This set fixes error reporting for dlm sockets, removes the unbound
        property on the dlm callback workqueue to improve performance, and
        includes a couple trivial changes"
      
      * tag 'dlm-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
        dlm: fix error return code in sctp_accept_from_sock()
        dlm: don't specify WQ_UNBOUND for the ast callback workqueue
        dlm: remove lock_sock to avoid scheduling while atomic
        dlm: don't save callbacks after accept
        dlm: audit and remove any unnecessary uses of module.h
        dlm: make genl_ops const
      19d37ce2
    • Linus Torvalds's avatar
      Merge tag 'jfs-4.10' of git://github.com/kleikamp/linux-shaggy · 3e5cecf2
      Linus Torvalds authored
      Pull jfs update from David Kleikamp:
       "The jfs piece of the current_time() series"
      
      * tag 'jfs-4.10' of git://github.com/kleikamp/linux-shaggy:
        fs: jfs: Replace CURRENT_TIME_SEC by current_time()
      3e5cecf2
    • Linus Torvalds's avatar
      Revert "nvme: add support for the Write Zeroes command" · cdb98c26
      Linus Torvalds authored
      This reverts commit 6d31e3ba.
      
      This causes bootup problems for me both on my laptop and my desktop.
      What they have in common is that they have NVMe disks with dm-crypt, but
      it's not the same controller, so it's not controller-specific.
      
      Jens does not see it on his machine (also NVMe), so it's presumably
      something that triggers just on bootup.  Possibly related to dm-crypt
      and the fact that I mark my luks volume with "allow-discards" in
      /etc/crypttab.
      
      It's 100% repeatable for me, which made it fairly straightforward to
      bisect the problem to this commit. Small mercies.
      
      So we don't know what the reason is yet, but the revert is needed to get
      things going again.
      Acked-by: default avatarJens Axboe <axboe@fb.com>
      Cc: Chaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cdb98c26
    • Linus Torvalds's avatar
      Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · f4000cd9
      Linus Torvalds authored
      Pull arm64 updates from Catalin Marinas:
      
       - struct thread_info moved off-stack (also touching
         include/linux/thread_info.h and include/linux/restart_block.h)
      
       - cpus_have_cap() reworked to avoid __builtin_constant_p() for static
         key use (also touching drivers/irqchip/irq-gic-v3.c)
      
       - uprobes support (currently only for native 64-bit tasks)
      
       - Emulation of kernel Privileged Access Never (PAN) using TTBR0_EL1
         switching to a reserved page table
      
       - CPU capacity information passing via DT or sysfs (used by the
         scheduler)
      
       - support for systems without FP/SIMD (IOW, kernel avoids touching
         these registers; there is no soft-float ABI, nor kernel emulation for
         AArch64 FP/SIMD)
      
       - handling of hardware watchpoint with unaligned addresses, varied
         lengths and offsets from base
      
       - use of the page table contiguous hint for kernel mappings
      
       - hugetlb fixes for sizes involving the contiguous hint
      
       - remove unnecessary I-cache invalidation in flush_cache_range()
      
       - CNTHCTL_EL2 access fix for CPUs with VHE support (ARMv8.1)
      
       - boot-time checks for writable+executable kernel mappings
      
       - simplify asm/opcodes.h and avoid including the 32-bit ARM counterpart
         and make the arm64 kernel headers self-consistent (Xen headers patch
         merged separately)
      
       - Workaround for broken .inst support in certain binutils versions
      
      * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (60 commits)
        arm64: Disable PAN on uaccess_enable()
        arm64: Work around broken .inst when defective gas is detected
        arm64: Add detection code for broken .inst support in binutils
        arm64: Remove reference to asm/opcodes.h
        arm64: Get rid of asm/opcodes.h
        arm64: smp: Prevent raw_smp_processor_id() recursion
        arm64: head.S: Fix CNTHCTL_EL2 access on VHE system
        arm64: Remove I-cache invalidation from flush_cache_range()
        arm64: Enable HIBERNATION in defconfig
        arm64: Enable CONFIG_ARM64_SW_TTBR0_PAN
        arm64: xen: Enable user access before a privcmd hvc call
        arm64: Handle faults caused by inadvertent user access with PAN enabled
        arm64: Disable TTBR0_EL1 during normal kernel execution
        arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1
        arm64: Factor out TTBR0_EL1 post-update workaround into a specific asm macro
        arm64: Factor out PAN enabling/disabling into separate uaccess_* macros
        arm64: Update the synchronous external abort fault description
        selftests: arm64: add test for unaligned/inexact watchpoint handling
        arm64: Allow hw watchpoint of length 3,5,6 and 7
        arm64: hw_breakpoint: Handle inexact watchpoint addresses
        ...
      f4000cd9
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 2ec4584e
      Linus Torvalds authored
      Pull s390 updates from Martin Schwidefsky:
       "The main bulk of the s390 patches for the 4.10 merge window:
      
         - Add support for the contiguous memory allocator.
      
         - The recovery for I/O errors in the dasd device driver is improved,
           the driver will now remove channel paths that are not working
           properly.
      
         - Additional fields are added to /proc/sysinfo, the extended
           partition name and the partition UUID.
      
         - New naming for PCI devices with system defined UIDs.
      
         - The last few remaining alloc_bootmem calls are converted to
           memblock.
      
         - The thread_info structure is stripped down and moved to the
           task_struct. The only field left in thread_info is the flags field.
      
         - Rework of the arch topology code to fix a fake numa issue.
      
         - Refactoring of the atomic primitives and add a new preempt_count
           implementation.
      
         - Clocksource steering for the STP sync check offsets.
      
         - The s390 specific headers are changed to make them usable with
           CLANG.
      
         - Bug fixes and cleanup"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (70 commits)
        s390/cpumf: Use configuration level indication for sampling data
        s390: provide memmove implementation
        s390: cleanup arch/s390/kernel Makefile
        s390: fix initrd corruptions with gcov/kcov instrumented kernels
        s390: exclude early C code from gcov profiling
        s390/dasd: channel path aware error recovery
        s390/dasd: extend dasd path handling
        s390: remove unused labels from entry.S
        s390/vmlogrdr: fix IUCV buffer allocation
        s390/crypto: unlock on error in prng_tdes_read()
        s390/sysinfo: show partition extended name and UUID if available
        s390/numa: pin all possible cpus to nodes early
        s390/numa: establish cpu to node mapping early
        s390/topology: use cpu_topology array instead of per cpu variable
        s390/smp: initialize cpu_present_mask in setup_arch
        s390/topology: always use s390 specific sched_domain_topology_level
        s390/smp: use smp_get_base_cpu() helper function
        s390/numa: always use logical cpu and core ids
        s390: Remove VLAIS in ptff() and clear_table()
        s390: fix machine check panic stack switch
        ...
      2ec4584e