aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-04-21scsi: bfa: use designated initializersKees Cook1-10/+21
Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. This also initializes the array members using the enum used to look up __port_action entries. Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-04-19scsi: bfa: remove bfa_module_s madnessChristoph Hellwig5-298/+108
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>
2017-02-27scripts/spelling.txt: add "aligment" pattern and fix typo instancesMasahiro Yamada1-1/+1
Fix typos and add the following to the scripts/spelling.txt: aligment||alignment I did not touch the "N_BYTE_ALIGMENT" macro in drivers/net/wireless/realtek/rtlwifi/wifi.h to avoid unpredictable impact. I fixed "_aligment_handler" in arch/openrisc/kernel/entry.S because it is surrounded by #if 0 ... #endif. It is surely safe and I confirmed "_alignment_handler" is correct. I also fixed the "controler" I found in the same hunk in arch/openrisc/kernel/head.S. Link: http://lkml.kernel.org/r/1481573103-11329-8-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-21Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds3-139/+48
Pull SCSI updates from James Bottomley: "This update includes the usual round of major driver updates (ncr5380, ufs, lpfc, be2iscsi, hisi_sas, storvsc, cxlflash, aacraid, megaraid_sas, ...). There's also an assortment of minor fixes and the major update of switching a bunch of drivers to pci_alloc_irq_vectors from Christoph" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (188 commits) scsi: megaraid_sas: handle dma_addr_t right on 32-bit scsi: megaraid_sas: array overflow in megasas_dump_frame() scsi: snic: switch to pci_irq_alloc_vectors scsi: megaraid_sas: driver version upgrade scsi: megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2 scsi: megaraid_sas: Indentation and smatch warning fixes scsi: megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints scsi: megaraid_sas: Increase internal command pool scsi: megaraid_sas: Use synchronize_irq to wait for IRQs to complete scsi: megaraid_sas: Bail out the driver load if ld_list_query fails scsi: megaraid_sas: Change build_mpt_mfi_pass_thru to return void scsi: megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool scsi: megaraid_sas: Remove unused pd_index from megasas_build_ld_nonrw_fusion scsi: megaraid_sas: megasas_return_cmd does not memset IO frame to zero scsi: megaraid_sas: max_fw_cmds are decremented twice, remove duplicate scsi: megaraid_sas: update can_queue only if the new value is less scsi: megaraid_sas: Change max_cmd from u32 to u16 in all functions scsi: megaraid_sas: set pd_after_lb from MR_BuildRaidContext and initialize pDevHandle to MR_DEVHANDLE_INVALID scsi: megaraid_sas: latest controller OCR capability from FW before sending shutdown DCMD ...
2017-02-06scsi: remove eh_timed_out methods in the transport templateChristoph Hellwig1-0/+2
Instead define the timeout behavior purely based on the host_template eh_timed_out method and wire up the existing transport implementations in the host templates. This also clears up the confusion that the transport template method overrides the host template one, so some drivers have to re-override the transport template one. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-01-17Merge remote-tracking branch 'mkp-scsi/fixes' into fixesJames Bottomley1-1/+1
2017-01-17scsi: bfa: fix wrongly initialized variable in bfad_im_bsg_els_ct_request()Johannes Thumshirn1-1/+1
Commit 01e0e15c8b3b ("scsi: don't use fc_bsg_job::request and fc_bsg_job::reply directly") introduced a typo, which causes that the bsg_request variable in bfad_im_bsg_els_ct_request() is initialized to itself instead of pointing to the bsg job's request. Reported-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-01-09scsi: bfa: remove bfa_fcs_mod_sChristoph Hellwig2-139/+46
Just call the functions directly instead of obsfucating the call chain. This was in reply to a patch from Kees Cook to constify the function pointer struct bfa_fcs_mod_s, but it turns out there is no reason to have this indirection at all. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-01-08Merge remote-tracking branch 'mkp-scsi/fixes' into fixesJames Bottomley2-4/+4
2017-01-05scsi: bfa: Increase requested firmware version to 3.2.5.1Benjamin Poirier2-4/+4
bna & bfa firmware version 3.2.5.1 was submitted to linux-firmware on Feb 17 19:10:20 2015 -0500 in 0ab54ff1dc ("linux-firmware: Add QLogic BR Series Adapter Firmware"). bna was updated to use the newer firmware on Feb 19 16:02:32 2015 -0500 in 3f307c3d70 ("bna: Update the Driver and Firmware Version") bfa was not updated. I presume this was an oversight but it broke support for bfa+bna cards such as the following 04:00.0 Fibre Channel [0c04]: Brocade Communications Systems, Inc. 1010/1020/1007/1741 10Gbps CNA [1657:0014] (rev 01) 04:00.1 Fibre Channel [0c04]: Brocade Communications Systems, Inc. 1010/1020/1007/1741 10Gbps CNA [1657:0014] (rev 01) 04:00.2 Ethernet controller [0200]: Brocade Communications Systems, Inc. 1010/1020/1007/1741 10Gbps CNA [1657:0014] (rev 01) 04:00.3 Ethernet controller [0200]: Brocade Communications Systems, Inc. 1010/1020/1007/1741 10Gbps CNA [1657:0014] (rev 01) Currently, if the bfa module is loaded first, bna fails to probe the respective devices with [ 215.026787] bna: QLogic BR-series 10G Ethernet driver - version: 3.2.25.1 [ 215.043707] bna 0000:04:00.2: bar0 mapped to ffffc90001fc0000, len 262144 [ 215.060656] bna 0000:04:00.2: initialization failed err=1 [ 215.073893] bna 0000:04:00.3: bar0 mapped to ffffc90002040000, len 262144 [ 215.090644] bna 0000:04:00.3: initialization failed err=1 Whereas if bna is loaded first, bfa fails with [ 249.592109] QLogic BR-series BFA FC/FCOE SCSI driver - version: 3.2.25.0 [ 249.610738] bfa 0000:04:00.0: Running firmware version is incompatible with the driver version [ 249.833513] bfa 0000:04:00.0: bfa init failed [ 249.833919] scsi host6: QLogic BR-series FC/FCOE Adapter, hwpath: 0000:04:00.0 driver: 3.2.25.0 [ 249.841446] bfa 0000:04:00.1: Running firmware version is incompatible with the driver version [ 250.045449] bfa 0000:04:00.1: bfa init failed [ 250.045962] scsi host7: QLogic BR-series FC/FCOE Adapter, hwpath: 0000:04:00.1 driver: 3.2.25.0 Increase bfa's requested firmware version. Also increase the driver version. I only tested that all of the devices probe without error. Reported-by: Tim Ehlers <tehlers@gwdg.de> Signed-off-by: Benjamin Poirier <bpoirier@suse.com> Acked-by: Rasesh Mody <rasesh.mody@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-12-24Replace <asm/uaccess.h> with <linux/uaccess.h> globallyLinus Torvalds1-1/+1
This was entirely automated, using the script by Al: PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>' sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \ $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h) to do the replacement at the end of the merge window. Requested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-11-21scsi: bfa: turn bfa_mem_{kva,dma}_setup into inline functionsArnd Bergmann1-13/+17
These two macros cause lots of warnings with gcc-7: drivers/scsi/bfa/bfa_svc.c: In function 'bfa_fcxp_meminfo': drivers/scsi/bfa/bfa_svc.c:521:103: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] Using inline functions makes them much more readable and avoids the warnings. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked by: Anil Gurumurthy <anil.gurumurthy@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-11-17scsi: fc: use bsg_job_doneJohannes Thumshirn1-2/+2
fc_bsg_jobdone() and bsg_job_done() are 1:1 copies now so use the bsg-lib one instead of the FC private implementation. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-11-17scsi: change FC drivers to use 'struct bsg_job'Johannes Thumshirn2-7/+7
Change FC drivers to use 'struct bsg_job' from bsg-lib.h instead of 'struct fc_bsg_job' from scsi_transport_fc.h and remove 'struct fc_bsg_job'. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-11-17scsi: fc: provide fc_bsg_to_shost() helperJohannes Thumshirn1-4/+2
Provide fc_bsg_to_shost() helper that will become handy when we're moving from struct fc_bsg_job to a plain struct bsg_job. Also use this little helper in the LLDDs. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-11-17scsi: fc: Export fc_bsg_jobdone and use it in FC driversJohannes Thumshirn1-2/+4
Export fc_bsg_jobdone so drivers can use it directly instead of doing the round-trip via struct fc_bsg_job::job_done() and use it in the LLDDs. That way we can also unify the interfaces of fc_bsg_jobdone and bsg_job_done. As we've converted all LLDDs over to use fc_bsg_jobdone() directly, we can remove the function pointer from struct fc_bsg_job as well. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-11-17scsi: don't use fc_bsg_job::request and fc_bsg_job::reply directlyJohannes Thumshirn1-17/+23
Don't use fc_bsg_job::request and fc_bsg_job::reply directly, but use helper variables bsg_request and bsg_reply. This will be helpful when transitioning to bsg-lib. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-09-02scsi: bfa: Do not dereference port before it is null checkedColin Ian King1-2/+2
Port is deferenced before it is null sanity checked, hence we potentially have a null pointer dereference bug. Instead, initialise trl_enabled from port->fcs->bfa after we are sure port is not null. Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-05-19scripts/spelling.txt: add "fimware" misspellingKees Cook1-1/+1
A few instances of "fimware" instead of "firmware" were found. Fix these and add it to the spelling.txt file. Signed-off-by: Kees Cook <keescook@chromium.org> Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-09bfa: fix bfa_fcb_itnim_alloc() error handlingDan Carpenter3-6/+8
The caller assumes that "itnim" is NULL on error and non-NULL on success but really "itnim" is uninitialized on error. This function should just use normal error handling where it returns zero on success and negative on failure. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-02-23bfa: deinline __bfa_trc() and __bfa_trc32()Denys Vlasenko2-37/+23
__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>
2016-02-23bfa: use strncpy() instead of memcpy()Dan Carpenter1-1/+1
BFA_MFG_NAME is "QLogic" which is only 7 bytes, but we are copying 8 bytes. It's harmless because the badding byte is likely zero but it makes static checkers complain. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-12-02bfa: Update driver version to 3.2.25.0Anil Gurumurthy1-1/+1
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: File header and user visible string changesAnil Gurumurthy39-89/+84
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: Fix for crash when bfa_itnim is NULLAnil Gurumurthy1-0/+26
Fix a very corner case when the port gets disconnected and the BFA and FCS layers clean up references to the IT nexus. During this window if a task management command is issued by the SCSI-ML and ends up referencing a NULL itnim, it could lead to a crash. 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 Gurumurthy39-78/+117
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-11-09scsi: use host wide tags by defaultChristoph Hellwig1-2/+0
This patch changes the !blk-mq path to the same defaults as the blk-mq I/O path by always enabling block tagging, and always using host wide tags. We've had blk-mq available for a few releases so bugs with this mode should have been ironed out, and this ensures we get better coverage of over tagging setup over different configs. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-09-06bfa: Fix incorrect de-reference of pointerAnil Gurumurthy1-1/+1
Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Tested-by: Sudarsana Kalluru <sudarsana.kalluru@qlogic.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-09-06bfa: Fix indentationAnil Gurumurthy1-11/+11
Signed-off-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Tested-by : Sudarasana Kalluru <sudarsana.kalluru@qlogic.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-08-12bfa: fix leak of bfad_im_port_index on module unloadAlexey Khoroshilov1-0/+2
Resources allocated within bfad_im_port_index idr are not deallocated on module unload. The patch adds idr_destroy() in exit function. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-17bfs: bfad_worker cleanupJiri Slaby1-13/+9
This kthread is not loop at all due to break at the end of the loop. Make that function linear, with no while loop. And remove an unnecessary cast. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-11-24scsi: drop reason argument from ->change_queue_depthChristoph Hellwig1-2/+2
Drop the now unused reason argument from the ->change_queue_depth method. Also add a return value to scsi_adjust_queue_depth, and rename it to scsi_change_queue_depth now that it can be used as the default ->change_queue_depth implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de>
2014-11-20bfa: replace 2 kzalloc/copy_from_user by memdup_userFabian Frederick1-24/+6
This patch also removes unnecessary printk(KERN_INFO Signed-off-by: Fabian Frederick <fabf@skynet.be> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-11-12scsi: don't set tagging state from scsi_adjust_queue_depthChristoph Hellwig1-2/+1
Remove the tagged argument from scsi_adjust_queue_depth, and just let it handle the queue depth. For most drivers those two are fairly separate, given that most modern drivers don't care about the SCSI "tagged" status of a command at all, and many old drivers allow queuing of multiple untagged commands in the driver. Instead we start out with the ->simple_tags flag set before calling ->slave_configure, which is how all drivers actually looking at ->simple_tags except for one worke anyway. The one other case looks broken, but I've kept the behavior as-is for now. Except for that we only change ->simple_tags from the ->change_queue_type, and when rejecting a tag message in a single driver, so keeping this churn out of scsi_adjust_queue_depth is a clear win. Now that the usage of scsi_adjust_queue_depth is more obvious we can also remove all the trivial instances in ->slave_alloc or ->slave_configure that just set it to the cmd_per_lun default. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
2014-11-12scsi: always assign block layer tags if enabledChristoph Hellwig1-5/+3
Allow a driver to ask for block layer tags by setting .use_blk_tags in the host template, in which case it will always see a valid value in request->tag, similar to the behavior when using blk-mq. This means even SCSI "untagged" commands will now have a tag, which is especially useful when using a host-wide tag map. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de>
2014-11-12scsi: remove ordered_tags scsi_device fieldChristoph Hellwig1-8/+3
Remove the ordered_tags field, we haven't been issuing ordered tags based on it since the big barrier rework in 2010. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
2014-07-29bfa: Use pci_enable_msix_exact() instead of pci_enable_msix()Alexander Gordeev1-14/+6
As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces. Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-07-29bfa: Cleanup bfad_setup_intr() functionAlexander Gordeev1-10/+8
Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-07-29bfa: Do not call pci_enable_msix() after it failed onceAlexander Gordeev1-25/+23
Function pci_enable_msix() should not be called in case it threw a negative errno from a previous call. Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-07-25bfa: use ARRAY_SIZE instead of sizeof/sizeof[0]Fabian Frederick1-3/+3
Use macro definition Signed-off-by: Fabian Frederick <fabf@skynet.be> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-07-25bfa: remove useless return variablesPeter Senna Tschudin1-6/+4
This patch remove variables that are initialized with a constant, are never updated, and are only used as parameter of return. Return the constant instead of using a variable. Verified by compilation only. The coccinelle script that find and fixes this issue is: // <smpl> @@ type T; constant C; identifier ret; @@ - T ret = C; ... when != ret when strict return - ret + C ; // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Acked-by: Sudarsana Kalluru <Sudarsana.Kalluru@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-07-25bfa: Fix undefined bit shift on big-endian architectures with 32-bit DMA addressBen Hutchings1-1/+1
bfa_swap_words() shifts its argument (assumed to be 64-bit) by 32 bits each way. In two places the argument type is dma_addr_t, which may be 32-bit, in which case the effect of the bit shift is undefined: drivers/scsi/bfa/bfa_fcpim.c: In function 'bfa_ioim_send_ioreq': drivers/scsi/bfa/bfa_fcpim.c:2497:4: warning: left shift count >= width of type [enabled by default] addr = bfa_sgaddr_le(sg_dma_address(sg)); ^ drivers/scsi/bfa/bfa_fcpim.c:2497:4: warning: right shift count >= width of type [enabled by default] drivers/scsi/bfa/bfa_fcpim.c:2509:4: warning: left shift count >= width of type [enabled by default] addr = bfa_sgaddr_le(sg_dma_address(sg)); ^ drivers/scsi/bfa/bfa_fcpim.c:2509:4: warning: right shift count >= width of type [enabled by default] Avoid this by adding casts to u64 in bfa_swap_words(). Compile-tested only. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Cc: stable@vger.kernel.org Fixes: f16a17507b09 ('[SCSI] bfa: remove all OS wrappers') Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-07-25bfa: Use dma_zalloc_coherentJoe Perches1-3/+3
Use the zeroing function instead of dma_alloc_coherent & memset(,0,) Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-05-19bfa: allocate memory with GFP_ATOMIC in spinlock contextAlexey Khoroshilov1-1/+1
bfa_fcb_pbc_vport_create() is called only from bfa_fcs_pbc_vport_init(), that is called only from bfad_drv_start() with bfad_lock spinlock held. So the patch replaces GFP_KERNEL with GFP_ATOMIC to avoid sleeping in atomic spinlock context. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-03-19[SCSI] bfa: Replace large udelay() with mdelay()Ben Hutchings1-1/+1
udelay() does not work on some architectures for values above 2000, in particular on ARM: ERROR: "__bad_udelay" [drivers/scsi/bfa/bfa.ko] undefined! Reported-by: Vagrant Cascadian <vagrant@debian.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] bfa: set correct command return codeHannes Reinecke1-1/+6
For various error conditions the bfa driver just returns 'DID_ERROR', which carries no information at all about the actual source of error. This patch updates the error handling to return a correct error code, depending on the type of error occurred. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] bfa: Fix smatch warningsVijaya Mohan Guvva1-4/+5
Fixed following smatch warnings in bfa. drivers/scsi/bfa/bfa_ioc.c:3882 bfa_sfp_show_comp() error: memcpy() 'des' too small (64 vs 248) drivers/scsi/bfa/bfa_ioc.c:6859 bfa_flash_status_read() warn: unsigned 'status' is never less than zero. drivers/scsi/bfa/bfa_ioc.c:6881 bfa_flash_status_read() warn: unsigned 'status' is never less than zero. drivers/scsi/bfa/bfa_ioc.c:6917 bfa_flash_read_start() warn: unsigned 'status' is never less than zero. drivers/scsi/bfa/bfa_ioc.c:7043 bfa_flash_raw_read() warn: unsigned 'status' is never less than zero. Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-03-15[SCSI] bfa: fix missing unlock on error in bfad_iocmd_cfg_trunk()Wei Yongjun1-1/+3
Add the missing unlock before return from function bfad_iocmd_cfg_trunk() in the error handling case. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2014-01-22Merge branch 'misc' into for-linusJames Bottomley13-104/+836
2013-12-19[SCSI] bfa: Driver version upgrade to 3.2.23.0Vijaya Mohan Guvva2-4/+4
Patch includes changes to upgrade bfa driver version to 3.2.23.0 and use firmware version 3.2.3.0 Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>