platform/kernel/linux-starfive.git
13 years ago[SCSI] fcoe: use kthread_create_on_node
Eric Dumazet [Wed, 28 Sep 2011 04:37:52 +0000 (21:37 -0700)]
[SCSI] fcoe: use kthread_create_on_node

Since fcoe_percpu_thread_create() creates percpu kthread, it makes sense
to use kthread_create_on_node() to get proper NUMA affinity for kthread
stack.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: fix warnings when checking sata/stp protocol
Dan Williams [Sat, 24 Sep 2011 01:09:11 +0000 (18:09 -0700)]
[SCSI] libsas: fix warnings when checking sata/stp protocol

Several sas drivers legitimately check the protocol against the union of
SAS_PROTOCOL_SATA and SAS_PROTOCOL_STP.  Provide a SAS_PROTOCOL_STP_ALL
to silence warnings like:

drivers/scsi/pm8001/pm8001_sas.c:438:3: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]
drivers/scsi/mvsas/mv_sas.c:798:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]
drivers/scsi/mvsas/mv_sas.c:1783:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]
drivers/scsi/mvsas/mv_sas.c:1886:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]
drivers/scsi/isci/request.c:3565:2: warning: case value ‘5’ not in enumerated type ‘enum sas_protocol’ [-Wswitch]

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: set sas_address and device type of rphy
Jack Wang [Fri, 23 Sep 2011 06:32:32 +0000 (14:32 +0800)]
[SCSI] libsas: set sas_address and device type of rphy

Libsas forget to set the sas_address and device type of rphy lead to file
under /sys/class/sas_x show wrong value, fix that.

Signed-off-by: Jack Wang <jack_wang@usish.com>
Tested-by: Crystal Yu <crystal_yu@usish.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: fix try_test_sas_gpio_gp_bit() build error
Dan Williams [Fri, 23 Sep 2011 23:43:45 +0000 (16:43 -0700)]
[SCSI] libsas: fix try_test_sas_gpio_gp_bit() build error

If the user has disabled CONFIG_SCSI_SAS_HOST_SMP then libsas drivers
will not be receiving smp-gpio frames and do not need this lookup code.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Tested-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] pm8001: remove pm8001_slave_{alloc|configure}
Dan Williams [Tue, 20 Sep 2011 22:11:03 +0000 (15:11 -0700)]
[SCSI] pm8001: remove pm8001_slave_{alloc|configure}

libsas handles:
1/ limiting ata scanning to lun0
2/ changes to /sys/block/<sdX>/device/queue_depth for ata devices

libata handles turning off ncq globally via kernel command line
(libata.force=noncq) or sysfs (echo 1 >
/sys/block/<sdX>/device/queue_depth).  A lldd specific compile option is
not necessary.

Cc: Jack Wang <jack_wang@usish.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] mvsas: remove mvs_slave_{alloc|configure}
Dan Williams [Tue, 20 Sep 2011 22:10:55 +0000 (15:10 -0700)]
[SCSI] mvsas: remove mvs_slave_{alloc|configure}

libsas now handles:
1/ limiting ata scanning to lun0
2/ maximizing the queue_depth of sas devices (up to 256, mvsas only
   supports 64)
3/ changes to /sys/block/<sdX>/device/queue_depth for ata devices

Acked-by: Xiangliang Yu <yuxiangl@marvell.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: dynamic queue depth
Dan Williams [Tue, 20 Sep 2011 22:10:46 +0000 (15:10 -0700)]
[SCSI] libsas: dynamic queue depth

The queue-depth for libsas-attached devices initializes to 32 and can
only be increased manually via sysfs to a max of 64, while mpt2sas
attached devices initialize to 254 and dynamically float via the
midlayer ->change_queue_depth interface.

No performance regression was observed with this change on the isci
driver.

Tested-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas,libata: fix ->change_queue_{depth|type} for sata devices
Dan Williams [Tue, 20 Sep 2011 22:10:33 +0000 (15:10 -0700)]
[SCSI] libsas,libata: fix ->change_queue_{depth|type} for sata devices

Pass queue_depth change requests to libata, and prevent queue_type
changes for ATA devices.

Otherwise:
1/ we do not honor the libata specific restrictions on the queue depth
2/ libsas drivers that do not set sdev->tagged_supported are unable to
   change the queue_depth of ata devices via sysfs

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: disable scanning lun > 0 on ata devices
Dan Williams [Tue, 20 Sep 2011 22:10:19 +0000 (15:10 -0700)]
[SCSI] libsas: disable scanning lun > 0 on ata devices

Currently mvsas and pm8001 have custom ->slave_alloc implementations to
achieve this.  Uplevel it for all libsas drivers as isci encounters problems
with atapi devices when scanning past lun0.

Just do what Darrick suggested [1], and limit the scan for ata devices.

[1] http://marc.info/?l=linux-scsi&m=116604101119861&w=2

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: Allow expander T-T attachments
Luben Tuikov [Thu, 22 Sep 2011 16:41:36 +0000 (09:41 -0700)]
[SCSI] libsas: Allow expander T-T attachments

Allow expander table-to-table attachments for
expanders that support it.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] ipr: Stop reading adapter dump prematurely
Brian King [Wed, 21 Sep 2011 13:51:11 +0000 (08:51 -0500)]
[SCSI] ipr: Stop reading adapter dump prematurely

When the ipr driver decides to dump the adapter, it changes the
sdt_state to GET_DUMP, then prepares the adapter so that the dump
can be read. However, if the ipr worker thread wakes up for some
reason before the driver has put the adapter in a state where it
can succesfully dump the adapter, the driver will start dumping
the adapter too early, which can potentially trigger a BUG check
in the pci config blocking API. Fix this by adding a new
sdt_state to differentiate between the ipr driver wanting to dump
the adapter in the near future and wanting to dump the adapter now.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh_rdac: Adding NetApp as a brand name for rdac
Chauhan, Vijay [Fri, 2 Sep 2011 07:56:32 +0000 (13:26 +0530)]
[SCSI] scsi_dh_rdac: Adding NetApp as a brand name for rdac

Signed-off-by: Vijay Chauhan <Vijay.chauhan@netapp.com>
Reviewed-by: Bob Stankey <Robert.stankey@netapp.com>
Reviewed-by: Babu Moger <Babu.moger@netapp.com>
Acked-by: Chandra Seetharaman <sekharan@us.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Bumped version to 1.0.7
Bhanu Prakash Gollapudi [Mon, 19 Sep 2011 23:52:14 +0000 (16:52 -0700)]
[SCSI] bnx2fc: Bumped version to 1.0.7

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Handle bnx2fc_map_sg failure
Bhanu Prakash Gollapudi [Mon, 19 Sep 2011 23:52:13 +0000 (16:52 -0700)]
[SCSI] bnx2fc: Handle bnx2fc_map_sg failure

Gracefully handle bnx2fc_map_sg failure, so that queuecommand returns host busy
and SCSI-ml can retry the IO.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Replace scsi_dma_map() with dma_map_sg().
Bhanu Prakash Gollapudi [Mon, 19 Sep 2011 23:52:12 +0000 (16:52 -0700)]
[SCSI] bnx2fc: Replace scsi_dma_map() with dma_map_sg().

scsi_dma_map doesn't work for NPIV since vport dev isn't fully initialized.

For more details: http://marc.info/?l=linux-scsi&m=118312448030633&w=2 and
commit - c59fd9ebc46da8d48b76955d4d48e3597f8c8726.

Signed-off-by: Nithin Sujir <nsujir@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] mptfusion: Added check for SILI bit in READ_16 CDB for DATA UNDERRUN ERRATA
nagalakshmi.nandigama@lsi.com [Mon, 19 Sep 2011 04:57:20 +0000 (10:27 +0530)]
[SCSI] mptfusion: Added check for SILI bit in READ_16 CDB for DATA UNDERRUN ERRATA

When READ_16 command is issued, the setting of SILI Bit in CDB is confirmed
and if SILI bit is off, the processing of relavent Errata is executed.

Added code for checking SILI bit for READ_16 as described in "SSC-4".

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] mpt2sas: take size of pointed value, not pointer
Julia Lawall [Fri, 16 Sep 2011 06:57:34 +0000 (08:57 +0200)]
[SCSI] mpt2sas: take size of pointed value, not pointer

Sizeof a pointer-typed expression returns the size of the pointer, not that
of the pointed data.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression *e;
type T;
identifier f;
@@

f(...,(T)e,...,
-sizeof(e)
+sizeof(*e)
,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Add driver documentation
Bhanu Prakash Gollapudi [Tue, 13 Sep 2011 18:55:14 +0000 (11:55 -0700)]
[SCSI] bnx2fc: Add driver documentation

bnx2fc.txt outlines the driver usage model.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] mac_esp: remove redundant mutual exclusion
Finn Thain [Sun, 11 Sep 2011 09:57:51 +0000 (19:57 +1000)]
[SCSI] mac_esp: remove redundant mutual exclusion

Mutual exclusion is redundant here because all the paths in the call graph
leading to esp_driver_ops.send_dma_cmd() happen under spin_lock_irqsave/
spin_lock_irqrestore. Remove it.

Tested on a Mac Quadra 660av and a Mac LC 630.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] mpt2sas: Bump driver version 09.100.00.01
nagalakshmi.nandigama@lsi.com [Thu, 8 Sep 2011 01:43:35 +0000 (07:13 +0530)]
[SCSI] mpt2sas: Bump driver version 09.100.00.01

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] mpt2sas: Added NUNA IO support in driver which uses multi-reply queue support...
nagalakshmi.nandigama@lsi.com [Thu, 8 Sep 2011 00:48:50 +0000 (06:18 +0530)]
[SCSI] mpt2sas: Added NUNA IO support in driver which uses multi-reply queue support of the HBA

Support added for controllers capable of multi reply queues.

The following are the modifications to the driver to support NUMA.

1) Create the new structure adapter_reply_queue to contain the reply queue
   info for every msix vector.  This object will contain a
   reply_post_host_index, reply_post_free for each instance, msix_index, among
   other parameters.  We will track all the reply queues on a link list called
   ioc->reply_queue_list. Each reply queue is aligned with each IRQ, and is
   passed to the interrupt via the bus_id parameter.

(2) The driver will figure out the msix_vector_count from the PCIe MSIX
    capabilities register instead of the IOC Facts->MaxMSIxVectors. This is
    because the firmware is not filling in this field until the driver has
    already registered MSIX support.

(3) If the ioc_facts reports that the controller is MSIX compatible in the
    capabilities, then the driver will request for multiple irqs.  This count
    is calculated based on the minimum between the online cpus available and
    the ioc->msix_vector_count.  This count is reported to firmware in the
    ioc_init request.

(4) New routines were added _base_free_irq and _base_request_irq, so
    registering and freeing msix vectors were done thru simple function API.

(5) The new routine _base_assign_reply_queues was added to align the msix
    indexes across cpus. This will initialize the array called
    ioc->cpu_msix_table.  This array is looked up on every MPI request so the
    MSIxIndex is set appropriately.

(6) A new shost sysfs attribute was added to report the reply_queue_count.

(7) User needs to set the affinity cpu mask, so the interrupts occur on the
    same cpu that sent the original request.

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh_rdac: Adding couple more vendor product ids
Moger, Babu [Fri, 2 Sep 2011 15:21:17 +0000 (11:21 -0400)]
[SCSI] scsi_dh_rdac: Adding couple more vendor product ids

This patch adds couple more Vendor/Product IDs for RDAC.. There are no
functional changes.

Signed-off-by: Babu Moger <babu.moger@netapp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] isci: initial sgpio write support
Dan Williams [Fri, 2 Sep 2011 04:18:31 +0000 (21:18 -0700)]
[SCSI] isci: initial sgpio write support

Basic support to initialize the gpio unit, accept an incomming
SAS_GPIO_REG_TX_GP bitstream, and translate it to the ODx.n fields in
the hardware registers.  If register indexes outside the supported range
are specified in the SMP frame we simply accept the write and return how
many registers (SFF-8485) were written (libsas reports this as residue
in the request).

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] isci: fix sgpio register definitions
Dan Williams [Fri, 2 Sep 2011 04:18:26 +0000 (21:18 -0700)]
[SCSI] isci: fix sgpio register definitions

output_data_select registers are off by one u32

delete the macros we will never use.

Reported-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: sgpio write support
Dan Williams [Fri, 2 Sep 2011 04:18:20 +0000 (21:18 -0700)]
[SCSI] libsas: sgpio write support

Add SFF-8485 v0.7 / SAS-1 smp-write-gpio register support to libsas.
Defer SAS-2 support unless/until it defines an sgpio interface.

Minimum implementation needed to get the lights blinking.
try_test_sas_gpio_gp_bit() provides a common method to parse the
incoming write data (raw bitstream), and the to_sas_gpio_gp_bit() helper
routine can be used as a basis for the set/clear operations for the
'read' implementation.  Host implementations parse as many bits
(ODx.[012]) as are locally supported and report the number of registers
successfully written.  If the submitted data overruns the internal
number of registers available report the write as a success with the
number of bytes remaining reported in ->resid_len.

Example (assuming an active backplane) set the "identify" pattern for
the first 21 devices:

smp_write_gpio --count=2 --data=92,49,24,92,24,92,49,24 -t 4 --index=1 /dev/bsg/sas_hostX

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: select iscsi boot sysfs attrs
Mike Christie [Thu, 1 Sep 2011 02:53:40 +0000 (21:53 -0500)]
[SCSI] qla4xxx: select iscsi boot sysfs attrs

qla4xxx now uses iscsi_boot_sysfs to export the targets used
for boot to sysfs. It needs to select that config option
to make sure that module is also built.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Bumped version to 1.0.6
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:54 +0000 (15:54 -0700)]
[SCSI] bnx2fc: Bumped version to 1.0.6

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Fix FW assert during RSCN stress tests
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:53 +0000 (15:54 -0700)]
[SCSI] bnx2fc: Fix FW assert during RSCN stress tests

Firmware asserts when the same CQE is armed twice. This scenario happens during
RSCN stress tests as driver incorrects arms the CQ after the session is
offloaded.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Fix panic caused because of incorrect errror handling in create().
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:52 +0000 (15:54 -0700)]
[SCSI] bnx2fc: Fix panic caused because of incorrect errror handling in create().

Driver incorrectly calls bnx2fc_interface_cleanup() when bnx2fc_if_create fails
which accesses bad pointer. Handle bnx2fc_if_create failure by directly calling
bnx2fc_net_cleanup.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Avoid calling bnx2fc_if_destroy with unnecessary locks
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:51 +0000 (15:54 -0700)]
[SCSI] bnx2fc: Avoid calling bnx2fc_if_destroy with unnecessary locks

It is not required to hold rtnl_lock and bnx2fc_dev_lock when calling
bnx2fc_if_destroy, as the locking is only required to serialize creation and
deletion of fcoe instances. More importantly, this unnecessary locking causes
deadlock as bnx2fc_if_destroy calls fc_remove_host holding rtnl_lock.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Validate vlan id in NETDEV_UNREGISTER handler
Nithin Nayak Sujir [Tue, 30 Aug 2011 22:54:50 +0000 (15:54 -0700)]
[SCSI] bnx2fc: Validate vlan id in NETDEV_UNREGISTER handler

When bnx2fc receives an UNREGISTER event on a vlan interface it calls
destroy on all interfaces that matches the physical interface. Add
vlan_id check to destroy only the vlan interface that generated the
event.

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: No abort issued for REC when it times out
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:49 +0000 (15:54 -0700)]
[SCSI] bnx2fc: No abort issued for REC when it times out

ABTS was not issued for timed out REC, as REC completion handler exits out if
the IO completed. Check for timed out REC and issue ABTS before proceeding with
further processing in REC completion handler. Also, initialize rec_retry and
srr_retry before starting the IO.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Send solicitation only after vlan discovery is complete
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:48 +0000 (15:54 -0700)]
[SCSI] bnx2fc: Send solicitation only after vlan discovery is complete

Link up event is generated to the driver even before vlan discovery has
started. Because of this driver can send discovery solicitation on a stale
vlan. Call fcoe_ctlr_link_up() only when the driver is in enabled state, which
implies the vlan discovery is complete before sending solicitation.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Reset max receive frame size during link up
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:47 +0000 (15:54 -0700)]
[SCSI] bnx2fc: Reset max receive frame size during link up

If the max receive frame size is changed during link down, the driver uses the
same value after linkup unless it is reset to default.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh_alua: Decrease retry interval
Hannes Reinecke [Wed, 24 Aug 2011 08:51:19 +0000 (10:51 +0200)]
[SCSI] scsi_dh_alua: Decrease retry interval

The alua device handler starts the first retry after 10 seconds,
and increases it times 10 for each round.
This leads to an unnecessary delay. This patch modifies it to
start after one second, and increase by a factor of two.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh_alua: Fix Erroneous TPG ID check
Hannes Reinecke [Wed, 24 Aug 2011 08:51:18 +0000 (10:51 +0200)]
[SCSI] scsi_dh_alua: Fix Erroneous TPG ID check

For Target Portal Group IDs occupying the full 2 bytes in the
RTPG response, the following group_id check in the alua_rtpg
routine always fails in scsi_dh_alua.c:

if (h->group_id == (ucp[2] << 8) + ucp[3]) {

This causes the ALUA handler to wrongly identify the AAS of
a specified device as well as incorrectly interpreting the
supported AAS of the target as seen by the following entries
in the /var/log/messages:

"alua: port group 3ea state A supports tousna"
"alua: port group 3e9 state A supports tousna"

This is because 'ucp' is wrongly declared in alua_rtpg as
a character pointer instead of an unsigned character pointer.

Signed-off-by: Martin George <marting@netapp.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh: Check for sdev state in store_dh_state()
Hannes Reinecke [Wed, 24 Aug 2011 08:51:17 +0000 (10:51 +0200)]
[SCSI] scsi_dh: Check for sdev state in store_dh_state()

Avoid attaching a hardware handler to a device which is
already scheduled for deletion.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh_alua: always update TPGS status on activate
Hannes Reinecke [Wed, 24 Aug 2011 08:51:16 +0000 (10:51 +0200)]
[SCSI] scsi_dh_alua: always update TPGS status on activate

When activating a patch we should always update the TPGS state
as it might have changed in between.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh: Implement match callback function
Hannes Reinecke [Wed, 24 Aug 2011 08:51:15 +0000 (10:51 +0200)]
[SCSI] scsi_dh: Implement match callback function

Some device handler types are not tied to the vendor/model
but rather to a specific capability. Eg ALUA is supported
if the 'TPGS' setting in the standard inquiry is set.
This patch implements a 'match' callback for device handler
which supersedes the original vendor/model lookup and
implements the callback for the ALUA handler.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh: Fixup kernel-doc comments
Hannes Reinecke [Wed, 24 Aug 2011 08:51:14 +0000 (10:51 +0200)]
[SCSI] scsi_dh: Fixup kernel-doc comments

Fixup some kernel-doc comments to reference to the
correct function name.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_dh_alua: Evaluate TPGS setting from inquiry data
Hannes Reinecke [Wed, 24 Aug 2011 08:51:13 +0000 (10:51 +0200)]
[SCSI] scsi_dh_alua: Evaluate TPGS setting from inquiry data

Instead of issuing a standard inquiry from within the
alua device handler we can evaluate the TPGS setting from
the existing inquiry data of the sdev and save us the I/O.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: fix sas_queuecommand return values
Christoph Hellwig [Sat, 16 Jul 2011 19:00:35 +0000 (15:00 -0400)]
[SCSI] libsas: fix sas_queuecommand return values

->queuecommand must return either 0, or one of the SCSI_MLQUEUE_* return
values.  Non-transient errors are indicated by setting cmd->result before
calling ->scsi_done and returning 0.  Fix libsas to adhere to this calling
convention.  Note that the DID_ERROR for returns from the low-level driver
might not be correct for all cases, but it's the best we can do with
the current layering in libsas.  I also suspect that the pre-existing
handling of -SAS_QUEUE_FULL should really be SCSI_MLQUEUE_HOST_BUSY, but
I'll leave that for a separate change.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: reindent sas_queuecommand
Christoph Hellwig [Mon, 11 Jul 2011 18:49:24 +0000 (14:49 -0400)]
[SCSI] libsas: reindent sas_queuecommand

Switch sas_queuecommand to a normal indentation and goto based error handling.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libsas: sas_queuecommand doesnt need host_lock
Christoph Hellwig [Mon, 11 Jul 2011 18:49:23 +0000 (14:49 -0400)]
[SCSI] libsas: sas_queuecommand doesnt need host_lock

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] sd: Use sd_printk() instead of printk()
Nao Nishijima [Thu, 25 Aug 2011 09:04:14 +0000 (18:04 +0900)]
[SCSI] sd: Use sd_printk() instead of printk()

sd_ioctl() still use printk() for log output.
It should use sd_printk() instead of printk(), as well as other sd_*.

All SCSI messages should output via s*_printk() instead of printk().

Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] genhd: add a new attribute "alias" in gendisk
Nao Nishijima [Thu, 25 Aug 2011 09:04:06 +0000 (18:04 +0900)]
[SCSI] genhd: add a new attribute "alias" in gendisk

This patch allows the user to set an "alias" of the disk via sysfs interface.

This patch only adds a new attribute "alias" in gendisk structure.
To show the alias instead of the device name in kernel messages,
we need to revise printk messages and use alias_name() in them.

Example:
(current) printk("disk name is %s\n", disk->disk_name);
(new)     printk("disk name is %s\n", alias_name(disk));

Users can use alphabets, numbers, '-' and '_' in "alias" attribute. A disk can
have an "alias" which length is up to 255 bytes. This attribute is write-once.

Suggested-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Suggested-by: Jon Masters <jcm@redhat.com>
Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi scan: don't fail scans when host is in recovery
Mike Christie [Thu, 25 Aug 2011 05:36:38 +0000 (00:36 -0500)]
[SCSI] scsi scan: don't fail scans when host is in recovery

The problem is that if we are doing a scsi scan then the device goes
into recovery then we will wait for the recovery to complete. It waits
because scsi-ml will send inquiries or report luns and the queueing code
will have been blocked due to the host not being ready. However, if we
are in recovery and then a scan is started the scan will silently fail
and some devices will not be added.

It is easy to hit the problem where devices do not show up with
FC where we are doing tests that disrupt the target controllers.
When the controller is disruprted (reboot, or setting firmware, etc),
and we cause the dev loss tmo to fire then devices will be removed
Then when the problem has been fixed, the rport will be scanned and
devices should be added back. But if we cause another disruption before
scanning has started then devices will not get added back. If the problem
is not started until the scan is started then the devices will be added
back.

This patch fixes that problem by not failing scans when the host
is in recovery. We will let scsi-ml send the IO and let the queueing
and scsi error handling deal with it like is done if we went into
recovery while scanning.

For recovery cases where the host is being torn down then with the
patch we will still fail the scan since there is not point in scanning.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] bnx2fc: Need not schedule destroy_work from __bnx2fc_destroy
Bhanu Prakash Gollapudi [Thu, 25 Aug 2011 01:56:42 +0000 (18:56 -0700)]
[SCSI] bnx2fc: Need not schedule destroy_work from __bnx2fc_destroy

Since it is already called in the right context with rtnl_lock and dev_mutex
held.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] lpfc 8.3.26: Change driver version to 8.3.26
James Smart [Mon, 22 Aug 2011 01:49:49 +0000 (21:49 -0400)]
[SCSI] lpfc 8.3.26: Change driver version to 8.3.26

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>
13 years ago[SCSI] lpfc 8.3.26: Fix SYSFS interface issues
James Smart [Mon, 22 Aug 2011 01:49:16 +0000 (21:49 -0400)]
[SCSI] lpfc 8.3.26: Fix SYSFS interface issues

Fix SYSFS interface issues.

- In the lpfc_sli4_pdev_status_reg_wait() routine, after initial 100ms delay
  following write to PHYSDEV_CONTROL register for the firmware reaction, check
  the RN bit and ERR bit of the SLIPORT_STATUS register. If none of them
  became 1, the previous PHYSDEV_CONTROL register should be considered failed
  due to lack of privilege and error for no permission should be returned
  immediately without getting into the wait for RDY bits on the SLIPORT_STATUS
  register.
- Remove the driver check on dev->is_physfn before proceed to perform the
  PHYSDEV_CONTROL register write, and let the PCI function's privilege
  setting and driver handling of PHYSDEV_CONTROL register write failure to
  handle the reset-ability through the SLI port.
- Added key to ctlreg_write to prevent unauthorized or unexpected write to
  the control register.
- Change return to EACCES for sysfs access that are failed because hba_reset
  is disabled.

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>
13 years ago[SCSI] lpfc 8.3.26: Fix HBA initialization issues
James Smart [Mon, 22 Aug 2011 01:48:49 +0000 (21:48 -0400)]
[SCSI] lpfc 8.3.26: Fix HBA initialization issues

Fix HBA initialization issues

- Swap all values that come from the firmware image on little endian systems.
  Created a new bf_get_be macro that does the same as the bf_get_le macro but
  for big endian data instead of little endian data.
- Moved the incrementing of temp_offset after the copy
  fixed the write object loop to use temp_offset to figure out where the end
  of the image is instead of offset.
- Added the necessary codes for properly bringing the driver instance offline
  and then trying to bring the port back online with the PCI function IP reset.
  If it fails to bring the SLI port back online, it will fall through to
  bringing the SLI port to HBA error offline.
- Add a call in the probe_one_s3 and probe_one_s4 routines to get the Modeldesc
- Change OCe50100 to OCe15100
- Made the error log also include the PCI BAR bitmap returned from kernel call
  pci_select_bars().

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>
13 years ago[SCSI] lpfc 8.3.26: Fix issues pertaining to SCSI/FC protocol.
James Smart [Mon, 22 Aug 2011 01:48:13 +0000 (21:48 -0400)]
[SCSI] lpfc 8.3.26: Fix issues pertaining to SCSI/FC protocol.

Fix issues pertaining to SCSI/FC protocol.

- Allow frames destined to 0xFFFFFE to be processed by the driver by matching
  that DID with the physical port.
- Call lpfc_sli_issue_iocb with context1 set to ndlp
- In echo command accept function, adjust memcpy to limit memcpy to 1K
- Set LPFC_SLI3_BG_ENABLED properly upon completion.
- Skip the INIT_VFI call in lpfc_register_fcf if the FCF is already
  registered and go immediately to initial flogi.
- use "status" variable instead of "ret" variable to hold the return of the
  fc_block_scsi_eh.

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>
13 years ago[SCSI] be2iscsi: Add pci_disable device
Jayamohan Kallickal [Mon, 22 Aug 2011 17:08:29 +0000 (10:08 -0700)]
[SCSI] be2iscsi: Add pci_disable device

  This patch adds call to pci_disable_device during
rmmod and shutdown. The lack of this call was causing hang in
insmod - rmmod loop test

Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] be2iscsi: Adding a shutdown Routine
Jayamohan Kallickal [Mon, 22 Aug 2011 17:08:28 +0000 (10:08 -0700)]
[SCSI] be2iscsi: Adding a shutdown Routine

This patch adds a shutdown routine. It fixes a bug where when be2net
and be2iscsi are both used be2iscsi was not cleaning up its resources
properly causing be2net to fail to get loaded when the system is
rebooted.

Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] be2iscsi: Fixing the /proc/interrupts problem V3
Jayamohan Kallickal [Wed, 24 Aug 2011 23:05:30 +0000 (16:05 -0700)]
[SCSI] be2iscsi: Fixing the /proc/interrupts problem V3

Fix be2iscsi driver to use a separate pointer for each irq action->name
field and avoid display corruption in /proc/interrupts. The be2iscsi driver
was using a single static array in a function for the irq action->name field.
This results in garbage output from  /proc/interrupts

The pointer for action->name is garbage and scribbles the output on the screen.

This patch fixes the problem:

156:          0          0          0          0          0          0
0          0          0          0          0          0          0
0          0          0          0          0          0          0
0          0          0          0       PCI-MSI-X  beiscsi_msix_0017

This patch is based on Prarit's patch here:
http://www.spinics.net/lists/linux-scsi/msg52325.html
but I have fixed up the failure paths and removed
redundant check for !i suggested by Eike.

Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Fix "active_mask" may be used uninitialized warning.
Chad Dupuis [Tue, 16 Aug 2011 18:31:55 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Fix "active_mask" may be used uninitialized warning.

Since active_mask is first assigned in an "else" block, the compiler throws
a warning saying that the active_mask variable may be used uninitialized in
a print statement later.  Initialize active_mask to 0 in the declaration to
stop the warning.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Issue mailbox command only when firmware hung bit is reset for ISP82xx.
Giridhar Malavali [Tue, 16 Aug 2011 18:31:54 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Issue mailbox command only when firmware hung bit is reset for ISP82xx.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Return sysfs error codes appropriate to conditions.
Joe Carnuccio [Tue, 16 Aug 2011 18:31:53 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Return sysfs error codes appropriate to conditions.

Return sysfs error codes that match the conditions encountered.
This prevents sysfs from retrying a request which is conditioned
to fail under the current circumstance.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Provide method for updating I2C attached VPD.
Joe Carnuccio [Tue, 16 Aug 2011 18:31:52 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Provide method for updating I2C attached VPD.

Provide bsg interface for updating VPD attached on the I2C serial bus.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Correction to sysfs edc interface.
Joe Carnuccio [Tue, 16 Aug 2011 18:31:51 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Correction to sysfs edc interface.

Corrects the return value for the cases where read/write edc fails;
this prevents sysfs from retrying the operation until forever.

Corrects the printk width specifier for the first byte of buf.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: During loopdown perform Diagnostic loopback.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:50 +0000 (11:31 -0700)]
[SCSI] qla2xxx: During loopdown perform Diagnostic loopback.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Fix array out of bound warning.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:49 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Fix array out of bound warning.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: check for marker IOCB during response queue processing.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:48 +0000 (11:31 -0700)]
[SCSI] qla2xxx: check for marker IOCB during response queue processing.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Enable write permission to some debug related module parameters to...
Chad Dupuis [Tue, 16 Aug 2011 18:31:47 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Enable write permission to some debug related module parameters to be changed dynamically.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Prevent CPU lockups when "ql2xdontresethba" module param is set.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:46 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Prevent CPU lockups when "ql2xdontresethba" module param is set.

Driver is not releasing the lock if ql2xdontresethba is set, this might lead
to a lockup.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Implemeted beacon on/off for ISP82XX.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:45 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Implemeted beacon on/off for ISP82XX.

[jejb: fix up checkpatch.pl errors]
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla2xxx: Add support for ISP82xx to capture dump (minidump) on failure.
Giridhar Malavali [Tue, 16 Aug 2011 18:31:44 +0000 (11:31 -0700)]
[SCSI] qla2xxx: Add support for ISP82xx to capture dump (minidump) on failure.

Minidump allows us to catpure a snapshot of the firmware/hardware states at the
time of failure for further analysis.

[jejb: added missing #include <linux/vmalloc.h>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> ]
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] zfcp: support for hardware data router
Swen Schillig [Mon, 15 Aug 2011 12:40:32 +0000 (14:40 +0200)]
[SCSI] zfcp: support for hardware data router

FICON Express8S supports hardware data router, which requires an
adapted qdio request format.
This part 2/2 exploits the functionality in zfcp.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qdio: base support for hardware data router with zfcp
Swen Schillig [Mon, 15 Aug 2011 12:40:31 +0000 (14:40 +0200)]
[SCSI] qdio: base support for hardware data router with zfcp

FICON Express8S supports hardware data router, which requires an
adapted qdio request format.
This part 1/2 provides the qdio base required for exploitation in
zfcp.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] zfcp: non-experimental support for DIF/DIX
Steffen Maier [Mon, 15 Aug 2011 12:40:30 +0000 (14:40 +0200)]
[SCSI] zfcp: non-experimental support for DIF/DIX

DIF/DIX support for zfcp is no longer experimental,
and config option is no longer necessary.
Return error from queuecommand for unsupported data directions.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] mvumi: Add Marvell UMI driver
Jianyun Li [Wed, 11 May 2011 15:22:44 +0000 (23:22 +0800)]
[SCSI] mvumi: Add Marvell UMI driver

The Marvell Universal Message Interface (UMI) defines a messaging
interface between host and Marvell products (Plato, for example). It
considers situations of limited system resource and optimized system
performance.
UMI driver translates host request to message and sends message
to FW via UMI, FW receives message and processes it, then sends response
to UMI driver.
FW generates an interrupt when it needs to send information or
response to UMI driver

Signed-off-by: Jianyun Li <jyli@marvell.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: export iface name
Mike Christie [Mon, 15 Aug 2011 01:42:56 +0000 (20:42 -0500)]
[SCSI] qla4xxx: export iface name

Export the name of iface session is attached to. This is needed
so tools like iscsiadm/iscsistart can match the sessions to
userspace ifaces when rebuilding iscsid's state during boot.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: Added support for adapter and firmware reset
Vikas Chaudhary [Fri, 12 Aug 2011 09:51:29 +0000 (02:51 -0700)]
[SCSI] qla4xxx: Added support for adapter and firmware reset

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>
13 years ago[SCSI] scsi: Added support for adapter and firmware reset
Vikas Chaudhary [Fri, 12 Aug 2011 09:51:28 +0000 (02:51 -0700)]
[SCSI] scsi: Added support for adapter and firmware reset

Added new sysfs attr 'host_reset' in scsi_sysfs.c to
perform adapter or firmware reset as suggested by
Mike Christie here:
http://marc.info/?l=linux-scsi&m=127359347111167&w=2

user/application can write "adapter" or "firmware" on
this attr and it will call newly added function hook
in scsi_host_template to call LDD adapter or firmware
reset implementation.

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>
13 years ago[SCSI] qla4xxx: Added Get ACB support using BSG
Harish Zunjarrao [Fri, 12 Aug 2011 09:51:27 +0000 (02:51 -0700)]
[SCSI] qla4xxx: Added Get ACB support using BSG

This command is used to read ACB params from firmware

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>
13 years ago[SCSI] qla4xxx: Added restore factory defaults support using BSG
Harish Zunjarrao [Fri, 12 Aug 2011 09:51:26 +0000 (02:51 -0700)]
[SCSI] qla4xxx: Added restore factory defaults support using BSG

This command will causes the firmware to update all
configurations to pre-defined factory default settings.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>
13 years ago[SCSI] Fix out of spec CD-ROM problem with media change
TARUISI Hiroaki [Thu, 11 Aug 2011 11:25:20 +0000 (20:25 +0900)]
[SCSI] Fix out of spec CD-ROM problem with media change

Some CD-ROMs fail to report a media change correctly.  The specific
one for this patch simply fails to respond to commands, then gives a
UNIT ATTENTION after being reset which returns ASC/ASCQ 28/00.  This
is out of spec behaviour, but add a check in the eat CC/UA on reset
path to catch this case so the CD-ROM will function somewhat properly.

[jejb: fixed up white space and accepted without signoff]
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: added support to update initiator iscsi port
Vikas Chaudhary [Mon, 1 Aug 2011 10:26:19 +0000 (03:26 -0700)]
[SCSI] qla4xxx: added support to update initiator iscsi port

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>
13 years ago[SCSI] scsi_transport_iscsi: Added support to update initiator iscsi port
Vikas Chaudhary [Mon, 1 Aug 2011 10:26:18 +0000 (03:26 -0700)]
[SCSI] scsi_transport_iscsi: Added support to update initiator iscsi port

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>
13 years ago[SCSI] qla4xxx: Added vendor specific sysfs attributes
Vikas Chaudhary [Mon, 1 Aug 2011 10:26:17 +0000 (03:26 -0700)]
[SCSI] qla4xxx: Added vendor specific sysfs attributes

Added board_id, fw_state, phy_port_cnt, phy_port_num,
iscsi_func_cnt, hba_model

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>
13 years ago[SCSI] qla4xxx: Add read/update NVRAM support for 40xx adapters using BSG
Harish Zunjarrao [Mon, 1 Aug 2011 10:26:16 +0000 (03:26 -0700)]
[SCSI] qla4xxx: Add read/update NVRAM support for 40xx adapters using BSG

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>
13 years ago[SCSI] qla4xxx: Add get ACB state support using BSG
Harish Zunjarrao [Mon, 1 Aug 2011 10:26:15 +0000 (03:26 -0700)]
[SCSI] qla4xxx: Add get ACB state support using BSG

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>
13 years ago[SCSI] qla4xxx: Code cleanup for read/update flash using BSG
Harish Zunjarrao [Mon, 1 Aug 2011 10:26:14 +0000 (03:26 -0700)]
[SCSI] qla4xxx: Code cleanup for read/update flash using BSG

- Corrected return status
- Added reset active check
- Removed unused dma_map_sg calls
- Added debug prints on failure

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>
13 years ago[SCSI] qla4xxx: Added support to update mtu
Vikas Chaudhary [Mon, 1 Aug 2011 10:26:13 +0000 (03:26 -0700)]
[SCSI] qla4xxx: Added support to update mtu

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>
13 years ago[SCSI] scsi_transport_iscsi: Added support to update mtu
Vikas Chaudhary [Mon, 1 Aug 2011 10:26:12 +0000 (03:26 -0700)]
[SCSI] scsi_transport_iscsi: Added support to update mtu

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>
13 years ago[SCSI] qla4xxx: Boot from SAN support for open-iscsi
Manish Rangankar [Mon, 25 Jul 2011 18:48:55 +0000 (13:48 -0500)]
[SCSI] qla4xxx: Boot from SAN support for open-iscsi

Hook qla4xxx in fw boot sysfs interface so iscsi tools
can use the info to create boot sessions.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: Remove reduandant code after open-iscsi integration.
Manish Rangankar [Mon, 25 Jul 2011 18:48:54 +0000 (13:48 -0500)]
[SCSI] qla4xxx: Remove reduandant code after open-iscsi integration.

1. Remove device database entry (ddb) state.
2. Remove device database (DDB) list building.
                With open-iscsi integration the logins to the target devices are
        handled by the user space. So the information of target is now
        maintained in the iscsi_session object. This is handled at
        libiscsi level so there is no need to maintain a list of DDBs in
        the qla4xxx LLD.
3. qla4xxx: Remove add_device_dynamically.
                Since autologin in FW is disabled with open-iscsi integration,
        driver will never get an AEN for which driver has not requested
        a DDB index. So remove the add_device_dynamically function.
4. Remove qla4xxx_tgt_dscvr
        Since firmware autologin is disabled this function will not work.
        Now user has the ability to do the target discovery and login to
        each target individually. Firwmare will not do the login on its own.
5. Remove relogin related code
        All relogin is handled by userspace now. qla4xxx just need to
        notify userspace of a connection failure, this triggers the
        relogin.
6. Remove add_session and alloc_session
        Now qla4xxx uses iscsi_session_setup that would do the necessary
        allocations for session and ddb_entry.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: support iscsiadm session mgmt
Manish Rangankar [Mon, 25 Jul 2011 18:48:53 +0000 (13:48 -0500)]
[SCSI] qla4xxx: support iscsiadm session mgmt

Add scsi_transport_iscsi hooks in qla4xxx to support
iSCSI session management using iscsiadm.

This patch is based on discussion here
http://groups.google.com/group/open-iscsi/browse_thread/thread/e89fd888baf656a0#

Now users can use iscsiadm to do target discovery and do login/logout to
individual targets using the qla4xxx iSCSI class interface.

This patch leaves some dead code, but to make it easier to review
we are leaving and in the next patch we will remove that old code.

V2 - NOTE: Added code to avoid waiting for AEN during login/logout
in the driver, instead added a kernel to user event
to notify iscsid about login status. Because of this
iscsid will not get blocked.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] scsi_transport_iscsi: Add conn login, kernel to user, event to support offload...
Manish Rangankar [Mon, 25 Jul 2011 18:48:52 +0000 (13:48 -0500)]
[SCSI] scsi_transport_iscsi: Add conn login, kernel to user, event to support offload session login.

Offload drivers like qla4xxx will offload the sending of the login/logout
pdus still, so this patch adds iscsi_conn_login_event which is
used by these types of drivers to notify userspace that the connection
has changed state.

It also adds a iscsi_is_session_online helper so the lld
can query the sessions state field.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: add bsg support
Vikas Chaudhary [Mon, 25 Jul 2011 18:48:51 +0000 (13:48 -0500)]
[SCSI] qla4xxx: add bsg support

This patch adds bsg support to qla4xxx.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] iscsi class: add bsg support to iscsi class
Mike Christie [Mon, 25 Jul 2011 18:48:50 +0000 (13:48 -0500)]
[SCSI] iscsi class: add bsg support to iscsi class

This patch adds bsg support to the iscsi class. There is only
1 request, the host vendor one, supported. It is expected that
this would be used for things like flash updates.

This patch is made over this one
http://marc.info/?l=linux-scsi&m=131149780020992&w=2

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: Add VLAN support
Vikas Chaudhary [Mon, 25 Jul 2011 18:48:49 +0000 (13:48 -0500)]
[SCSI] qla4xxx: Add VLAN support

Add support to set VLAN and show vlan settings in sysfs

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
[Patch updated to new defines]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] libiscsi: don't bugon when if user sets markers
Mike Christie [Mon, 25 Jul 2011 18:48:48 +0000 (13:48 -0500)]
[SCSI] libiscsi: don't bugon when if user sets markers

libiscsi does not support markers and if someone tries
to set them the driver does a BUG(). There is not need
to be that extreme. Just return -ENOSYS.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] iscsi class: expand vlan support
Mike Christie [Mon, 25 Jul 2011 18:48:47 +0000 (13:48 -0500)]
[SCSI] iscsi class: expand vlan support

Add support to set vlan priority and enable/disble a vlan.

Patch based on code from Vikas Chaudhary.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] be2iscsi: remove host and session casts
Mike Christie [Mon, 25 Jul 2011 18:48:46 +0000 (13:48 -0500)]
[SCSI] be2iscsi: remove host and session casts

iscsi_session_to_shost is a macro around dev_to_shost which returns a
Scsi_Host so there is no need to cast.

iscsi_session_to_shost is a macro around shost_priv which
returns a void pointer so no need to cast.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] iscsi class: sysfs group is_visible callout for iscsi host attrs
Mike Christie [Mon, 25 Jul 2011 18:48:45 +0000 (13:48 -0500)]
[SCSI] iscsi class: sysfs group is_visible callout for iscsi host attrs

The iscsi class currently does not support writable sysfs
attrs for LLD sysfs settings. This patch converts the
iscsi class and driver's host attrs to use the attribute
container sysfs group and the sysfs group's is_visible callout
to be able to support readable or writable sysfs attrs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] iscsi class: remove iface param mask
Mike Christie [Mon, 25 Jul 2011 18:48:44 +0000 (13:48 -0500)]
[SCSI] iscsi class: remove iface param mask

We can replace the iface param mask with the
attr_is_visible callback.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] iscsi class: sysfs group is_visible callout for session attrs
Mike Christie [Mon, 25 Jul 2011 18:48:43 +0000 (13:48 -0500)]
[SCSI] iscsi class: sysfs group is_visible callout for session attrs

The iscsi class currently does not support writable sysfs
attrs for LLD sysfs settings. This patch converts the
iscsi class and driver's session attrs to use the attribute
container sysfs group and the sysfs group's is_visible callout
to be able to support readable or writable sysfs attrs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] iscsi cls: sysfs group is_visible callout for conn attrs
Mike Christie [Mon, 25 Jul 2011 18:48:42 +0000 (13:48 -0500)]
[SCSI] iscsi cls: sysfs group is_visible callout for conn attrs

The iscsi class currently does not support writable sysfs
attrs for LLD sysfs settings. This patch converts the
iscsi class and drivers to use the attribute container
sysfs group and the sysfs group's is_visible callout
to be able to support readable or writable sysfs attrs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years ago[SCSI] qla4xxx: added support to show multiple iface in sysfs
Vikas Chaudhary [Mon, 25 Jul 2011 18:48:41 +0000 (13:48 -0500)]
[SCSI] qla4xxx: added support to show multiple iface in sysfs

Add support for default ipv4 and ipv6 ifaces in qla4xxx.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Reviewed-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
[make iface creation dynamic]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>