Johannes Thumshirn [Wed, 20 Jan 2016 15:22:22 +0000 (16:22 +0100)]
lpfc: Add lockdep assertions
Several functions in lpfc have comments stating that the function must
be called with the hbalock (or hostlock, or ringlock) held. Add
lockdep_assert_held() annotations to these functions, so one can
actually verify the locks are held.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Acked-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Denys Vlasenko [Thu, 4 Feb 2016 20:40:48 +0000 (21:40 +0100)]
bfa: deinline __bfa_trc() and __bfa_trc32()
__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>
Sudip Mukherjee [Thu, 11 Feb 2016 05:12:49 +0000 (10:42 +0530)]
scsi: ppa: use new parport device model
Modify ppa driver to use the new parallel port device model.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sudip Mukherjee [Thu, 11 Feb 2016 04:59:03 +0000 (10:29 +0530)]
scsi: sim710: fix build warning
We are getting build warning about:
"Section mismatch in reference from the variable sim710_eisa_driver to
the function .init.text:sim710_eisa_probe()
The variable sim710_eisa_driver references the function __init
sim710_eisa_probe()"
sim710_eisa_probe() was having __init but that was being referenced from
sim710_eisa_driver.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Maurizio Lombardi [Thu, 1 Oct 2015 08:56:25 +0000 (10:56 +0200)]
be2iscsi: Fix memory leak in beiscsi_alloc_mem()
In case of error, the memory allocated for phwi_ctrlr was not freed.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tomas Winkler [Tue, 9 Feb 2016 08:25:41 +0000 (10:25 +0200)]
scsi: ufs: fix typo in comment
[mkp: Only one typo remained]
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tomas Winkler [Tue, 9 Feb 2016 08:25:40 +0000 (10:25 +0200)]
ufs: fix typo: MAZ to MAX
QUERY_DESC_GEOMETRY_MAZ_SIZE
QUERY_DESC_GEOMETRY_MAX_SIZE
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:50 +0000 (15:02 +0200)]
scsi: ufs: add wrapper for retrying sending query attribute
Sometimes queries from the device might return a failure so it is
recommended to retry sending the query, before giving up. This change
adds a wrapper to retry sending a query attribute, in cases where we
need to wait longer, before we continue, or before reporting a failure.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:49 +0000 (15:02 +0200)]
scsi: ufs: commit descriptors before setting the doorbell
Add a write memory barrier to make sure descriptors prepared are
actually written to memory before ringing the doorbell. We have also
added the write memory barrier after ringing the doorbell register so
that controller sees the new request immediately.
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:48 +0000 (15:02 +0200)]
scsi: ufs: add missing memory barriers
Performing several writes to UFS host controller registers has no
guarantee of ordering, so we must make sure register writes to setup
request list base address etc. are performed before the run/stop
register is enabled. In addition, when setting up a task request, we
must make sure the updating of descriptors takes places before ringing
the doorbell, similarly to setting up a transfer request.
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:47 +0000 (15:02 +0200)]
scsi: ufs: reduce the interrupts for power mode change requests
DME commands such as Hibern8 enter/exit and gear switch generate 2
completion interrupts, one for confirmation that command is received by
local UniPro and 2nd one is the final confirmation after communication
with remote UniPro. Currently both of these completions are registered
as interrupt events which is not quite necessary and instead we can just
wait for the interrupt of 2nd completion, this should reduce the number
of interrupts and could reduce the unnecessary CPU wakeups to handle
extra interrupts.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:46 +0000 (15:02 +0200)]
scsi: ufs: retry failed query flag requests
UFS flag query requests may fail sometimes due to timeouts etc. Add a
wrapper function to retry up to 10 times in case of such failure,
similar to retries being made for attribute queries.
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:45 +0000 (15:02 +0200)]
scsi: ufs: fix error recovery after the hibern8 exit failure
Hibern8 exit can be called from 3 different contexts:
- ufshcd_hibern8_exit_work
- ufshcd_ungate_work
- runtime/system resume
If hibern8 exit fails for some reason then we try to bring the link to
active state by link startup but this recovery mechanism results into
deadlock or errors from first 2 context listed above. This change fixes
the recovery by adding proper error handling mechanism.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:44 +0000 (15:02 +0200)]
scsi: ufs: add retries for hibern8 enter
If hibern8 enter command fails then UFS link state may be unknown which
may result into timeout of all the commands issued after failure.
This change does 2 things (for pre-defined number of retry counts) after
hibern8 enter failure:
1. Recovers the UFS link to active state
2. If link is recovered to active state, tries to put the UFS link in
hibern8 enter again until retry count expires.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:43 +0000 (15:02 +0200)]
scsi: ufs: add retries to dme_peer get and set attribute
The dme_peer get/set attribute commands are prone to errors, therefore
we add three retries for the UIC command sending. Error code returned
from ufshcd_send_uic_cmd() is checked, and unless it was successful or
the retries have finished, another command will be sent.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Lee Susman <lsusman@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:42 +0000 (15:02 +0200)]
scsi: ufs: avoid exception event handler racing with PM callbacks
If device raises the exception event in the response to the commands
sent during the runtime/system PM callbacks, exception event handler
might run in parallel with PM callbacks and may see unclocked register
accesses. This change fixes this issue by not scheduling the exception
event handler while PM callbacks are running.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:41 +0000 (15:02 +0200)]
scsi: ufs: increase fDeviceInit query response timeout
fDeviceInit query response time for some devices is too long that
default query request timeout of 100ms may not be enough. Experiments
show that fDeviceInit response sometimes takes 500ms so to be on safer
side this change sets the timeout to 600ms. Without this change, we
might unnecessarily have to retry fDeviceInit query requests multiple
times and each query request timeout prints one error message.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:40 +0000 (15:02 +0200)]
scsi: ufs: clear outstanding_request bit in case query timeout
When sending a query to the device returns with a timeout error, we
clear the corresponding bit in the DOORBELL register but we don't clear
the outstanding_request field as we should. This patch fixes this bug.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:39 +0000 (15:02 +0200)]
scsi: ufs: verify command tag validity
A race condition appear to exist between request completion when
scsi_done() is called to end the request and set the tag back to -1 (at
blk_queue_end_tag() scsi_end_request), and scsi layer error handling
which aborts the command and reuses it to request sense data. Sending
the request sense is done with tag which was set to -1 and so it is
invalid. Assert command tag passed from scsi layer is valid.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:38 +0000 (15:02 +0200)]
scsi: ufs: clear fields UTRD, UPIU req and rsp before new transfers
Some of the data structures (like response UPIU) and/or its elements
(unused fields) should be cleared before sending out the respective
command to UFS device.
This change clears the UPIU response data structure for query commands
and NOP command before sending out the command. We also initialize the
PRDT table length to zero which should take care of commands which
doesn't have any data associated with it. We are also clearing the
unused fields in request UPIU for NOP command.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Tested-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Yaniv Gardi [Mon, 1 Feb 2016 13:02:37 +0000 (15:02 +0200)]
scsi: ufs: clear UTRD, UPIU req and rsp before new transfers
Clear the UFS data structures before sending new request.
The SCSI command is sent to the device within the UFS UPIU request.
As part of the transfer UPIU preparation, the SCSI command is copied
to the UPIU structure according to the SCSI command size.
As different SCSI commands differ in size from each other, we need
to clear the whole SCSI command field to prevent sending uninitialized
data to the device.
The UPIU response doesn't always include the sense data and can differ
in size.
Hence, the UPIU response should also be cleared before the transfer.
Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Wed, 27 Jan 2016 15:57:23 +0000 (16:57 +0100)]
scsi_dh: force modular build if SCSI is a module
When the scsi_dh core was moved into the scsi core module,
CONFIG_SCSI_DH became a 'bool' option, and now anything depending on it
can be built-in even when CONFIG_SCSI=m. This of course cannot link
successfully:
drivers/scsi/built-in.o: In function `rdac_init':
scsi_dh_alua.c:(.init.text+0x14): undefined reference to `scsi_register_device_handler'
scsi_dh_alua.c:(.init.text+0x64): undefined reference to `scsi_unregister_device_handler'
drivers/scsi/built-in.o: In function `alua_init':
scsi_dh_alua.c:(.init.text+0xb0): undefined reference to `scsi_register_device_handler'
As a workaround, this adds an extra dependency on CONFIG_SCSI, so
Kconfig can figure out whether built-in is allowed or not.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes:
086b91d052eb ("scsi_dh: integrate into the core SCSI code")
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Wed, 27 Jan 2016 15:57:22 +0000 (16:57 +0100)]
scsi: aha1542: avoid uninitialized variable warnings
Gcc incorrectly detects that two variables in aha1542_queuecommand might
be used without an initialization:
scsi/aha1542.c: In function 'aha1542_queuecommand':
scsi/aha1542.c:382:16: error: 'cptr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
scsi/aha1542.c:379:11: error: 'sg_count' may be used uninitialized in this function [-Werror=maybe-uninitialized]
The only user of these is doing the same check that the assigment has,
so it is actually guaranteed to work. Adding an "else" clause with a
fake initialization shuts up the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Wed, 27 Jan 2016 15:57:21 +0000 (16:57 +0100)]
scsi: qla4xxx: shut up warning for rd_reg_indirect
The qla4_83xx_rd_reg_indirect() function can fail when it is unable to
read a register, but not all callers check its return value before using
the register data, and gcc correctly warns about this:
qla4xxx/ql4_83xx.c: In function 'qla4_83xx_process_reset_template':
qla4xxx/ql4_83xx.c:1073:36: warning: 'value' may be used uninitialized in this function
ha->reset_tmplt.array[index++] = value;
^
qla4xxx/ql4_83xx.c:1050:11: note: 'value' was declared here
uint32_t value;
^
qla4xxx/ql4_83xx.c:902:8: warning: 'value' may be used uninitialized in this function
value &= p_rmw_hdr->test_mask;
^
qla4xxx/ql4_83xx.c:895:11: note: 'value' was declared here
uint32_t value;
^
In file included from ../include/linux/io.h:25:0,
from ../include/linux/pci.h:31,
from ../drivers/scsi/qla4xxx/ql4_def.h:16,
from ../drivers/scsi/qla4xxx/ql4_83xx.c:10:
asm/io.h:101:2: warning: 'value' may be used uninitialized in this function
asm volatile("str %1, %0"
^
qla4xxx/ql4_83xx.c:874:11: note: 'value' was declared here
uint32_t value;
^
Unfortunately, I don't see any helpful way to add proper error handling
for this case, and the failure scenario for rd_reg seems rather obscure,
so this bails out and makes the rd_reg accessor set the result to
0xffffffff so we at least get a predictable value.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Wed, 27 Jan 2016 15:57:20 +0000 (16:57 +0100)]
scsi: fas216: avoid fas216_log_setup for loadable module
We get a warning for the fas216 driver when it is compiled as a loadable
module, as the __setup() functions are never called then:
scsi/arm/fas216.c:101:19: warning: 'fas216_log_setup' defined but not used [-Wunused-function]
static int __init fas216_log_setup(char *str)
This adds an #ifndef MODULE around the definition to shut up the warning
and clarify for the reader when it is used or not.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Wed, 27 Jan 2016 15:57:19 +0000 (16:57 +0100)]
scsi: acornscsi: mark calc_sync_xfer as __maybe_unused
The calc_sync_xfer function is only used if CONFIG_SCSI_ACORNSCSI_SYNC
is set, otherwise we get a compiler warning:
scsi/arm/acornscsi.c:680:15: warning: 'calc_sync_xfer' defined but not used [-Wunused-function]
unsigned char calc_sync_xfer(unsigned int period, unsigned int offset)
This marks the function as __maybe_unused to shut up the warning and
silently drop the function in the object code when there is no caller.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Wed, 27 Jan 2016 15:57:18 +0000 (16:57 +0100)]
mptfusion: hide unused seq_mpt_print_ioc_summary function
The seq_mpt_print_ioc_summary function is used for the
/proc/mpt/iocN/summary implementation and never gets called when
CONFIG_PROC_FS is disabled:
drivers/message/fusion/mptbase.c:6851:13: warning: 'seq_mpt_print_ioc_summary' defined but not used [-Wunused-function]
static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int showlan)
This adds an #ifdef to hide the function definition in that case and
avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Wed, 27 Jan 2016 15:57:17 +0000 (16:57 +0100)]
scsi: fdomain: drop fdomain_pci_tbl when built-in
The fdomain SCSI host driver is one of the last remaining drivers that
manually search the PCI bus using pci_get_device rather than registering
a pci_driver instance.
This means the module device table is unused when the driver is
built-in, and we get a warning about it:
drivers/scsi/fdomain.c:1773:29: warning: 'fdomain_pci_tbl' defined but not used [-Wunused-variable]
To avoid the warning, this adds another #ifdef around the table
definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tomas Henzl [Mon, 1 Feb 2016 14:12:04 +0000 (15:12 +0100)]
megaraid_sas: Add an i/o barrier
A barrier should be added to ensure proper ordering of memory mapped
writes.
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Kashyap Desai <kashyap.desai@broadcom.com>
Acked-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Johannes Thumshirn [Wed, 20 Jan 2016 15:08:40 +0000 (16:08 +0100)]
lpfc: Remove redundant code block in lpfc_scsi_cmd_iocb_cmpl
This removes a redundant code block that will either be executed if the
ENABLE_FCP_RING_POLLING flag is set in phba->cfg_poll or not. The code
is just duplicated in both cases, hence we unify it again.
This probably is a left over from some sort of refactoring.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
Acked-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:07 +0000 (12:07 +0530)]
mpt3sas: Updating mpt3sas driver version to 12.100.00.00
Bump mpt3sas driver version from 09.102.00.00 to 12.100.00.00
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:06 +0000 (12:07 +0530)]
mpt3sas: Fix for Asynchronous completion of timedout IO and task abort of timedout IO.
Track msix of each IO and use the same msix for issuing abort to timed
out IO. With this driver will process IO's reply first followed by TM.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:05 +0000 (12:07 +0530)]
mpt3sas: Updated MPI Header to 2.00.42
Updated MPI version and MPI header files.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:04 +0000 (12:07 +0530)]
mpt3sas: Add support for configurable Chain Frame Size
Added support for configurable Chain Frame Size. Calculate the
Chain Message Frame size from the IOCMaxChainSegementSize (iocfacts).
Applicable only for mpt3sas/SAS3.0 HBA's.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath Prabu Subramani [Mon, 8 Feb 2016 16:43:39 +0000 (22:13 +0530)]
mpt3sas: Added smp_affinity_enable module parameter.
Module parameter to enable/disable configuring affinity hint for msix
vector. SMP affinity feature can be enabled/disabled by setting module
parameter "smp_affinity_enable" to 1/0. By default this feature is
enabled. (smp_affinity_enable = 1 enabled).
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:02 +0000 (12:07 +0530)]
mpt3sas: Make use of additional HighPriority credit message frames for sending SCSI IO's
Driver assumes HighPriority credit as part of Global credit. But,
Firmware treats HighPriority credit value and global cedits as two
different values. Changed host queue algorithm to treat global credits
and highPriority credits as two different values.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:01 +0000 (12:07 +0530)]
mpt3sas: Never block the Enclosure device
Never block the SEP device (i.e. Never invoke the
scsi_internal_device_block() API for SEP device) even for the delay not
responding events. Blocking the SEP device will create a deadlock while
adding any device to the OS.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:37:00 +0000 (12:07 +0530)]
mpt3sas: Fix static analyzer(coverity) tool identified defects
1.Wrong size of argument is being passed
The size of struct being passed as an argument to memset func and area of
memory being pointed by an instance of struct in memset func should be of
same structure type.
2.Dereference null return value
3.Array compared against '0'
Check whether value pointed by particular index of an array is null or not
in "if" statement.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:36:59 +0000 (12:06 +0530)]
mpt3sas: Used IEEE SGL instead of MPI SGL while framing a SMP Passthrough request message.
As driver was using MPI SGL while framing the SMP Passthrough request
message due to which firmware unable to post the Reply Data in the host
memory and timeout is observed for this SMP Passthrough request message
and so unable to perform phy disable operation.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Suganath prabu Subramani [Thu, 28 Jan 2016 06:36:58 +0000 (12:06 +0530)]
mpt3sas: Added support for high port count HBA variants.
Updated hardware description headers with MPI v2.6 and
mpt3sas_pci_table[] with vendor_ids, device_ids of Cutlass and Intruder
HBA which have support for 4 ports.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com>
Signed-off-by: Chaitra P B <chaitra.basappa@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kai Makisara [Tue, 9 Feb 2016 19:56:55 +0000 (21:56 +0200)]
st: Fix MTMKPART to work with newer drives
Change the MTMKPART operation of the MTIOCTOP ioctl so that it works
also with current drives (LTO-5/6, etc.). Send a separate FORMAT MEDIUM
command if the partition mode page indicates that this is required. Use
LOAD to position the tape at the beginning of tape.
The operation is extended so that if the argument is negative, its
absolute value specifies the size of partition 0, which is the
physically first partition of the tape.
Signed-off-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Tested-by: Shane M Seymour <shane.seymour@hpe.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sumit Saxena [Thu, 28 Jan 2016 15:44:26 +0000 (21:14 +0530)]
megaraid_sas: Fix SMAP issue
Inside compat IOCTL hook of driver, driver was using wrong address of
ioc->frame.raw which leads sense_ioc_ptr to be calculated wrongly and
failing IOCTL.
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sumit Saxena [Thu, 28 Jan 2016 15:44:25 +0000 (21:14 +0530)]
megaraid_sas: Fix for IO failing post OCR in SRIOV environment
Driver assumes that VFs always have peers present whenever they have
same LD IDs. But this is not the case. This patch handles the above
mentioned by explicitly checking for a peer before making HA/non-HA path
decision.
Signed-off-by: Uday Lingala <uday.lingala@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Wed, 3 Feb 2016 18:26:10 +0000 (02:26 +0800)]
hisi_sas: update driver version to 1.2
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Wed, 3 Feb 2016 18:26:09 +0000 (02:26 +0800)]
hisi_sas: add v1 hw ACPI support
Add support in v1 hw driver for ACPI.
A check on whether an ACPI handle is available for the device is used to
decide on whether to use ACPI reset handler or syscon for hw reset.
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Wed, 3 Feb 2016 18:26:08 +0000 (02:26 +0800)]
hisi_sas: use Unified Device Properties API
The hisi_sas driver is required to support both device tree and
ACPI. The scanning of the device properties now uses the Unified Device
Properties API, which serves both OF and ACPI.
Since syscon is not supported by ACPI, syscon is only used in the driver
when device tree is used.
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:20 +0000 (15:49 +0530)]
be2iscsi: Add lock to protect WRB alloc and free
FW got into UE after running IO stress test
With kernel change to split session lock in frwd_lock and back_lock for
tx and rx path correspondingly, in the IO path, common resource used in
driver such as WRB was left unprotected.
Add wrb_lock spinlock to protect allocation and freeing of WRB.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:19 +0000 (15:49 +0530)]
be2iscsi: _bh for io_sgl_lock and mgmt_sgl_lock
Processing of mgmt and IO tasks are done in process context and
softirqs.
Allocation and freeing of sgl_handles needs to be done under
spin_lock_bh/spin_unlock_bh and move the locks to the routines.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:18 +0000 (15:49 +0530)]
be2iscsi: Fix ExpStatSn in management tasks
Connection resets observed from some targets when NOP-Out with wrong
ExpStatSn is sent.
FW keeps track of StatSn and fills up ExpStatSn accordingly. The header
filled up by the stack needs to be modified by driver to clear
ExpStatSn. If the field is not cleared, FW recalculates ExpStatSn and
wrong offset'ed ExpStatSn is seen in the wire trace.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:17 +0000 (15:49 +0530)]
be2iscsi: Couple MCC tag and WRB alloc and free
WARN_ON(atomic_read(&mccq->used) >= mccq->len) seen when FW gets into
UE.
MCCQ overflow is happening because driver discards any new request and
frees up the tag. The tag allocation controls the number of MCC WRB
posted. It is being replenished but WRBs are not hence the WARN_ON.
Allocation and freeing of WRB and tags for MCC is now done in one place.
This helps to achieve proper accounting of WRB indices and MCC tags.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:16 +0000 (15:49 +0530)]
be2iscsi: Fix MCC WRB leak in open_connection
In open with IP of unknown address family, only tag is freed and error
returned. MCC WRB allocated for the operation is not freed.
Added check for supported family of IP in the beginning before
allocating the tag and WRB.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:15 +0000 (15:49 +0530)]
be2iscsi: Cleanup processing of BMBX completion
Remove confusingly named be_mcc_compl_is_new and be_mcc_compl_use
functions in processing of BMBX. Rearrange beiscsi_process_mbox_compl
function.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:14 +0000 (15:49 +0530)]
be2iscsi: Fix be_mcc_compl_poll to use tag_state
be_mcc_compl_poll waits till 'used' count of MCC WRBQ is zero. This is
to determine the completion of an MCC sent.
Change function to poll for the tag of MCC sent, instead, and wait till
its tag_state is cleared.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:13 +0000 (15:49 +0530)]
be2iscsi: Remove be_mbox_notify_wait function
be_mbox_notify_wait does exactly same thing as be_mbox_notify.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:12 +0000 (15:49 +0530)]
be2iscsi: Rename MCC and BMBX processing functions
beiscsi_mccq_compl -> beiscsi_mccq_compl_wait - indicate blocking call.
be_mcc_wait_compl -> be_mcc_compl_poll - indicate polling for completion.
be_mbox_db_ready_wait -> be_mbox_db_ready_poll - indicate polling for RDY.
be_mcc_compl_process -> beiscsi_process_mbox_compl - indicate BMBX compl.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:11 +0000 (15:49 +0530)]
be2iscsi: Remove redundant MCC processing code
be_mcc_compl_process_isr is removed. MCC CQ processing is done only in
beiscsi_process_mcc_cq and MCC CQE processing is done only in
beiscsi_process_mcc_compl.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:10 +0000 (15:49 +0530)]
be2iscsi: Use macros for MCC WRB and CQE fields
Rename mcc_numtag to mcc_tag_status. MCC CQE status is processed using
macros already defined in be_cmds.h.
Add MCC_Q_WRB_ and MCC_Q_CMD_TAG_MASK macros to map to already defined
CQE_STATUS_ macros to be consistent when posting MCC.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jitendra Bhivare [Thu, 4 Feb 2016 10:19:09 +0000 (15:49 +0530)]
be2iscsi: Remove unused mcc_cq_lock
mcc_cq_lock spin_lock is used only in beiscsi_process_mcc which is
called only when all interrupts are disabled from mgmt_epfw_cleanup
during unloading of driver. There is no other context where there can be
contention for the processing of CQ.
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Dan Carpenter [Sat, 30 Jan 2016 14:36:03 +0000 (17:36 +0300)]
bfa: use strncpy() instead of memcpy()
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>
Maurizio Lombardi [Fri, 22 Jan 2016 12:41:42 +0000 (13:41 +0100)]
megaraid: fix null pointer check in megasas_detach_one().
The pd_seq_sync pointer can't be NULL, we have to check its entries
instead.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:08 +0000 (15:06 -0800)]
aacraid: Update driver version
Updated diver version to 41052
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:07 +0000 (15:06 -0800)]
aacraid: Fix character device re-initialization
During EEH PCI hotplug activity kernel unloads and loads the driver,
causing character device to be unregistered(aac_remove_one).When the
driver is loaded back using aac_probe_one the character device needs
to be registered again for the AIF management tools to work.
Fixed by adding code to register character device in aac_probe_one if
it is unregistered in aac_remove_one.
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:06 +0000 (15:06 -0800)]
aacraid: Fix AIF triggered IOP_RESET
while driver removal is in progress or PCI shutdown is invoked, driver
kills AIF aacraid thread, but IOCTL requests from the management tools
re-start AIF thread leading to IOP_RESET.
Fixed by setting adapter_shutdown flag when PCI shutdown is invoked.
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:05 +0000 (15:06 -0800)]
aacraid: Created new mutex for ioctl path
aac_mutex was used to create protect the ioctl path for only the compat
path, it would be make more sense to place mutex in aac_do_ioctl, which
is the main ioctl function call that handles all ioctl commands.
Created new mutex ioctl_mutex in struct aac_dev to protect switch case
in aac_do_ioctl and removed aac_mutex from aac_cfg_ioctl and
aac_compat_do_ioctl
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:04 +0000 (15:06 -0800)]
aacraid: Fundamental reset support for Series 7
Series 7 does not support PCI hot reset used by EEH.
Enabled fundamental reset only for Series 7
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:03 +0000 (15:06 -0800)]
aacraid: Set correct msix count for EEH recovery
During EEH recovery number of online CPU's might change thereby changing
the number of MSIx vectors. Since each fib is allocated to a vector,
changes in the number of vectors causes fib to be sent thru invalid
vectors.In addition the correct number of MSIx vectors is not updated in
the INIT struct sent to the controller, when it is reinitialized.
Fixed by reassigning vectors to fibs based on the updated number of MSIx
vectors and updating the INIT structure before sending to controller.
Fixes: MSI-X vector calculation for suspend/resume
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthushirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:02 +0000 (15:06 -0800)]
aacraid: Fix memory leak in aac_fib_map_free
aac_fib_map_free() calls pci_free_consistent() without checking that
dev->hw_fib_va is not NULL and dev->max_fib_size is not zero.If they are
indeed NULL/0, this will result in a hang as pci_free_consistent() will
attempt to invalidate cache for the entire 64-bit address space
(which would take a very long time).
Fixed by adding a check to make sure that dev->hw_fib_va and
dev->max_fib_size are not NULL and 0 respectively.
Fixes:
9ad5204d6 - "[SCSI]aacraid: incorrect dma mapping mask during blinked recover or user initiated reset"
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:01 +0000 (15:06 -0800)]
aacraid: Added EEH support
Added support for PCI EEH (extended error handling).
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:06:00 +0000 (15:06 -0800)]
aacraid: Fix RRQ overload
The driver utilizes an array of atomic variables to keep track of IO
submissions to each vector. To submit an IO multiple threads iterate
through the array to find a vector which has empty slots to send an
IO. The reading and updating of the variable is not atomic, causing race
conditions when a thread uses a full vector to submit an IO.
Fixed by mapping each FIB to a vector, the submission path then uses
said vector to submit IO thereby removing the possibly of a race
condition.The vector assignment is started from 1 since vector 0 is
reserved for the use of AIF management FIBS.If the number of MSIx
vectors is 1 (MSI or INTx mode) then all the fibs are allocated to
vector 0.
Fixes:
495c0217 "aacraid: MSI-x support"
Cc: stable@vger.kernel.org # v4.1
Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Raghava Aditya Renukunta [Wed, 3 Feb 2016 23:05:59 +0000 (15:05 -0800)]
aacraid: SCSI blk tag support
The method to allocate and free FIB's in the present code utilizes
spinlocks. Multiple IO's have to wait on the spinlock to acquire or free
fibs creating a performance bottleneck.
An alternative solution would be to use block layer tags to keep track
of the fibs allocated and freed. To this end aac_fib_alloc_tag was
created to utilize the blk layer tags to plug into the Fib pool.These
functions are used exclusively in the IO path. 8 fibs are reserved for
the use of AIF management software and utilize the previous spinlock
based implementations.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:23 +0000 (02:47 +0800)]
hisi_sas: update driver version to 1.1
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:22 +0000 (02:47 +0800)]
hisi_sas: add v2 tmf functions
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:21 +0000 (02:47 +0800)]
hisi_sas: add v2 slot error handler
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:20 +0000 (02:47 +0800)]
hisi_sas: add v2 path to send ATA command
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:19 +0000 (02:47 +0800)]
hisi_sas: add v2 code for itct setup and free
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:18 +0000 (02:47 +0800)]
hisi_sas: add v2 code to send smp command
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:17 +0000 (02:47 +0800)]
hisi_sas: add v2 path to send ssp frame
Include code to prep ssp frame and deliver to hardware.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:16 +0000 (02:47 +0800)]
hisi_sas: add v2 cq interrupt handler
Also include slot_complete_v2_hw handler
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:15 +0000 (02:47 +0800)]
hisi_sas: add v2 SATA interrupt handler
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:14 +0000 (02:47 +0800)]
hisi_sas: add v2 channel interrupt handler
This also includes broadcast handler. Unlike v1 hw, broadcast does not
have its own dedicated interrupt.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:13 +0000 (02:47 +0800)]
hisi_sas: add v2 phy down handler
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:12 +0000 (02:47 +0800)]
hisi_sas: add v2 int init and phy up handler
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:11 +0000 (02:47 +0800)]
hisi_sas: add v2 phy init code
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:10 +0000 (02:47 +0800)]
hisi_sas: add init_id_frame_v2_hw()
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:09 +0000 (02:47 +0800)]
hisi_sas: add v2 hw init
Add code to initialise the hardware.
Support is also added to deal with the "am-max-transmissions" (amt)
limitation in hip06 controller #1. This is how many connection requests
we can send on the system bus before waiting for a response. Due to
chip bus design, controller #1 is limited to 32 amt, while, by design, a
controller supports 64. The default value for the nibbles in the
relevant registers is 0x40; these need to be programmed with 0x20.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:08 +0000 (02:47 +0800)]
hisi_sas: add v2 register definitions
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:07 +0000 (02:47 +0800)]
hisi_sas: add bare v2 hw driver
Just add enough to build and init the module.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:06 +0000 (02:47 +0800)]
hisi_sas: rename some fields in hisi_sas_itct
Since hisi_sas_itct format is different between v1 and v2 hw, give more
general names for some fields.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:05 +0000 (02:47 +0800)]
hisi_sas: add hisi_sas_err_record_v1
Since the error record structure is different for v2 hw, make
hisi_sas_err_record opaque and add hisi_sas_err_record_v1.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:04 +0000 (02:47 +0800)]
hisi_sas: reduce max itct entries
Since v2 hw only supports 2048 itct entries, as opposed to 4096 for v1
hw, set the max itct entries to the lower of the two.
It is not anticipated that any device with v1 will ever require to
connect > 2048 devices.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:03 +0000 (02:47 +0800)]
hisi_sas: set max commands as configurable
Since v2 hardware permits different numbers of commands to v1, set this
as configurable in hisi_sas_hw.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:02 +0000 (02:47 +0800)]
hisi_sas: relocate DEV_IS_EXPANDER
Relocate DEV_IS_EXPANDER to hisi_sas.h as it will be required for v2 hw
support.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Mon, 25 Jan 2016 18:47:01 +0000 (02:47 +0800)]
devicetree: bindings: hisi_sas: add v2 HW bindings
Add the dt bindings for HiSi SAS controller v2 HW.
The main difference in the controller from dt perspective is
interrupts. The v2 controller does not have dedicated fatal and
broadcast interrupts - they are multiplexed on the channel interrupt.
Each SAS v2 controller can issue upto 64 commands (or connection
requests) on the system bus without waiting for a response - this is
know as am-max-transmissions. In hip06, sas controller #1 has a
limitation that it has to limit am-max-transmissions to 32 - this
limitation is due to chip system bus design. It is not anticipated that
any future chip incorporating v2 controller will have such a limitation.
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Maurizio Lombardi [Mon, 1 Feb 2016 15:08:45 +0000 (16:08 +0100)]
bnx2fc: bnx2fc_eh_abort(): fix wrong return code.
If the link is not ready, the bnx2fc_eh_abort() function should return
FAILED.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Jose Castillo [Fri, 29 Jan 2016 14:39:26 +0000 (14:39 +0000)]
bnx2fc: Show information about log levels in 'modinfo'
This patch adds the information of the different values that can be used
in the module parameter 'debug_logging', as it is shown below:
$ modinfo bnx2fc
[...]
parm: debug_logging:Option to enable extended logging,
Default is 0 - no logging.
0x01 - SCSI cmd error, cleanup.
0x02 - Session setup, cleanup, etc.
0x04 - lport events, link, mtu, etc.
0x08 - ELS logs.
0x10 - fcoe L2 fame related logs.
0xff - LOG all messages. (int)
Signed-off-by: Jose Castillo <jcastillo@redhat.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Lee Duncan [Wed, 20 Jan 2016 19:48:00 +0000 (11:48 -0800)]
scsi: Use ida for host number management
Update the SCSI hosts module to use ida to manage its host_no index
instead of an atomic integer. This means that the SCSI host number will
now be reclaimable.
Use the ida "simple" mechanism, since there should be no need for a
separate spin lock current usage. Ida was chosen over idr because the
hosts module already has its own instance and locking mechanisms that
aren't easily changed.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sumit Saxena [Thu, 28 Jan 2016 15:34:36 +0000 (21:04 +0530)]
megaraid_sas: driver version upgrade
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sumit Saxena [Thu, 28 Jan 2016 15:34:35 +0000 (21:04 +0530)]
megaraid_sas: SPERC OCR changes
This patch fixes online controller resets on SRIOV-enabled series of
Avago controllers.
1) Remove late detection heartbeat.
2) Change in the behavior if the FW found in READY/OPERATIONAL state.
Signed-off-by: Uday Lingala <uday.lingala@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sumit Saxena [Thu, 28 Jan 2016 15:34:34 +0000 (21:04 +0530)]
megaraid_sas: Introduce module parameter for SCSI command timeout
This patch will introduce module-parameter for SCSI command timeout
value and fix setting of resetwaittime beyond a value.
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sumit Saxena [Thu, 28 Jan 2016 15:34:33 +0000 (21:04 +0530)]
megaraid_sas: MFI adapter OCR changes
Optimized MFI adapters' OCR path, particularly
megasas_wait_for_outstanding() function.
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>