summaryrefslogtreecommitdiff
path: root/drivers/scsi/bfa/bfa_core.c
AgeCommit message (Collapse)Author
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 292Thomas Gleixner
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license gpl version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 66 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.606369721@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10scsi: bfa: use ARRAY_SIZE for array sizing calculation on array __pciidsColin Ian King
Use the ARRAY_SIZE macro on array __pciids to determine size of the array. Improvement suggested by coccinelle. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-04-19scsi: bfa: remove bfa_module_s madnessChristoph Hellwig
Just call the functions directly and remove a giant pile of boilerplate code. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23bfa: deinline __bfa_trc() and __bfa_trc32()Denys Vlasenko
__bfa_trc() compiles to 115 bytes of machine code. With this .config: http://busybox.net/~vda/kernel_config there are 1494 calls of __bfa_trc(). __bfa_trc32() is very similar, so it is uninlined too. However, it appears to be unused, therefore this patch ifdefs it out. Change in code size is about 130,000 bytes: text data bss dec hex filename 85975426 22294712 20627456 128897594 7aed23a vmlinux.before 85842882 22294584 20627456 128764922 7accbfa vmlinux [mkp: Removed unused __bfa_trc32()] Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> CC: Fabian Frederick <fabf@skynet.be> CC: Anil Gurumurthy <anil.gurumurthy@qlogic.com> CC: Christoph Hellwig <hch@lst.de> CC: Guenter Roeck <linux@roeck-us.net> CC: Ben Hutchings <ben@decadent.org.uk> CC: James Bottomley <JBottomley@Parallels.com> CC: linux-kernel@vger.kernel.org CC: linux-scsi@vger.kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02bfa: File header and user visible string changesAnil Gurumurthy
Signed-off-by: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com> Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02bfa: Update copyright messagesAnil Gurumurthy
Signed-off-by: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com> Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2013-12-19[SCSI] bfa: Fix for bcu or hcm faa query hangVijaya Mohan Guvva
This patch set fixes the issue of brocade management utility hang (bcu/HCM) when faa attributes are queried from multiple application threads. Hang was due to race between the threads and completion handler corruption. Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-06-26[SCSI] bfa: Allow rsp queue process during ioc disableVijaya Mohan Guvva
Allow processing completions from firmware during IOC_DISABLE request is being processed by the firmware, by setting the queue_process flag appropriately. Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-10-07[SCSI] bfa: Add support to read/update the FRU data.Krishna Gudipati
- Add FRU sub-module to support FRU read/write/update. - Add support to read/write from the temp FRU module. [jejb: fix checkpatch issues] Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-10-07[SCSI] bfa: Add support to configure min/max bandwidth for a pcifnKrishna Gudipati
- Added support to configure minimum bandwidth for a pcifn. - Minimum bandwith is guaranteed at per queue level. - Added support to update pcifn bandwidth dynamically without a server reboot. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-10-07[SCSI] bfa: Add support for IO throttling at port levelKrishna Gudipati
Add capability to limit the number of exchanges on a port to avoid queue-full conditions from the target side. Signed-off-by: Sudarsana Reddy Kalluru <skalluru@brocade.com> Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-10-07[SCSI] bfa: IOCFC state machine enhancementsKrishna Gudipati
- Add support to handle STOP/DISABLE events in the IOCFC state machine. - Made changes to bring the IOC down on a flash driver config read failure. - Added logic to clean the use count and fail sync registers during IOCFC init. Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24[SCSI] bfa: Fix to process mbox interrupts only if interrupts are enabled in ↵Krishna Gudipati
INTx mode. - Made changes to process mbox and error interrupts only if interrupts are enabled, when running in INTx mode. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-09-24[SCSI] bfa: Add PowerPC support and enable PCIE AER handling.Krishna Gudipati
- Added few missing endian swap changes to support BFA on PowerPC. - Added PCIE AER support to BFA: a) Implemented the PCI error handler entry points. b) Made changes to FCS state machine to handle STOP event from the PCI error detected entry point. c) Made changes to the IO Controller state machine to handle SUSPEND event from the PCI error detected entry point. d) Made changes to restart the BFA operations on a slot_reset completion. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-03-28[SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.Krishna Gudipati
Made changes to the Fabric Assigned Address(FAA) feature implementation. Introduced the IOCFC state machine, which now handles the FAA logic, IOC and BFA sub-modules enablement. Removed un-wanted FAA enable/disable routines; FAA is enabled by default. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-03-28[SCSI] bfa: Modify ISR to process pending completionsKrishna Gudipati
Made changes to the driver ISR to process any pending completions even if the RME bit is not set in the interrupt status register. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27[SCSI] bfa: Add support to store driver configuration in flash.Krishna Gudipati
- Added dconf (Driver Config) BFA sub-module. - The dconf sub-module provides interfaces and manages flash writes to the flash DRV parition. - dconf sub-module also ensures that the whole 64K DRV partition is updated on a flash write. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27[SCSI] bfa: Added support to collect and reset fcport statsKrishna Gudipati
- Added support to collect and reset fcport stats. - Modified design to allow multiple requests for fcport stats. - fcport will remember the stats request in its stats_pending queue and service each of the queued requests after receiving a firmware response for the prior request. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27[SCSI] bfa: Update RME interrupt handling.Krishna Gudipati
- Made changes to always acknowledge RME interrupt and update consumer index (CI) when RME interrupt is generated. - Made changes to have ASIC specific hw_rspq_ack() handler. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Added support to query PHY.Krishna Gudipati
- Added PHY sub-module. - Implemented interface to obtain stats and to read/update the fw from the PHY module. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Added HBA diagnostics support.Krishna Gudipati
- Added diagnostics sub-module to BFA. - Implemented interface to perform memtest/loopback test and some other diagnostics tests. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Added support for flash configurationKrishna Gudipati
- Added flash sub-module. - Implemented the interface to read/erase/update flash partition. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Added support to obtain SFP info.Krishna Gudipati
- Added SFP sub-module to BFA. - Added interface to collect sfp media info and sfp speed. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Added support for CEE info and stats query.Krishna Gudipati
- Added CEE sub-module. - Added support to collect stats/cee module info using BSG interface. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Extend BSG interface.Krishna Gudipati
- Added support to collect driver/fw stats. - Added support to perform adapter/ioc enable, disable operations. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: DMA memory allocation enhancement.Krishna Gudipati
- Modified the design such that each BFA sub-module will provide the amount of DMA and KVA memory needed by it and queues the same request to the global dma and kva info queues. - During the memory allocation we iterate over this queue to allocate the dma and kva memory requested by sub-modules. - The change is needed to avoid requesting the aggregate amount of memory needed by all the BFA sub-modules as one contiguous chunk. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Brocade-1860 Fabric Adapter vHBA support.Krishna Gudipati
- Introduced partitioning of the BFA resources. - Added h/w queue ID in CPE messages, firmware uses h/w queue ID from messages to pick a matching RME queue. - Added message header to bfa_reqq_produce(). h/w queue ID is set in the message header and firmware modules use h/w queue ID from message header instead of from cpqe event. - Made changes to allow using all 256 queues of Brocade-1860 asic. Previously only a single queue per queue group was used. - Added function tag to BFI message header. Only used by FC BFI messages. Used to translate host tag to firmware tag. bfa_lpuid() is changed to bfa_fn_lpu() that encodes both PCI function and port ID in BFI message header. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Brocade-1860 Fabric Adapter PLL init fixes.Krishna Gudipati
- If flash controller is halted unconditionally, this results in illegal write access to flash controller register domain. Since flash controller registers are only accessible once s_clk is started - added logic to check for WGN status and halt flash controller only if it is already running. - Added check to wait for flash controller halt to be completed before proceeding with s_clk/l_clk initializations. - Removed unnecessary reset logic for PMM 1T memory and moved memory initialization after flash access enable. - Disable Brocade-1860 asic MBOX interrupt before PLL initialization. - Remove reset enable for S_CLK/L_CLK after both PLL initializations are complete. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Added Fabric Assigned Address(FAA) supportKrishna Gudipati
- Updated/added data structures and definitions to support FAA protocol. - Modified the IOC state machine to support FAA. - Introduced FAA feature configuration - enable/disable/query. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Enable ASIC block configuration and query.Krishna Gudipati
- Added ASIC block configuration APIs: - to create/delete/update the physical functions - to do adapter/port mode configuration - to query the current ASIC block configuration. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Enhancement for fcpim and IO tag handling.Krishna Gudipati
- Enhancements to FCPIM module. - Introduced IO tag management to allocate/release IOs to FCPIM module from a free IOtag pool. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: IOC and PLL init changes for Brocade-1860 Fabric Adapter.Krishna Gudipati
- Introduced IOC poll mechanism which replaces current interrupt based FW READY method. - The timer based poll routine in IOC will query the ioc_fwstate register to see if there is a state change in FW, and sends the READY event. - Bug fixes in the new asic PLL initialization. - Added logic to handle CPE/RME queue interrupts before iocfc config done. 1. Use the queue_process flag to see if iocfc configuration is done in INTX mode. 2. Split the MSIX handler installation in two - one for IOC intr handler and the other for cpe/rme queue handler - and delay assigning queue handlers until iocfc config is done in MSIX mode. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Changes to support vport disable and enable operations.Krishna Gudipati
Made changes to FCS lport, vport state machines to support vport enable / disable operations. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Brocade-1860 Fabric Adapter Hardware EnablementKrishna Gudipati
- Added support for Brocade-1860 Fabric Adapter. - Made changes to support single firmware image per asic type. - Combined bfi_cbreg.h and bfi_ctreg.h defines into bfi_reg.h with only minimal defines used by host. - Added changes to setup CPE/RME Queue register offsets based on firmware response. - Removed queue register offset initializations and added register offsets to BFI config response message. - Added Brocade-1860 asic specific interrupt status definitions and mailbox interfaces. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29[SCSI] bfa: Introduce IOC event notification mechanism.Krishna Gudipati
Introduced a generic event notification callback function that receives IOC_ENABLED, IOC_DISABLED, IOC_FAILED events and notifies the modules registered for these events. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2010-12-31[SCSI] bfa: remove unused defintions and misc cleanupsJing Huang
This patch removes unused functions, data strucutres, and definitions. It also includes misc comment and formatting cleanups. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31[SCSI] bfa: remove inactive functionsJing Huang
This patch removes some inactive functions and macros. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31[SCSI] bfa: replace bfa_assert with WARN_ONJing Huang
Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21[SCSI] bfa: remove unused functions and misc cleanupsMaggie Zhang
Remove unused functions and fix checkpatch errors. Misc cleanups in comment and formatting. Signed-off-by: Maggie Zhang <xmzhang@brocade.com> Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21[SCSI] bfa: remove all OS wrappersMaggie Zhang
Remove OS wrapper functions/macros, and as a result remove bfa_os_inc.h. Signed-off-by: Maggie Zhang <xmzhang@brocade.com> Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21[SCSI] bfa: remove a file with small sizeMaggie Zhang
Removed bfa_drv.c, merged it to bfa_core.c and modified Makefile. Signed-off-by: Maggie Zhang <xmzhang@brocade.com> Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21[SCSI] bfa: clean up one line functionsMaggie Zhang
Cleaned up one line functions. Signed-off-by: Maggie Zhang <xmzhang@brocade.com> Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21[SCSI] bfa: remove unused and empty functionsMaggie Zhang
Removed unused and empty functions. Signed-off-by: Maggie Zhang <xmzhang@brocade.com> Signed-off-by: Jing Huang <xmzhang@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25[SCSI] bfa: fix comments for c filesJing Huang
This patch addresses the comments from Randy Dunlap (Randy.Dunlap@oracle.com) regarding comment blocks that begining with "/**". bfa driver comments currently do not follow kernel-doc convention, we hence replace all /** with /* and **/ with */. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25[SCSI] bfa: remove os wrapper functions and macrosJing Huang
This patch replaces register access functions and macros with the the ones provided by linux. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25[SCSI] bfa: replace endian swap macros with the ones provided by linuxJing Huang
Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25[SCSI] bfa: remove os wrapper and unused functionsJing Huang
This patch removes os wrapper and unused functions. bfa_os_assign(), bfa_os_memset(), bfa_os_memcpy(), bfa_os_udelay() bfa_os_vsprintf(), bfa_os_snprintf(), and bfa_os_get_clock() are replaced with direct assignment or native linux functions. Some unused functions related to VF (Vitual fabric) are also removed. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-16[SCSI] bfa: cleanup driverKrishna Gudipati
We have flattened the BFA hierarchy and also reduced the number of source and header files we used to have earlier. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-08-04Merge branch 'for-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (48 commits) Documentation: update broken web addresses. fix comment typo "choosed" -> "chosen" hostap:hostap_hw.c Fix typo in comment Fix spelling contorller -> controller in comments Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> Fault fs/Kconfig: Fix typo Userpace -> Userspace Removing dead MACH_U300_BS26 drivers/infiniband: Remove unnecessary casts of private_data fs/ocfs2: Remove unnecessary casts of private_data libfc: use ARRAY_SIZE scsi: bfa: use ARRAY_SIZE drm: i915: use ARRAY_SIZE drm: drm_edid: use ARRAY_SIZE synclink: use ARRAY_SIZE block: cciss: use ARRAY_SIZE comment typo fixes: charater => character fix comment typos concerning "challenge" arm: plat-spear: fix typo in kerneldoc reiserfs: typo comment fix update email address ...