Brian King [Thu, 15 Mar 2012 02:20:06 +0000 (21:20 -0500)]
[SCSI] ipr: Fix target id allocation re-use problem
For the latest ipr SAS adapters, target id's are a completely
logical construct that are managed in the ipr driver. This fixes
an issue that can arise if a device is deleted via sysfs. If
a new device is then physically added, it will use the previous
device's target id. If the host is then rescanned, the device
that had been deleted, since it is using the same target id as
the new device is using, will never be found, resulting in
a missing device. Fix this by only freeing the target id
only if the resource is actually gone.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Sergei Shtylyov [Wed, 14 Mar 2012 19:04:30 +0000 (22:04 +0300)]
[SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revision
commit
44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (PCI: Change all
drivers to use pci_device->revision) converted all drivers to use
pci_dev->revision. Convert these three drivers which got missed.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Robert Love [Wed, 14 Mar 2012 01:22:12 +0000 (18:22 -0700)]
[SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up
The rtnl_lock is primarily used to serialize networking
driver changes as well as to ensure that a networking driver
is not removed when making changes to it. fcoe also uses
the rtnl_lock to protect the fcoe hostlist.
fcoe_create holds the rtnl_lock over the entirity of the
routine including a the call to fcoe_ctlr_link_up.
This causes the below deadlock because fcoe_ctlr_link_up
acquires the fcoe_ctlr ctlr_mutex and this deadlocks with
a libfcoe thread that acquires the fcoe_ctlr ctlr_mutex and
then the rtnl_lock (to update a MAC address).
This patch drops the rtnl_lock before calling
fcoe_ctlr_link_up and therefore the deadlock is prevented.
https://bugzilla.kernel.org/show_bug.cgi?id=42918
the existing dependency chain (in reverse order) is:
-> #1 (&fip->ctlr_mutex){+.+...}:
[<
c1091f70>] lock_acquire+0x80/0x1b0
[<
c147655d>] mutex_lock_nested+0x6d/0x340
[<
f8970c32>] fcoe_ctlr_link_up+0x22/0x180 [libfcoe]
[<
f894620e>] fcoe_create+0x47e/0x6e0 [fcoe]
[<
f8973dd3>] fcoe_transport_create+0x143/0x250 [libfcoe]
[<
c10527e0>] param_attr_store+0x30/0x60
[<
c1052696>] module_attr_store+0x26/0x40
[<
c11a201e>] sysfs_write_file+0xae/0x100
[<
c11449df>] vfs_write+0x8f/0x160
[<
c1144cbd>] sys_write+0x3d/0x70
[<
c147a0c4>] syscall_call+0x7/0xb
-> #0 (rtnl_mutex){+.+.+.}:
[<
c109164b>] __lock_acquire+0x140b/0x1720
[<
c1091f70>] lock_acquire+0x80/0x1b0
[<
c147655d>] mutex_lock_nested+0x6d/0x340
[<
c13a10c4>] rtnl_lock+0x14/0x20
[<
f89445ac>] fcoe_update_src_mac+0x2c/0xb0 [fcoe]
[<
f8971712>] fcoe_ctlr_timer_work+0x712/0xb60 [libfcoe]
[<
c104fb69>] process_one_work+0x179/0x5d0
[<
c10502f1>] worker_thread+0x121/0x2d0
[<
c10550ed>] kthread+0x7d/0x90
[<
c1481a82>] kernel_thread_helper+0x6/0x10
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&fip->ctlr_mutex);
lock(rtnl_mutex);
lock(&fip->ctlr_mutex);
lock(rtnl_mutex);
*** DEADLOCK ***
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:41:25 +0000 (17:41 -0700)]
[SCSI] bfa: Update the driver version to 3.0.23.0
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:41:02 +0000 (17:41 -0700)]
[SCSI] bfa: BSG and User interface fixes.
Made changes to set the rport maxfrsize param to use a value that is
equal to or less than the Buffer-to-Buffer Receive Data_Field size
specified in the Common Service Parameters.
Increased the diag memtest timeout for the Brocade-1860 adapters.
Made changes to enable valid port speed configuration check for all adapters.
Made changes to increase the max hw segments in a request, in order to
support larger data transfers from user space.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:40:31 +0000 (17:40 -0700)]
[SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario.
Fixed the LPS (Logical Port Services) state machine to send a
FDISC/FLOGI to the FW from the request queue wait state, when
there is space available again on the request queue.
Made changes to free the vport on LOGO/cleanup complete instead
of free'ing it from vport_delete_handler in the module unload scenario.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:40:01 +0000 (17:40 -0700)]
[SCSI] bfa: Move service parameter programming logic into firmware.
Programming of the service parameters Tx credits etc., is now done in firmware.
Remove the logic of sending the service parameters to firmware from driver.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:39:36 +0000 (17:39 -0700)]
[SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.
Made changes to the Fabric Assigned Address(FAA) feature implementation.
Introduced the IOCFC state machine, which now handles the FAA logic,
IOC and BFA sub-modules enablement.
Removed un-wanted FAA enable/disable routines; FAA is enabled by default.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:39:22 +0000 (17:39 -0700)]
[SCSI] bfa: Flash controller IOC pll init fixes.
Made changes to resume the flash controller if it is halted before going
ahead with flash controller pause/resume logic.
Made changes to avoid clearing off the interrupts during the initial
pll initialization.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:38:56 +0000 (17:38 -0700)]
[SCSI] bfa: Serialize the IOC hw semaphore unlock logic.
Made changes to ensure only the function that comes first will execute
the IOC hw semaphore unlock logic.
Used IOC init sem register to serialize execution of the unlock logic.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:38:15 +0000 (17:38 -0700)]
[SCSI] bfa: Modify ISR to process pending completions
Made changes to the driver ISR to process any pending completions even if
the RME bit is not set in the interrupt status register.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Krishna Gudipati [Wed, 14 Mar 2012 00:37:26 +0000 (17:37 -0700)]
[SCSI] bfa: Add fc host issue lip support
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Sathisha Nanjappa [Tue, 13 Mar 2012 18:59:28 +0000 (11:59 -0700)]
[SCSI] mpt2sas: remove extraneous sas_log_info messages
This fix ensures that the IOP_LOGINFO_CODE_TASK_TERMINATED
messages do not clutter the sas_log_info messages.
Bugzilla 42142 - mpt2sas: Number specified in wrong base
https://bugzilla.kernel.org/show_bug.cgi?id=42142
Signed-off-by: Sathisha Nanjappa <sathisha.nanjappa@hp.com>
Acked-by: "Nandigama, Nagalakshmi" <Nagalakshmi.Nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Steven Clark [Fri, 9 Mar 2012 22:50:30 +0000 (14:50 -0800)]
[SCSI] libfc: fcoe_transport_create fails in single-CPU environment
Starting fcoe fails at fcoe_transport_create when attempting to allocate a
pool of 4K exchanges on a 64-bit single-CPU environment because the call to
__alloc_percpu() is greater than the max of 32K. This patch reduces the
number of exchanges to fit within the maximum allowed space.
[ Whitespace problems fixed by Robert Love to satisfy chechpatch.pl ]
Signed-off-by: Steven Clark <sclark@crossbeam.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Neil Horman [Fri, 9 Mar 2012 22:50:24 +0000 (14:50 -0800)]
[SCSI] fcoe: reduce contention for fcoe_rx_list lock [v2]
There is potentially lots of contention for the rx_list_lock. On a cpu that is
receiving lots of fcoe traffic, the softirq context has to add and release the
lock for every frame it receives, as does the receiving per-cpu thread. We can
reduce this contention somewhat by altering the per-cpu threads loop such that
when traffic is detected on the fcoe_rx_list, we splice it to a temporary list.
In this way, we can process multiple skbs while only having to acquire and
release the fcoe_rx_list lock once.
[ Braces around single statement while loop removed by Robert Love
to satisfy checkpath.pl. ]
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Neil Horman [Fri, 9 Mar 2012 22:50:19 +0000 (14:50 -0800)]
[SCSI] fcoe: remove frame dropping code from fcoe_percpu_clean
commit
e7a51997dad4e17395be1209970e18d2e9305b24 ([SCSI] fcoe: flush per-cpu
thread work when destroying interface) added a skb flush to the fcoe_rx_list,
which ensures that we push any pending frames on the list through the per-cpu
receive thread. Because of this, its redundant to lock and scan the list
first, dropping any arriving frames.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Neil Horman [Fri, 9 Mar 2012 22:50:13 +0000 (14:50 -0800)]
[SCSI] bnx2fc: Remove bh disable in softirq context
As with the fcoe sw transport, the bnx2fc packet handler function runs only in
softirq context. Theres no need to disable bottom halves here
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Neil Horman [Fri, 9 Mar 2012 22:50:08 +0000 (14:50 -0800)]
[SCSI] foce: remove bh disable from fcoe sw transport rcv function
The fcoe sw recive packet function (fcoe_rcv) only ever executes in softirq
context. Given that, and the fact that no use of the fcoe_rx_list is made in
irq context, its not necessecary to disable bottom halves while actually
receiving the frame. Convert spin_*_bh calls in that function to their
lock-only equivalents
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Bhanu Prakash Gollapudi [Fri, 9 Mar 2012 22:50:03 +0000 (14:50 -0800)]
[SCSI] libfcoe: Support extra MAC descriptor to be used as FCoE MAC
Some switch implementations (eg., HP virtual connect FlexFabric) send two MAC
descriptors in FIP FLOGI response, with first MAC descriptor (granted_mac) used
as FPMA, and the second one (fcoe_mac) used as destination address for
sending/receiving FCoE packets. fip_mac continues to be used for FIP traffic.
This patch introduces fcoe_mac in fcoe_fcf structure. For regular switches,
both fcoe_mac and fip_mac will be the same. For the switches that send
additional MAC descriptor, fcoe_mac is updated.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vasu Dev [Fri, 9 Mar 2012 22:49:58 +0000 (14:49 -0800)]
[SCSI] libfc: update fc_host mfs along with updating lport->mfs
Currently fc_host mfs is not getting updated in
case its changed during FLOGI and that leaves fc_host
to show its initial old value in sysfs, so instead
have fc_host mfs updated along with updating lport mfs
during FLOGI.
Also in case of bad mfs during flogi, error out
instead of continuing with flogi.
[ Changes made by Robert Love: condition to '>=' and
added printing of lport->mfs in DBG statement. FLOGI
resp processing failed without being able to compare
FCoE MFS 2112 against an incoming MFS of 2112 ]
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Bhanu Prakash Gollapudi [Fri, 9 Mar 2012 22:49:53 +0000 (14:49 -0800)]
[SCSI] libfcoe: Do not sends FDISCs before FLOGI during CVL
When handling CVL with no Vx port descriptors, lports for NPIV ports are reset
before issuing the ctlr_reset. This causes FDISCs to be issued before
successful FLOGI. Fix it by resetting the controller before resetting the
lports.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Neil Horman [Fri, 9 Mar 2012 22:49:48 +0000 (14:49 -0800)]
[SCSI] fcoe: Ensure fcoe_recv_frame is always called in process context
commit
859b7b649ab58ee5cbfb761491317d5b315c1b0f introduced the ability to call
fcoe_recv_frame in softirq context. While this is beneficial to performance,
its not safe to do, as it breaks the serialization of access to the lport
structure (i.e. when an fcoe interface is being torn down, theres no way to
serialize the teardown effort with the completion of receieve operations
occuring in softirq context. As a result, lport (and other) data structures can
be read and modified in parallel leading to corruption. Most notable is the
vport list, which is protected by a mutex, that will cause a panic if a softirq
receive while said mutex is locked. Additionaly, the ema_list, discussed here:
http://lists.open-fcoe.org/pipermail/devel/2012-February/011947.html
Can be corrupted if a list traversal occurs in softirq context at the same time
as a list delete in process context. And generally the lport state variables
will not be stable, and may lead to unpredictable results.
The most direct fix is to remove the bits from the above commit that allowed
fcoe_recv_frame to be called in softirq context. We just force all frames to be
handled by the per-cpu rx threads. This will allow the fcoe_if_destroy's use of
fcoe_percpu_clean to function properly, ensuring that no frames are being
received while the lport is being torn down.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Santosh Nayak [Fri, 9 Mar 2012 08:13:38 +0000 (13:43 +0530)]
[SCSI] pm8001: Use spin_lock_irqsave() for task_state.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Arvind Kumar [Thu, 8 Mar 2012 10:18:53 +0000 (15:48 +0530)]
[SCSI] vmw_pvscsi: Try setting host->max_id as suggested by the device.
Fetch the config page from the device to learn max target id to set
host->max_id.
Also, fix some indentation issues and update the 'Maintained by' field.
Signed-off-by: Arvind Kumar <arvindkumar@vmware.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Martin K. Petersen [Thu, 8 Mar 2012 15:48:29 +0000 (10:48 -0500)]
[SCSI] scsi_debug: Fix incorrect page length in logical block provisioning VPD
The page length for the 0xb2 VPD page is defined to be 4 bytes when no
provisioning descriptors are provided (DP=0).
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Eric Sandeen [Thu, 8 Mar 2012 06:03:59 +0000 (00:03 -0600)]
[SCSI] scsi_debug: add LBPRZ support
Add LBPRZ support to scsi_debug; i.e. read zeros for
unmapped blocks.
Rather than checking for unmapped blocks at
read time, this just zeroes them on the backing store
at unmap time so it behaves the same way.
This also adds a module parameter to disable it.
lbprz, "unmapped blocks return 0 on read (def=1)"
[jejb: fix whitespace errors]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Mike Christie [Tue, 6 Mar 2012 22:09:01 +0000 (16:09 -0600)]
[SCSI] iscsi class: fix gfp use in ping compl and host event
If a ping or host event were to occur when memory is low
we do not want to use GFP_KERNEL, because the paths
sending them cannot block for data to be written. These
paths might be needed to recover write paths. Use GFP_NOIO
instead.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Santosh Nayak [Tue, 6 Mar 2012 17:06:59 +0000 (22:36 +0530)]
[SCSI] bfa: Fix endian bug in bfad_iocmd_debug_fw_core().
Casting pointer from native data type to other type is
endian-sensitive.
"iocmd->offset" is 64 bit but we use only first 32 bit.
It works in little-endian system but in big-endian system
it will break.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Acked-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Tue, 6 Mar 2012 12:16:06 +0000 (04:16 -0800)]
[SCSI] qla4xxx: Update driver version to 5.02.00-k16
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Tue, 6 Mar 2012 12:16:05 +0000 (04:16 -0800)]
[SCSI] qla4xxx: Removed packed attr from struct iscsi_chap_rec
We don't need to pack 'struct iscsi_chap_rec' as buffer is built
locally in the driver and pass to the user-space.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Tue, 6 Mar 2012 12:16:04 +0000 (04:16 -0800)]
[SCSI] iscsi_transport: Added error status code for ping comp event
Defined error codes for ping completion status.
This patch take care of Mike Christie's commets
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Fri, 2 Mar 2012 09:55:31 +0000 (01:55 -0800)]
[SCSI] qla4xxx: assign correct address for iscsi_cls_host
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Lee Duncan [Thu, 1 Mar 2012 20:41:01 +0000 (12:41 -0800)]
[SCSI] st: expand ability to write immediate filemarks
The st tape driver recently added the MTWEOFI ioctl, which writes
a tape filemark (EOF), like the MTWEOF ioctl, except that MTWEOFI
returns immediately. This makes certain applications, like backup
software, run much more quickly on buffered tape drives.
Since legacy applications do not know about this new MTWEOFI ioctl,
this patch adds a new ioctl option that tells the st driver to return
immediately when writing an EOF (i.e. a filemark). This new flag
is much like the existing flag that tells the st driver to perform
writes (and certain other IOs) immediately, but this new flag only
applies to writing EOFs.
This new feature is controlled via the MTSETDRVBUFFER ioctl, using
the newly-defined MT_ST_NOWAIT_EOF flag.
Use of this new feature is displayed via the sysfs tape "options"
attribute.
The st documentation was updated to mention this new flag, as well
as the problems that can occur from using it.
Signed-off-by: Lee Duncan <lduncan@suse.com>
Acked-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:38:52 +0000 (22:38 -0500)]
[SCSI] lpfc 8.3.30: Update lpfc to version 8.3.30
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:38:42 +0000 (22:38 -0500)]
[SCSI] lpfc 8.3.30: Revert fix for Link Pull Causes I/O Failures
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:38:29 +0000 (22:38 -0500)]
[SCSI] lpfc 8.3.30: Added more T10 DIF debugfs error injection
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:38:13 +0000 (22:38 -0500)]
[SCSI] lpfc 8.3.30: Update copyright date for files modified in 2012
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:37:54 +0000 (22:37 -0500)]
[SCSI] lpfc 8.3.30: Fix handling of REG_VFI and cable pull.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:37:42 +0000 (22:37 -0500)]
[SCSI] lpfc 8.3.30: Enhancements for T10 DIF debugfs error injection
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:37:32 +0000 (22:37 -0500)]
[SCSI] lpfc 8.3.30: Change default DA_ID support from disabled to enabled
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:37:18 +0000 (22:37 -0500)]
[SCSI] lpfc 8.3.30: Flush reset register write
Used PCI configure space read to flush PCI function reset register write
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:37:07 +0000 (22:37 -0500)]
[SCSI] lpfc 8.3.30: Update copyright date for files modified in 2012
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:36:54 +0000 (22:36 -0500)]
[SCSI] lpfc 8.3.30: Fixed panic with extents and small blocks
Fixed system panic when extents enabled with large number of small blocks
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:36:40 +0000 (22:36 -0500)]
[SCSI] lpfc 8.3.30: Add -Werror compilation flag
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:36:29 +0000 (22:36 -0500)]
[SCSI] lpfc 8.3.30: Fixed the system panic during EEH recovery
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:36:15 +0000 (22:36 -0500)]
[SCSI] lpfc 8.3.30: Fix resource leak when acc fails for received plogi
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:35:58 +0000 (22:35 -0500)]
[SCSI] lpfc 8.3.30: Fix SLI4 driver module load and unload
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:35:45 +0000 (22:35 -0500)]
[SCSI] lpfc 8.3.30: Fixed missing CVL event causing FCF failover
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:35:34 +0000 (22:35 -0500)]
[SCSI] lpfc 8.3.30: Fix deadlock during adapter offline request
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:35:23 +0000 (22:35 -0500)]
[SCSI] lpfc 8.3.30: Fix RPI registered multiple times after HBA reset
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:34:36 +0000 (22:34 -0500)]
[SCSI] lpfc 8.3.30: Fix driver handling of XRI Aborted CQE response
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:34:19 +0000 (22:34 -0500)]
[SCSI] lpfc 8.3.30: Fix port and system failure in SLI4 FC function reset
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:33:52 +0000 (22:33 -0500)]
[SCSI] lpfc 8.3.30: Fix lack of LOGO with vport delete.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
James Smart [Fri, 2 Mar 2012 03:33:29 +0000 (22:33 -0500)]
[SCSI] lpfc 8.3.30: Make BA_ACC work on a fully qualified exchange
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Petr Uzel [Fri, 24 Feb 2012 15:56:54 +0000 (16:56 +0100)]
[SCSI] sd: make comment and printk string match code
Adapt comment and printk string after renaming sd_init_command to sd_prep_fn
Adapt comment and printk string after renaming sd_attach to sd_probe
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Santosh Yaraganavi [Wed, 29 Feb 2012 06:41:50 +0000 (12:11 +0530)]
[SCSI] ufshcd: UFS Host controller driver
This patch adds support for Universal Flash Storage(UFS)
host controllers. The UFS host controller driver
includes host controller initialization method.
The Initialization process involves following steps:
- Initiate UFS Host Controller initialization process by writing
to Host controller enable register
- Configure UFS Host controller registers with host memory space
datastructure offsets.
- Unipro link startup procedure
- Check for connected device
- Configure UFS host controller to process requests
- Enable required interrupts
- Configure interrupt aggregation
[jejb: fix warnings in 32 bit compile]
Signed-off-by: Santosh Yaraganavi <santoshsy@gmail.com>
Signed-off-by: Vinayak Holikatti <vinholikatti@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@linaro.org>
Reviewed-by: Vishak G <vishak.g@samsung.com>
Reviewed-by: Girish K S <girish.shivananjappa@linaro.org>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Petr Uzel [Fri, 24 Feb 2012 15:32:59 +0000 (16:32 +0100)]
[SCSI] qla4xxx: Add missing spaces to error messages
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Lan Tianyu [Thu, 15 Mar 2012 03:11:31 +0000 (11:11 +0800)]
[SCSI] sd: Add runtime pm in the sd_check_events()
The sd_check_event() will be called periodly even when the device is in the
suspended status to check media event. The scsi_test_unit_ready() in the
sd_check_event() will issue scsi cmd request. Issuing scsi request when the
device is in the suspeneded status will cause problem. For example, when a usb
flash disk in the suspended status, scsi_test_unit_ready() issues a scsi
request. The request will be returned as failed because the usb device is not
active. The patch adds scsi_autopm_get_device() and scsi_autopm_put_device()
around scsi_test_unit_ready() in the sd_check_event() to resolve such problem.
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Mon, 27 Feb 2012 11:08:58 +0000 (03:08 -0800)]
[SCSI] qla4xxx: Update driver version to 5.02.00-k15
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Mon, 27 Feb 2012 11:08:57 +0000 (03:08 -0800)]
[SCSI] qla4xxx: trivial cleanup
1. Do not initialise globals to 0
2. Fix wrong spelling in debug message
3. Modified debug log messages
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Vikas Chaudhary [Mon, 27 Feb 2012 11:08:56 +0000 (03:08 -0800)]
[SCSI] qla4xxx: Fix sparse warning
Fix following warning:-
drivers/scsi/qla4xxx/ql4_os.c:35:5: warning: symbol 'ql4xdisablesysfsboot' was not declared. Should it be static?
drivers/scsi/qla4xxx/ql4_iocb.c:461:5: warning: symbol 'qla4xxx_send_mbox_iocb' was not declared. Should it be static?
drivers/scsi/qla4xxx/ql4_os.c:3025:6: warning: symbol 'qla4xxx_do_work' was not declared. Should it be static?
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Manish Rangankar [Mon, 27 Feb 2012 11:08:55 +0000 (03:08 -0800)]
[SCSI] qla4xxx: Add support for multiple session per host.
This patch will allow iscsiadm to create multiple session
for the same target on per host.
Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Mike Christie [Mon, 27 Feb 2012 11:08:54 +0000 (03:08 -0800)]
[SCSI] qla4xxx: Export CHAP index as sysfs attribute
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Mike Christie [Mon, 27 Feb 2012 11:08:53 +0000 (03:08 -0800)]
[SCSI] scsi_transport: Export CHAP index as sysfs attribute
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Nilesh Javali [Mon, 27 Feb 2012 11:08:52 +0000 (03:08 -0800)]
[SCSI] qla4xxx: Add support to display CHAP list and delete CHAP entry
For offload iSCSI like qla4xxx CHAP entries are stored in FLASH.
This patch adds support to list CHAP entries stored in FLASH and
delete specified CHAP entry from FLASH using iscsi tools.
Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Nilesh Javali [Mon, 27 Feb 2012 11:08:51 +0000 (03:08 -0800)]
[SCSI] iscsi_transport: Add support to display CHAP list and delete CHAP entry
For offload iSCSI like qla4xxx CHAP entries are stored in FLASH.
This patch adds support to list CHAP entries stored in FLASH and
delete specified CHAP entry from FLASH using iscsi tools.
Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Santosh Nayak [Sun, 26 Feb 2012 14:44:46 +0000 (20:14 +0530)]
[SCSI] pm8001: fix endian issue with code optimization.
1. Fix endian issue.
2. Fix the following warning :
" drivers/scsi/pm8001/pm8001_hwi.c:2932:32: warning: comparison
between ‘enum sas_device_type’ and ‘enum sas_dev_type’".
3. Few code optimization.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Santosh Nayak [Sun, 26 Feb 2012 13:35:03 +0000 (19:05 +0530)]
[SCSI] pm8001: Fix possible racing condition.
There is a possble racing scenario.
'process_oq' is called by two routines, as shown below.
pm8001_8001_dispatch = {
.......
.isr = pm8001_chip_isr --> process_oq,// A
.isr_process_oq = process_oq, // B
.....
}
process_oq() --> process_one_iomb() --> mpi_sata_completion()
In 'mpi_sata_completion', "pm8001_ha->lock" is first released.
It means lock is taken before, which is true for
the context A, as 'pm8001_ha->lock' is taken in 'pm8001_chip_isr()'
But for context B there is no lock taken before and pm8001_ha->lock
is unlocked in 'mpi_sata_completion()'. This may unlock the lock
taken in context A. Possible racing ??
If 'pm8001_ha->lock' is taken in 'process_oq()' instead of
'pm8001_chip_isr' then the above issue can be avoided.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Santosh Nayak [Sun, 26 Feb 2012 13:33:30 +0000 (19:03 +0530)]
[SCSI] pm8001: Fix bogus interrupt state flag issue.
Static checker is giving following warning:
" error: calling 'spin_unlock_irqrestore()' with bogus flags"
The code flow is as shown below:
process_oq() --> process_one_iomb --> mpi_sata_completion
In 'mpi_sata_completion'
the first call for 'spin_unlock_irqrestore()' is with flags=0,
which is as good as 'spin_unlock_irq()' ( unconditional interrupt
enabling).
So for better performance 'spin_unlock_irqrestore()' can be replaced
with 'spin_unlock_irq()' and 'spin_lock_irqsave()' can be replaced by
'spin_lock_irq()'.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Wayne Boyer [Thu, 23 Feb 2012 19:54:55 +0000 (11:54 -0800)]
[SCSI] ipr: update PCI ID definitions for new adapters
This patch updates some PCI ID definitions for new adapters based on the next
generation 64 bit IOA PCI interface chip.
Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Carpenter [Tue, 21 Feb 2012 07:29:40 +0000 (10:29 +0300)]
[SCSI] qla2xxx: handle default case in qla2x00_request_firmware()
This silences a static checker warning. Also we're always adding new
types of firmware, so it might fix a bug in real life some day.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Andrzej Jakowski [Fri, 10 Feb 2012 09:18:54 +0000 (01:18 -0800)]
[SCSI] isci: improvements in driver unloading routine
This patch fixes scenario where driver removal should be possible
only when driver is in READY state. Also it removes redundant
invocation of routine disabling SCU interrupts - this method is
called somewhere else in driver deinitialization path.
Signed-off-by: Andrzej Jakowski <andrzej.jakowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Fri, 10 Feb 2012 09:18:49 +0000 (01:18 -0800)]
[SCSI] isci: improve phy event warnings
isci occasionally spews messages like:
isci 0000:03:00.0: sci_phy_event_handler: PHY starting substate machine received unexpected event_code
b3940000
...which is not very helpful, since we don't know which controller,
which phy, the exact state, or a decode of the event.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Fri, 10 Feb 2012 09:18:44 +0000 (01:18 -0800)]
[SCSI] isci: debug, provide state-enum-to-string conversions
Debugging the driver requires tracing the state transtions and tracing
state names is less work than decoding numbers.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Tue, 31 Jan 2012 06:53:51 +0000 (22:53 -0800)]
[SCSI] scsi_transport_sas: 'enable' phys on reset
If userspace requests a phy reset, treat that as a request for the phy
to be enabled since that is the effect on hardware.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Tue, 31 Jan 2012 05:40:45 +0000 (21:40 -0800)]
[SCSI] libsas: don't recover end devices attached to disabled phys
If userspace has decided to disable a phy the kernel should honor that
and not inadvertantly re-enable the phy via error recovery. This is
more straightforward in the sata case where link recovery (via
libata-eh) is separate from sas_task cancelling in libsas-eh. Teach
libsas to accept -ENODEV as a successful response from I_T_nexus_reset
('successful' in terms of not escalating further).
This is a more comprehensive fix then "libsas: don't recover 'gone'
devices in sas_ata_hard_reset()", as it is no longer sata-specific.
aic94xx does check the return value from sas_phy_reset() so if the phy
is disabled we proceed with clearing the I_T_nexus.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Thu, 9 Feb 2012 07:20:41 +0000 (23:20 -0800)]
[SCSI] libsas: fixup target_port_protocols for expanders that don't report sata
If discovery returns 0 for target_port_protocols but shows an attached
sata device, just report SAS_PROTOCOL_SATA in the identify data so
userspace can reliably search for sata devices in the domain.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Sun, 29 Jan 2012 01:24:40 +0000 (17:24 -0800)]
[SCSI] libsas: set attached device type and target protocols for local phys
Before:
$ cat /sys/class/sas_phy/phy-6\:3/device_type
none
$ cat /sys/class/sas_phy/phy-6\:3/target_port_protocols
none
After:
$ cat /sys/class/sas_phy/phy-6\:3/device_type
end device
$ cat /sys/class/sas_phy/phy-6\:3/target_port_protocols
sata
Also downgrade the phy_list_lock to _irq instead of _irqsave since
libsas will never call sas_get_port_device with interrupts disbled.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Fri, 20 Jan 2012 23:26:03 +0000 (15:26 -0800)]
[SCSI] libsas: revert ata srst
libata issues follow up srsts when the controller has a hard time
recording the signature-fis after a reset, or if the link supports port
multipliers. libsas does not support port multipliers and no current
libsas lldds appear to need help retrieving the signature fis. Revert
it for now to remove confusion.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Fri, 20 Jan 2012 23:23:07 +0000 (15:23 -0800)]
[SCSI] libsas: fix lifetime of SAS_HA_FROZEN
Until all sas_tasks are known to no longer be in-flight this flag gates late
completions from colliding with error handling. However, it must be cleared
prior to the submission of scsi_send_eh_cmnd() requests, otherwise those
commands will never be completed correctly.
This was spotted by slub debug:
=============================================================================
BUG sas_task: Objects remaining on kmem_cache_close()
-----------------------------------------------------------------------------
INFO: Slab 0xffffea001f0eba00 objects=34 used=1 fp=0xffff8807c3aecb00 flags=0x8000000000004080
Pid: 22919, comm: modprobe Not tainted 3.2.0-isci+ #2
Call Trace:
[<
ffffffff810fcdcd>] slab_err+0xb0/0xd2
[<
ffffffff810e1c50>] ? free_percpu+0x31/0x117
[<
ffffffff81100122>] ? kzalloc+0x14/0x16
[<
ffffffff81100122>] ? kzalloc+0x14/0x16
[<
ffffffff81100486>] kmem_cache_destroy+0x11d/0x270
[<
ffffffffa0112bdc>] sas_class_exit+0x10/0x12 [libsas]
[<
ffffffff81078fba>] sys_delete_module+0x1c4/0x23c
[<
ffffffff814797ba>] ? sysret_check+0x2e/0x69
[<
ffffffff8126479e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<
ffffffff81479782>] system_call_fastpath+0x16/0x1b
INFO: Object 0xffff8807c3aed280 @offset=21120
INFO: Allocated in sas_alloc_task+0x22/0x90 [libsas] age=
4615311 cpu=2 pid=12966
__slab_alloc.clone.3+0x1d1/0x234
kmem_cache_alloc+0x52/0x10d
sas_alloc_task+0x22/0x90 [libsas]
sas_queuecommand+0x20e/0x230 [libsas]
scsi_send_eh_cmnd+0xd1/0x30c
scsi_eh_try_stu+0x4f/0x6b
scsi_eh_ready_devs+0xba/0x6ef
sas_scsi_recover_host+0xa35/0xab1 [libsas]
scsi_error_handler+0x14b/0x5fa
kthread+0x9d/0xa5
kernel_thread_helper+0x4/0x10
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Thu, 19 Jan 2012 04:47:01 +0000 (20:47 -0800)]
[SCSI] libsas: async ata scanning
libsas ata error handling is already async but this does not help the
scan case. Move initial link recovery out from under host->scan_mutex,
and delay synchronization with eh until after all port probe/recovery
work has been queued.
Device ordering is maintained with scan order by still calling
sas_rphy_add() in order of domain discovery.
Since we now scan the domain list when invoking libata-eh we need to be
careful to check for fully initialized ata ports.
Acked-by: Jack Wang <jack_wang@usish.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Thu, 19 Jan 2012 04:14:01 +0000 (20:14 -0800)]
[SCSI] libsas: restore scan order
ata devices are always scanned after ssp. Prior to the ata error
handling reworks libsas would tend to scan devices in ascending expander
phy order. Restore this ordering by deferring ssp discovery to a
DISCE_PROBE event, and keep the probe order consistent with the
discovery order, not the placement of sata devices.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Fri, 20 Jan 2012 02:43:08 +0000 (18:43 -0800)]
[SCSI] libsas: delete device on sas address changed
If the phy is attached to a new sas address unregister the first address
before processing the new attachment.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Fri, 13 Jan 2012 01:57:35 +0000 (17:57 -0800)]
[SCSI] libsas: let libata recover links that fail to transmit initial sig-fis
libsas fails to discover all sata devices in the domain. If a device fails
negotiation and does not transmit a signature fis the link needs recovery.
libata already understands how to manage slow to come up links, so treat these
conditions as ata device attach events for the purposes of creating an
ata_port. This allows libata to manage retrying link bring up.
Rediscovery is modified to be careful about checking changes in dev_type. It
looks like libsas leaks old devices if the sas address changes, but that's a
fix for another patch.
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Mon, 16 Jan 2012 21:54:28 +0000 (13:54 -0800)]
[SCSI] libsas: fix sas port naming
Make sas-port naming consistent with the expander-attached case whereby
the phy-id is the last digit in the port name. Otherwise we get the
random behavior of the allocation order.
Reported-by: Patrick Thomson <patrick.s.thomson@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Mon, 16 Jan 2012 19:56:50 +0000 (11:56 -0800)]
[SCSI] libsas: improve debug statements
It's difficult to determine which domain_device is triggering error recovery,
so convert messages like:
sas: ex
5001b4da000e703f phy08:T attached:
5001b4da000e7028
sas: ex
5001b4da000e703f phy09:T attached:
5001b4da000e7029
...
ata7: sas eh calling libata port error handler
ata8: sas eh calling libata port error handler
...into:
sas: ex
5001517e85cfefff phy05:T:9 attached:
5001517e85cfefe5 (stp)
sas: ex
5001517e3b0af0bf phy11:T:8 attached:
5001517e3b0af0ab (stp)
...
sas: ata7: end_device-21:1: dev error handler
sas: ata8: end_device-20:0:5: dev error handler
which shows attached link rate, device type, and associates a
domain_device with its ata_port id to correlate messages emitted from
libata-eh.
As Doug notes, we can also take the opportunity to clarify expander phy
routing capabilities.
[dgilbert@interlog.com: clarify table2table with 'U']
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Maciej Trela [Fri, 13 Jan 2012 21:52:38 +0000 (21:52 +0000)]
[SCSI] libsas: kill spurious sas_put_device
Holdover from a patch rework, prior to the addition of SAS_DEV_DESTROY
we were holding a reference while the destruct was pending in case the
domain was torn down before the desctruct event ran. That case is
covered by SAS_DEV_DESTROY, and the sas_put_device() just corrupts freed
memory, or worse frees the memory while another agent holds a reference.
Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Thu, 12 Jan 2012 19:47:24 +0000 (11:47 -0800)]
[SCSI] libsas: fix sas_unregister_ports vs sas_drain_work
We need to hold drain_mutex across the unregistration as port down events
queue device removal as chained events, so we need to make sure no other
drainers are active.
[ 1118.673968] WARNING: at kernel/workqueue.c:996 __queue_work+0x11a/0x326()
[ 1118.681982] Hardware name: S2600CP
[ 1118.686193] Modules linked in: isci(-) libsas scsi_transport_sas nls_utf8
ipv6 uinput sg iTCO_wdt iTCO_vendor_support i2c_i801 i2c_core ioatdma dca
sd_mod sr_mod cdrom ahci libahci libata [last unloaded: scsi_transport_sas]
[ 1118.709893] Pid: 6831, comm: rmmod Not tainted 3.2.0-isci+ #1
[ 1118.716727] Call Trace:
[ 1118.719867] [<
ffffffff8103e9f5>] warn_slowpath_common+0x85/0x9d
[ 1118.727000] [<
ffffffff8103ea27>] warn_slowpath_null+0x1a/0x1c
[ 1118.733942] [<
ffffffff81056d44>] __queue_work+0x11a/0x326
[ 1118.740481] [<
ffffffff81056f99>] queue_work_on+0x1b/0x22
[ 1118.746925] [<
ffffffff81057106>] queue_work+0x37/0x3e
[ 1118.753105] [<
ffffffffa0120e05>] ? sas_discover_event+0x55/0x82 [libsas]
[ 1118.761094] [<
ffffffff813217c3>] scsi_queue_work+0x42/0x44
[ 1118.767717] [<
ffffffffa0120e19>] sas_discover_event+0x69/0x82 [libsas]
[ 1118.775509] [<
ffffffffa0120f5b>] sas_unregister_dev+0xc3/0xcc [libsas]
[ 1118.783319] [<
ffffffffa0120fae>] sas_unregister_domain_devices+0x4a/0xc8 [libsas]
[ 1118.792731] [<
ffffffffa0120071>] sas_deform_port+0x60/0x1a6 [libsas]
[ 1118.800339] [<
ffffffffa01201ea>] sas_unregister_ports+0x33/0x44 [libsas]
[ 1118.808342] [<
ffffffffa011f7e5>] sas_unregister_ha+0x41/0x6b [libsas]
[ 1118.816055] [<
ffffffffa0134055>] isci_unregister+0x22/0x4d [isci]
[ 1118.823384] [<
ffffffffa0143040>] isci_pci_remove+0x2e/0x60 [isci]
Reported-by: Jacek Danecki <jacek.danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Wed, 11 Jan 2012 21:13:44 +0000 (13:13 -0800)]
[SCSI] libsas: route local link resets through ata-eh
Similar to the conversion of the transport-class reset we want bsg
initiated resets to be managed by libata.
Reported-by: Jacek Danecki <jacek.danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Wed, 11 Jan 2012 20:08:36 +0000 (12:08 -0800)]
[SCSI] libsas: fix mixed topology recovery
If we have a domain with sas and sata devices there may still be sas
recovery actions to take after peeling off the commands to send to
libata.
Reported-by: Andrzej Jakowski <andrzej.jakowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Tue, 10 Jan 2012 23:14:09 +0000 (15:14 -0800)]
[SCSI] libsas: close scsi_remove_target() vs libata-eh race
ata_port lifetime in libata follows the host. In libsas it follows the
scsi_target. Once scsi_remove_device() has caused all commands to be
completed it allows scsi_remove_target() to immediately proceed to
freeing the ata_port causing bug reports like:
[ 848.393333] BUG: spinlock bad magic on CPU#4, kworker/u:2/5107
[ 848.400262] general protection fault: 0000 [#1] SMP
[ 848.406244] CPU 4
[ 848.408310] Modules linked in: nls_utf8 ipv6 uinput i2c_i801 i2c_core iTCO_wdt iTCO_vendor_support ioatdma dca sg sd_mod sr_mod cdrom ahci libahci isci libsas libata scsi_transport_sas [last unloaded: scsi_wait_scan]
[ 848.432060]
[ 848.434137] Pid: 5107, comm: kworker/u:2 Not tainted 3.2.0-isci+ #8 Intel Corporation S2600CP/S2600CP
[ 848.445310] RIP: 0010:[<
ffffffff8126a68c>] [<
ffffffff8126a68c>] spin_dump+0x5e/0x8c
[ 848.454787] RSP: 0018:
ffff8807f868dca0 EFLAGS:
00010002
[ 848.461137] RAX:
0000000000000048 RBX:
ffff8807fe86a630 RCX:
ffffffff817d0be0
[ 848.469520] RDX:
0000000000000000 RSI:
ffffffff814af1cf RDI:
0000000000000002
[ 848.477959] RBP:
ffff8807f868dcb0 R08:
00000000ffffffff R09:
000000006b6b6b6b
[ 848.486327] R10:
000000000003fb8c R11:
ffffffff81a19448 R12:
6b6b6b6b6b6b6b6b
[ 848.494699] R13:
ffff8808027dc520 R14:
0000000000000000 R15:
000000000000001e
[ 848.503067] FS:
0000000000000000(0000) GS:
ffff88083fd00000(0000) knlGS:
0000000000000000
[ 848.512899] CS: 0010 DS: 0000 ES: 0000 CR0:
000000008005003b
[ 848.519710] CR2:
00007ff77d001000 CR3:
00000007f7a5d000 CR4:
00000000000406e0
[ 848.528072] DR0:
0000000000000000 DR1:
0000000000000000 DR2:
0000000000000000
[ 848.536446] DR3:
0000000000000000 DR6:
00000000ffff0ff0 DR7:
0000000000000400
[ 848.544831] Process kworker/u:2 (pid: 5107, threadinfo
ffff8807f868c000, task
ffff8807ff348000)
[ 848.555327] Stack:
[ 848.557959]
ffff8807fe86a630 ffff8807fe86a630 ffff8807f868dcd0 ffffffff8126a6e0
[ 848.567072]
ffffffff817c142f ffff8807fe86a630 ffff8807f868dcf0 ffffffff8126a703
[ 848.576190]
ffff8808027dc520 0000000000000286 ffff8807f868dd10 ffffffff814af1bb
[ 848.585281] Call Trace:
[ 848.588409] [<
ffffffff8126a6e0>] spin_bug+0x26/0x28
[ 848.594357] [<
ffffffff8126a703>] do_raw_spin_unlock+0x21/0x88
[ 848.601283] [<
ffffffff814af1bb>] _raw_spin_unlock_irqrestore+0x2c/0x65
[ 848.609089] [<
ffffffffa001c103>] ata_scsi_port_error_handler+0x548/0x557 [libata]
[ 848.618331] [<
ffffffff81061813>] ? async_schedule+0x17/0x17
[ 848.625060] [<
ffffffffa004f30f>] async_sas_ata_eh+0x45/0x69 [libsas]
[ 848.632655] [<
ffffffff810618aa>] async_run_entry_fn+0x97/0x125
[ 848.639670] [<
ffffffff81057439>] process_one_work+0x207/0x38d
[ 848.646577] [<
ffffffff8105738c>] ? process_one_work+0x15a/0x38d
[ 848.653681] [<
ffffffff810576f7>] worker_thread+0x138/0x21c
[ 848.660305] [<
ffffffff810575bf>] ? process_one_work+0x38d/0x38d
[ 848.667493] [<
ffffffff8105b098>] kthread+0x9d/0xa5
[ 848.673382] [<
ffffffff8106e1bd>] ? trace_hardirqs_on_caller+0x12f/0x166
[ 848.681304] [<
ffffffff814b7704>] kernel_thread_helper+0x4/0x10
[ 848.688324] [<
ffffffff814af534>] ? retint_restore_args+0x13/0x13
[ 848.695530] [<
ffffffff8105affb>] ? __init_kthread_worker+0x5b/0x5b
[ 848.702929] [<
ffffffff814b7700>] ? gs_change+0x13/0x13
[ 848.709155] Code: 00 00 48 8d 88 38 04 00 00 44 8b 80 84 02 00 00 31 c0 e8 cf 1b 24 00 41 83 c8 ff 44 8b 4b 08 48 c7 c1 e0 0b 7d 81 4d 85 e4 74 10 <45> 8b 84 24 84 02 00 00 49 8d 8c 24 38 04 00 00 8b 53 04 48 89
[ 848.732467] RIP [<
ffffffff8126a68c>] spin_dump+0x5e/0x8c
[ 848.738905] RSP <
ffff8807f868dca0>
[ 848.743743] ---[ end trace
143161646eee8caa ]---
...so arrange for the ata_port to have the same end of life as the domain
device.
Reported-by: Marcin Tomczak <marcin.tomczak@intel.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Tue, 10 Jan 2012 22:39:13 +0000 (14:39 -0800)]
[SCSI] libsas: mark all domain devices gone if root port disappears
If the top level expander is hot removed, mark all child devices as gone
before unregistration to short circuit futile recovery.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Mon, 9 Jan 2012 18:12:52 +0000 (10:12 -0800)]
[SCSI] libsas: pre-clean commands that won the eh vs completion race
When scrolling forward through the eh list (in a clear_q scenario) it is
possible to encounter commands that won the completion vs eh race. Rather
than sprinkle more "if (!task)" throughout the handler just make a pass
through the list and delete the race winners before handling the rest.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Tue, 13 Dec 2011 04:32:09 +0000 (20:32 -0800)]
[SCSI] isci: remove IDEV_EH hack to disable "discovery-time" ata resets
Prior to commit
61aaff49 "isci: filter broadcast change notifications
during SMP phy resets" we borrowed the MVS_DEV_EH approach from the
mvsas driver for preventing ->lldd_I_T_nexus_reset() events during ata
discovery. This hack was protecting against the old ->phy_reset() in
ata_bus_probe(), but since the conversion to the new error handling this
hack is preventing resets from reaching ata devices.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Thu, 8 Dec 2011 08:37:25 +0000 (00:37 -0800)]
[SCSI] isci: remove bus and reset handlers
Remove ->eh_device_reset_handler() and ->eh_bus_reset_handler() for the
same reason they are not implemented for libata hosts, they cannot be
implemented reliably with ata-eh. ATA error recovery wants to divert
all resets to the eh thread and wait for completion, these handlers may
be invoked from a non-blocking ioctl.
The other path they are called from is libsas-eh, and if we escalate
past I_T_nexus reset we have larger problems i.e. tear down all
in-flight commands in the domain potentially without notification to the
lldd if it has chosen not to implement ->lldd_clear_nexus_port() /
->lldd_clear_nexus_ha().
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Fri, 18 Nov 2011 02:01:38 +0000 (18:01 -0800)]
[SCSI] isci: ->lldd_ata_check_ready handler
Report to libata whether the link to the given domain_device is up and the
signature fis has been received.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Fri, 9 Dec 2011 07:20:44 +0000 (23:20 -0800)]
[SCSI] isci: stop interpreting ->lldd_lu_reset() as an ata soft-reset
Driving resets from libsas-eh is pre-mature as libata will make a
decision about performing a softreset. Currently libata determines
whether to perform a softreset based on ata_eh_followup_srst_needed(),
and none of those conditions apply to isci.
Remove the srst implementation and translate ->lldd_lu_reset() for ata
devices as a request to drive a reset via libata-eh.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Wed, 30 Nov 2011 19:57:34 +0000 (11:57 -0800)]
[SCSI] isci: fix interpretation of "hard" reset
A hard reset to isci in the direct-attached case is one where the driver
internally manages debouncing the link. In the sas-expander-attached
case a hard reset is one that clears affiliations. The driver should
not be prematurely dropping affiliations at run time, that decision (to
force expander hard resets to ata devices) is left to userspace to
manage. So, arrange for I_T_nexus resets to be sas-link-resets in the
expander-attached case and isci-hard-resets in the direct-attached case.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Wed, 4 Jan 2012 07:26:15 +0000 (23:26 -0800)]
[SCSI] isci: kill isci_port->status
It only tracks whether the port is stopping in order to gate new devices
being discovered while the port is stopping. However, since the check
and subsequent handling is unlocked there is nothing to stop the port
from going down immediately after the check.
Driver is already prepared to handle devices arriving on stale ports,
and those will be cleaned up by an eventual ->lldd_dev_gone()
notification.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams [Wed, 4 Jan 2012 07:26:08 +0000 (23:26 -0800)]
[SCSI] isci: kill iphy->isci_port lookups
This field is a holdover from the OS abstraction conversion. The stable
phy to port lookups are done via iphy->ownining_port under scic_lock.
After this conversion to use port->lldd_port the only volatile lookup is
the initial lookup in isci_port_formed(). After that point any lookup
via a successfully notified domain_device is guaranteed to be valid
until the domain_device is destroyed.
Delete ->start_complete as it is only set once and is set as a
consequence of the port going link up, by definition of getting a port
formed event the port is "ready".
While we are correcting port lookups also move the asd_sas_port table
out from under the isci_port. This is to preclude any temptation to use
container_of() to convert an asd_sas_port to an isci_port, the
association is dynamic and under libsas control.
Tested-by: Maciej Trela <maciej.trela@intel.com>
[dmilburn@redhat.com: fix i686 compile error]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>