summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx
AgeCommit message (Collapse)Author
2020-04-24scsi: qla2xxx: Delete all sessions before unregister local nvme portQuinn Tran
Delete all sessions before unregistering local nvme port. This allows nvme layer to decrement all active rport count down to zero. Once the count is down to zero, nvme would call qla to continue with the npiv port deletion. PID: 27448 TASK: ffff9e34b777c1c0 CPU: 0 COMMAND: "qaucli" 0 [ffff9e25e84abbd8] __schedule at ffffffff977858ca 1 [ffff9e25e84abc68] schedule at ffffffff97785d79 2 [ffff9e25e84abc78] schedule_timeout at ffffffff97783881 3 [ffff9e25e84abd28] wait_for_completion at ffffffff9778612d 4 [ffff9e25e84abd88] qla_nvme_delete at ffffffffc0e3024e [qla2xxx] 5 [ffff9e25e84abda8] qla24xx_vport_delete at ffffffffc0e024b9 [qla2xxx] 6 [ffff9e25e84abdf0] fc_vport_terminate at ffffffffc011c247 [scsi_transport_fc] 7 [ffff9e25e84abe28] store_fc_host_vport_delete at ffffffffc011cd94 [scsi_transport_fc] 8 [ffff9e25e84abe70] dev_attr_store at ffffffff974b376b 9 [ffff9e25e84abe80] sysfs_kf_write at ffffffff972d9a92 10 [ffff9e25e84abe90] kernfs_fop_write at ffffffff972d907b 11 [ffff9e25e84abec8] vfs_write at ffffffff9724c790 12 [ffff9e25e84abf08] sys_write at ffffffff9724d55f 13 [ffff9e25e84abf50] system_call_fastpath at ffffffff97792ed2 RIP: 00007fc0bd81a6fd RSP: 00007ffff78d9648 RFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000022 RCX: 00007ffff78d96e0 RDX: 0000000000000022 RSI: 00007ffff78d94e0 RDI: 0000000000000008 RBP: 00007ffff78d9440 R8: 0000000000000000 R9: 00007fc0bd48b2cd R10: 0000000000000017 R11: 0000000000000293 R12: 0000000000000000 R13: 00005624e4dac840 R14: 00005624e4da9a10 R15: 0000000000000000 ORIG_RAX: 0000000000000001 CS: 0033 SS: 002b Link: https://lore.kernel.org/r/20200331104015.24868-4-njavali@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-24scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIVArun Easi
In NPIV environment, a NPIV host may use a queue pair created by base host or other NPIVs, so the check for a queue pair created by this NPIV is not correct, and can cause an abort to fail, which in turn means the NVME command not returned. This leads to hang in nvme_fc layer in nvme_fc_delete_association() which waits for all I/Os to be returned, which is seen as hang in the application. Link: https://lore.kernel.org/r/20200331104015.24868-3-njavali@marvell.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Arun Easi <aeasi@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-21scsi: qla2xxx: check UNLOADING before posting async workMartin Wilck
qlt_free_session_done() tries to post async PRLO / LOGO, and waits for the completion of these async commands. If UNLOADING is set, this is doomed to timeout, because the async logout command will never complete. The only way to avoid waiting pointlessly is to fail posting these commands in the first place if the driver is in UNLOADING state. In general, posting any command should be avoided when the driver is UNLOADING. With this patch, "rmmod qla2xxx" completes without noticeable delay. Link: https://lore.kernel.org/r/20200421204621.19228-3-mwilck@suse.com Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip") Acked-by: Arun Easi <aeasi@marvell.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Martin Wilck <mwilck@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-21scsi: qla2xxx: set UNLOADING before waiting for session deletionMartin Wilck
The purpose of the UNLOADING flag is to avoid port login procedures to continue when a controller is in the process of shutting down. It makes sense to set this flag before starting session teardown. Furthermore, use atomic test_and_set_bit() to avoid the shutdown being run multiple times in parallel. In qla2x00_disable_board_on_pci_error(), the test for UNLOADING is postponed until after the check for an already disabled PCI board. Link: https://lore.kernel.org/r/20200421204621.19228-2-mwilck@suse.com Fixes: 45235022da99 ("scsi: qla2xxx: Fix driver unload by shutting down chip") Reviewed-by: Arun Easi <aeasi@marvell.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Martin Wilck <mwilck@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-13scsi: qla2xxx: Fix regression warningsNilesh Javali
drivers/scsi/qla2xxx/qla_dbg.c:2542:7: warning: The scope of the variable 'pbuf' can be reduced. [variableScope] drivers/scsi/qla2xxx/qla_init.c:3615:6: warning: Variable 'rc' is assigned a value that is never used. [unreadVariable] drivers/scsi/qla2xxx/qla_isr.c:81:11-29: WARNING: dma_alloc_coherent use in rsp_els already zeroes out memory, so memset is not needed drivers/scsi/qla2xxx/qla_mbx.c:4889:15-33: WARNING: dma_alloc_coherent use in els_cmd_map already zeroes out memory, so memset is not needed [mkp: added newline after variable declaration] Link: https://lore.kernel.org/r/20200403084018.30766-2-njavali@marvell.com Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-04-10Merge tag 'block-5.7-2020-04-10' of git://git.kernel.dk/linux-blockLinus Torvalds
Pull block fixes from Jens Axboe: "Here's a set of fixes that should go into this merge window. This contains: - NVMe pull request from Christoph with various fixes - Better discard support for loop (Evan) - Only call ->commit_rqs() if we have queued IO (Keith) - blkcg offlining fixes (Tejun) - fix (and fix the fix) for busy partitions" * tag 'block-5.7-2020-04-10' of git://git.kernel.dk/linux-block: block: fix busy device checking in blk_drop_partitions again block: fix busy device checking in blk_drop_partitions nvmet-rdma: fix double free of rdma queue blk-mq: don't commit_rqs() if none were queued nvme-fc: Revert "add module to ops template to allow module references" nvme: fix deadlock caused by ANA update wrong locking nvmet-rdma: fix bonding failover possible NULL deref loop: Better discard support for block devices loop: Report EOPNOTSUPP properly nvmet: fix NULL dereference when removing a referral nvme: inherit stable pages constraint in the mpath stack device blkcg: don't offline parent blkcg first blkcg: rename blkcg->cgwb_refcnt to ->online_pin and always use it nvme-tcp: fix possible crash in recv error flow nvme-tcp: don't poll a non-live queue nvme-tcp: fix possible crash in write_zeroes processing nvmet-fc: fix typo in comment nvme-rdma: Replace comma with a semicolon nvme-fcloop: fix deallocation of working context nvme: fix compat address handling in several ioctls
2020-04-04nvme-fc: Revert "add module to ops template to allow module references"James Smart
The original patch was to resolve the lldd being able to be unloaded while being used to talk to the boot device of the system. However, the end result of the original patch is that any driver unload while a nvme controller is live via the lldd is now being prohibited. Given the module reference, the module teardown routine can't be called, thus there's no way, other than manual actions to terminate the controllers. Fixes: 863fbae929c7 ("nvme_fc: add module to ops template to allow module references") Cc: <stable@vger.kernel.org> # v5.4+ Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2020-04-02Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds
Pull SCSI updates from James Bottomley: "This series has a huge amount of churn because it pulls in Mauro's doc update changing all our txt files to rst ones. Excluding that, we have the usual driver updates (qla2xxx, ufs, lpfc, zfcp, ibmvfc, pm80xx, aacraid), a treewide update for scnprintf and some other minor updates. The major core change is Hannes moving functions out of the aacraid driver and into the core" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (223 commits) scsi: aic7xxx: aic97xx: Remove FreeBSD-specific code scsi: ufs: Do not rely on prefetched data scsi: dc395x: remove dc395x_bios_param scsi: libiscsi: Fix error count for active session scsi: hpsa: correct race condition in offload enabled scsi: message: fusion: Replace zero-length array with flexible-array member scsi: qedi: Add PCI shutdown handler support scsi: qedi: Add MFW error recovery process scsi: ufs: Enable block layer runtime PM for well-known logical units scsi: ufs-qcom: Override devfreq parameters scsi: ufshcd: Let vendor override devfreq parameters scsi: ufshcd: Update the set frequency to devfreq scsi: ufs: Resume ufs host before accessing ufs device scsi: ufs-mediatek: customize the delay for enabling host scsi: ufs: make HCE polling more compact to improve initialization latency scsi: ufs: allow custom delay prior to host enabling scsi: ufs-mediatek: use common delay function scsi: ufs: introduce common and flexible delay function scsi: ufs: use an enum for host capabilities scsi: ufs: fix uninitialized tx_lanes in ufshcd_disable_tx_lcc() ...
2020-03-26scsi: qla2xxx: Remove non functional codeDaniel Wagner
Remove code which has no functional use anymore since commit 3c75ad1d87c7 ("scsi: qla2xxx: Remove defer flag to indicate immeadiate port loss"). While at it remove also the stale function documentation. Link: https://lore.kernel.org/r/20200206135443.110701-1-dwagner@suse.de Reviewed-by: Arun Easi <aeasi@marvell.com> Reviewed-by: Lee Duncan <lduncan@suse.com> Signed-off-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-17scsi: qla2xxx: Fix I/Os being passed down when FC device is being deletedArun Easi
I/Os could be passed down while the device FC SCSI device is being deleted. This would result in unnecessary delay of I/O and driver messages (when extended logging is set). [mkp: fixed commit hash and added SoB for Nilesh] Link: https://lore.kernel.org/r/20200313085001.3781-1-njavali@marvell.com Fixes: 3c75ad1d87c7 ("scsi: qla2xxx: Remove defer flag to indicate immeadiate port loss") # v5.6-rc1+ Tested-by: Laurence Oberman <loberman@redhat.com> Reviewed-by: Laurence Oberman <loberman@redhat.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Arun Easi <aeasi@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-03-11scsi: qla2xxx: add ring buffer for tracing debug logsRajan Shanmugavelu
Having this log in a ring buffer helps to diagnose qla2xxx driver and firmware issues instead of having to reproduce the problem with extended_logging enabled. This saves cycles and helps when it is hard to reproduce problem. Link: https://lore.kernel.org/r/1581557368-32080-1-git-send-email-rajan.shanmugavelu@oracle.com Reviewed-by: Joe Jin <joe.jin@oracle.com> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Rajan Shanmugavelu <rajan.shanmugavelu@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Update driver version to 10.01.00.25-kHimanshu Madhani
Link: https://lore.kernel.org/r/20200226224022.24518-19-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Set Nport ID for N2NQuinn Tran
When transitioning from loop to N2N, stale NPort ID is not re-assigned. Stale ID can collide with remote device. This patch will re-assign NPort ID on N2N is detected. Link: https://lore.kernel.org/r/20200226224022.24518-18-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Handle NVME status iocb correctlyArun Easi
Certain state flags bit combinations are not checked and not handled correctly. Plus, do not log a normal underrun situation where there is no frame drop. Link: https://lore.kernel.org/r/20200226224022.24518-17-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Arun Easi <aeasi@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Remove restriction of FC T10-PI and FC-NVMeQuinn Tran
T10-PI and FC-NVMe are not mutually exclusive. This patch removes restrictions where if FC-NVMe is enabled T10-PI defaults to disabled. Link: https://lore.kernel.org/r/20200226224022.24518-16-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Serialize fc_port alloc in N2NQuinn Tran
For N2N, fc_port struct is created during report id acquisition. At later time, the loop resync (fabric, n2n, loop) would trigger the rest of the login using the created fc_port struct. The loop resync logic can trigger another fc_port allocation if the 1st allocation was not able to execute. This patch prevents the 2nd allocation trigger. Link: https://lore.kernel.org/r/20200226224022.24518-15-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Fix NPIV instantiation after FW dumpQuinn Tran
NPIV re-enable code was blocked after FW had been initialized. The blocking check was too broad. Reduce the check to make sure if FW is initialized or not. Link: https://lore.kernel.org/r/20200226224022.24518-14-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Fix RDP respond data formatQuinn Tran
RPD information failed to display by switch cli command. This is caused by driver failure to properly format RDP response data with data descriptor to allow switch to parse it correctly. Link: https://lore.kernel.org/r/20200226224022.24518-13-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Force semaphore on flash validation failureQuinn Tran
For single port 28XX adapter, the second core can still run in the background. The flash semaphore can be held by the non-active core. This patch tell MPI FW to check for this case and clear the semaphore from the non-active core. Link: https://lore.kernel.org/r/20200226224022.24518-12-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: add more FW debug informationQuinn Tran
Per FW request, MB 1-7 should be logged for 8002 error. Link: https://lore.kernel.org/r/20200226224022.24518-11-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Update BPM enablement semantics.Andrew Vasquez
commit e4e3a2ce9556 ("scsi: qla2xxx: Add ability to autodetect SFP type") takes a heavy handed approach to BPM (Buffer Plus Management) enablement: 1) During hardware initialization, if an LR-capable transceiver is recognized, the driver schedules a disruptive post-initialization chip-reset (ISP-ABORT) to allow the BPM settings to be sent to the firmware. This chip-reset will result in (short-term) path-loss to all fc-rports and their attached SCSI devices. 2) LR-detection is triggered during any link-up event, resulting in a refresh and potential chip-reset Based on firmware-team guidance, upon LR-capable transceiver recognition, the driver's hardware initialization code will now re-execute firmware with the new BPM settings, then continue on with driver initialization. To address the second issue, the driver performs LR-capable detection upon the driver receiving a transceiver-insertion asynchronous event from firmware. No short-term path loss is needed with this new semantic. Link: https://lore.kernel.org/r/20200226224022.24518-10-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Andrew Vasquez <andrewv@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: fix FW resource count valuesQuinn Tran
This patch fixes issue where current and original exchanges count were swapped for intiator and targets. Also fix IOCB count for current and original which were swapped. Link: https://lore.kernel.org/r/20200226224022.24518-9-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Use a dedicated interrupt handler for 'handshake-required' ISPsAndrew Vasquez
There's no point checking flags.disable_msix_handshake in the interrupt handler hot-path. Instead perform the check during queue-pair instantiation and use the proper interrupt handler. Link: https://lore.kernel.org/r/20200226224022.24518-8-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Andrew Vasquez <andrewv@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Return appropriate failure through BSG InterfaceMichael Hernandez
This patch ensures flash updates API calls return possible failure status through BSG interface to the application. Link: https://lore.kernel.org/r/20200226224022.24518-7-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Michael Hernandez <mhernandez@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Improved secure flash support messagesMichael Hernandez
This patch improved message for Secure Flash support. No functionality has been changed. Link: https://lore.kernel.org/r/20200226224022.24518-6-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Michael Hernandez <mhernandez@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Fix FCP-SCSI FC4 flag passing errorQuinn Tran
This patch fixes issue where incorrect flag was used for sending switch commands. Link: https://lore.kernel.org/r/20200226224022.24518-5-hmadhani@marvell.com Fixes: e8c72ba51a15 ("[SCSI] qla2xxx: Use GFF_ID to check FCP-SCSI FC4 type before logging into Nx_Ports") Fixes: a4239945b8ad ("scsi: qla2xxx: Add switch command to simplify fabric discovery") Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Use FC generic update firmware options routine for ISP27xxGiridhar Malavali
This patch uses generic firmware update options for FCoE based adapters as well to reduce code duplication. Link: https://lore.kernel.org/r/20200226224022.24518-4-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Avoid setting firmware options twice in 24xx_update_fw_options.Giridhar Malavali
This patch moves ql2xrdpenable check earlier to avoids setting fw_option once again before exiting qla24xx_update_fw_options. Link: https://lore.kernel.org/r/20200226224022.24518-3-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Giridhar Malavali <gmalavali@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Add 16.0GT for PCI StringHimanshu Madhani
This patch adds 16.0GT for readable display string. Link: https://lore.kernel.org/r/20200226224022.24518-2-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Convert MAKE_HANDLE() from a define into an inline functionBart Van Assche
This patch allows sparse to verify the endianness of the arguments passed to make_handle(). Link: https://lore.kernel.org/r/20200220043441.20504-5-bvanassche@acm.org Cc: Roman Bolshakov <r.bolshakov@yadro.com> Cc: Daniel Wagner <dwagner@suse.de> Cc: Martin Wilck <mwilck@suse.com> Cc: Quinn Tran <qutran@marvell.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Fix sparse warnings triggered by the PCI state checking codeBart Van Assche
This patch fixes the following sparse warnings: drivers/scsi/qla2xxx/qla_mbx.c:120:21: warning: restricted pci_channel_state_t degrades to integer drivers/scsi/qla2xxx/qla_mbx.c:120:37: warning: restricted pci_channel_state_t degrades to integer >From include/linux/pci.h: enum pci_channel_state { /* I/O channel is in normal state */ pci_channel_io_normal = (__force pci_channel_state_t) 1, /* I/O to channel is blocked */ pci_channel_io_frozen = (__force pci_channel_state_t) 2, /* PCI card is dead */ pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, }; Link: https://lore.kernel.org/r/20200220043441.20504-4-bvanassche@acm.org Cc: Roman Bolshakov <r.bolshakov@yadro.com> Cc: Martin Wilck <mwilck@suse.com> Cc: Quinn Tran <qutran@marvell.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Suppress endianness complaints in qla2x00_configure_local_loop()Bart Van Assche
Instead of changing endianness in-place, write the data in CPU endian format in another buffer and copy that buffer back. This patch does not change any functionality but silences some sparse endianness warnings. Link: https://lore.kernel.org/r/20200220043441.20504-3-bvanassche@acm.org Cc: Roman Bolshakov <r.bolshakov@yadro.com> Cc: Martin Wilck <mwilck@suse.com> Cc: Quinn Tran <qutran@marvell.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Simplify the code for aborting SCSI commandsBart Van Assche
Since the SCSI core does not reuse the tag of the SCSI command that is being aborted by .eh_abort() before .eh_abort() has finished it is not necessary to check from inside that callback whether or not the SCSI command has already completed. Instead, rely on the firmware to return an error code when attempting to abort a command that has already completed. Additionally, rely on the firmware to return an error code when attempting to abort an already aborted command. In qla2x00_abort_srb(), use blk_mq_request_started() instead of sp->completed and sp->aborted. Link: https://lore.kernel.org/r/20200220043441.20504-2-bvanassche@acm.org Cc: Martin Wilck <mwilck@suse.com> Cc: Quinn Tran <qutran@marvell.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-28scsi: qla2xxx: Fix sparse warning reported by kbuild botHimanshu Madhani
this patch fixes following sparse warnings >> drivers/scsi/qla2xxx/qla_tmpl.c:873:32: sparse: sparse: incorrect type in assignment (different base types) >> drivers/scsi/qla2xxx/qla_tmpl.c:873:32: sparse: expected unsigned int [usertype] capture_timestamp >> drivers/scsi/qla2xxx/qla_tmpl.c:873:32: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_tmpl.c:885:29: sparse: sparse: incorrect type in assignment (different base types) >> drivers/scsi/qla2xxx/qla_tmpl.c:885:29: sparse: expected unsigned int vim +873 drivers/scsi/qla2xxx/qla_tmpl.c 869 870 static void 871 qla27xx_time_stamp(struct qla27xx_fwdt_template *tmp) 872 { > 873 tmp->capture_timestamp = cpu_to_le32(jiffies); 874 } 875 876 static void 877 qla27xx_driver_info(struct qla27xx_fwdt_template *tmp) 878 { 879 uint8_t v[] = { 0, 0, 0, 0, 0, 0 }; 880 881 WARN_ON_ONCE(sscanf(qla2x00_version_str, 882 "%hhu.%hhu.%hhu.%hhu.%hhu.%hhu", 883 v+0, v+1, v+2, v+3, v+4, v+5) != 6); 884 > 885 tmp->driver_info[0] = cpu_to_le32( 886 v[3] << 24 | v[2] << 16 | v[1] << 8 | v[0]); 887 tmp->driver_info[1] = cpu_to_le32(v[5] << 8 | v[4]); 888 tmp->driver_info[2] = __constant_cpu_to_le32(0x12345678); 889 } 890 Link: https://lore.kernel.org/r/20200227201148.13973-1-hmadhani@marvell.com Fixes: a31056ddc665 ("scsi: qla2xxx: Use endian macros to assign static fields in fwdump header") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Update driver version to 10.01.00.24-kHimanshu Madhani
Link: https://lore.kernel.org/r/20200212214436.25532-26-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Use QLA_FW_STOPPED macro to propagate flagHimanshu Madhani
This patch uses QLA_FW_STOPPED macro so that flag is propogated to all the QPairs. Link: https://lore.kernel.org/r/20200212214436.25532-25-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Add fixes for mailbox commandHimanshu Madhani
This patch fixes: - qla2x00_issue_iocb_timeout will now return if chip is down - only check for sp->qpair in abort handling Link: https://lore.kernel.org/r/20200212214436.25532-24-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Fix control flags for login/logout IOCBHimanshu Madhani
This patch fixes control flag options for login/logout IOCB. Link: https://lore.kernel.org/r/20200212214436.25532-23-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Save rscn_gen for new fcportHimanshu Madhani
Add missing rscn_gen when creating new fcport. Link: https://lore.kernel.org/r/20200212214436.25532-22-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Use correct ISP28xx active FW regionQuinn Tran
For ISP28xx, use 28xx call to retrieve active FW region. Link: https://lore.kernel.org/r/20200212214436.25532-21-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Print portname for logging in qla24xx_logio_entry()Joe Carnuccio
Add port name in the messages file to help debugging of Login/Logout IOCBs Link: https://lore.kernel.org/r/20200212214436.25532-20-hmadhani@marvell.com Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Fix qla2x00_echo_test() based on ISP typeJoe Carnuccio
Ths patch fixes MBX in-direction for setting right bits for qla2x00_echo_test() Link: https://lore.kernel.org/r/20200212214436.25532-19-hmadhani@marvell.com Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Correction to selection of loopback/echo testJoe Carnuccio
This fixes loopback and echo test options. Link: https://lore.kernel.org/r/20200212214436.25532-18-hmadhani@marvell.com Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Use endian macros to assign static fields in fwdump headerJoe Carnuccio
This takes care of big endian architectures. Link: https://lore.kernel.org/r/20200212214436.25532-17-hmadhani@marvell.com Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Fix RDP response sizeHimanshu Madhani
This patch fixes RDP length in case when driver needs to reduce length of RDP response Link: https://lore.kernel.org/r/20200212214436.25532-16-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Handle cases for limiting RDP response payload lengthJoe Carnuccio
This patch reduces RDP response payload length, if requesting port is a domain controller (sid 0xfffc01) and fw is earlier than 8.09.00 and fw is not 8.05.65 then limit the RDP response payload length to maximum of 256 bytes by terminating the response just before the optical element descriptor. Link: https://lore.kernel.org/r/20200212214436.25532-15-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Add deferred queue for processing ABTS and RDPJoe Carnuccio
This patch adds deferred queue for processing aborts and RDP in the driver. Link: https://lore.kernel.org/r/20200212214436.25532-14-hmadhani@marvell.com Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Cleanup ELS/PUREX iocb fieldsJoe Carnuccio
This patch does the following to improve RDP processing: - Rename field port_id to d_id in ELS and PUREX iocb structs to match FW spec. - Remove redundant comments from ELS and PUREX iocb structs. - Refactor fields in ELS iocb struct for error subcode common access. - Properly use error subcode fields in rdp processing routine. - Add print logs for alloc failure in purex rdp processing routine. Link: https://lore.kernel.org/r/20200212214436.25532-13-hmadhani@marvell.com Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Show correct port speed capabilities for RDP commandHimanshu Madhani
This patch correctly displays port speed capability and current speed for RDP command. Link: https://lore.kernel.org/r/20200212214436.25532-12-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-02-24scsi: qla2xxx: Display message for FCE enabledHimanshu Madhani
During Link up phase and Data rate MBX command response, print message indicating FCE is enabled. Link: https://lore.kernel.org/r/20200212214436.25532-11-hmadhani@marvell.com Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>