Usha Ketineni [Mon, 29 Feb 2016 11:36:52 +0000 (03:36 -0800)]
fcoe: fix reset of fip selection time.
Do not reset fip selection time for every advertisement
in fcoe_ctlr_recv_adv() but set it only once for the first
validated FCF. Otherwise FCF selection won't happen when the
advertisements consistently arrive with sub FCOE_CTLR_START_DELAY
periodicity.
Tested-by: Narendra K <narendra_k@dell.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Usha Ketineni <usha.k.ketineni@intel.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Thu, 25 Feb 2016 09:42:15 +0000 (17:42 +0800)]
hisi_sas: update driver version to 1.3
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 [Thu, 25 Feb 2016 09:42:14 +0000 (17:42 +0800)]
hisi_sas: add hisi_sas_slave_configure()
In high-datarate aging tests, it is found that the
SCSI framework can periodically issue lu resets as
some commands timeout.
Response TASK SET FULL and SAS_QUEUE_FULL may be
returned many times for the same command, causing the
timeouts.
The SAS_QUEUE_FULL errors come from
TRANS_TX_CREDIT_TIMEOUT_ERR, TRANS_TX_CLOSE_NORMAL_ERR,
and TRANS_TX_ERR_FRAME_TXED errors. They do not mean
that the queue is full in the host, but rather it is
equivalent to meaning the queue is full for the sdev.
To overcome this, the queue depth for the sdev is
reduced to 64 (from 256, set in sas_slave_configure()).
Normally error code SAS_QUEUE_FULL will result in the
sdev queue depth falling, but it falls too slowly during
high-datarate tests and commands timeout before it
has fallen to an adequete level from original value.
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 [Thu, 25 Feb 2016 09:42:13 +0000 (17:42 +0800)]
hisi_sas: use slot abort in v2 hw
When TRANS_TX_ERR_FRAME_TXED error occurs in
a slot, the command should be re-attempted.
This error is equivalent to meaning that the queue
is full in the sdev (and not the host).
A superflous debug statement is also removed in the
slot complete 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 [Thu, 25 Feb 2016 09:42:12 +0000 (17:42 +0800)]
hisi_sas: use slot abort in v1 hw
When TRANS_TX_CREDIT_TIMEOUT_ERR or
TRANS_TX_CLOSE_NORMAL_ERR error occur in
a slot, the command should be re-attempted.
This error is equivalent to meaning that the queue
is full in the sdev (and not the host).
Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
John Garry [Thu, 25 Feb 2016 09:42:11 +0000 (17:42 +0800)]
hisi_sas: add hisi_sas_slot_abort()
Add a function to abort a slot (task) in the target
device and then cleanup and complete the task.
The function is called from work queue context as
it cannot be called from the context where it is
triggered (interrupt).
Flag hisi_sas_slot.abort is added as the flag used
in the slot error handler to indicate whether the
slot needs to be aborted in the sdev prior to
cleanup and finish.
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 [Thu, 25 Feb 2016 09:42:10 +0000 (17:42 +0800)]
hisi_sas: change tmf func complete check
In hisi_sas_exec_internal_tmf_task(), the check for
SAM_STAT_GOOD is replaced with
TMF_RESP_FUNC_COMPLETE, which is a genuine tmf
response code.
SAM_STAT_GOOD and TMF_RESP_FUNC_COMPLETE have the
same value, so this is why it worked before.
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>
Alison Schofield [Thu, 18 Feb 2016 05:29:34 +0000 (21:29 -0800)]
gdth: replace struct timeval with ktime_get_real_seconds()
struct timeval will overflow on 32-bit systems in y2038 and is being
removed from the kernel. Replace the use of struct timeval and
do_gettimeofday() with ktime_get_real_seconds() which provides a 64-bit
seconds value and is y2038 safe.
gdth driver requires changes in two areas:
1) gdth_store_event() loads two u32 timestamp fields for ioctl GDTIOCTL_EVENT
These timestamp fields are part of struct gdth_evt_str used for passing
event data to userspace. At the first instance of an event we do
(first_stamp=last_stamp="current time"). If that same event repeats,
we do (last_stamp="current time") AND increment same_count to indicate
how many times the event has repeated since first_stamp.
This patch replaces the use of timeval and do_gettimeofday() with
ktime_get_real_seconds() cast to u32 to extend the timestamp fields
to y2106.
Beyond y2106, the userspace tools (ie. RAID controller monitors) can
work around the time rollover and this driver would still not need to
change.
Alternative: The alternative approach is to introduce a new ioctl in gdth
with the u32 time fields defined as u64. This would require userspace
changes now, but not in y2106.
2) gdth_show_info() calculates elapsed time using u32 first_stamp
It is adding events with timestamps to a seq_file. Timestamps are
calculated as the "current time" minus the first_stamp.
This patch replaces the use of timeval and do_gettimeofday() with
ktime_get_real_seconds() cast to u32 to calculate the timestamp.
This elapsed time calculation is safe even when the time wraps (beyond
y2106) due to how unsigned subtraction works. A comment has been added
to the code to indicate this safety.
Alternative: This piece itself doesn't warrant an alternative, but
if we do introduce a new structure & ioctl with u64 timestamps, this
would change accordingly.
Signed-off-by: Alison Schofield <amsfield22@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sudip Mukherjee [Wed, 24 Feb 2016 11:21:28 +0000 (16:51 +0530)]
osd: remove deadcode
The variable is_ver1 is always true and so OSD_CAP_LEN can never be
used.
Reported by Coverity.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Acked-by: Boaz harrosh <ooo@elecrozaur.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Sudip Mukherjee [Wed, 24 Feb 2016 10:57:11 +0000 (16:27 +0530)]
imm: check parport_claim
parport_claim() can fail and we should be checking if we were able to
claim the port.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Charles [Mon, 22 Feb 2016 12:07:09 +0000 (20:07 +0800)]
stex: Add S3/S4 support
Add S3/S4 support, add .suspend and .resume function in pci_driver. In
.suspend handler, driver send S3/S4 signal to the device.
Signed-off-by: Charles Chiou <charles.chiou@tw.promise.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Charles [Mon, 22 Feb 2016 12:04:25 +0000 (20:04 +0800)]
stex: Add hotplug support
1. Add hotplug support. Pegasus support surprise removal. To this end, I
use return_abnormal_state function to return DID_NO_CONNECT for all
commands which sent to driver.
2. Remove stex_hba_stop in stex_remove because we cannot send command to
device after hotplug.
3. Add new device status: MU_STATE_STOP, MU_STATE_NOCONNECT,
MU_STATE_STOP. MU_STATE_STOP is currently not referenced.
MU_STATE_NOCONNECT represent that device is plugged out from the
host.
4. Use return_abnormal_function() to substitute part of code in
stex_do_reset.
Signed-off-by: Charles Chiou <charles.chiou@tw.promise.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Charles [Mon, 22 Feb 2016 12:02:02 +0000 (20:02 +0800)]
stex: Support to Pegasus series.
Pegasus is a high performace hardware RAID solution designed to unleash
the raw power of Thunderbolt technology.
1. Add code to distinct SuperTrack and Pegasus series by sub device ID.
It should support backward compatibility.
2. Change the driver version.
Signed-off-by: Charles Chiou <charles.chiou@tw.promise.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Tue, 23 Feb 2016 21:21:44 +0000 (15:21 -0600)]
hpsa: update MAINTAINERS with new e-mail
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Tue, 23 Feb 2016 21:16:46 +0000 (15:16 -0600)]
hpsa: update copyright information
Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Tue, 23 Feb 2016 21:16:40 +0000 (15:16 -0600)]
hpsa: remove function definition for sanitize_inquiry_string
This patch depends on patch
- commit ac10a3e4ed64
("Export function scsi_scan.c:sanitize_inquiry_string")
Suggested-by: Hannes Reinecke <hare@suse.de> Suggested-by: Matthew R. Ochs mrochs@linux.vnet.ibm.com Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Tue, 23 Feb 2016 21:16:34 +0000 (15:16 -0600)]
hpsa: check for a null phys_disk pointer in ioaccel2 path
An oops can occur when submitting ioaccel2 commands when the phys_disk
pointer is NULL in hpsa_scsi_ioaccel_raid_map. Happens when there are
configuration changes during I/O operations.
If the phys_disk pointer is NULL, send the command down the RAID path.
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Tue, 23 Feb 2016 21:16:28 +0000 (15:16 -0600)]
hpsa: correct abort tmf for hba devices
Aborts were not being sent down to HBA devices
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Tue, 23 Feb 2016 21:16:22 +0000 (15:16 -0600)]
hpsa: correct lun data caching bitmap definition
The bitmap was changed after this definition was added to the
driver. Correcting the bitmap definition.
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Tue, 23 Feb 2016 21:16:15 +0000 (15:16 -0600)]
hpsa: add SMR drive support
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Don Brace [Tue, 23 Feb 2016 21:16:09 +0000 (15:16 -0600)]
hpsa: do not get enclosure info for external devices
Stop annoying "Error, could not get enclosure information"
messages.
Reviewed-by: Mahesh Rajashekhara <mahesh.rajashekhara@microsemi.com> Reviewed-by: Justin Lindley <justin.lindley@microsemi.com> Reviewed-by: Scott Teel <scott.teel@microsemi.com> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Don Brace <don.brace@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:20 +0000 (09:17 +0100)]
scsi_dh_alua: Update version to 2.0
[mkp: Fixed merge due to patches 20-22 of series being postponed]
Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:16 +0000 (09:17 +0100)]
scsi_dh: add 'rescan' callback
If a device needs to be rescanned the device_handler might need
to be rechecked, too.
So add a 'rescan' callback to the device handler and call it
upon scsi_rescan_device(). The rescan callback will be invoked
from the Unit Attention handling of ASC/ASCQ 3F 03
(INQUIRY DATA HAS CHANGED).
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:15 +0000 (09:17 +0100)]
scsi_dh_alua: Send TEST UNIT READY to poll for transitioning
Sending a 'REPORT TARGET PORT GROUP' command is a costly operation,
as the array has to gather information about all ports.
So instead of using RTPG to poll for a status update when a port
is in transitioning we should be sending a TEST UNIT READY, and
wait for the sense code to report success.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Ewan Milne <emilne@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:14 +0000 (09:17 +0100)]
scsi_dh_alua: update all port states
When we read in the target port group state we should be
updating all affected port groups, otherwise we risk
running out of sync.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:13 +0000 (09:17 +0100)]
scsi_dh_alua: Recheck state on unit attention
When we receive a unit attention code of 'ALUA state changed'
we should recheck the state, as it might be due to an implicit
ALUA state transition. This allows us to return NEEDS_RETRY
instead of ADD_TO_MLQUEUE, allowing to terminate the retries
after a certain time.
At the same time a workqueue item might already be queued, which
should be started immediately to avoid any delays.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:12 +0000 (09:17 +0100)]
scsi_dh_alua: Add new blacklist flag 'BLIST_SYNC_ALUA'
Add a new blacklist flag BLIST_SYNC_ALUA to instruct the
alua device handler to use synchronous command submission
for ALUA commands.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:11 +0000 (09:17 +0100)]
scsi_dh_alua: Allow workqueue to run synchronously
Some arrays may only capable of handling one STPG at a time,
so this patch adds a singlethreaded workqueue for STPGs to be
submitted synchronously.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:10 +0000 (09:17 +0100)]
scsi_dh_alua: Use workqueue for RTPG
The current ALUA device_handler has two drawbacks:
- We're sending a 'SET TARGET PORT GROUP' command to every LUN,
disregarding the fact that several LUNs might be in a port group
and will be automatically switched whenever _any_ LUN within
that port group receives the command.
- Whenever a LUN is in 'transitioning' mode we cannot block I/O
to that LUN, instead the controller has to abort the command.
This leads to increased traffic across the wire and heavy load
on the controller during switchover.
With this patch the RTPG handling is moved to a per-portgroup
workqueue. This reduces the number of 'REPORT TARGET PORT GROUP'
and 'SET TARGET PORT GROUPS' sent to the controller as we're sending
them now per port group, and not per device as previously.
It also allows us to block I/O to any LUN / port group found to be
in 'transitioning' ALUA mode, as the workqueue item will be requeued
until the controller moves out of transitioning.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:09 +0000 (09:17 +0100)]
scsi_dh_alua: remove 'rel_port' from alua_dh_data structure
The 'relative port' field is not used, and might get stale when
the port group changes. So remove the field altogether.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:08 +0000 (09:17 +0100)]
scsi_dh_alua: move optimize_stpg evaluation
When the optimize_stpg module option is set we should just set it
once during port_group allocation. Doing so allows us to override
it later with device specific settings.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ewan Milne <emilne@redhat.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:06 +0000 (09:17 +0100)]
scsi_dh_alua: simplify alua_initialize()
Rework alua_check_vpd() to use scsi_vpd_get_tpg()
and move the port group selection into the function, too.
With that we can simplify alua_initialize() to just
call alua_check_tpgs() and alua_check_vpd();
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:05 +0000 (09:17 +0100)]
scsi_dh_alua: use unique device id
Use scsi_vpd_lun_id() to assign a unique device identification
to the alua port group structure.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:04 +0000 (09:17 +0100)]
scsi_dh_alua: Use separate alua_port_group structure
The port group needs to be a separate structure as several
LUNs might belong to the same group.
Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ewan Milne <emilne@redhat.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:03 +0000 (09:17 +0100)]
scsi_dh_alua: allocate RTPG buffer separately
The RTPG buffer will only evaluated within alua_rtpg(),
so we can allocate it locally there and avoid having to
put it into the global structure.
Reviewed-by: Ewan Milne <emilne@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:02 +0000 (09:17 +0100)]
scsi_dh_alua: switch to scsi_execute_req_flags()
All commands are issued synchronously, so no need to open-code
scsi_execute_req_flags() anymore. And we can get rid of the
static sense code structure element. scsi_execute_req_flags()
will be setting REQ_QUIET and REQ_PREEMPT, but that is
perfectly fine as we're evaluating and logging any errors
ourselves and we really need to send the command even if
the device is quiesced.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ewan Milne <emilne@redhat.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:01 +0000 (09:17 +0100)]
scsi_dh_alua: call alua_rtpg() if stpg fails
If the call to SET TARGET PORT GROUPS fails we have no idea what
state the array is left in, so we need to issue a call to
REPORT TARGET PORT GROUPS in these cases.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:17:00 +0000 (09:17 +0100)]
scsi_dh_alua: Make stpg synchronous
The 'activate_complete' function needs to be executed after
stpg has finished, so we can as well execute stpg synchronously
and call the function directly.
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:16:59 +0000 (09:16 +0100)]
scsi_dh_alua: separate out alua_stpg()
Separate out SET TARGET PORT GROUP functionality into a separate
function alua_stpg().
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Hannes Reinecke [Fri, 19 Feb 2016 08:16:58 +0000 (09:16 +0100)]
scsi_dh_alua: Pass buffer as function argument
Pass in the buffer as a function argument for submit_rtpg().
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Ewan D. Milne [Tue, 23 Feb 2016 14:00:12 +0000 (09:00 -0500)]
mptbase: fixup error handling paths in mpt_attach()
mpt_attach() was not checking for the failure to create fw_event_q.
Also, iounmap() was not being called in all error cases after ioremap()
had been called by mpt_mapresources().
Signed-off-by: Ewan D. Milne <emilne@redhat.com> Reported-by: Insu Yun <wuninsu@gmail.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>
Sudip Mukherjee [Thu, 18 Feb 2016 08:29:13 +0000 (13:59 +0530)]
dpt_i2o: fix build warning
We were getting build warning about:
drivers/scsi/dpt_i2o.c:183:29: warning: 'dptids' defined but not used
dptids[] is only used in the MODULE_DEVICE_TABLE so when MODULE is not
defined then dptids[] becomes unused.
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>
SCSI: Updating maintainers list for MPT FUSION DRIVERS.
Updating maintainers list for MPT FUSION DRIVERS, broadcom support link
and email id.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
mpt3sas: Free memory pools before retrying to allocate with different value.
Deallocate resources before reallocating of the same in retry_allocation
path of _base_allocate_memory_pools()
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@avagotech.com> Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.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>
Alan [Mon, 15 Feb 2016 19:11:56 +0000 (19:11 +0000)]
lpfc: fix missing zero termination in debugfs
If you feed 32 bytes in then the kstrtoull() doesn't receive a terminated
string so will run off the end.
Signed-off-by: Alan Cox <alan@linux.intel.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Alan [Mon, 15 Feb 2016 19:01:29 +0000 (19:01 +0000)]
esas2r: Fix array overrun
Check the array size *before* dereferencing it with a user provided
offset.
Signed-off-by: Alan Cox <alan@linux.intel.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>
Alan [Mon, 15 Feb 2016 18:53:15 +0000 (18:53 +0000)]
aic7xxx: Fix queue depth handling
We were setting the queue depth correctly, then setting it back to
two. If you hit this as a bisection point then please send me an email
as it would imply we've been hiding other bugs with this one.
Cc: <stable@vger.kernel.org> Signed-off-by: Alan Cox <alan@linux.intel.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tyrel Datwyler [Thu, 11 Feb 2016 22:24:35 +0000 (16:24 -0600)]
ibmvfc: byteswap scsi_id, wwpn, and node_name prior to logging
When logging async events the scsi_id, wwpn, and node_name values are
used directly from the CRQ struct which are of type __be64. This can be
confusing to someone looking through the log on a LE system. Instead
byteswap these values to host endian prior to logging.
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tyrel Datwyler [Thu, 11 Feb 2016 01:32:28 +0000 (19:32 -0600)]
ibmvscsi: use H_CLOSED instead of magic number
In a couple places the magic value of 2 is used to check the return code
of hypercalls. This translates to H_CLOSED.
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tyrel Datwyler [Thu, 11 Feb 2016 01:32:27 +0000 (19:32 -0600)]
ibmvscsi: Add endian conversions to sysfs attribute show functions
The values returned by the show functions for the host os_type,
mad_version, and partition_number attributes get their values directly
from the madapter_info struct whose associated fields are __be32
typed. Added endian conversion to ensure these values are sane on LE
platforms.
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tyrel Datwyler [Thu, 11 Feb 2016 01:32:26 +0000 (19:32 -0600)]
ibmvscsi: Remove unsupported host config MAD
A VIOSRP_HOST_CONFIG_TYPE management datagram (MAD) has existed in the
code for some time. From what information I've gathered from Brian King
this was likely implemented on the host side in a SLES 9 based VIOS,
which is no longer supported anywhere. Further, it is not defined in
PAPR or supported by any AIX based VIOS.
Treating as bit rot and removing the associated host config code. The
config attribute and its show function are left as not to break
userspace. The behavior remains the same returning nothing.
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tyrel Datwyler [Thu, 11 Feb 2016 01:32:25 +0000 (19:32 -0600)]
ibmvscsi: Use of_root to access OF device tree root node
The root node of the OF device tree is exported as of_root. No need to
look up the root by path name. Instead just get a reference directly via
of_root.
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tyrel Datwyler [Thu, 11 Feb 2016 01:32:23 +0000 (19:32 -0600)]
ibmvscsi: Add and use enums for valid CRQ header values
The PAPR defines four valid header values for the first byte of a CRQ
message. Namely, an unused/empty message (0x00), a valid
command/response entry (0x80), a valid initialization entry (0xC0), and
a valid transport event (0xFF). Further, initialization responses have
two formats namely initialize (0x01) and initialize complete
(0x02). Define these values as enums and use them in the code in
place of their magic number equivalents.
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Reported-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Tyrel Datwyler [Thu, 11 Feb 2016 01:32:22 +0000 (19:32 -0600)]
ibmvscsi: Correct values for several viosrp_crq_format enums
The enum values for VIOSRP_LINUX_FORMAT and VIOSRP_INLINE_FORMAT are off
by one. They are currently defined as 0x06 and 0x07 respetively. These
values are defined in PAPR correctly as 0x05 and 0x06. This
inconsistency has gone unnoticed as neither enum is currently used. The
possible future support of PING messages between the VIOS and client
adapter relies on VIOSRP_INLINE_FORMAT crq messages. Corrected these
enum values to match PAPR definitions.
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
mpt3sas: Remove cpumask_clear for zalloc_cpumask_var and don't free free_cpu_mask_var before reply_q
Removed cpumask_clear as it is not required for zalloc_cpumask_var and
free free_cpumask_var before freeing reply_q.
Signed-off-by: Suganath prabu Subramani <suganath-prabu.subramani@broadcom.com> Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
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>
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>
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.
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.
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.
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.
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.
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.
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.
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.
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>
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: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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>