Joe Carnuccio [Fri, 2 Jun 2017 16:11:55 +0000 (09:11 -0700)]
scsi: qla2xxx: Retain loop test for fwdump length exceeding buffer length
Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Quinn Tran [Fri, 2 Jun 2017 16:11:53 +0000 (09:11 -0700)]
scsi: qla2xxx: Allow ABTS, PURX, RIDA on ATIOQ for ISP83XX/27XX
Driver added mechanism to move ABTS/PUREX/RIDA mailbox to
ATIO queue as part of commit id 41dc529a4602ac737020f423f84686a81de38e6d
("qla2xxx: Improve RSCN handling in driver").
This patch adds a check to only allow ABTS/PURX/RIDA
to be moved to ATIO Queue for ISP83XX and ISP27XX.
Cc: <stable@vger.kernel.org> # 4.11 Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Chad Dupuis [Wed, 31 May 2017 13:33:56 +0000 (06:33 -0700)]
scsi: qedf: Add bus_reset No-op.
We need to add a bus reset no-op as without it some of the LUNs attached to a
vport may go offline when the error handler escalates to host reset due to not
having a bus reset handler in the driver. What happens is we escalate to host
reset which does a soft link down/link up to reset the adapter. However with
multiple vports attached it's been observed that if the vports do log back into
the target within 5 seconds, the SCSI layer offlines the devices most likely
due to a TUR timing out to verify that the device is online. Adding a bus
reset handler will cause the TUR to be sent after the bus reset handler where
the devices will still be online if the bus reset is initiated by sg_reset
(which is the case in the test that was failing). The bus reset will succeed
and not needlessly bring the device offline/online.
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Chad Dupuis [Wed, 31 May 2017 13:33:55 +0000 (06:33 -0700)]
scsi: qedf: Use same logic for SCSI host reset and FC lip_reset.
We should be using the same logic to do a soft reset of the FCoE function
whether it is initiated via sg_reset or the fc_host issue_lip attribute.
Refactor the host reset and fcoe reset handlers to use the preferred logic
which is currently contained in qedf_eh_host_reset().
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Chad Dupuis [Wed, 31 May 2017 13:33:54 +0000 (06:33 -0700)]
scsi: qedf: Set qed logging level to QED_LEVEL_NOTICE.
Reduce the logging level we set for qed messages pertaining to this PCI
function so that unnecessary messages are not printed in the kernel
message log.
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Chad Dupuis [Wed, 31 May 2017 13:33:51 +0000 (06:33 -0700)]
scsi: qedf: Look at all descriptors when processing a clear virtual link.
If there are multiple descriptors for a particular type in a clear virtual
link we receive, we will not process it correctly but rather take the last
value. This can cause us not to not flap the virtual link as the value from
the descriptors that we compare against the our stored FCF or fc_lport values
may not match.
Change this to do a comparison when processing the each descriptor instead of at
the end and then set a bool if we need to do the reset.
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
We need to check the return code the set_fp_int() callback in case we were
not allocated any fastpath interrupts or there was an error setting up the
fastpath interrupts from the qed perspective.
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Milan P. Gandhi [Thu, 1 Jun 2017 12:08:55 +0000 (17:38 +0530)]
scsi: fcoe: Remove an extra out label in _fcoe_create function
This patch removes an extra out label in _fcoe_create function where we
return if creation of FCOE interface is failed.
Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Milan P. Gandhi [Thu, 1 Jun 2017 12:05:49 +0000 (17:35 +0530)]
scsi: fcoe: Fix few small typos in fcoe.c
This patch does a cleanup and fixes few small typos in fcoe.c
Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Trivial fix to spelling mistake in debugfs message
Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: James Smart <james.smart@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bart Van Assche [Mon, 22 May 2017 20:10:53 +0000 (13:10 -0700)]
scsi: qla2xxx: Remove an unused structure member
qla_tgt_cmd.free_work is not used by the qla2xxx driver. Hence remove
that member of struct qla_tgt_cmd.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Quinn Tran <quinn.tran@cavium.com> Cc: Hannes Reinecke <hare@suse.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Andy Grover <agrover@redhat.com> Cc: David Disseldorp <ddiss@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: hisi_sas: add null check before indirect pointer dereference
Add null check before indirectly dereferencing pointer task->lldd_task
in statement u32 tag = slot->idx;
Addresses-Coverity-ID: 1373843 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Reviewed-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Arnd Bergmann [Thu, 18 May 2017 08:32:18 +0000 (10:32 +0200)]
scsi: smartpqi: mark PM functions as __maybe_unused
The newly added suspend/resume support causes harmless warnings when
CONFIG_PM is disabled:
smartpqi/smartpqi_init.c:5147:12: error: 'pqi_ctrl_wait_for_pending_io' defined but not used [-Werror=unused-function]
smartpqi/smartpqi_init.c:2019:13: error: 'pqi_wait_until_lun_reset_finished' defined but not used [-Werror=unused-function]
smartpqi/smartpqi_init.c:2013:13: error: 'pqi_wait_until_scan_finished' defined but not used [-Werror=unused-function]
We can avoid the warnings by removing the #ifdef around the handlers and
instead marking them as __maybe_unused, which will let gcc drop the
unused code silently.
Fixes: f44d210312a6 ("scsi: smartpqi: add suspend and resume support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kees Cook [Tue, 9 May 2017 22:34:44 +0000 (15:34 -0700)]
scsi: csiostor: Avoid content leaks and casts
When copying attributes, the len argument was padded out and the
resulting memcpy() would copy beyond the end of the source buffer.
Avoid this, and use size_t for val_len to avoid all the casts.
Similarly, avoid source buffer casts and use void *.
Additionally enforces val_len can be represented by u16 and that the DMA
buffer was not overflowed. Fixes the size of mfa, which is not
FC_FDMI_PORT_ATTR_MAXFRAMESIZE_LEN (but it will be padded up to 4). This
was noticed by the future CONFIG_FORTIFY_SOURCE checks.
Cc: Daniel Micay <danielmicay@gmail.com> Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Varun Prakash <varun@chelsio.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
In storvsc driver, inbound messages do not go through inbound lock. The
only effect of this lock was is to provide a barrier for connect and
remove logic.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
In 4.12-rc1, new functions were added to support iterating over elements
in the vmbus event ring. This patch uses them to simplify the ring
buffer handling in virtual SCSI driver as well.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kyle Fortin [Wed, 17 May 2017 20:21:54 +0000 (16:21 -0400)]
scsi: libiscsi: use kvzalloc for iscsi_pool_init
iscsiadm session login can fail with the following error:
iscsiadm: Could not login to [iface: default, target: iqn.1986-03.com...
iscsiadm: initiator reported error (9 - internal error)
When /etc/iscsi/iscsid.conf sets node.session.cmds_max = 4096, it
results in 64K-sized kmallocs per session. A system under fragmented
slab pressure may not have any 64K objects available and fail iscsiadm
session login. Even though memory objects of a smaller size are
available, the large order allocation ends up failing.
The kernel prints a warning and does dump_stack, like below:
Kevin Barnett [Wed, 3 May 2017 23:55:55 +0000 (18:55 -0500)]
scsi: smartpqi: bump driver version
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Gerry Morong <gerry.morong@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Corentin Labbe [Wed, 3 May 2017 23:55:49 +0000 (18:55 -0500)]
scsi: smartpqi: remove writeq/readq function definitions
Instead of rewriting write/readq, use existing functions
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:55:43 +0000 (18:55 -0500)]
scsi: smartpqi: add module parameters
Add module parameters to disable heartbeat support and to disable
shutting down the controller when a controller is taken offline.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:55:37 +0000 (18:55 -0500)]
scsi: smartpqi: cleanup list initialization
Better initialization of linked list heads.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:55:31 +0000 (18:55 -0500)]
scsi: smartpqi: add raid level show
Display the RAID level via sysfs
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:55:25 +0000 (18:55 -0500)]
scsi: smartpqi: make ioaccel references consistent
- make all references to RAID bypass consistent throughout driver.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:55:19 +0000 (18:55 -0500)]
scsi: smartpqi: enhance device add and remove messages
Improved formatting of information displayed when devices
are added/removed from the system.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:55:13 +0000 (18:55 -0500)]
scsi: smartpqi: update timeout on admin commands
Increase the timeout on admin commands from 3 seconds to 60
seconds and added a check for controller crash in the loop
where the driver polls for admin command completion.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:55:07 +0000 (18:55 -0500)]
scsi: smartpqi: map more raid errors to SCSI errors
enhance mapping of RAID path errors to Linux SCSI host
error codes.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:55:01 +0000 (18:55 -0500)]
scsi: smartpqi: cleanup controller branding
- Improve controller branding support.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:55 +0000 (18:54 -0500)]
scsi: smartpqi: update rescan worker
improve support for taking controller offline.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:49 +0000 (18:54 -0500)]
scsi: smartpqi: update device offline
- Improve handling of offline devices.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:43 +0000 (18:54 -0500)]
scsi: smartpqi: correct aio error path
set the internal flag that causes I/O to be sent down the
RAID path when the AIO path is disabled
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:37 +0000 (18:54 -0500)]
scsi: smartpqi: add lockup action
add support for actions to take when controller goes offline.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:31 +0000 (18:54 -0500)]
scsi: smartpqi: remove qdepth calculations for logical volumes
make the queue depth for LVs the same as the maximum
I/Os supported by the controller
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:25 +0000 (18:54 -0500)]
scsi: smartpqi: enhance kdump
constrain resource usage during kdump to avoid kdump failures
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:18 +0000 (18:54 -0500)]
scsi: smartpqi: change return value for LUN reset operations
change return value for controller offline to be consistent
with the rest of the driver.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:12 +0000 (18:54 -0500)]
scsi: smartpqi: add ptraid support
add support for PTRAID devices
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:06 +0000 (18:54 -0500)]
scsi: smartpqi: update copyright
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:54:00 +0000 (18:54 -0500)]
scsi: smartpqi: cleanup messages
- improve some error messages.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:53:54 +0000 (18:53 -0500)]
scsi: smartpqi: add new PCI device IDs
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:53:48 +0000 (18:53 -0500)]
scsi: smartpqi: minor driver cleanup
- remove debug code that is no longer necessary.
- Some WARN_ON checks were removed because the driver continues
to function when the conditions are met.
- remove a MACRO that is no longer used.
- remove unnecessary multi-line statements.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
eliminate redundant error message during initialization
if the controller has crashed.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:53:30 +0000 (18:53 -0500)]
scsi: smartpqi: make pdev pointer names consistent
make all variable names for pointers to struct pci_dev consistent
throughout the driver.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:53:24 +0000 (18:53 -0500)]
scsi: smartpqi: add pqi_wait_for_completion_io
Add check for controller lockup during waits for synchronous
controller commands.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:53:18 +0000 (18:53 -0500)]
scsi: smartpqi: correct bdma hw bug
add workaround for BDMA hardware bug that can cause
hw to read up to 12 SGL elements (192 bytes) beyond the
last element in the list. This fix avoids IOMMU violations
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:53:11 +0000 (18:53 -0500)]
scsi: smartpqi: add heartbeat check
check for controller lockups
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:53:05 +0000 (18:53 -0500)]
scsi: smartpqi: add suspend and resume support
add support for ACPI S3 (suspend) and S4 (hibernate)
system power states.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:52:58 +0000 (18:52 -0500)]
scsi: smartpqi: enhance resets
- Block all I/O targeted at LUN reset device.
- Wait until all I/O targeted at LUN reset device has been
consumed by the controller.
- Issue LUN reset request.
- Wait until all outstanding I/Os and LUN reset completion
have been received by the host.
- Return to OS results of LUN reset request.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:52:52 +0000 (18:52 -0500)]
scsi: smartpqi: add supporting events
Only register for controller events that driver supports
cleanup event handling.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:52:46 +0000 (18:52 -0500)]
scsi: smartpqi: ensure controller is in SIS mode at init
put in SIS mode during initialization.
support kexec/kdump
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:52:40 +0000 (18:52 -0500)]
scsi: smartpqi: add in controller checkpoint for controller lockups.
tell smartpqi controller to generate a checkpoint for rare lockup
conditions.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:52:34 +0000 (18:52 -0500)]
scsi: smartpqi: set pci completion timeout
add support for setting PCIe completion timeout.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:52:28 +0000 (18:52 -0500)]
scsi: smartpqi: cleanup interrupt management
minor cleanup of interrupt initialization and tear-down.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Kevin Barnett [Wed, 3 May 2017 23:52:22 +0000 (18:52 -0500)]
scsi: smartpqi: correct remove scsi devices
correct a problem caused by holding a spinlock during device deletion.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:51:56 +0000 (17:51 -0500)]
scsi: hpsa: bump driver version
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:51:49 +0000 (17:51 -0500)]
scsi: hpsa: remove abort handler
- simplify the driver
- there are a lot of quirky racy conditions not handled
- causes more aborts/resets when the number of commands to be aborted is
large, such as in multi-path fail-overs.
- has been turned off in our internal driver since 8/31/2015
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:51:42 +0000 (17:51 -0500)]
scsi: hpsa: send ioaccel requests with 0 length down raid path
- Block I/O requests with 0 length transfers which go down the ioaccel
path. This causes lockup issues down in the basecode.
- These issues have been fixed, but there are customers who are
experiencing the issues when running older firmware.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Scott Teel [Thu, 4 May 2017 22:51:36 +0000 (17:51 -0500)]
scsi: hpsa: separate monitor events from rescan worker
create new worker thread to monitor controller events
- both the rescan and event monitor workers can cause a rescan to occur
however for multipath we have found that we need to respond faster
than the normal scheduled rescan interval for path fail-overs.
- getting controller events only involves reading a register, but the
rescan worker can obtain an updated LUN list when there is a PTRAID
device present.
- move common code to a separate function.
advantages:
- detect controller events more frequently.
- leave rescan thread interval at 30 seconds.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:51:28 +0000 (17:51 -0500)]
scsi: hpsa: correct queue depth for externals
- queue depth assignment not in correct place, had no effect.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:51:22 +0000 (17:51 -0500)]
scsi: hpsa: cleanup reset handler
- mark device state sooner.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:51:16 +0000 (17:51 -0500)]
scsi: hpsa: correct resets on retried commands
- call scsi_done when the command completes.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:51:10 +0000 (17:51 -0500)]
scsi: hpsa: rescan later if reset in progress
- schedule another scan.
- mark current scan as completed.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:51:04 +0000 (17:51 -0500)]
scsi: hpsa: do not reset enclosures
Prevent enclosure resets.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.tell@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:50:58 +0000 (17:50 -0500)]
scsi: hpsa: update reset handler
Use the return from TUR as a check for the device state.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.tell@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Thu, 4 May 2017 22:50:50 +0000 (17:50 -0500)]
scsi: hpsa: do not get enclosure info for external devices
external shelves do not support BMICs.
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
- align with latest spec.
- added __attribute((aligned(512)))
Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Remove reference to Series-9 HBA and created arc ctrl check function.
Signed-off-by: Prasad B Munirathnam <prasad.munirathnam@microsemi.com> Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Added info and error messages in controller reset function to log
information about the status of the IOP/SOFT reset.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Enable ctrl reset for both hba and arc
Make sure that IOP and SOFT reset are enabled for both for both arc and
hba1000 controllers.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Make sure ioctl returns on controller reset
Made sure that ioctl commands return in case of a controller reset.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: Dave Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Use correct function to get ctrl health
The command thread checks the ctrl health periodically before sending
updates to the controller. The function that it uses is aac_check_health
which does more than get the health status.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Removed switch case and replaced with if mask checks. Moved KERNEL_PANIC
check to when bled is less than 0.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Now the driver issues a soft reset and waits for the controller to be up
and running by periodically checking on the status of the controller
health registers. Also prevents ARC adapters from issuing soft reset if
IOP resets failed.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Add periodic checks to see IOP reset status
Added function that waits with a timeout for the ctrl to be up and running
after triggering an IOP reset. Also removed 30 sec sleep as it is not
needed.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reworked IOP reset to remove unneeded variable and created a helper
function to notify fw of an imminent IOP reset.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Using single reset mask for IOP reset
The driver can now trigger IOP reset with a single reset mask. Removed
code that retrieves a reset_mask from the firmware.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Log the status of the controller before issuing a reset.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Log count info of scsi cmds before reset
Log the location of the scsi cmds before triggering a reset. This
information is useful for debugging.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Change wait time for fib completion
Change the completion wait time for the fibs in the reset and abort
callback from 2 minutes to 15 seconds.
2 minutes is too long for waiting for completion.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Remove reset support from check_health
Check health does not need to reset the ctrl but just return the
controller health status.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Set correct Queue Depth for HBA1000 RAW disks
The default queue depth for non NATIVE RAW disks is calculated from the
number of fibs and number of disks or a max of 256. This causes poor disk
IO performance.
The fix is to set default qd based on the type of disks
(SATA -32 and SAS -64)
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Added 32 and 64 queue depth for arc natives
The qd for ARC Native disks is calculated by dividing the max IO 1024
by the number of disks or 256 which ever is lower. This causes poor
disk IO performance.
The fix is set the qd based on the type of disk (SAS - 64 and SATA -
32).
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: David Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
The driver changed the DMA consistent map after consistent memory was
allocated, this invalidated the IOMMU identity mapping. The fix was to
make sure that we set the DMA consistent mask setting once depending on
the controller card.
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: Dave Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
scsi: aacraid: Remove __GFP_DMA for raw srb memory
The raw srb commands do not requires memory that in the ZONE_DMA memory
space. For 32bit srb commands use GFP_DMA32 to limit the memory to 32bit
memory range (4GB).
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com> Reviewed-by: Dave Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Linus Torvalds [Sun, 11 Jun 2017 23:17:29 +0000 (16:17 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull key subsystem fixes from James Morris:
"Here are a bunch of fixes for Linux keyrings, including:
- Fix up the refcount handling now that key structs use the
refcount_t type and the refcount_t ops don't allow a 0->1
transition.
- Fix a potential NULL deref after error in x509_cert_parse().
- Don't put data for the crypto algorithms to use on the stack.
- Fix the handling of a null payload being passed to add_key().
- Fix incorrect cleanup an uninitialised key_preparsed_payload in
key_update().
- Explicit sanitisation of potentially secure data before freeing.
- Fixes for the Diffie-Helman code"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (23 commits)
KEYS: fix refcount_inc() on zero
KEYS: Convert KEYCTL_DH_COMPUTE to use the crypto KPP API
crypto : asymmetric_keys : verify_pefile:zero memory content before freeing
KEYS: DH: add __user annotations to keyctl_kdf_params
KEYS: DH: ensure the KDF counter is properly aligned
KEYS: DH: don't feed uninitialized "otherinfo" into KDF
KEYS: DH: forbid using digest_null as the KDF hash
KEYS: sanitize key structs before freeing
KEYS: trusted: sanitize all key material
KEYS: encrypted: sanitize all key material
KEYS: user_defined: sanitize key payloads
KEYS: sanitize add_key() and keyctl() key payloads
KEYS: fix freeing uninitialized memory in key_update()
KEYS: fix dereferencing NULL payload with nonzero length
KEYS: encrypted: use constant-time HMAC comparison
KEYS: encrypted: fix race causing incorrect HMAC calculations
KEYS: encrypted: fix buffer overread in valid_master_desc()
KEYS: encrypted: avoid encrypting/decrypting stack buffers
KEYS: put keyring if install_session_keyring_to_cred() fails
KEYS: Delete an error message for a failed memory allocation in get_derived_key()
...