summaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc
AgeCommit message (Collapse)Author
34 hoursMerge branch 'for-next' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
34 hoursMerge branch 'for-next' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
10 daysMerge patch series "scsi: Enable context analysis for most drivers"Martin K. Petersen (Oracle)
Bart Van Assche <bvanassche@acm.org> says: This patch series enables lock context analysis for all SCSI drivers in the drivers/scsi/ directory except scsi_debug. The advantages are as follows: - The compiler (only Clang) verifies whether the lock and unlock calls match what has been declared via __must_hold(), __acquires() or __releases(). This is useful for catching locking bugs in error paths. - Support for __guarded_by() is enabled. If a member variable is annotated with __guarded_by(lock), the compiler will issue a warning if that member variable is accessed without holding 'lock'. Please consider this patch series for the next merge window. Thanks, Bart. [mkp: Left out BusLogic changes and excluded that driver from context analysis] Link: https://patch.msgid.link/cover.1790360262.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
10 daysscsi: lpfc: Prepare for enabling lock context analysisBart Van Assche
Annotate the functions that perform conditional locking with __context_unsafe(). Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/9ace40e6af0b7623c61d9e3caad997856455dbef.1790360262.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysMerge patch series "lpfc: Update lpfc to revision 15.0.0.1"Martin K. Petersen (Oracle)
Nigel Kirkland <nkirkland2304@gmail.com> says: This patch set contains important bug fixes related to cleanup handling in both normal and error paths, and refactoring of duplicate code. The patches were cut against Martin's 7.4/scsi-queue tree. Link: https://patch.msgid.link/20261013001648.62289-1-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysscsi: lpfc: Update lpfc version to 15.0.0.1Nigel Kirkland
Update lpfc version to 15.0.0.1 Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com> Tested-by: Ewan D. Milne <emilne@redhat.com> Link: https://patch.msgid.link/20261013001648.62289-9-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysscsi: lpfc: Update correct ndlp refcnt when rejecting an unsolicited PLOGINigel Kirkland
The domain controller FC_ID can change whenever a fabric switch with an ISL link is replaced or the admin reconfigures the fabric switch with active links. In such situations, reference count updates should be applied to the correct nodelist structure. Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com> Link: https://patch.msgid.link/20261013001648.62289-8-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysscsi: lpfc: Refactor calls on fc_disctmo to lpfc_set_disctmo in RSCN handlerNigel Kirkland
The lpfc_set_disctmo() routine is not used for all cases when the driver needs to restart discovery on the fc_disctmo timer. Not doing so, makes discovery timer actions invisible in some cases as they do not get logged. This patch substitutes calls on fc_disctmo to use lpfc_set_disctmo() in lpfc_els_rcv_rscn(). Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com> Tested-by: Ewan D. Milne <emilne@redhat.com> Link: https://patch.msgid.link/20261013001648.62289-7-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysscsi: lpfc: Rework I/O flush ordering when unloading driverNigel Kirkland
The lpfc_els_abort() routine has a code path that cancels outstanding I/Os on the ELS ring when attempted aborts fail. The failed aborts are queued to a drv_cmpl_list and then cancelled after the ELS pring->txcmplq is fully traversed. However if the abort failure returns IOCB_ABORTING, then the driver should not have cancelled it. Doing so starts two threads working on the same iocb and ndlp, leading to unintended race conditions. Fix by capturing the IOCB_ABORTING return value in lpfc_els_abort() and not adding it to the list of IOCBs for cancelling. We should allow the IOCB scheduled for abort to complete naturally. This avoids simultaneous threads acting on the same IOCB and ndlp objects. The lpfc_free_iocb_list() is moved to execute after lpfc_sli4_hba_unset() allowing the routine to flush I/O before freeing it. And, in lpfc_pci_remove_one_s4() a call to flush the phba->wq is added. This makes the unload logic consistent with offline handling logic. Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com> Tested-by: Ewan D. Milne <emilne@redhat.com> Link: https://patch.msgid.link/20261013001648.62289-6-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysscsi: lpfc: Check fc4_xpt_flags before decrementing ndlp kref on FDISC errorNigel Kirkland
The current initial kref count drop logic for an ndlp that fails FDISC assumes that the ndlp has never registered with transport layer and thus the lpfc_dev_loss_tmo_callbk never called. However, a failed FDISC can occur after a successful transport layer registration too. So, lpfc_dev_loss_tmo_callbk can occur and there is a potential use-after-free on the ndlp. Check ndlp->fc4_xpt_flags if previously registered with an upper layer transport and check ndlp->nlp_flags if there is a LPFC_EVT_DEV_LOSS work pending. If not previously registered nor LPFC_EVT_DEV_LOSS work pending, then set the NLP_DROPPED flag as before and decrement the initial kref on FDISC error. However, if ndlp has been previously registered, then let the pre-existing logic for each transport's respective dev_loss_tmo_callbk perform the initial kref decrement. Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com> Link: https://patch.msgid.link/20261013001648.62289-5-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysscsi: lpfc: Fix kernel oops when unmapping SCSI DMA buffers for an aborted cmdNigel Kirkland
A kernel oops at dma_unmap_sg_attrs() may occur due to a race between an aborted SCSI I/O completion and a SCSI error handler issued TUR using the same repurposed scsi_cmnd structure. The LPFC_DRIVER_ABORTED cmd_flag is set when inflight I/Os are aborted via lpfc_sli_abort_taskmgmt(), and this flag is not cleared until after scsi_done() is called. The inflight I/O test is changed to check SCSI I/O for either LFPC_IO_ON_TXCMPLQ or LPFC_DRIVER_ABORTED. If either cmd_flag is set, then the I/O should still be counted. Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com> Tested-by: Ewan D. Milne <emilne@redhat.com> Link: https://patch.msgid.link/20261013001648.62289-4-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysscsi: lpfc: Early return out of lpfc_els_abort() when HBA_SETUP flag is not setNigel Kirkland
It is possible that a dev_loss_tmo callback fires during an HBA reset. The ELS pring structure is cleared by the HBA reset path and the dev_loss_tmo callback executing lpfc_els_abort() could be using a stale ELS pring pointer. To significantly reduce exposure, check if HBA_SETUP flag is set before proceeding to use the ELS pring pointer in lpfc_els_abort(). There is no point to issue aborts when the SLI port is not setup anyways. Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com> Reveiwed-by: Ewan D. Milne <emilne@redhat.com> Tested-by: Ewan D. Milne <emilne@redhat.com> Link: https://patch.msgid.link/20261013001648.62289-3-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
11 daysscsi: lpfc: Fix use-after-free in lpfc_cmpl_ct_cmd_vmid()Nigel Kirkland
In lpfc_cmpl_ct_cmd_vmid(), there is an early call to lpfc_ct_free_iocb() when cmd is SLI_CTAS_DALLAPP_ID. Within lpfc_ct_free_iocb() the cmdiocb->rsp_dmabuf will be freed. This means any ctrsp ptr dereference for SLI_CT_RESPONSE_FS_RJT or even ctrsp->ReasonCode and ctrsp->Explanation when handling a CT LS_RJT response is a use-after-free. Remove the early lpfc_ct_free_iocb call for SLI_CTAS_DALLAPP_ID. There already is a free_res label that calls lpfc_ct_free_iocb so there doesn't need to be an early lpfc_ct_free_iocb at the start of lpfc_cmpl_ct_cmd_vmid. Signed-off-by: Nigel Kirkland <nkirkland2304@gmail.com> Tested-by: Ewan D. Milne <emilne@redhat.com> Link: https://patch.msgid.link/20261013001648.62289-2-nkirkland2304@gmail.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
13 daysscsi: lpfc: Print rx monitor records straight into the seq_bufKees Cook
lpfc_rx_monitor_report() formats each record into a stack buffer, then appends it with seq_buf_puts(), relying on seq_buf_puts() appending nothing when a string does not fit: the debugfs output then ends at the last whole record, and the record left out is read in full next time. The next patch makes seq_buf_puts() copy as much as fits instead, as seq_buf_printf() and strlcat() do. Print each record with seq_buf_printf(), and when it does not fit, end the string where the record began, since the reader takes the buffer up to its NUL. This also takes the DBG_LOG_STR_SZ buffer off the stack. Build tested ARCH=x86_64 with GCC 16.2.0, CONFIG_SCSI_LPFC=m and W=1. Assisted-by: LLM Link: https://patch.msgid.link/20261005155708.1471260-3-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
2026-09-16Merge patch series "Use defined 16-bits ASC/ASCQ combinations"Martin K. Petersen (Oracle)
Damien Le Moal <dlemoal@kernel.org> says: This patch series defines as macros all ASC/ASCQ combinations present in https://www.t10.org/lists/asc-num.txt and converts the SCSI core code and SCSI low level drivers to use these macros instead of hard-coded ASC/ASCQs. To do this, struct scsi_sense_hdr and struct scsi_failure are modified to replace the asc and ascq 8-bits fields with a 16-bits sense_code field. This cleans up the code in many places and makes it easier, and self documented, to test sense codes in the case of errors. Overall, there should be no functional chnages here. Note: this series currently applies cleanly only to the scsi-staging tree. It does not apply to Linus tree as commit 6d81700ad7c4 ("ata: libata-scsi: do not raise UA for storage element depopulation and restoration") creates a conflict with patch 37. The conflict is trivial to resolve, but this will create a conflict in linux-next. Could you maybe rebase scsi-staging on rc2 ? Also please note that sashiko did comment about several pre-existing issues for different drivers, but I am not addressing these issues in this series. [mkp: fixed ufs conflict] Link: https://patch.msgid.link/20260908090308.1085097-1-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-09-16scsi: lpfc: Use combined sense codesDamien Le Moal
Refactor the lpfc driver to use scsi_set_sense() and replace all hard-coded additional sense codes and additional sense code qualifiers with the enum values defined in include/scsi/scsi_sense.h. This helps with code clarity as the sense codes being processed are easier to test and self-documented. No functional change intended. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Hannes Reinecke <hare@kernel.org> Link: https://patch.msgid.link/20260908090308.1085097-27-dlemoal@kernel.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-09-01scsi: core: Drop Scsi_Host.default_lockJohn Garry
Back in the 2.6.xx days, it was possible to for low-level drivers to set the shost lock pointer. That is why there is a default lock and a pointer to the shost lock. However, support for this has long been removed, so drop Scsi_Host.default_lock and make Scsi_Host.host_lock as the actual lock. Getting the address of embedded host_lock structure just requires adding a fixed offset value to the shost pointer. However, getting the value of the host_lock pointer requires loading from a fixed offset to the shost pointer. The latter should be very slightly slower, which is relevant as this lock is used a lot throughout the core code and drivers. Signed-off-by: John Garry <john.garry@linux.dev> Acked-by: Damien Le Moal <dlemoal@kernel.org> # ata parts Reviewed-by: Hannes Reinecke <hare@kernel.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20260831095821.3486994-1-john.g.garry@oracle.com Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-29Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsiLinus Torvalds
Pull more SCSI updates from Martin Petersen: "Remaining updates for the 7.3 merge window. The only core change is enabling context analysis for the SCSI layer and UFS. The remaining changes are either bug fixes or hardening" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi: (26 commits) scsi: snic: Fix SCSI host leak on workqueue allocation failure scsi: MAINTAINERS: Update my email address scsi: MAINTAINERS: Leave the cumana_1 and oak drivers to the RISCPC maintainers scsi: leapraid: Standardize NCQ priority sysfs attributes scsi: leapraid: Serialize firmware log mmap with teardown scsi: leapraid: Balance host references for firmware log VMAs scsi: lpfc: Remove unnnecessary NULL check scsi: qla2xxx: Fix an loop timeout test scsi: qla2xxx: Fix an error code in qla_get_tmf() scsi: ibmvfc: Fix use of uninitialized rport in ibmvfc_do_work() scsi: core: Enable context analysis for hosts.o scsi: lpfc: Replace strlcat() with sysfs_emit_at() in the sysfs show functions scsi: lpfc: Replace strlcat() with seq_buf in the debugfs dump helpers scsi: lpfc: Replace strlcat() with seq_buf in lpfc_rx_monitor_report() scsi: lpfc: Replace strlcat() with scnprintf() in lpfc_vport_symbolic_node_name() scsi: lpfc: Replace strlcat() with seq_buf in lpfc_info() scsi: core: Enable context analysis scsi: core: Protect host state changes with the host lock scsi: core: Add lock context annotations scsi: core: Pass the SCSI host pointer directly to scanning functions ...
2026-08-23scsi: lpfc: Remove unnnecessary NULL checkDan Carpenter
The "evt_dat" variale is non-NULL at this point so there is no need to check. Delete the check and pull the code in a tab. Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Paul Ely <paul.ely@broadcom.com> Link: https://patch.msgid.link/an1trOAUeQmYEus_@stanley.mountain Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-13scsi: lpfc: Replace strlcat() with sysfs_emit_at() in the sysfs show functionsIan Bridges
In preparation for removing the strlcat() API[1], replace its uses in lpfc_cmf_info_show(), lpfc_nvme_info_show() and lpfc_scsi_stat_show(). The three functions build sysfs attribute output, and sysfs_emit_at() is the designated helper for that. The single write paths become sysfs_emit(), the offset zero form of the same helper. Each intermediate tmp buffer and its per fragment overflow check become unnecessary. Once the page is full, sysfs_emit_at() writes nothing more, so dropping the early exits does not change the produced bytes. Each loop that appends keeps one exit, so a full page stops the iteration. In lpfc_nvme_info_show() the exit also releases the fc_nodes_list_lock as it did before. The unlock_buf_done label loses its last user and is removed. The old code capped every fragment at LPFC_MAX_INFO_TMP_LEN or LPFC_MAX_SCSI_INFO_TMP_LEN bytes before appending it. The replacement formats each fragment directly into the page, so a fragment longer than its old tmp buffer is no longer truncated when the page has room for it. Both macros lose their last user and are removed. The running length that sysfs_emit_at() maintains equals the length that the removed strnlen() calls computed, so the "Could be more info" overflow markers keep their trigger condition. Link: https://github.com/KSPP/linux/issues/370 [1] Signed-off-by: Ian Bridges <icb@fastmail.org> Link: https://patch.msgid.link/20260729144617.1388646-6-icb@fastmail.org Reviewed-by: Nigel Kirkland <nigel.kirkland@broadcom.com> Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-13scsi: lpfc: Replace strlcat() with seq_buf in the debugfs dump helpersIan Bridges
In preparation for removing the strlcat() API[1], replace its uses in lpfc_debugfs_multixripools_data(), lpfc_debugfs_scsistat_data() and lpfc_debugfs_hdwqstat_data(). Each helper accumulates a variable number of lines into the debugfs buffer, which is what seq_buf is for. The intermediate tmp buffers and the per fragment overflow checks become unnecessary. Once a seq_buf overflows, later writes to it do nothing, so dropping the early exits does not change the produced bytes. Each loop that appends keeps one seq_buf_has_overflowed() exit, so a full buffer stops the iteration. lpfc_debugfs_multixripools_data() and lpfc_debugfs_hdwqstat_data() append to whatever the buffer already holds, so their seq_buf is anchored at the current end of the string. All three helpers keep returning strnlen() because seq_buf_used() reports the full buffer size after an overflow. Link: https://github.com/KSPP/linux/issues/370 [1] Signed-off-by: Ian Bridges <icb@fastmail.org> Link: https://patch.msgid.link/20260729144617.1388646-5-icb@fastmail.org Reviewed-by: Nigel Kirkland <nigel.kirkland@broadcom.com> Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-13scsi: lpfc: Replace strlcat() with seq_buf in lpfc_rx_monitor_report()Ian Bridges
In preparation for removing the strlcat() API[1], replace its use in lpfc_rx_monitor_report(). The function accumulates one line per ring entry, which is what seq_buf is for. seq_buf tracks the write position, so the per entry strlen() rescans of the destination are gone. Each record is still formatted into the tmp buffer. seq_buf_puts() appends it only when it fits whole, so the output keeps ending at the last complete record. The loop still stops on overflow without consuming the current entry, and the returned count and the ring head keep their old meaning. The produced bytes are unchanged. Link: https://github.com/KSPP/linux/issues/370 [1] Signed-off-by: Ian Bridges <icb@fastmail.org> Link: https://patch.msgid.link/20260729144617.1388646-4-icb@fastmail.org Reviewed-by: Nigel Kirkland <nigel.kirkland@broadcom.com> Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-13scsi: lpfc: Replace strlcat() with scnprintf() in ↵Ian Bridges
lpfc_vport_symbolic_node_name() In preparation for removing the strlcat() API[1], replace its uses in lpfc_vport_symbolic_node_name(). The function builds five unconditional fragments, so one scnprintf() call composes the whole string. The intermediate tmp buffer and the per fragment overflow checks become unnecessary. scnprintf() truncates at the buffer size and returns the number of bytes it wrote, which equals the length that the removed strnlen() call computed. The old code capped every fragment at MAXHOSTNAMELEN bytes before appending it, independently of the room left in the destination. The replacement formats each fragment directly into the destination, so a fragment longer than MAXHOSTNAMELEN is no longer truncated when the destination has room for it. Link: https://github.com/KSPP/linux/issues/370 [1] Signed-off-by: Ian Bridges <icb@fastmail.org> Link: https://patch.msgid.link/20260729144617.1388646-3-icb@fastmail.org Reviewed-by: Nigel Kirkland <nigel.kirkland@broadcom.com> Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-08-13scsi: lpfc: Replace strlcat() with seq_buf in lpfc_info()Ian Bridges
In preparation for removing the strlcat() API[1], replace its uses in lpfc_info(). The function accumulates a variable number of optional fragments, which is what seq_buf is for. The intermediate tmp buffer and the per fragment overflow checks become unnecessary. seq_buf is memory safe by construction and silently truncates in the same way as the replaced pattern. The old code passed phba->ModelDesc as the format string of the first scnprintf() call. The model description comes from adapter VPD data. seq_buf_printf() takes a format string, so the replacement prints it through "%s". A model description containing conversion specifiers is no longer interpreted. Link: https://github.com/KSPP/linux/issues/370 [1] Signed-off-by: Ian Bridges <icb@fastmail.org> Link: https://patch.msgid.link/20260729144617.1388646-2-icb@fastmail.org Reviewed-by: Nigel Kirkland <nigel.kirkland@broadcom.com> Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-07-08scsi: lpfc: Fix memory leak in lpfc_sli4_driver_resource_setup()Abdun Nihaal
The memory allocated for mboxq using mempool_alloc() is not freed in some of the early exit error paths. Fix that by moving the mempool_free() call to an earlier point after last use. Fixes: d79c9e9d4b3d ("scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware.") Cc: stable@vger.kernel.org Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in> Reviewed-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260707065304.949135-1-nihaal@cse.iitm.ac.in Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-06-08scsi: lpfc: Fix spelling mistakes in commentsWilliam Theesfeld
Comment-only changes across the lpfc driver, found by running scripts/checkpatch.pl with the kernel's scripts/spelling.txt list against drivers/scsi/lpfc/. No functional impact. v1 covered a single site in lpfc_bsg.c. v2 expands to all checkpatch-detected comment misspellings across the driver, per review feedback from Justin Tee on the v1 thread. Identifiers that happen to match common-typo entries (e.g. LSEXP_CANT_GIVE_DATA, LPFC_FC_LA_TOP_UNKOWN) are intentionally left untouched, as renaming them would change the driver's internal API. Signed-off-by: William Theesfeld <william@theesfeld.net> Reviewed-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260602111912.23864-1-william@theesfeld.net Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-06-01scsi: lpfc: Turn lpfc_queue q_pgs into a flexible arrayRosen Penev
The q_pgs pointer was assigned to point at the trailing memory allocated past the struct. Convert it to a proper C99 flexible array member and use struct_size() for the allocation. Assisted-by: Claude:Opus-4.7 Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260523050241.190239-1-rosenp@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02Merge patch series "Update lpfc to revision 15.0.0.0"Martin K. Petersen
Justin Tee <justintee8345@gmail.com> says: Update lpfc to revision 15.0.0.0 This patch set adds support for the G8 ASIC found on the LPe42100 series adapter models. Updates are made to irq affinity assignment, mailbox command handling related to initialization, SGL construction, firmware download diagnostics, and the removal of an outdated performance feature. We also add 128G link speed selection and support. The patches were cut against Martin's 7.1/scsi-queue tree. Link: https://patch.msgid.link/20260331205928.119833-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Update lpfc version to 15.0.0.0Justin Tee
Update lpfc version to 15.0.0.0 Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-11-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Add PCI ID support for LPe42100 series adaptersJustin Tee
Update supported pci_device_id table to include the values for the G8 ASIC Device ID utilized by LPe42100 series of adapters. The default reporting string will be "LPe42100". Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-10-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Introduce 128G link speed selection and supportJustin Tee
128G link speed selection and support is added for various mailbox commands, defines, and ACQE handling. The default behavior to autonegotiate supported link speed remains the same. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-9-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Check ASIC_ID register to aid diagnostics during failed fw updatesJustin Tee
When WRITE_OBJECT mailbox command fails during firmware update, the lpfc_log_write_firmware_error() routine is used to log and parse commonly found error codes. Update this routine to also include ASIC_ID register checks for notifying users of incompatible images. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Update construction of SGL when XPSGL is enabledJustin Tee
The construction of SGLs is updated to safeguard ASIC boundary requirements when using XPSGL. The LSP type SGE is used to notify where a continuing SGL resides. Typically, this means that the LSP is the last SGE in an SGL because the current SGL has reached its maximum size and the LSP is used to refer to the next follow up SGL. Due to ASIC boundary requirements, there is a need to ensure a 4 KB boundary is not crossed. Thus, for a maximum size of 256 byte SGLs or 16 SGEs, this means restricting the LSP to being the 12th SGE for the very first SGL that is used for pre-registration. If additional SGEs are needed, the LSP will be the last SGE position within that follow up SGL as was previously implemented. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Remove deprecated PBDE featureJustin Tee
The PBDE feature is no longer supported and its related fields are removed in this patch. There are no expected side effects with regards to existing functionality. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Add REG_VFI mailbox cmd error handlingJustin Tee
If lpfc_issue_reg_vfi() returns an error in lpfc_rcv_plogi(), then execution of lpfc_rcv_plogi() continues and lpfc_reg_rpi() is called, which allocates an mbuf. When this REG_RPI mailbox is issued, it inevitably fails because the VFI is not registered. However, the REG_RPI failure does not free the mbuf that was allocated in lpfc_reg_rpi() because there is no check for mbox error status in lpfc_defer_plogi_acc(). Fix by adding a check in lpfc_rcv_plogi() if lpfc_reg_vfi() fails, then exit early. Also, add mailbox status check in lpfc_defer_plogi_acc to enter the REG_RPI mbox_cmpl functions and free the allocated mbuf. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Log MCQE contents for mbox commands with no contextJustin Tee
Update log message to display the entirety of an MCQE for which there is no submission context. This log message is not expected to occur and hence is tagged as a LOG_TRACE_EVENT. As such, move the hbalock release to before this log message so that the trace event process does not hold the hbalock for too long. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Select mailbox rq_create cmd version based on SLI4 if_typeJustin Tee
When specifying rq version, it is preferred to refer to SLI4 interface type instead of the get_sli4_parameters mailbox command response. If SLI4 if_type is 2 or above, then the newer version 1 is used for rq_create mailbox commands. Otherwise, version 0 is used and is meant for older adapters. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02scsi: lpfc: Break out of IRQ affinity assignment when mask reaches nr_cpu_idsJustin Tee
The purpose of the lpfc_next_online_cpu() call is to save the CPU index for the next iteration of the for (index = 0; index < vectors; index++) loop. Because we’ve reached the last iteration of the loop, cpumask_next(cpu, aff_mask) returns nr_cpu_ids. Thus, if we already know we've reached the last iteration of the IRQ affinity assignment loop, then we can just break and exit. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260331205928.119833-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-04-02Merge branch 7.0/scsi-fixes into 7.1/scsi-stagingMartin K. Petersen
Pull in fixes to resolve mpi3mr merge conflict. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-03-27scsi: lpfc: Update outdated comment for renamed lpfc_freenode()Kexin Sun
The function lpfc_freenode() was renamed to lpfc_cleanup_node() by commit 685f0bf7afe0 ("[SCSI] lpfc 8.1.12 : Collapse discovery lists to a single node list"), and commit a70e63eee1c1 ("scsi: lpfc: Fix NPIV Fabric Node reference counting") later removed the lpfc_unreg_rpi() call from lpfc_cleanup_node(). Remove the now-inaccurate "called from lpfc_freenode()" sentence and reflow the remaining comment text for lpfc_unreg_rpi(). Assisted-by: unnamed:deepseek-v3.2 coccinelle Signed-off-by: Kexin Sun <kexinsun@smail.nju.edu.cn> Link: https://patch.msgid.link/20260321105909.7804-1-kexinsun@smail.nju.edu.cn Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-03-19scsi: lpfc: Use the crc32c() functionEric Biggers
lpfc_cgn_calc_crc32(data, size, crc) is really just an open-coded version of ~crc32c(bitrev32(crc), data, size). However, all callers pass crc == ~0, so it can be simplified even further to just ~crc32c(~0, data, size). Remove the crc argument and implement it that way. While we're at it, also use proper types in the function prototype. Signed-off-by: Eric Biggers <ebiggers@kernel.org> Link: https://patch.msgid.link/20260316223631.72361-1-ebiggers@kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-28scsi: lpfc: ELIMINATE kernel-doc warnings in lpfc.hRandy Dunlap
Avoid all kernel-doc warnings in lpfc.h: - Use the correct function parameter name - Add a '*' to a kernel-doc line - Repair the function Returns: comments Fixes these warnings: Warning: drivers/scsi/lpfc/lpfc.h:1674 No description found for return value of 'lpfc_next_online_cpu' Warning: drivers/scsi/lpfc/lpfc.h:1686 No description found for return value of 'lpfc_next_present_cpu' Warning: drivers/scsi/lpfc/lpfc.h:1700 function parameter 'eq' not described in 'lpfc_sli4_mod_hba_eq_delay' Warning: drivers/scsi/lpfc/lpfc.h:1755 bad line: -------------------------- Warning: drivers/scsi/lpfc/lpfc.h:1759 No description found for return value of 'lpfc_is_vmid_enabled' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260224234954.3606638-1-rdunlap@infradead.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-24scsi: lpfc: Update lpfc version to 14.4.0.14Justin Tee
Update lpfc version to 14.4.0.14. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260212213008.149873-14-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-24scsi: lpfc: Update copyright year string for 2026Justin Tee
Update copyright string to 2026 for this version patch set. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260212213008.149873-13-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-24scsi: lpfc: Restrict first burst to non-FCoE and SLI4 adapters onlyJustin Tee
First burst is only supported on adapters running in SLI4 mode and that are non-FCoE based. Include sli_rev and FCoE mode checks before setting the write transfer ready disabled bit in PRLIs. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260212213008.149873-12-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-24scsi: lpfc: Update class of service bit field to 3 bits for WQE submissionsJustin Tee
WQE submissions only require a 3 bit field when specifying the class of service to use. So, update WQE submission paths to use a 3 bit field instead of 0x0f as the bit mask. A NLP_FCP_CLASS_MASK bitmask is defined to ensure only a 3 bit mask is used. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260212213008.149873-11-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-24scsi: lpfc: Add clean up of aborted NVMe commands during PCI fcn resetJustin Tee
When handling a PCI function reset, notification to the NVMe transport layer is skipped for outstanding aborted NVMe I/O. Introduce a new routine called lpfc_nvme_flush_abts_list(), which notifies upper NVMe transport layer of outstanding aborted NVMe I/O that are not planned to be completed normally due to a PCI function reset request. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260212213008.149873-10-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-24scsi: lpfc: Fix incorrect txcmplq_cnt during cleanup in lpfc_sli_abort_ring()Justin Tee
When a port is offline in lpfc_sli_abort_ring, the phba->txcmplq is cleared but the phba->txcmplq_cnt is not reset to zero. This can sometimes result in a phba->txcmplq_cnt that never reaches zero, which hangs the cleanup process. Update lpfc_sli_abort_ring so that txcmplq_cnt is reset to zero and also ensure that the LPFC_IO_ON_TXCMPLQ flag is properly cleared. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260212213008.149873-9-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-24scsi: lpfc: Cleanup error exit paths in lpfc_fdmi_cmd() and associated messagesJustin Tee
Error labels in lpfc_fdmi_cmd() accidentally return success status and can potentially leak memory. Change error exit path status to return a non-zero value using a common exit path for failure cases. The error path also frees allocated memory and provides logging. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260212213008.149873-8-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2026-02-24scsi: lpfc: Remove unnecessary ndlp kref get in lpfc_check_nlp_post_devlossJustin Tee
When NLP_IN_RECOV_POST_DEV_LOSS is set, the initial node reference remains held while recovery is in progress. Taking a reference when NLP_IN_RECOV_POST_DEV_LOSS is cleared results in an additional reference being held. This causes an extra reference when cleaning up lpfc_vport instances. Thus, remove the extraneous ndlp kref get in lpfc_check_nlp_post_devloss. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://patch.msgid.link/20260212213008.149873-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>