1. 17 11月, 2020 2 次提交
    • J
      scsi: lpfc: Rework locations of ndlp reference taking · 4430f7fd
      James Smart 提交于
      Now that the driver has gone to a normal ref interface (with no odd logic)
      the discovery logic needs to be updated to reworked so that it properly
      takes references when it should and give them up when it should.
      
      Rework the driver for the following get/put model:
      
       - Move gets to just before an I/O is issued. Add gets for places where an
         I/O was issued without one.
      
       - Ensure that failures from lpfc_nlp_get() are handled by the driver.
      
       - Check and fix the placement of lpfc_nlp_puts relative to io completions.
         Note: some of these paths may not release the reference on the exact io
         completion as the reference is held as the code takes another step in
         the discovery thread and which may cause another io to be issued.
      
       - Rearrange some code for error processing and calling lpfc_nlp_put.
      
       - Fix some places of incorrect reference freeing that was causing the
         premature releasing of the structure.
      
       - Nvmet plogi handling performs unreg_rpi's. The reference counts were
         unbalanced resulting in premature node removal. In some cases this
         caused loss of node discovery. Corrected the reftaking around nvmet
         plogis.
      
      Nodes that experience devloss now get released from the node list now that
      there is a proper reference taking.
      
      Link: https://lore.kernel.org/r/20201115192646.12977-3-james.smart@broadcom.comCo-developed-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      4430f7fd
    • J
      scsi: lpfc: Rework remote port ref counting and node freeing · 307e3380
      James Smart 提交于
      When a remote port is disconnected and disappears, its node structure
      (ndlp) stays allocated and on a vport node list. While on the list it can
      be matched, thus requires validation checks on state to be added in
      numerous code paths. If the node comes back, its possible for there to be
      multiple node structures for the same device on the vport node list. There
      is no reason to keep the node structure around after it is no longer in
      existence, and the current implementation creates problems for itself
      (multiple nodes) and lots of unnecessary code for state validation.
      
      Additionally, the reference taking on the node structure didn't follow the
      normal model used by the kernel kref api. It included lots of odd logic to
      match state with reference count.  The combination of this odd logic plus
      the way it was implicitly used in the discovery engine made its reference
      taking implementation suspect and extremely hard to follow.
      
      Change the driver such that the reference taking routines are now normal
      ref increments/decrements and callout on refcount=0.
      
      With this in place, the rework can be done such that the node structure is
      fully removed and deallocated when the remote port no longer exists and all
      references are removed.  This removal logic, and the basic ref counting are
      intrically tied, thus in a single patch.
      
      Link: https://lore.kernel.org/r/20201115192646.12977-2-james.smart@broadcom.comCo-developed-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      307e3380
  2. 11 11月, 2020 1 次提交
    • L
      scsi: lpfc: lpfc_bsg: Provide correct documentation for a bunch of functions · ea085dab
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/scsi/lpfc/lpfc_bsg.c:917: warning: Function parameter or member 'phba' not described in 'lpfc_bsg_ct_unsol_event'
       drivers/scsi/lpfc/lpfc_bsg.c:917: warning: Function parameter or member 'pring' not described in 'lpfc_bsg_ct_unsol_event'
       drivers/scsi/lpfc/lpfc_bsg.c:1484: warning: Function parameter or member 'cmp' not described in 'lpfc_issue_ct_rsp'
       drivers/scsi/lpfc/lpfc_bsg.c:3900: warning: Function parameter or member 'job' not described in 'lpfc_bsg_sli_cfg_read_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:3900: warning: Function parameter or member 'dmabuf' not described in 'lpfc_bsg_sli_cfg_read_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:3900: warning: Excess function parameter 'mb' description in 'lpfc_bsg_sli_cfg_read_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:3900: warning: Excess function parameter 'dmabuff' description in 'lpfc_bsg_sli_cfg_read_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4088: warning: Function parameter or member 'job' not described in 'lpfc_bsg_sli_cfg_write_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4088: warning: Function parameter or member 'nemb_tp' not described in 'lpfc_bsg_sli_cfg_write_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4088: warning: Function parameter or member 'dmabuf' not described in 'lpfc_bsg_sli_cfg_write_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4088: warning: Excess function parameter 'mb' description in 'lpfc_bsg_sli_cfg_write_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4088: warning: Excess function parameter 'dmabuff' description in 'lpfc_bsg_sli_cfg_write_cmd_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4254: warning: Function parameter or member 'job' not described in 'lpfc_bsg_handle_sli_cfg_mbox'
       drivers/scsi/lpfc/lpfc_bsg.c:4254: warning: Function parameter or member 'dmabuf' not described in 'lpfc_bsg_handle_sli_cfg_mbox'
       drivers/scsi/lpfc/lpfc_bsg.c:4254: warning: Excess function parameter 'mb' description in 'lpfc_bsg_handle_sli_cfg_mbox'
       drivers/scsi/lpfc/lpfc_bsg.c:4254: warning: Excess function parameter 'dmabuff' description in 'lpfc_bsg_handle_sli_cfg_mbox'
       drivers/scsi/lpfc/lpfc_bsg.c:4403: warning: Function parameter or member 'job' not described in 'lpfc_bsg_read_ebuf_get'
       drivers/scsi/lpfc/lpfc_bsg.c:4403: warning: Excess function parameter 'dmabuf' description in 'lpfc_bsg_read_ebuf_get'
       drivers/scsi/lpfc/lpfc_bsg.c:4474: warning: Function parameter or member 'job' not described in 'lpfc_bsg_write_ebuf_set'
       drivers/scsi/lpfc/lpfc_bsg.c:4600: warning: Function parameter or member 'job' not described in 'lpfc_bsg_handle_sli_cfg_ebuf'
       drivers/scsi/lpfc/lpfc_bsg.c:4600: warning: Function parameter or member 'dmabuf' not described in 'lpfc_bsg_handle_sli_cfg_ebuf'
       drivers/scsi/lpfc/lpfc_bsg.c:4600: warning: Excess function parameter 'mb' description in 'lpfc_bsg_handle_sli_cfg_ebuf'
       drivers/scsi/lpfc/lpfc_bsg.c:4600: warning: Excess function parameter 'dmabuff' description in 'lpfc_bsg_handle_sli_cfg_ebuf'
       drivers/scsi/lpfc/lpfc_bsg.c:4645: warning: Function parameter or member 'job' not described in 'lpfc_bsg_handle_sli_cfg_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4645: warning: Function parameter or member 'dmabuf' not described in 'lpfc_bsg_handle_sli_cfg_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4645: warning: Excess function parameter 'mb' description in 'lpfc_bsg_handle_sli_cfg_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4645: warning: Excess function parameter 'dmabuff' description in 'lpfc_bsg_handle_sli_cfg_ext'
       drivers/scsi/lpfc/lpfc_bsg.c:4723: warning: Function parameter or member 'job' not described in 'lpfc_bsg_issue_mbox'
       drivers/scsi/lpfc/lpfc_bsg.c:4723: warning: Excess function parameter 'mb' description in 'lpfc_bsg_issue_mbox'
      
      Link: https://lore.kernel.org/r/20201102142359.561122-8-lee.jones@linaro.org
      Cc: James Smart <james.smart@broadcom.com>
      Cc: Dick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      ea085dab
  3. 27 10月, 2020 1 次提交
  4. 05 8月, 2020 1 次提交
  5. 03 7月, 2020 2 次提交
  6. 10 12月, 2019 1 次提交
  7. 25 10月, 2019 1 次提交
  8. 20 8月, 2019 3 次提交
  9. 23 7月, 2019 1 次提交
  10. 19 6月, 2019 1 次提交
  11. 20 3月, 2019 2 次提交
  12. 14 2月, 2019 1 次提交
  13. 08 1月, 2019 1 次提交
  14. 13 12月, 2018 1 次提交
  15. 08 12月, 2018 3 次提交
    • J
      scsi: lpfc: Fix driver release of fw-logging buffers · 1165a5c2
      James Smart 提交于
      On driver termination, after the driver stops fw logging by writing a
      register on the chip, the driver immediately unmaps and frees the logging
      buffer, without confirming in any way that the chip has received the write
      and terminated the logging. As termination on the chip is not immediate,
      the chip may issue a dma request to the now unmapped dma buffer, resulting
      in a iommu fault.
      
      Change the driver to receive a confirmation that logging ahs been
      terminated. As the driver always issues an SLI reset with the device as
      part of shutdown, and as part of that is receiving confirmation that the
      reset is complete - the driver was modified to perform the write to disable
      fw logging prior to the SLI reset and only free the fw log buffer after the
      SLI reset is complete. That guarantees use of the fw log buffer is fully
      terminated when it is unmapped.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      1165a5c2
    • J
      scsi: lpfc: refactor mailbox structure context fields · 3e1f0718
      James Smart 提交于
      The driver data structure for managing a mailbox command contained two
      context fields. Unfortunately, the context were considered "generic" to be
      used at the whim of the command code.  Of course, one section of code used
      fields this way, while another did it that way, and eventually there were
      mixups.
      
      Refactored the structure so that the generic contexts become a node context
      and a buffer context and all code standardizes on their use.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      3e1f0718
    • J
      scsi: lpfc: Fix panic when FW-log buffsize is not initialized · cb34990b
      James Smart 提交于
      While trying to get adapter fw-log for a function whose buffsize was set to
      0, kernel panic occurred.
      
      When buffsize is 0, the kernel buffer for the log won't be allocated.  When
      fw log usage was enabled, it failed to check the buffer size, and log usage
      was started. Eventually the driver referenced the unallocated log buffer.
      
      Added checks of the buffer size before allowing fw logging to be enabled
      and added check for valid buffer if enabling fw log.
      
      Performed a couple other minor cleanups while fixing this:
       - clarified log messages
       - re-evaluated log message severity
       - treat any error as an error, not only a couple codes
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <jsmart2021@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      cb34990b
  16. 07 11月, 2018 2 次提交
  17. 16 10月, 2018 1 次提交
  18. 12 9月, 2018 1 次提交
    • J
      scsi: lpfc: add support to retrieve firmware logs · d2cc9bcd
      James Smart 提交于
      This patch adds the ability to read firmware logs from the adapter. The driver
      registers a buffer with the adapter that is then written to by the adapter.
      The adapter posts CQEs to indicate content updates in the buffer. While the
      adapter is writing to the buffer in a circular fashion, an application will
      poll the driver to read the next amount of log data from the buffer.
      
      Driver log buffer size is configurable via the ras_fwlog_buffsize sysfs
      attribute. Verbosity to be used by firmware when logging to host memory is
      controlled through the ras_fwlog_level attribute.  The ras_fwlog_func
      attribute enables or disables loggy by firmware.
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      d2cc9bcd
  19. 11 7月, 2018 1 次提交
  20. 08 5月, 2018 1 次提交
  21. 23 2月, 2018 2 次提交
  22. 03 10月, 2017 1 次提交
  23. 25 8月, 2017 1 次提交
  24. 24 4月, 2017 1 次提交
    • J
      Fix crash after issuing lip reset · 9d3d340d
      James Smart 提交于
      When RPI is not available, driver sends WQE with invalid RPI value and
      rejected by HBA.
      lpfc 0000:82:00.3: 1:3154 BLS ABORT RSP failed, data:  x3/xa0320008
      and
      lpfc :2753 PLOGI failure DID:FFFFFA Status:x3/xa0240008
      
      In this case, driver accesses rpi_ids array out of bounds.
      
      Fix:
      Check return value of lpfc_sli4_alloc_rpi(). Do not allocate
      lpfc_nodelist entry if RPI is not available.
      
      When RPI is not available, we will get discovery timeouts and
      command drops for some of the vports as seen below.
      
      lpfc :0273 Unexpected discovery timeout, vport State x0
      lpfc :0230 Unexpected timeout, hba link state x5
      lpfc :0111 Dropping received ELS cmd Data: x0 xc90c55 x0
      Signed-off-by: NDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      9d3d340d
  25. 23 2月, 2017 3 次提交
  26. 18 11月, 2016 4 次提交