1. 18 Mar, 2016 3 commits
    • Arnd Bergmann's avatar
      qla2xxx: avoid maybe_uninitialized warning · bc7095a9
      Arnd Bergmann authored
      The qlt_check_reserve_free_req() function produces an incorrect warning
      when CONFIG_PROFILE_ANNOTATED_BRANCHES is set:
      
      drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_check_reserve_free_req':
      drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt_in' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         ql_dbg(ql_dbg_io, vha, 0x305a,
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             "qla_target(%d): There is no room in the request ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d Req-Length=%d\n",
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             vha->vp_idx, vha->req->ring_index,
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      The problem is that gcc fails to track the state of the condition across
      an annotated branch.
      
      This slightly rearranges the code to move the second if() block
      into the first one, to avoid the warning while retaining the
      behavior of the code.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-By: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      bc7095a9
    • Arnd Bergmann's avatar
      megaraid_sas: add missing curly braces in ioctl handler · 3deb9438
      Arnd Bergmann authored
      gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl
      function:
      
      drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl':
      drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
          kbuff_arr[i] = NULL;
          ^~~~~~~~~
      drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not
         if (kbuff_arr[i])
         ^~
      
      The code is actually correct, as there is no downside in clearing a NULL
      pointer again.
      
      This clarifies the code and avoids the warning by adding extra curly
      braces.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 90dc9d98 ("megaraid_sas : MFI MPT linked list corruption fix")
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      3deb9438
    • Arnd Bergmann's avatar
      lpfc: fix misleading indentation · aeb6641f
      Arnd Bergmann authored
      gcc-6 complains about the indentation of the lpfc_destroy_vport_work_array()
      call in lpfc_online(), which clearly doesn't look right:
      
      drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_online':
      drivers/scsi/lpfc/lpfc_init.c:2880:3: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
         lpfc_destroy_vport_work_array(phba, vports);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/lpfc/lpfc_init.c:2863:2: note: ...this 'if' clause, but it is not
        if (vports != NULL)
        ^~
      
      Looking at the patch that introduced this code, it's clear that the
      behavior is correct and the indentation is wrong.
      
      This fixes the indentation and adds curly braces around the previous
      if() block for clarity, as that is most likely what caused the code
      to be misindented in the first place.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 549e55cd ("[SCSI] lpfc 8.2.2 : Fix locking around HBA's port_list")
      Reviewed-by: default avatarSebastian Herbszt <herbszt@gmx.de>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      aeb6641f
  2. 15 Mar, 2016 19 commits
  3. 14 Mar, 2016 4 commits
  4. 11 Mar, 2016 2 commits
  5. 10 Mar, 2016 1 commit
  6. 09 Mar, 2016 7 commits
    • Manoj N. Kumar's avatar
      cxlflash: Increase cmd_per_lun for better throughput · 83430833
      Manoj N. Kumar authored
      With the current value of cmd_per_lun at 16, the throughput
      over a single adapter is limited to around 150kIOPS.
      
      Increase the value of cmd_per_lun to 256 to improve
      throughput. With this change a single adapter is able to
      attain close to the maximum throughput (380kIOPS).
      Also change the number of RRQ entries that can be queued.
      Signed-off-by: default avatarManoj N. Kumar <manoj@linux.vnet.ibm.com>
      Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Reviewed-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      83430833
    • Manoj N. Kumar's avatar
      cxlflash: Fix to avoid unnecessary scan with internal LUNs · 603ecce9
      Manoj N. Kumar authored
      When switching to the internal LUN defined on the
      IBM CXL flash adapter, there is an unnecessary
      scan occurring on the second port. This scan leads
      to the following extra lines in the log:
      
      Dec 17 10:09:00 tul83p1 kernel: [ 3708.561134] cxlflash 0008:00:00.0: cxlflash_queuecommand: (scp=c0000000fc1f0f00) 11/1/0/0 cdb=(A0000000-00000000-10000000-00000000)
      Dec 17 10:09:00 tul83p1 kernel: [ 3708.561147] process_cmd_err: cmd failed afu_rc=32 scsi_rc=0 fc_rc=0 afu_extra=0xE, scsi_extra=0x0, fc_extra=0x0
      
      By definition, both of the internal LUNs are on the first port/channel.
      
      When the lun_mode is switched to internal LUN the
      same value for host->max_channel is retained. This
      causes an unnecessary scan over the second port/channel.
      
      This fix alters the host->max_channel to 0 (1 port), if internal
      LUNs are configured and switches it back to 1 (2 ports) while
      going back to external LUNs.
      Signed-off-by: default avatarManoj N. Kumar <manoj@linux.vnet.ibm.com>
      Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Reviewed-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      603ecce9
    • Uma Krishnan's avatar
      cxlflash: Reorder user context initialization · 5d1952ac
      Uma Krishnan authored
      In order to support cxlflash in the PowerVM environment, underlying
      hypervisor APIs have imposed a kernel API ordering change.
      
      For the superpipe access to LUN, user applications need a context.
      The cxlflash module creates this context by making a sequence of
      cxl calls. In the current code, a context is initialized via
      cxl_dev_context_init() followed by cxl_process_element(), a function
      that obtains the process element id. Finally, cxl_start_work()
      is called to attach the process element.
      
      In the PowerVM environment, a process element id cannot be obtained
      from the hypervisor until the process element is attached. The
      cxlflash module is unable to create contexts without a valid
      process element id.
      
      To fix this problem, cxl_start_work() is called before obtaining
      the process element id.
      Signed-off-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      5d1952ac
    • Matthew R. Ochs's avatar
      cxlflash: Simplify attach path error cleanup · 8a96b52a
      Matthew R. Ochs authored
      The cxlflash_disk_attach() routine currently uses a cascading error
      gate strategy for its error cleanup path. While this strategy is
      commonly used to handle cleanup scenarios, it is too restrictive when
      function callouts need to be restructured. Problems range from
      inserting error path bugs in previously 'good' code to the cleanup
      path imposing design changes to how the normal path is structured.
      A less restrictive approach is needed to support ordering changes
      that come about when operating in different environments.
      
      To overcome this restriction, the error cleanup path is modified to
      have a single entrypoint and use conditional logic to cleanup where
      necessary. Entities that require multiple cleanup steps must be
      carefully vetted to ensure their APIs support state. In cases where
      they do not (none as of this commit) additional local variables can
      be used to maintain state on their behalf.
      Signed-off-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Reviewed-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      8a96b52a
    • Matthew R. Ochs's avatar
      cxlflash: Split out context initialization · 5e6632d1
      Matthew R. Ochs authored
      Presently, context information structures are allocated and
      initialized in the same routine, create_context(). This imposes
      an ordering restriction such that all pieces of information needed
      to initialize a context must be known before the context is even
      allocated.
      
      This design point is not flexible when the order of context
      creation needs to be modified. Specifically, this can lead to
      problems when members of the context information structure are
      a part of an ordering dependency (i.e. - the 'work' structure
      embedded within the context).
      
      To remedy, the allocation is left as-is, inside of the existing
      create_context() routine and the initialization is transitioned
      to a new void routine, init_context(). At the same time, in
      anticipation of these routines not being called in sequence, a
      state boolean is added to the context information structure to
      track when the context has been initilized. The context teardown
      routine, destroy_context(), is modified to support being called
      with a non-initialized context.
      Signed-off-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Reviewed-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      5e6632d1
    • Uma Krishnan's avatar
      cxlflash: Unmap problem state area before detaching master context · 6ded8b3c
      Uma Krishnan authored
      When operating in the PowerVM environment, the cxlflash module can
      receive an error from the hypervisor indicating that there are
      existing mappings in the page table for the process MMIO space.
      
      This issue exists because term_afu() currently invokes term_mc()
      before stop_afu(), allowing for the master context to be detached
      first and the problem state area to be unmapped second.
      
      To resolve this issue, stop_afu() should be called before term_mc().
      Signed-off-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      6ded8b3c
    • Manoj N. Kumar's avatar
      cxlflash: Simplify PCI registration · 961487e4
      Manoj N. Kumar authored
      The calls to pci_request_regions(), pci_resource_start(),
      pci_set_dma_mask(), pci_set_master() and pci_save_state() are all
      unnecessary for the IBM CXL flash adapter since data buffers
      are not required to be mapped to the device's memory.
      
      The use of services such as pci_set_dma_mask() are problematic on
      hypervisor managed systems as the IBM CXL flash adapter is operating
      under a virtual PCI Host Bridge (virtual PHB) which does not support
      these services.
      
      cxlflash 0001:00:00.0: init_pci: Failed to set PCI DMA mask rc=-5
      
      The resolution is to simplify init_pci(), to a point where it does the
      bare minimum (pci_enable_device). Similarly, remove the call the
      pci_release_regions() from cxlflash_remove().
      Signed-off-by: default avatarManoj N. Kumar <manoj@linux.vnet.ibm.com>
      Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Reviewed-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      961487e4
  7. 08 Mar, 2016 1 commit
  8. 05 Mar, 2016 3 commits