summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_debugfs.c
Commit message (Collapse)AuthorAgeFilesLines
* scsi: lpfc: use div_u64 for 64-bit divisionArnd Bergmann2017-02-271-32/+32
| | | | | | | | | | | | | | | The new debugfs output causes a link error on 32-bit architectures: ERROR: "__aeabi_uldivmod" [drivers/scsi/lpfc/lpfc.ko] undefined! This code is not performance critical, so we can simply use div_u64(). [mkp: fixed up whitespace] Fixes: bd2cdd5e400f ("scsi: lpfc: NVME Initiator: Add debugfs support") Fixes: 2b65e18202fd ("scsi: lpfc: NVME Target: Add debugfs support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: Update copyrightsJames Smart2017-02-221-1/+3
| | | | | | | | | | Update copyrights to 2017 for all files touched in this patch set Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: NVME Target: Add debugfs supportJames Smart2017-02-221-3/+300
| | | | | | | | | | | NVME Target: Add debugfs support Adds debugfs snippets to cover the new NVME target functionality Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: NVME Target: Receive buffer updatesJames Smart2017-02-221-2/+23
| | | | | | | | | | | | | NVME Target: Receive buffer updates Allocates buffer pools and configures adapter interfaces to handle receive buffer (asynchronous FCP CMD ius, first burst data) from the adapter. Splits by protocol, etc. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: NVME Target: Base modificationsJames Smart2017-02-221-2/+5
| | | | | | | | | | | | | | | | | | | NVME Target: Base modifications This set of patches adds the base modifications for NVME target support The base modifications consist of: - Additional module parameters or configuration tuning - Enablement of configuration mode for NVME target. Ties into the queueing model put into place by the initiator basemods patches. - Target-specific buffer pools, dma pools, sgl pools [mkp: fixed space at end of file] Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: NVME Initiator: Add debugfs supportJames Smart2017-02-221-119/+1041
| | | | | | | | | | | NVME Initiator: Add debugfs support Adds debugfs snippets to cover the new NVME initiator functionality Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: NVME Initiator: Base modificationsJames Smart2017-02-221-47/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NVME Initiator: Base modifications This patch adds base modifications for NVME initiator support. The base modifications consist of: - Formal split of SLI3 rings from SLI-4 WQs (sometimes referred to as rings as well) as implementation now widely varies between the two. - Addition of configuration modes: SCSI initiator only; NVME initiator only; NVME target only; and SCSI and NVME initiator. The configuration mode drives overall adapter configuration, offloads enabled, and resource splits. NVME support is only available on SLI-4 devices and newer fw. - Implements the following based on configuration mode: - Exchange resources are split by protocol; Obviously, if only 1 mode, then no split occurs. Default is 50/50. module attribute allows tuning. - Pools and config parameters are separated per-protocol - Each protocol has it's own set of queues, but share interrupt vectors. SCSI: SLI3 devices have few queues and the original style of queue allocation remains. SLI4 devices piggy back on an "io-channel" concept that eventually needs to merge with scsi-mq/blk-mq support (it is underway). For now, the paradigm continues as it existed prior. io channel allocates N msix and N WQs (N=4 default) and either round robins or uses cpu # modulo N for scheduling. A bunch of module parameters allow the configuration to be tuned. NVME (initiator): Allocates an msix per cpu (or whatever pci_alloc_irq_vectors gets) Allocates a WQ per cpu, and maps the WQs to msix on a WQ # modulo msix vector count basis. Module parameters exist to cap/control the config if desired. - Each protocol has its own buffer and dma pools. I apologize for the size of the patch. Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> ---- Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: refactor debugfs queue dump routinesJames Smart2017-02-221-11/+11
| | | | | | | | | | Create common wq, cq, eq, rq dump functions Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: refactor debugfs queue printsJames Smart2017-02-221-337/+227
| | | | | | | | | | Create common wq, cq, eq, rq print functions Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* scsi: lpfc: minor code cleanupsJames Smart2017-02-221-42/+39
| | | | | | | | | | | | | | | | | | | | | | This contains code cleanups that were in the prior patch set. This allows better review of real changes later. minor code cleanups: fix indentation, punctuation, line length addition/reduction of whitespace remove unneeded parens, braces lpfc_debugfs_nodelist_data: print as u64 rather than byte by byte covert printk(KERN_ERR to pr_err small print string deltas use num_present_cpus() rather than count them comment updates rctl/type names moved to module variable, not on stack Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com> Signed-off-by: James Smart <james.smart@broadcom.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* locking/atomic, kref: Add kref_read()Peter Zijlstra2017-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | Since we need to change the implementation, stop exposing internals. Provide kref_read() to read the current reference count; typically used for debug messages. Kills two anti-patterns: atomic_read(&kref->refcount) kref->refcount.counter Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
* lpfc: fix missing zero termination in debugfsAlan2016-02-231-2/+2
| | | | | | | | | If you feed 32 bytes in then the kstrtoull() doesn't receive a terminated string so will run off the end. Signed-off-by: Alan Cox <alan@linux.intel.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
* Merge branch 'for-linus' of ↵Linus Torvalds2015-06-231-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "As usual, mostly comment, kerneldoc and printk() fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: lpfc: Grammar s/an negative/a negative/ ARM: lib/lib1funcs.S: fix typo s/substractions/subtractions/ cx25821: cx25821-medusa-reg.h: fix 0x0x prefix lib: crc-itu-t.[ch] fix 0x0x prefix in integer constants rapidio: Fix kerneldoc and comment qla4xxx: Fix printk() in qla4_83xx_read_reset_template() and qla4_83xx_pre_loopback_config() treewide: Kconfig: fix wording / spelling usb/serial: fix grammar in Kconfig help text for FTDI_SIO megaraid_sas: fix kerneldoc netfilter: ebtables: fix comment grammar drm/radeon: fix comment isdn: fix grammar in comment ARM: KVM: fix comment
| * lpfc: Grammar s/an negative/a negative/Geert Uytterhoeven2015-05-261-6/+6
| | | | | | | | | | | | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-By: James Smart <james.smart@avagotech.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | lpfc: Update copyright to 2015James Smart2015-04-101-1/+1
| | | | | | | | | | | | | | | | | | Update copyright to 2015 Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
* | kill f_dentry usesAl Viro2014-11-191-2/+2
| | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* | assorted conversions to %p[dD]Al Viro2014-11-191-2/+2
|/ | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* lpfc: fix low priority issues from fortify source code scanJames Smart2014-09-161-2/+2
| | | | | | | | Fixed Low priority issues from lpfc given by fortify source code scan. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* lpfc: Update Copyright on changed filesJames Smart2014-06-021-1/+1
| | | | | | | | Update Copyright on changed files Signed-off-by: James Smart <james.smart@emulex.com> Reviewed-By: Dick Kennedy <dick.kennedy@emulex.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* lpfc: Convert runtime references to old xlane cfg param to fof cfg paramJames Smart2014-06-021-1/+1
| | | | | | | | Convert runtime references to old xlane cfg param to fof cfg param Signed-off-by: James Smart <james.smart@emulex.com> Reviewed-By: Dick Kennedy <dick.kennedy@emulex.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* [SCSI] lpfc 8.3.45: Incorporated support of a low-latency io pathJames Smart2014-03-151-0/+98
| | | | | Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.44: Fixed incorrect allocation of iDiags directories/files ↵James Smart2014-03-151-0/+10
| | | | | | | in debugfs Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc: Fix wrong assignment in lpfc_debugfs.cFelipe Pena2013-12-191-1/+1
| | | | | | | | | | On lpfc_debugfs_initialize function the dumpHostSlim member setup happens when 'phba->sli_rev < LPFC_SLI_REV4' is true, however when it is false NULL has been assigned to debug_dumpHBASlim instead of debug_dumpHostSlim. Signed-off-by: Felipe Pena <felipensp@gmail.com> Acked-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* lpfc: switch to fixed_size_llseek()Al Viro2013-06-291-16/+2
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* lseek(fd, n, SEEK_END) does *not* go to eof - nAl Viro2013-06-161-1/+1
| | | | | | | | | | When you copy some code, you are supposed to read it. If nothing else, there's a chance to spot and fix an obvious bug instead of sharing it... X-Song: "I Got It From Agnes", by Tom Lehrer Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> [ Tom Lehrer? You're dating yourself, Al ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [SCSI] lpfc 8.3.34: Correct typecasts for snprintf messagesJames Smart2012-09-141-7/+11
| | | | | Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.34: Add LOGO support after ABTS complianceJames Smart2012-09-141-2/+10
| | | | | | | Make compliant with FC specs by sending LOGO after ABTS timeouts Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.33: Fixed debugfs queInfo to include queue statsJames Smart2012-09-141-157/+259
| | | | | Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.33: Tie parallel I/O queues into separate MSIX vectorsJames Smart2012-09-141-52/+26
| | | | | | | Add fcp_io_channel module attribute to control amount of parallel I/O queues Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.33: Formally separate lpfc_sli_ring SLI-3 and SLI-4 variantionsJames Smart2012-09-141-3/+5
| | | | | Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.31: Debug helper utility routines for dumping various SLI4 ↵James Smart2012-05-171-0/+46
| | | | | | | | queues Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* Merge branch 'akpm' (Andrew's patch-bomb)Linus Torvalds2012-04-051-8/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge batch of fixes from Andrew Morton: "The simple_open() cleanup was held back while I wanted for laggards to merge things. I still need to send a few checkpoint/restore patches. I've been wobbly about merging them because I'm wobbly about the overall prospects for success of the project. But after speaking with Pavel at the LSF conference, it sounds like they're further toward completion than I feared - apparently davem is at the "has stopped complaining" stage regarding the net changes. So I need to go back and re-review those patchs and their (lengthy) discussion." * emailed from Andrew Morton <akpm@linux-foundation.org>: (16 patches) memcg swap: use mem_cgroup_uncharge_swap fix backlight: add driver for DA9052/53 PMIC v1 C6X: use set_current_blocked() and block_sigmask() MAINTAINERS: add entry for sparse checker MAINTAINERS: fix REMOTEPROC F: typo alpha: use set_current_blocked() and block_sigmask() simple_open: automatically convert to simple_open() scripts/coccinelle/api/simple_open.cocci: semantic patch for simple_open() libfs: add simple_open() hugetlbfs: remove unregister_filesystem() when initializing module drivers/rtc/rtc-88pm860x.c: fix rtc irq enable callback fs/xattr.c:setxattr(): improve handling of allocation failures fs/xattr.c:listxattr(): fall back to vmalloc() if kmalloc() failed fs/xattr.c: suppress page allocation failure warnings from sys_listxattr() sysrq: use SEND_SIG_FORCED instead of force_sig() proc: fix mount -t proc -o AAA
| * simple_open: automatically convert to simple_open()Stephen Boyd2012-04-051-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many users of debugfs copy the implementation of default_open() when they want to support a custom read/write function op. This leads to a proliferation of the default_open() implementation across the entire tree. Now that the common implementation has been consolidated into libfs we can replace all the users of this function with simple_open(). This replacement was done with the following semantic patch: <smpl> @ open @ identifier open_f != simple_open; identifier i, f; @@ -int open_f(struct inode *i, struct file *f) -{ ( -if (i->i_private) -f->private_data = i->i_private; | -f->private_data = i->i_private; ) -return 0; -} @ has_open depends on open @ identifier fops; identifier open.open_f; @@ struct file_operations fops = { ... -.open = open_f, +.open = simple_open, ... }; </smpl> [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | [SCSI] lpfc 8.3.30: Added more T10 DIF debugfs error injectionJames Smart2012-03-271-8/+50
| | | | | | | | | | | | Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] lpfc 8.3.30: Update copyright date for files modified in 2012James Smart2012-03-271-1/+1
| | | | | | | | | | | | Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* | [SCSI] lpfc 8.3.30: Enhancements for T10 DIF debugfs error injectionJames Smart2012-03-271-12/+20
|/ | | | | | Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.29: T10 Diff fixes and enhancementsJames Smart2012-02-191-0/+19
| | | | | | | | | | | | | T10 Diff fixes and enhancements: - Add SLI4 Lancer support for T10 DIF / BlockGuard (121980) - Fix SLI4 BlockGuard behavior when protection data is generated by HBA (121980) - Enhance debugfs for injecting T10 DIF errors (123966, 132966) - Fix Incorrect usage of bghm for BlockGuard errors (127022) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.28: Critical Miscellaneous fixesJames Smart2011-12-151-59/+113
| | | | | | | | | | | | | | | | | | | - Make lpfc_sli4_pci_mem_unset interface type aware (CR 124390) - Convert byte count to word count when calling __iowrite32_copy (CR 122550) - Checked the ERR1 and ERR2 registers for error attention due to SLI Port state affected by forced debug dump. (CR 122986, 122426, 124859) - Use the lpfc_readl routine instead of the readl for the port status register read in lpfc_handle_eratt_s4 (CR 125403) - Call lpfc_sli4_queue_destroy inside of lpfc_sli4_brdreset before doing a pci function reset (CR 125124, 125168, 125572, 125622) - Zero out the HBQ when it is allocated (CR 125663) - Alter port reset log messages to indicate error type (CR 125989) - Added proper NULL pointer checking to all the places that accessing the queue memory (CR 125832) Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* scsi: Fix up files implicitly depending on module.h inclusionPaul Gortmaker2011-10-311-0/+1
| | | | | | | | | The module.h header was implicitly present everywhere, so files with no explicit include of the module infrastructure would build anyway. We are now removing the implicit include, and so we need to call out the module.h file that we need explicitly. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* [SCSI] lpfc 8.3.27: T10 additions for SLI4James Smart2011-10-161-0/+181
| | | | | | | | | Added T10 DIFF error injection code. Added T10 DIFF structure definitions for SLI4 devices. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.25: Enhancements to Debug infrastructureJames Smart2011-07-271-28/+1326
| | | | | | | | | | | | | | | | | | | | | | | | Enhancements to Debug infrastructure - debugfs additions for new hardware. - Correct stack overflow in lpfc_debugfs_dumpHBASlim_data() - Correct warning on uninitialized reg_val in lpfc_idiag_drbacc_write() - Separated the iDiag command for capturing mailbox commands for generic issue mailbox command entry point and for BSG multi-buffer handling. - Added capturing dumping capabiliy of mailbox command and external buffer for the completion of the mailbox command so that the outcome can be examined. - Changed all the iDiag command structure data array indexing introduced so far with properly defined macros. - Added SLI4 device PCI BAR memory mapped register read/browse, write-by- value, set-bit, and clear-bit methods for both interface type 0 and interface type 2. - Corrected warnings on mbxstatus being uninitialized in error paths in lpfc_bsg.c Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warningStephen Boyd2011-06-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Enabling DEBUG_STRICT_USER_COPY_CHECKS causes the following warning: In file included from arch/x86/include/asm/uaccess.h:573, from include/linux/uaccess.h:5, from include/linux/highmem.h:7, from include/linux/pagemap.h:10, from include/linux/blkdev.h:12, from drivers/scsi/lpfc/lpfc_debugfs.c:21: In function 'copy_from_user': arch/x86/include/asm/uaccess_64.h:65: warning: call to 'copy_from_user_overflow' declared with attribute warning: copy_from_user() buffer size is not provably correct presumably due to buf_size being signed causing GCC to fail to see that buf_size can't become negative. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
* [SCSI] lpfc 8.3.24: Miscellaneous Fixes and CorrectionsJames Smart2011-05-261-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Miscellaneous Fixes and Corrections - Remove the memset in the lpfc_sli4_remove_rpi_hdrs call. - Correct swapping of SGE word 2 relative to offset value - Reorganize CQ and EQ usage to comply with SLI4 Specification. - Expand the driver to check the rn bit. Only detect an error if the error bit is set and the RN bit is NOT set. - If mailbox completion code is not success AND the mailbox status is success, then and only then will the driver overwrite the mailbox status. - When driver initializing device, if the device is on a PCIe bus, set PCI's "needs fundamental reset" bit so that EEH uses fundamental reset instead of hot reset for recovery. - Prevent driver from using new WWN when changed in firmware (until driver reload) - When HBA reports maximum SGE size > 0xffffffff (infinite), override with 0x80000000. - Fixed potential missed SLI4 device initialization failure conditions. - Added 100ms delay before driver action following IF_TYPE_2 function reset. - Reverted patch to UNREG/REG on PLOGI to mapped/unmapped node. - Add a check for the CVL received flag in the fcf inuse routine to avoid unregistering the fcf if Devloss fires before Delay discover timer fires. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>
* [SCSI] lpfc 8.3.23: Debugfs enhancementsJames Smart2011-05-011-218/+713
| | | | | | | | | | | | | Debugfs enhancements - Added iDiag support for new adapters. - Added queue entry access methods. - Fix host/port index in decimal - Added Doorbell register access methods. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* Fix common misspellingsLucas De Marchi2011-03-311-4/+4
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* [SCSI] lpfc 8.3.21: Debugfs additionsJames Smart2011-02-181-52/+902
| | | | | | | | | | | | | - Add the driver debugfs framework for supporting debugfs read and write operations, and iDiag command structure. - Add read and write to SLI4 device PCI config space registers. - Add the driver support of debugfs PCI config space register bits set/clear methods to the provided bitmask. - Add iDiag driver support for SLI4 device queue diagnostic. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] lpfc 8.3.21: Initialization and user interface changesJames Smart2011-02-181-4/+4
| | | | | | | | | | | | - Make link speed not supported by port message an error message. - Add support for new SLI failure codes add sysfs parameter to reflect the security setting and current state. - Add all lpfc module parameters to the /sys/modules/lpfc/parameters directory. [jejb: fix up compile failure] Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* [SCSI] lpfc 8.3.5: fix sysfs parameters, vport creation and other bugs and ↵James Smart2009-12-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | update logging This patch include the following fixes and changes: - Fix crash when "error" is echoed to board_mode sysfs parameter - Fix FCoE Parameter parsing in regions 23 - Fix driver crash when creating vport with large number of targets on SLI4 - Fix bug with npiv message being logged when it is not supported by the adapter - Fix a potential dereferencing mailbox structure after free bug - Fix firmware crash after vport create with high target count - Error out requests to set board_mode to warm restart via sysfs on SLI4 HBAs - Fix Block guard logging - Fix a memory corruption issue during GID_FT IO prep - Fix crash while processing unsolicited FC frames - Fix failed to allocate XRI message is not a critical failure - Update and fix formatting in some log messages - Fix missing new line characters in log messages - Removed the use of the locally defined FC transport layer related macros - Check the rsplen in lpfc_handle_fcp_err function before using rsplen Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem.GeunSik Lim2009-06-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many developers use "/debug/" or "/debugfs/" or "/sys/kernel/debug/" directory name to mount debugfs filesystem for ftrace according to ./Documentation/tracers/ftrace.txt file. And, three directory names(ex:/debug/, /debugfs/, /sys/kernel/debug/) is existed in kernel source like ftrace, DRM, Wireless, Documentation, Network[sky2]files to mount debugfs filesystem. debugfs means debug filesystem for debugging easy to use by greg kroah hartman. "/sys/kernel/debug/" name is suitable as directory name of debugfs filesystem. - debugfs related reference: http://lwn.net/Articles/334546/ Fix inconsistency of directory name to mount debugfs filesystem. * From Steven Rostedt - find_debugfs() and tracing_files() in this patch. Signed-off-by: GeunSik Lim <geunsik.lim@samsung.com> Acked-by : Inaky Perez-Gonzalez <inaky@linux.intel.com> Reviewed-by : Steven Rostedt <rostedt@goodmis.org> Reviewed-by : James Smart <james.smart@emulex.com> CC: Jiri Kosina <trivial@kernel.org> CC: David Airlie <airlied@linux.ie> CC: Peter Osterlund <petero2@telia.com> CC: Ananth N Mavinakayanahalli <ananth@in.ibm.com> CC: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> CC: Masami Hiramatsu <mhiramat@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>