Commit Graph

6189 Commits (21351013402ab4556d1ef62aed6cbe8dfb809f77)

Author SHA1 Message Date
Joe Eykholt 4291365784 [SCSI] libfcoe: eliminate unused link and last_link fields
The link and last_link fields in the fcoe_ctlr struct are no
longer useful, since they are always set to the same value,
and FIP always calls libfc to pass link information to the lport.

Eliminate those fields and rename link_work to timer_work, since
it no longer has any link change work to do.

Thanks to Brian Uchino for discovering this issue.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:38 -05:00
Joe Eykholt 50036bbae0 [SCSI] fcoe: remove an unused variable in fcoe_recv_frame()
Remove an unused variable, mac, in fcoe_recv_frame().

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:38 -05:00
Joe Eykholt ccfc309802 [SCSI] libfc: send point-to-poin FLOGI LS_ACC to assigned D_DID
The method we've been using for point-to-point mode requires
that the LS_ACC for the FLOGI uses the D_ID and S_ID assigned
to the remote port and local port, not those in the exchange.

This is not the correct method, but for now, it's what works
with the old target, as well as with new targets based on libfc.

This patch changes the addresses used accordingly.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:37 -05:00
Joe Eykholt f4568b8b97 [SCSI] libfc: recognize incoming FLOGI for point-to-point mode
When receiving a FLOGI request from a point-to-point peer,
the D_ID of 0xfffffe was not recognized as belonging to one
of the lports, so it was dropped.

Change fc_vport_id_lookup() to treat d_id 0xfffffe as a match.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:37 -05:00
Joe Eykholt 7d65b0df6c [SCSI] fcoe: save gateway address when receiving FLOGI request
In point-to-point mode, we need to save the source MAC
from received FLOGI requests to use as the destination MAC
for all outgoing frames.  We stopped doing that at some point.

Use the lport_set_port_id method to catch incoming FLOGI frames
and pass them to fcoe_ctlr_recv_flogi() so it can save the source MAC.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:36 -05:00
Joe Eykholt e49bf6145f [SCSI] libfcoe: fix debug message entering non-FIP mode
The debug message that indicated we are using non-FIP mode was
being printed only if we were already in non-FIP mode.
Also changed the message text to make it more clear the mode
is being set, not that the message is indicating how FLOGI
was received.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:35 -05:00
Joe Eykholt 9860eeb497 [SCSI] fcoe: call fcoe_ctlr_els_send even for ELS responses
In point-to-point mode, the destination MAC address for
the FLOGI response was zero because the LS_ACC for the FLOGI
wasn't getting intercepted by FIP.

Change to call fcoe_ctlr_els_send when sending any ELS,
not just requests.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:35 -05:00
Joe Eykholt 2f2ac4a0df [SCSI] libfc: fix oops in point-to-point mode
In point-to-point mode, if the PLOGI to the remote port times
out, it can get deleted by the remote port module.  Since there's
no reference by the local port, lport->ptp_data points to a freed
rport, and when the local port is reset and tries to logout again,
an oops occurs in mutex_lock_nested().

Hold a reference count on the point-to-point rdata.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:34 -05:00
Joe Eykholt a2f6a024e1 [SCSI] libfc: recode incoming PRLI handling
Reduce indentation in fc_rport_recv_prli_req() using gotos.
Also add payload length checks.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:33 -05:00
Richard A Lary fc193172e6 [SCSI] mpt2sas: use correct pci_resource_flag for comparison
This patch replaces incorrect base address space flag with correct IO
resource flag.  Also, performs check of memory resource to validate
resource before using.

Signed-off-by: Richard A Lary <rlary@linux.vnet.ibm.com>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:33 -05:00
Julia Lawall 4644efabde [SCSI] bfa: eliminate useless code
The variable bfa_itnim is initialized twice to the same (side effect-free)
expression.  Drop one initialization.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@forall@
idexpression *x;
identifier f!=ERR_PTR;
@@

x = f(...)
... when != x
(
x = f(...,<+...x...+>,...)
|
* x = f(...)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Jing Huang <huangj@brocade.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:32 -05:00
Roel Kluin f3d6e1dcd2 [SCSI] pmcraid: redundant check in pmcraid_check_ioctl_buffer()
struct pmcraid_ioctl_header member buffer_length is unsigned, so this
check appears redundant.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Anil Ravindranath <anil_ravindranath@pmc-sierra.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:32 -05:00
Roel Kluin 6ce00cae68 [SCSI] gdth: fix buffer overflow
This allows i == MAXHA, which is out of range

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:31 -05:00
Julia Lawall e05a9e7b18 [SCSI] pm8001: drop redundant memset
The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy.

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

// <smpl>
@@
expression e1,e2,e3,e4;
@@

- memset(e1,e2,e3);
  memcpy(e1,e4,e3);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:30 -05:00
Kashyap, Desai 1278b11f46 [SCSI] mpt2sas : Device removal algorithm in interrupt context only
external host not connecting after controller reboot: The
problem is : devices are not coming back after having the cable
disconnected then reconnected. The problem is because the
driver/firmware device removal handshake is failing. Due to this failure,
the controller firmware is not sending out device add events when the target
is reconnected. This is root caused to a race in the driver/firmware device
removal algorithm. There is duplicate code in both interrupt and user
context; where target reset is being issue from user context path while
sas_iounit_control(OP_REMOVE) is being sent from interrupt context. An
active target_reset will fail the OP_REMOVE. To fix this problem, the
duplicate code has been removed from user context path.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:29 -05:00
Kashyap, Desai 40956059fb [SCSI] mpt2sas: Upgrading version to 04.100.01.02
Upgraded version string.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:29 -05:00
Kashyap, Desai cd9843f8af [SCSI] mpt2sas: modified _scsih_sas_device_find_by_handle/sas_address
modified _scsih_sas_device_find_by_handle
so to handle the search on both list(device list and device_init_list)
Also, we moved the priority of the
search so the ioc->sas_device_list is done first.  The
"sas_device_init_list" is only used during the 1st port enable, so its
unlikely there’s devices on it.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:28 -05:00
Kashyap, Desai f1c35e6aea [SCSI] mpt2sas: RESCAN Barrier work is added in case of HBA reset.
Add the cancel_pending_work flag from the fw_event_work structure, and then to
set the flag during host reset, check the flag later from work threads
context and if cancel_pending_work_flag is set ingore those events.

Now Rescan after host reset is changed.
Added special task MPT2SAS_RESCAN_AFTER_HOST_RESET. This task will be queued
at the time of HBA reset. this task is treated as barrier. All work after
MPT2SAS_RESCAN_AFTER_HOST_RESET will be treated as new work and will be
server by callback handle. If host_recovery is going on while running RESCAN
task, it will wait for shos_recovery_done completion which will be called
from HBA reset DONE context.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Reviewed-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:27 -05:00
Hannes Reinecke 36dd288f0f [SCSI] scsi_transport_fc: Protect against overflow in dev_loss_tmo
The rport structure defines dev_loss_tmo as u32, which is
later multiplied with HZ to get the actual timeout value.
This might overflow for large dev_loss_tmo values. So we
should be better using u64 as intermediate variables here
to protect against overflow.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:27 -05:00
FUJITA Tomonori bb789d0162 [SCSI] mpt2sas: fix the incorrect scsi_dma_map error checking
scsi_dma_map() returns -1 if an error occurred (zero means that the
command has no data). So the following current code can't catch an
error:

sges_left = scsi_dma_map(scmd);
if (!sges_left) {
	sdev_printk(KERN_ERR, scmd->device, "pci_map_sg"
	" failed: request for %d bytes!\n", scsi_bufflen(scmd));
	return -ENOMEM;
}

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:26 -05:00
adam radford 4deedd845a [SCSI] 3w-xxxx, 3w-9xxx: force 60 second timeout
This small patch forces 60 second timeouts for the older 3w-xxxx &
3w-9xxx drivers for systems that don't contain the udev rule for
setting scsi timeouts to 60 seconds.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:25 -05:00
Jiri Slaby bc0beb44f2 [SCSI] qla2xxx: fix lock imbalance
Stanse found that one error path in qla24xx_bsg_timeout omits to
unlock ha->hardware_lock. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-08 18:42:41 -04:00
Jiri Slaby 67221a4226 [SCSI] lpfc: fix lock imbalances
Stanse found that two error paths in lpfc_bsg_rport_els_cmp and
lpfc_issue_ct_rsp_cmp omits to unlock phba->ct_ev_lock. It is
because they wrongly unlock phba->hbalock instead. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-08 18:42:10 -04:00
Jiri Slaby 4ec3fdbef1 [SCSI] be2iscsi: fix lock imbalance
Stanse found that one error path in mgmt_invalidate_icds omits to unlock
ctrl->mbox_lock. Fix that.

Added in 756d29c8c7 (Enable async mode for mcc rings)
where the spinlock was moved.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-08 18:41:50 -04:00
Dan Carpenter 229bab6bac [SCSI] dpt_i2o: several use after free issues
adpt_i2o_delete_hba() calls kfree() so we have to save "pHba->next"
before calling it.  Also inside adpt_i2o_delete_hba() itself, there
was another use after free bug which I fixed by moving the kfree()
down a line.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-08 18:26:15 -04:00
Linus Torvalds 7da23b86e1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] qla1280: retain firmware for error recovery
  [SCSI] attirbute_container: Initialize sysfs attributes with sysfs_attr_init
  [SCSI] advansys: fix regression with request_firmware change
  [SCSI] qla2xxx: Updated version number to 8.03.02-k2.
  [SCSI] qla2xxx: Prevent sending mbx commands from sysfs during isp reset.
  [SCSI] qla2xxx: Disable MSI on qla24xx chips other than QLA2432.
  [SCSI] qla2xxx: Check to make sure multique and CPU affinity support is not enabled at the same time.
  [SCSI] qla2xxx: Correct vp_idx checking during PORT_UPDATE processing.
  [SCSI] qla2xxx: Honour "Extended BB credits" bit for CNAs.
  [SCSI] scsi_transport_fc: Make sure commands are completed when rport is offline
  [SCSI] libiscsi: Fix recovery slowdown regression
2010-04-05 15:37:12 -07:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Michael Reed 421e33d004 [SCSI] qla1280: retain firmware for error recovery
The qla1280 driver acquires its firmware via udev.  During boot the firmware
is located in the initrd.  If, after root is mounted, the adapter needs to
reload firmware (host reset), the firmware load may fail if the root device
is on the adapter being reset.  This patch modifies qla1280 to retain the
firmware loaded via the initial request_firmware() for use during error
recovery.

[jejb: fix up checkpatch issues]
Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:20:16 -04:00
Herton Ronaldo Krzesinski cf7474451c [SCSI] advansys: fix regression with request_firmware change
On newer kernels users of advansys module are reporting system hang when
trying to load it without firmware files present. After looking closely
at description on https://qa.mandriva.com/show_bug.cgi?id=53220, I think
this is related to commit "[SCSI] advansys: use request_firmware". The
problem is that after switch to request_firmware, asc_dvc->err_code
isn't being set when firmware files aren't found or loading fails.

err_code is used by the driver to judge if there was a fatal error or
not, as can be seen for example on advansys_board_found, which will only
return -ENODEV when err_code is set. Because err_code isn't being set
when request_firmware fails, this is a change of behaviour of the code
before request_firmware addition, making it continue to load and it
fails later as the firmware wasn't really loaded.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:12:37 -04:00
Giridhar Malavali 89162e9c21 [SCSI] qla2xxx: Updated version number to 8.03.02-k2.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:11:39 -04:00
Santosh Vernekar d6136f3f74 [SCSI] qla2xxx: Prevent sending mbx commands from sysfs during isp reset.
The fix prevents application path from sending get-firmware-state mbx command
during as isp reset.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:11:37 -04:00
Ben Hutchings 6377a7ae1a [SCSI] qla2xxx: Disable MSI on qla24xx chips other than QLA2432.
On specific platforms, MSI is unreliable on some of the QLA24xx chips, resulting
in fatal I/O errors under load, as reported in <http://bugs.debian.org/572322>
and by some RHEL customers.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:11:35 -04:00
Michael Hernandez d84a47c2e8 [SCSI] qla2xxx: Check to make sure multique and CPU affinity support is not enabled at the same time.
The logic is changed to detect this condition based on following
1) both module parameters are off (ql2xmaxqueues and ql2xmultique_tag).
2) both module parameters are on (ql2xmaxqueues and ql2xmultique_tag).
3) The HBA does not support multi queue.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:11:32 -04:00
Andrew Vasquez 12cec63e40 [SCSI] qla2xxx: Correct vp_idx checking during PORT_UPDATE processing.
Checks should only be done for NPIV-capable ISPs.  Original code
could result in PORT_UPDATEs being missed on non-NPIV-capable
ISPs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:11:30 -04:00
Santosh Vernekar cad454b12a [SCSI] qla2xxx: Honour "Extended BB credits" bit for CNAs.
We now enable/disable "Additional Receive Credits" in f/w based on nvram
parameter "Extended_BB_Credits" bit (i.e. Enhanced-Features: at offset 0x196).
This is applicable only for GEN2 CNAs.

Signed-off-by: Santosh Vernekar <santosh.vernekar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:11:29 -04:00
Sarang Radke d88a714bfe [SCSI] scsi_transport_fc: Make sure commands are completed when rport is offline
blk_end_request doesn't complete a bidi request
successfully

The unfinished request eventually triggers a panic in
timeout handling routine fc_bsg_job_timeout as
req->special is NULL

Use blk_end_request_all to end the request unconditionally

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Acked-by: James Smart  <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:08:08 -04:00
Mike Christie 4ae0a6c15e [SCSI] libiscsi: Fix recovery slowdown regression
We could be failing/stopping a connection due to libiscsi starting
recovery/cleanup, but the xmit path or scsi eh thread path
could be dropping the connection at the same time.

As a result the session->state gets set to failed instead of in
recovery. We end up not blocking the session
and so the replacement timeout never gets started and we only end up
failing the IO when scsi_softirq_done sees that the
cmd has been running for (cmd->allowed + 1) * rq->timeout secs.

We used to fail the IO right away so users are seeing a long
delay when using dm-multipath. This problem was added in
2.6.28.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-27 15:02:48 -04:00
Linus Torvalds 961cde93de Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (69 commits)
  [SCSI] scsi_transport_fc: Fix synchronization issue while deleting vport
  [SCSI] bfa: Update the driver version to 2.1.2.1.
  [SCSI] bfa: Remove unused header files and did some cleanup.
  [SCSI] bfa: Handle SCSI IO underrun case.
  [SCSI] bfa: FCS and include file changes.
  [SCSI] bfa: Modified the portstats get/clear logic
  [SCSI] bfa: Replace bfa_get_attr() with specific APIs
  [SCSI] bfa: New portlog entries for events (FIP/FLOGI/FDISC/LOGO).
  [SCSI] bfa: Rename pport to fcport in BFA FCS.
  [SCSI] bfa: IOC fixes, check for IOC down condition.
  [SCSI] bfa: In MSIX mode, ignore spurious RME interrupts when FCoE ports are in FW mismatch state.
  [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt.
  [SCSI] bfa: IOC recovery fix in fcmode.
  [SCSI] bfa: AEN and byte alignment fixes.
  [SCSI] bfa: Introduce a link notification state machine.
  [SCSI] bfa: Added firmware save clear feature for BFA driver.
  [SCSI] bfa: FCS authentication related changes.
  [SCSI] bfa: PCI VPD, FIP and include file changes.
  [SCSI] bfa: Fix to copy fpma MAC when requested by user space application.
  [SCSI] bfa: RPORT state machine: direct attach mode fix.
  ...
2010-03-18 16:54:31 -07:00
Dan Carpenter e794c01b7d pcmcia: add important if statement
There was a problem introduced in Jul 2008 by:
0e6f9d2708 pcmcia: use pcmcia_loop_config in scsi pcmcia drivers

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-03-15 14:50:17 +01:00
Linus Torvalds 3474cbd11d Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc64: Add very basic XVR-1000 framebuffer driver.
  qlogicpti: Remove slash in QlogicPTI irq name
2010-03-13 21:29:38 -08:00
Linus Torvalds c32da02342 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (56 commits)
  doc: fix typo in comment explaining rb_tree usage
  Remove fs/ntfs/ChangeLog
  doc: fix console doc typo
  doc: cpuset: Update the cpuset flag file
  Fix of spelling in arch/sparc/kernel/leon_kernel.c no longer needed
  Remove drivers/parport/ChangeLog
  Remove drivers/char/ChangeLog
  doc: typo - Table 1-2 should refer to "status", not "statm"
  tree-wide: fix typos "ass?o[sc]iac?te" -> "associate" in comments
  No need to patch AMD-provided drivers/gpu/drm/radeon/atombios.h
  devres/irq: Fix devm_irq_match comment
  Remove reference to kthread_create_on_cpu
  tree-wide: Assorted spelling fixes
  tree-wide: fix 'lenght' typo in comments and code
  drm/kms: fix spelling in error message
  doc: capitalization and other minor fixes in pnp doc
  devres: typo fix s/dev/devm/
  Remove redundant trailing semicolons from macros
  fix typo "definetly" -> "definitely" in comment
  tree-wide: s/widht/width/g typo in comments
  ...

Fix trivial conflict in Documentation/laptops/00-INDEX
2010-03-12 16:04:50 -08:00
Julia Lawall 9b3a6549b2 drivers/scsi/ses.c: eliminate double free
The few lines below the kfree of hdr_buf may go to the label err_free
which will also free hdr_buf.  The most straightforward solution seems to
be to just move the kfree of hdr_buf after these gotos.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier E;
expression E1;
iterator I;
statement S;
@@

*kfree(E);
... when != E = E1
    when != I(E,...) S
    when != &E
*kfree(E);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-12 15:52:28 -08:00
Meelis Roos 77d3926306 qlogicpti: Remove slash in QlogicPTI irq name
qlogicpti driver registers its irq with a name containing slash.
This results in 

[   71.049735] WARNING: at fs/proc/generic.c:316 __xlate_proc_name+0xa8/0xb8()
[   71.132815] name 'Qlogic/PTI'

because proc_mkdir with the name of the irq fails. Fix it by just 
removing the slash from irq name. Discovered and tested on real hardware 
(Sun Ultra 1).

Signed-off-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-08 10:53:08 -08:00
Gal Rosen 0d9dc7c8b9 [SCSI] scsi_transport_fc: Fix synchronization issue while deleting vport
The issue occur while deleting 60 virtual ports through the sys
interface /sys/class/fc_vports/vport-X/vport_delete. It happen while in
a mistake each request sent twice for the same vport. This interface is
asynchronous, entering the delete request into a work queue, allowing
more than one request to enter to the delete work queue. The result is a
NULL pointer. The first request already delete the vport, while the
second request got a pointer to the vport before the device destroyed.
Re-create vport later cause system freeze.

Solution: Check vport flags before entering the request to the work queue.

[jejb: fixed int<->long problem on spinlock flags variable]
Signed-off-by: Gal Rosen <galr@storwize.com>
Acked-by: James Smart <james.smart@emulex.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-08 22:36:53 +05:30
Jiri Kosina 318ae2edc3 Merge branch 'for-next' into for-linus
Conflicts:
	Documentation/filesystems/proc.txt
	arch/arm/mach-u300/include/mach/debug-macro.S
	drivers/net/qlge/qlge_ethtool.c
	drivers/net/qlge/qlge_main.c
	drivers/net/typhoon.c
2010-03-08 16:55:37 +01:00
Uwe Kleine-König 1b07193b34 platform-drivers: move probe to .devinit.text in drivers/scsi
A pointer to a probe callback is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Cc: Henrik Kretzschmar <henne@nachtwindheim.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: peter fuerst <post@pfrst.de>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-07 17:04:50 -08:00
Krishna Gudipati d55f88f027 [SCSI] bfa: Update the driver version to 2.1.2.1.
Upgrade the upstream driver from 2.0.0.0 to 2.1.2.1.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:28:38 +05:30
Krishna Gudipati d1c61f8ef5 [SCSI] bfa: Remove unused header files and did some cleanup.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:27:51 +05:30
Krishna Gudipati 95aa060dec [SCSI] bfa: Handle SCSI IO underrun case.
When IO is completed with underrun and with good SCSI status, check if
the transferred bytes against scsi_cmnd->underflow, which is set to
minimum number of bytes that must be transferred for this command, if
is less than required minimum, complete the IO with DID_ERROR.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:12:38 +05:30
Krishna Gudipati 25e2934c26 [SCSI] bfa: FCS and include file changes.
MS module did not invoke fdmi offline in all cases,
call fdmi offline when ms module receives a port offline,
so that fdmi offline is from one place in the ms module.

Make changes to handle 10G speed in the conversion routine.

Replaced the usage of bfa_adapter_attr_s struct with specific API's.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:12:04 +05:30
Krishna Gudipati ca8b4327e4 [SCSI] bfa: Modified the portstats get/clear logic
Modified the portstats get/clear logic for port physical/FCoE/QoS stats.
Added more stats to FC
Fixed some issues with FCoE stats collection.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:10:13 +05:30
Krishna Gudipati 0a4b1fc0b2 [SCSI] bfa: Replace bfa_get_attr() with specific APIs
bfa_ioc_attr_s is a big structure and some times could cause
stack overflow if defined locally, so add specific APIs that
are needed to replace the use of ioc_attr local var.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:07:00 +05:30
Krishna Gudipati f58e9ebbf7 [SCSI] bfa: New portlog entries for events (FIP/FLOGI/FDISC/LOGO).
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:06:36 +05:30
Krishna Gudipati 1c8a4c3749 [SCSI] bfa: Rename pport to fcport in BFA FCS.
Rename pport structures to fcport in BFA FCS, to resolve confusion
about the port structures in the firmware, and make sure the SG page
is setup correctly.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:05:10 +05:30
Krishna Gudipati 13cc20c5e7 [SCSI] bfa: IOC fixes, check for IOC down condition.
Currently BFA was not checking for IOC down condition when issuing
getstats/clearstats

Add check to see if IOC is operational, before issuing
getstats/clearstats.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:03:50 +05:30
Krishna Gudipati 78f915f7b0 [SCSI] bfa: In MSIX mode, ignore spurious RME interrupts when FCoE ports are in FW mismatch state.
Use dummy interrupt handlers till chip initialization is complete.
Install real interrupt handlers after chip initialization.

Also removed msix installation code in bfa_iocfc_init().

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:02:45 +05:30
Krishna Gudipati f5713c5dfb [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt.
Fixed the issue of not acknowledging the command queue
full-to-non-full interrupt.  Implemented separate acknowledging
functions for different ASIC and interrupt mode.

Fixed the case of missing CPE interrupt by always processing the
pending requests in the completion path.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:02:14 +05:30
Krishna Gudipati 816e49b8ed [SCSI] bfa: IOC recovery fix in fcmode.
ioc_recover failed to work in fcmode.

Fixed the code to initialize the ioc_regs.err_set during the
notify_hbfail.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:01:42 +05:30
Krishna Gudipati 2993cc71d1 [SCSI] bfa: AEN and byte alignment fixes.
Replace enum types with int and rearrange the fields to fix some
alignment issue.

Local var ioc_attr is causing the stack to overflow, so removed the
usage of the local ioc_attr var and now invoking an API to return the
ioc_type.

Fix some AEN issues.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:01:23 +05:30
Krishna Gudipati 9693e7dff5 [SCSI] bfa: Introduce a link notification state machine.
Introduce a link notification state machine to handle next incoming
link events while the current event is being delivered to the driver.

When the event has been processed by the driver, the link notification
state machine will queue the next event (if there is any) to the
driver.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:59:36 +05:30
Krishna Gudipati 738c9e66dc [SCSI] bfa: Added firmware save clear feature for BFA driver.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:58:59 +05:30
Krishna Gudipati f926a05f5c [SCSI] bfa: FCS authentication related changes.
Made FCS authentication related changes to state machines and header
files.

Made changes in FCS state machines to handle the case when secret
string is NULL.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:58:41 +05:30
Krishna Gudipati 7af074dc9d [SCSI] bfa: PCI VPD, FIP and include file changes.
Changed PCI VPD to incorporate specific OEM vendors.

Added FCoE specific interrupt latency and delay params.

Added some variables needed by FIP 2.0.

Added some new logging and tracing definitions.

Added reserved members to make the structures (IOC, IOCFC) 64bit aligned.

Changed the module identifiers, as some files were moved.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:57:35 +05:30
Krishna Gudipati 86e32dabba [SCSI] bfa: Fix to copy fpma MAC when requested by user space application.
Copy fpma MAC when requested by user space application.  Added FPMA
mac address to the lport attributes structure.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:57:05 +05:30
Krishna Gudipati 72041ed8fc [SCSI] bfa: RPORT state machine: direct attach mode fix.
Make sure that in direct attach mode, we do not query the name server
after a target is marked offline.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:54:38 +05:30
Krishna Gudipati e641de37e6 [SCSI] bfa: Replace bfa_assert() with bfa_sm_fault()
Replace bfa_assert() with bfa_sm_fault() to get unhandled events for
debugging.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:54:18 +05:30
Krishna Gudipati 8b651b4294 [SCSI] bfa: Clear LL_HALT and PSS_ERR bit when IOC crashes.
Clear LL_HALT and PSS_ERR bit in the interrupt status register on an IOC crash.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:53:53 +05:30
Krishna Gudipati 0a20de446c [SCSI] bfa: IOC changes: Support faster recovery and split bfa_ioc.c into ASIC specific code.
Add support for faster IOC recovery after failure.

Split bfa_ioc.c into three files:
  bfa_ioc.c:    Common code shared between crossbow and catapult ASIC's.

  bfa_ioc_cb.c: Code specific to the crossbow, reg mapping and
                interrupt related routines.

  bfa_ioc_ct.c: Code specific to the catapult, reg mapping and
                interrupt related routines.

Fix to make sure IOC reinitialize's properly on enable request -
update the ioc_fwstate reg with BFI_IOC_FAIL on ioc disable mbox cmd
timeout.

Makefile changes to support the 2 newly added files bfa_ioc_cb.c and
bfa_ioc_ct.c.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:49:48 +05:30
Krishna Gudipati e67143243a [SCSI] bfa: Resume BFA operations after firmware mismatch is resolved.
bfad.c & bfad_drv.h:
  * Created a kernel thread from pci_probe that does the bfad start
    operations after BFA init done on a firmware mismatch.
  * The kernel thread on a fw mismatch waits for an event from IOC
    call back and is woken up from bfa_cb_init() on BFA init success.
  * In normal cases of no firmware mismatch this thread is terminated
    in pci_probe.

bfa_fcs_lport.c, fabric.c, fcs_lport.h & vport.c:
  * Split the lport init to attach time and init time code, so that
    proper config attributes are set after firmware mismatch.

bfa_iocfc.c:
  * Handle an IOC timer issue, where the IOC timer would expire before
    the init completion and send Init fail event to the driver,
    however IOC init continues and completes successfully at the later
    stage. The bfa and driver were not handling this kind of deferred
    init completion.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:17:02 +05:30
Krishna Gudipati a046bf0559 [SCSI] bfa: Fix to allow creation of only 190 vports on CNA.
Brocade CNA currently supports only 190 vports (instead of 191),
since there are only 192 unicast cam entries reserved for FCoE.

Brocade CNA has a total of 256 unicast cam entries (192 FCoE + 64 LL)

192 cam entries = 1 burned in mac + 1 baseport FPMA mac + 190 vport
FPMA macs.

Made changes to the code to support only 190 vports.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:15:24 +05:30
Krishna Gudipati 82794a2e41 [SCSI] bfa: New interface to handle firmware upgrade scenario
Split bfa_fcs_init() into bfa_fcs_attach() and bfa_fcs_init().

Removed empty function definitions in FCS modules

Modified driver to call bfa_fcs_attach() and bfa_fcs_init() as needed.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:14:10 +05:30
Krishna Gudipati 5b098082e2 [SCSI] bfa: Changes to support FDMI Driver Parameter
Added a FCS function to be called during driver init, to set the FDMI
 Driver parameter.

fdmi.c: Created a disabled state when fdmi is disabled.

bfad.c:
  * Added fdmi_enable driver parameter.
  * Added support to call bfa_fcs_set_fdmi_param() to initialize fcs
    fdmi setting.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:13:40 +05:30
Krishna Gudipati ab5336189a [SCSI] bfa: Enable new halt interrupt in BFA.
bfa_intr.c:  Enable new halt interrupt in BFA.
bfi_ctreg.h: Expose new halt interrupt bit definition to host.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:12:58 +05:30
Krishna Gudipati 2f9b8857a9 [SCSI] bfa: Enable IOC auto-recovery and IOC type fix.
bfa_ioc.c:
  - Enable IOC auto-recovery by default.
  - When CNA is in FC mode, return IOC type as FC (not FCoE)

bfa_iocfc.c:
  - Set fcmode before pci initialization/setup.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:10:02 +05:30
Krishna Gudipati 5c1fb1d556 [SCSI] bfa: Defined a new LPS event to clear virtual link on a vport
Clear virtual links was not propagated upwards to bfa from fw.
This resulted in HBA and switch being in an inconsistent state.

So defined a new LPS event for clear virtual link on a vport,
and also now clear virtual link on a baseport, is sent as a
link down event from the fw.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:09:37 +05:30
Krishna Gudipati 4c147dd819 [SCSI] bfa: Added separate MSI-X module parameters.
Added separate MSI-X module parameters to selectively
enable / disable MSI-X interrupts for both Brocade HBA and CNA's.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 15:29:46 +05:30
James Bottomley fac829fdca [SCSI] raid_attrs: fix dependency problems
RAID attributes uses scsi_is_sdev_device() to gate some SCSI specific
checking code.  This causes two problems.  Firstly if SCSI == n just
defining scsi_is_sdev_device() to return false might not be enough to
prevent gcc from emitting the code (and thus referring to undefined
symbols), so this needs surrounding with an ifdef.  Secondly, using
scsi_is_sdev_device() when SCSI is either y or m gives a subtle
problem in the m case: raid_attrs must also be m to use the symbol.
Do the usual Kconfig jiggery-pokery to fix this.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 21:17:06 +05:30
Boaz Harrosh 98e1e0f07c [SCSI] libosd: Fix unchecked err return found by smatch
Doing CHECK="smatch --two-passes gives:
drivers/scsi/osd/osd_initiator.c +1435 osd_finalize_request warning: assignment to 'ret' was never used

Which is an unchecked possible allocation failure, Fixed.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 21:12:21 +05:30
Martin K. Petersen bb2d3de188 [SCSI] sd: Fix VPD buffer allocations
Commit e3deec09 incorrectly assumed that the B0 and B1 page lengths were
limited to 32 bytes.  The B0 VPD page length is defined to be 64 bytes
when the device supports thin provisioning.  B1 is always defined to be
64 bytes.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 19:13:16 +05:30
James Smart 74315ad00b [SCSI] lpfc 8.3.10: Update Driver version to 8.3.10
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 19:10:26 +05:30
James Smart 0c9ab6f5cb [SCSI] lpfc 8.3.10: Added round robin FCF failover
- Added round robin FCF failover on initial or FCF rediscovery FLOGI failure.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 19:10:09 +05:30
James Smart fc2b989be9 [SCSI] lpfc 8.3.10: Fix Discovery issues
- Prevent Vport discovery after reg_new_vport completes when physical
  logged in using FDISC.
- Remove fast FCF failover fabric name matching. Allow failover to FCFs
  connected to different fabrics.
- Added fast FCF failover in response to FCF DEAD event on current
  FCF record.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 19:09:52 +05:30
James Smart e2aed29f29 [SCSI] lpfc 8.3.10: Added management for LP21000 through BSG.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 19:09:36 +05:30
James Smart 0f65ff680f [SCSI] lpfc 8.3.10: Update SLI interface areas
- Clear LPFC_DRIVER_ABORTED on FCP command completion.
- Clear exchange busy flag when I/O is aborted and found on aborted list.
- Free sglq when XRI_ABORTED event is processed before release of IOCB.
- Only process iocb as aborted when LPFC_DRIVER_ABORTED is set.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 19:09:18 +05:30
James Smart e40a02c125 [SCSI] lpfc 8.3.10: Fix user interface issues
- Add Logging message for critial errors.
- Remove unused variable from lpfc_nodev_tmo_show
- Update supress_link_up parameter with #define values.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 19:08:58 +05:30
James Smart 9f1177a3f8 [SCSI] lpfc 8.3.10: Fix Initialization issues
- Add NULL checks to the pointers for the config_async mailbox
  and dump_wakeup_params mailbox.
- Add code to check return value of lpfc_read_sparams everywhere
  and handle failures appropriately.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 19:08:34 +05:30
Stephen M. Cameron 43aebfa12e [SCSI] hpsa: remove unused members next, prev, and retry_count from command list structure.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:37:37 +05:30
Stephen M. Cameron 33a2ffce51 [SCSI] hpsa: Increase the number of scatter gather elements supported.
This uses the scatter-gather chaining feature of Smart Array
controllers.  32 scatter-gather elements are embedded in the
"command list", and the last element in the list may be marked
as a "chain pointer", and point to an additional block of
scatter gather elements.  The precise number of scatter gather
elements supported is dependent on the particular kind of
Smart Array, and is determined at runtime by querying the
hardware.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:37:22 +05:30
Stephen M. Cameron db61bfcfe2 [SCSI] hpsa: Clarify calculation of padding for commandlist structure
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:37:08 +05:30
Stephen M. Cameron ff9fea9454 [SCSI] hpsa: mark hpsa_pci_init as __devinit
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:36:58 +05:30
Mike Miller 31468401cc [SCSI] hpsa: remove scan thread
The intent of the scan thread was to allow a UNIT ATTENTION/LUN
DATA CHANGED condition encountered in the interrupt handler
to trigger a rescan of devices, which can't be done in interrupt
context.  However, we weren't able to get this to work, due to
multiple such UNIT ATTENTION conditions arriving during the rescan,
during updating of the SCSI mid layer, etc.  There's no way to tell
the devices, "stand still while I scan you!"  Since it doesn't work,
there's no point in having the thread, as the rescan triggered via
ioctl or sysfs can be done without such a thread.

Signed-off-by: Mike Miller <mikem@beardog.cce.hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:36:48 +05:30
Stephen M. Cameron e9ea04a65a [SCSI] hpsa: return -ENOMEM, not -1
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:36:18 +05:30
Stephen M. Cameron 5512672f75 [SCSI] hpsa: fix scsi status mis-shift
The SCSI status does not need to be shifted.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:36:04 +05:30
Stephen M. Cameron f0edafc662 [SCSI] hpsa: fix firmwart typo
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:35:50 +05:30
Stephen M. Cameron 667e23d4e9 [SCSI] hpsa: allow modifying device queue depth.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:35:40 +05:30
Brian King b0f4d4cf12 [SCSI] ibmvfc: Add suspend/resume support
Adds support for resuming from suspend for IBM VFC devices. We may have
lost an interrupt over the suspend, so we just kick the interrupt handler
to process anything that is outstanding. We expect to find a transport event
indicating we need to reestablish our CRQ.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:32:42 +05:30
Brian King 64355b929d [SCSI] ibmvscsi: Add suspend/resume support
Adds support for resuming from suspend for IBM VSCSI devices. We may have
lost an interrupt over the suspend, so we just kick the interrupt handler
to process anything that is outstanding. We expect to find a transport event
indicating we need to reestablish our CRQ.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:32:41 +05:30
Jayamohan Kallickal c03af1ae1c [SCSI] be2iscsi: Alloc only one EQ if intr mode
This patch ensures that we alloc only one EQ
if we are if we are not in msix mode

Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:31:21 +05:30
Jayamohan Kallickal ed58ea2ab5 [SCSI] be2iscsi: Fixing memory allocation for connection
This patch fixes some situations where enough resources were not
avaialable  when targets exceeded a certain limit

Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:30:06 +05:30
Jayamohan Kallickal 90a289e876 [SCSI] be2iscsi: Remove debug code
This patch removes some debug lines which are unnecessary and
also aligns some lines in code

Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:29:54 +05:30
Jayamohan Kallickal dafab8e079 [SCSI] be2iscsi: cleans up abort handling
This patch cleans up abort handling when TMF is sent

Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 18:29:44 +05:30
Jayamohan Kallickal 944b2fbce2 [SCSI] be2iscsi: Fix for a possible udelay while holding lock
This patch fixes a situation where we could call udelay
while holding spin_lock

Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 17:40:04 +05:30
Jayamohan Kallickal 4183122dbc [SCSI] be2iscsi: Cleanup of resets for device and target
This patch cleans up device and target reset handling
for the driver

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 17:39:24 +05:30
Jayamohan Kallickal 309ce156aa [SCSI] libiscsi: Make iscsi_eh_target_reset start with session reset
The iscsi_eh_target_reset has been modified to attempt
target reset only. If it fails, then iscsi_eh_session_reset
will be called.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 17:39:04 +05:30
Wayne Boyer d7b4627f5f [SCSI] ipr: adds PCI ID definitions for new adapters
This patch adds the PCI ID definitions for new adapters based on the next
generation 64 bit IOA PCI interface chip.  New entries have been added to the
ipr_pci_table[] array for the adapters and to the ipr_chip[] array for the new
versions of the chip.

Older entries have been removed for cards that did not ship.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:05:05 +05:30
Wayne Boyer 5aa3a333ea [SCSI] ipr: add support for new IOASCs
This patch adds support for new errors that can be received from adapters
using the next generation 64 bit IOA PCI interface chip.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:05:04 +05:30
Wayne Boyer 214777ba12 [SCSI] ipr: add support for multiple stages of initialization
This patch adds support for using the new IOA initialization feedback register.
It also enables 64 bit support in the ipr_ioafp_identify_hrrq and
ipr_mask_and_clear_interrupts routines.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:05:03 +05:30
Wayne Boyer f72919ec2b [SCSI] ipr: implement shutdown changes and remove obsolete write cache parameter
This patch adds a reboot notifier that will issue a shutdown prepare command
to all adapters.  This helps to prevent a problem where the primary adapter can
get shut down before the secondary adapter and cause the secondary adapter to
fail over and log and error.
This patch also removes the "enable_cache" paramater as it is obsolete.  Write
cache for an adapter is now controlled from the iprconfig utility.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:05:02 +05:30
Wayne Boyer dcbad00e6b [SCSI] ipr: add hardware assisted smart dump functionality
This patch adds the hardware assisted smart dump functionality for the next
generation IOA PCI interface chip.

Signea-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:05:00 +05:30
Wayne Boyer 4565e37063 [SCSI] ipr: add error handling updates for the next generation chip
Add support for the new log data notification and overlay IDs.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:04:59 +05:30
Wayne Boyer 3e7ebdfa58 [SCSI] ipr: update the configuration table code for the next generation chip
This patch changes the configuration table structures and related code such
that both 32 bit and 64 bit based adapters can work with the driver.

This patch also implements the code to generate the virtual bus/id/lun values
for devices connected to the new adapters.  It also implements support for the
new device resource path.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:04:57 +05:30
Wayne Boyer a74c16390a [SCSI] ipr: define new offsets to registers for the next generation chip
This patch adds the entry to the ipr_chip_cfg array that defines the register
offsets for the next generation 64 bit IOA PCI interface chip.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:04:55 +05:30
Wayne Boyer a32c055fee [SCSI] ipr: add support for new adapter command structures for the next generation chip
Change the adapter command structures such that both 32 bit and 64 bit based
adapters can work with the driver.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:01:33 +05:30
Hannes Reinecke 6c71dcb28f [SCSI] scsi_dh_emc: fix mode select request setup
This patch fixes the request setup code for mode selects. I got the fixes from
Hannes Reinecke while trying to hunt down some problems and merged it
into one patch. I am sending it because Hannes is busy with other things.

The patch fixes:
- setting of the length for mode selects.
- setting of the data direction for mode select 10.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-03 16:00:11 +05:30
Linus Torvalds b1bf936840 Merge branch 'for-2.6.34' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.34' of git://git.kernel.dk/linux-2.6-block: (38 commits)
  block: don't access jiffies when initialising io_context
  cfq: remove 8 bytes of padding from cfq_rb_root on 64 bit builds
  block: fix for "Consolidate phys_segment and hw_segment limits"
  cfq-iosched: quantum check tweak
  blktrace: perform cleanup after setup error
  blkdev: fix merge_bvec_fn return value checks
  cfq-iosched: requests "in flight" vs "in driver" clarification
  cciss: Fix problem with scatter gather elements in the scsi half of the driver
  cciss: eliminate unnecessary pointer use in cciss scsi code
  cciss: do not use void pointer for scsi hba data
  cciss: factor out scatter gather chain block mapping code
  cciss: fix scatter gather chain block dma direction kludge
  cciss: simplify scatter gather code
  cciss: factor out scatter gather chain block allocation and freeing
  cciss: detect bad alignment of scsi commands at build time
  cciss: clarify command list padding calculation
  cfq-iosched: rethink seeky detection for SSDs
  cfq-iosched: rework seeky detection
  block: remove padding from io_context on 64bit builds
  block: Consolidate phys_segment and hw_segment limits
  ...
2010-03-01 09:00:29 -08:00
Randy Dunlap 786f8ba2e9 scsi.c: add missing kernel-doc notation for new VPD parameters
Add missing kernel-doc notation for new function parameters:

Warning(drivers/scsi/scsi.c:1031): No description found for parameter 'buf'
Warning(drivers/scsi/scsi.c:1031): No description found for parameter 'buf_len'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-03-01 08:11:54 -08:00
Finn Thain cff75f1fb1 mac68k: move mac_esp platform device
Move platform device code from the driver to the platform init function.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2010-02-27 18:31:10 +01:00
Linus Torvalds 06a79b82b2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM / Hibernate: Fix preallocating of memory
  PM / Hibernate: Remove swsusp.c finally
  PM / Hibernate: Remove trailing space in message
  PM: Allow SCSI devices to suspend/resume asynchronously
  PM: Allow USB devices to suspend/resume asynchronously
  USB: implement non-tree resume ordering constraints for PCI host controllers
  PM: Allow PCI devices to suspend/resume asynchronously
  PM / Hibernate: Swap, remove useless check from swsusp_read()
  PM / Hibernate: Really deprecate deprecated user ioctls
  PM: Allow device drivers to use dpm_wait()
  PM: Start asynchronous resume threads upfront
  PM: Add facility for advanced testing of async suspend/resume
  PM: Add a switch for disabling/enabling asynchronous suspend/resume
  PM: Asynchronous suspend and resume of devices
  PM: Add parent information to timing messages
  PM: Document device power attributes in sysfs
  PM / Runtime: Add sysfs switch for disabling device run-time PM
2010-02-26 17:22:53 -08:00
Linus Torvalds 654451748b Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (158 commits)
  [SCSI] Fix printing of failed 32-byte commands
  [SCSI] Fix printing of variable length commands
  [SCSI] libsrp: fix bug in ADDITIONAL CDB LENGTH interpretation
  [SCSI] scsi_dh_alua: Add IBM Power Virtual SCSI ALUA device to dev list
  [SCSI] scsi_dh_alua: add netapp to dev list
  [SCSI] qla2xxx: Update version number to 8.03.02-k1.
  [SCSI] qla2xxx: EEH: Restore PCI saved state during pci slot reset.
  [SCSI] qla2xxx: Add firmware ETS burst support.
  [SCSI] qla2xxx: Correct loop-resync issues during SNS scans.
  [SCSI] qla2xxx: Correct use-after-free issue in terminate_rport_io callback.
  [SCSI] qla2xxx: Correct EH bus-reset handling.
  [SCSI] qla2xxx: Proper clean-up of BSG requests when request times out.
  [SCSI] qla2xxx: Initialize payload receive length in failure path of vendor commands
  [SCSI] fix duplicate removal on error path in scsi_sysfs_add_sdev
  [SCSI] fix refcounting bug in scsi_get_host_dev
  [SCSI] fix memory leak in scsi_report_lun_scan
  [SCSI] lpfc: correct PPC build failure
  [SCSI] raid_class: add raid1e
  [SCSI] mpt2sas: Do not call sas_is_tlr_enabled for RAID volumes.
  [SCSI] zfcp: Introduce header file for qdio structs and inline functions
  ...
2010-02-26 16:55:27 -08:00
Rafael J. Wysocki 4cb077d93a PM: Allow SCSI devices to suspend/resume asynchronously
Set power.async_suspend for all SCSI devices, targets and hosts, so
that they can be suspended and resumed in parallel with the main
suspend/resume thread and possibly with other devices they don't
depend on in a known way (i.e. devices which are not their parents or
children).

The power.async_suspend flag is also set for devices that don't have
suspend or resume callbacks, because otherwise they would make the
main suspend/resume thread wait for their "asynchronous" children
(during suspend) or parents (during resume), effectively negating the
possible gains from executing these devices' suspend and resume
callbacks asynchronously.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2010-02-26 20:39:12 +01:00
Martin K. Petersen 8a78362c4e block: Consolidate phys_segment and hw_segment limits
Except for SCSI no device drivers distinguish between physical and
hardware segment limits.  Consolidate the two into a single segment
limit.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-26 13:58:08 +01:00
Martin K. Petersen 086fa5ff08 block: Rename blk_queue_max_sectors to blk_queue_max_hw_sectors
The block layer calling convention is blk_queue_<limit name>.
blk_queue_max_sectors predates this practice, leading to some confusion.
Rename the function to appropriately reflect that its intended use is to
set max_hw_sectors.

Also introduce a temporary wrapper for backwards compability.  This can
be removed after the merge window is closed.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-02-26 13:58:08 +01:00
Linus Torvalds cf7ad04300 Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm:
  ARM: allow alignment fault mode to be configured at kernel boot
  ARM: Update mach-types
  ARM: 5951/1: ARM: fix documentation of the PrimeCell bus
  ARM: 5950/1: ARM: Fix build error for arm1026ej-s processor
  MAINTAINERS: fix my e-mail and status for Gemini and FA526
  Gemini: wrong registers used to set reg_level in gpio_set_irq_type()
  ARM: 5944/1: scsi: fix timer setup in fas216.c
  ARM: 5938/1: ARM: L2: export outer_cache_fns
2010-02-20 16:55:05 -08:00
Tomas Henzl b3dc1a212e [SCSI] megaraid_sas: fix for 32bit apps
It looks like this patch -

commit 7b2519afa1
Author: Yang, Bo <Bo.Yang@lsi.com>
Date:   Tue Oct 6 14:52:20 2009 -0600

    [SCSI] megaraid_sas: fix 64 bit sense pointer truncation

has caused a problem for 32bit programs with 64bit os -

http://bugzilla.kernel.org/show_bug.cgi?id=15001

fix by converting the user space 32bit pointer to a 64 bit one when
needed.

[jejb: fix up some 64 bit warnings]
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Cc: Bo Yang <Bo.Yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 15:11:53 -06:00
Martin K. Petersen 77c9cfc51b [SCSI] Fix printing of failed 32-byte commands
Having the large CDB allocation logic in sd.c means that
scsi_io_completion does not have access to the command buffer. That in
turn causes garbage to be printed when a 32-byte command fails. Move the
command printing to sd_done where the command buffer is intact.  Clear
the command buffer pointer after the extended CDB has been freed.

Make scsi_print_command ignore commands with NULL CDB pointers to
inhibit printing of garbled command strings.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 11:15:33 -06:00
Martin K. Petersen 8475f688d7 [SCSI] Fix printing of variable length commands
We dereferenced the MAINTENANCE IN array when decoding variable length
commands.  Use the right array.  Also consolidate identical if
statements below.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 11:14:11 -06:00
Bart Van Assche 78d85019ba [SCSI] libsrp: fix bug in ADDITIONAL CDB LENGTH interpretation
Fix a bug in the interpretation of the ADDITIONAL CDB LENGTH (add_cdb_len)
field of SRP_CMD requests. According to the SRP specification, the layout
of this single-byte field is as follows:
* Bits 0 and 1 are reserved.
* Bits 2 to 7 represent the ADDITIONAL CDB LENGTH field, symbolically
  represented as n.
* Still according to the SRP specification, the ADDITIONAL CDB section
  takes 4*n bytes.

Currently libsrp is only used by the ibmvscsi driver. Since the ibmvscsi
driver doesn't support large CDB's, this bug hasn't caused any problems yet.

[jejb: use & ~3 to mask the bits]
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 11:11:07 -06:00
Brian King 22963a37b3 [SCSI] scsi_dh_alua: Add IBM Power Virtual SCSI ALUA device to dev list
Adds IBM Power Virtual SCSI ALUA devices to the ALUA device handler.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:52:54 -06:00
Mike Christie cd4a8814d4 [SCSI] scsi_dh_alua: add netapp to dev list
Newer Netapp target software supports ALUA, so
this patch adds them to the scsi_dev_alua dev list.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:51:47 -06:00
Giridhar Malavali 35b7f0a76b [SCSI] qla2xxx: Update version number to 8.03.02-k1.
Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:47:19 -06:00
Richard Lary 8c1496bda8 [SCSI] qla2xxx: EEH: Restore PCI saved state during pci slot reset.
Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:47:15 -06:00
Andrew Vasquez ae97c91eb1 [SCSI] qla2xxx: Add firmware ETS burst support.
Can be used to balance NIC/FCoE traffic distribution.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:47:05 -06:00
Andrew Vasquez bb2d52b2fd [SCSI] qla2xxx: Correct loop-resync issues during SNS scans.
Original code could inadvertently skip the post processing of
port information returned from the SNS scan, if any link-flopping
asynchronous-events were received (noticed in FCAL topologies).

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:46:45 -06:00
Andrew Vasquez 715848ca6f [SCSI] qla2xxx: Correct use-after-free issue in terminate_rport_io callback.
The explicit logout (LOGO) issued at the end of the callback will
flush (via normal scsi_cmnd->done()) any outstanding commands
(FCP2) the firmware is holding.  While iterating through the
outstanding_cmnd array in qla2x00_abort_fcport_cmds(), locking
and unlocking of the hardware spinlock, opens-up the driver to
cases where the processed SRB (sp) could be used after the
command completed from interrupt context.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:46:35 -06:00
Andrew Vasquez 55e5ed273d [SCSI] qla2xxx: Correct EH bus-reset handling.
Target-level resets are unlikely to complete if done after the
bus (LIP/OLS/NOS) has been reset.  Perform target-level resets,
if necessary, prior to hitting the bus.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:45:02 -06:00
Giridhar Malavali db3ad7f885 [SCSI] qla2xxx: Proper clean-up of BSG requests when request times out.
Fix for BSG request cleanup when the request timesout.
Proper release of driver resources used for BSG request during timeout cleanup.

Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:44:52 -06:00
Sarang Radke 236b0249c2 [SCSI] qla2xxx: Initialize payload receive length in failure path of vendor commands
Since bsg_job->reply->reply_payload_rcv_len is uninitialized
in case of failure, fc-transport triggers a warning for each command
failed.

Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-19 10:44:40 -06:00
Guennadi Liakhovetski b857df1acc ARM: 5944/1: scsi: fix timer setup in fas216.c
mod_timer() takes an absolute time and not a delay as its argument.

Cc: <stable@kernel.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-02-18 17:24:21 +00:00
Alan Stern ee37e09d81 [SCSI] fix duplicate removal on error path in scsi_sysfs_add_sdev
This patch (as1335) fixes a bug in scsi_sysfs_add_sdev().  Its callers
always remove the device if anything goes wrong, so it should never
remove the device.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-18 11:06:39 -06:00
Alan Stern d5469119f0 [SCSI] fix refcounting bug in scsi_get_host_dev
This patch (as1334) fixes a bug in scsi_get_host_dev().  It
incorrectly calls get_device() on the new device's target.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-18 10:52:39 -06:00
Alan Stern 75f8ee8e01 [SCSI] fix memory leak in scsi_report_lun_scan
This patch (as1333) fixes a bug in scsi_report_lun_scan().  If a
newly-allocated device can't be used, it should be deleted.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-18 10:52:10 -06:00
James Smart 277e76f182 [SCSI] lpfc: correct PPC build failure
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-18 10:23:50 -06:00
Kashyap, Desai 8e4a0cf79d [SCSI] raid_class: add raid1e
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 17:50:48 -06:00
Kashyap, Desai 3ed215259f [SCSI] mpt2sas: Do not call sas_is_tlr_enabled for RAID volumes.
For RAID volume sas_is_tlr_enabled call will hit BUG at
scsi_transport_sas.c:163, since raid volume
is not visible to sas transport layer.
Now Added check to make sure arg pass in sas_is_tlr_enabled() is not a volume.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 17:49:25 -06:00
Venkata Siva Vijayendra Bhamidipati f90f50d7c5 [SCSI] fnic: Set fnic driver version
Update fnic driver version.

Signed-off-by: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 17:43:54 -06:00
Venkata Siva Vijayendra Bhamidipati c693a71d25 [SCSI] fnic: lport stats need to be initialized in fnic_probe()
Incorrect initialization of lport stats in fnic_probe() causes fnic to
crash at bootup and a node hang if fip is enabled and all links are brought
up after fnic is loaded.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 17:43:52 -06:00
Venkata Siva Vijayendra Bhamidipati aaa5e569ca [SCSI] fnic: Allow multicast and unicast address registrations for fnic
To enable FIP support in fnic, we have to register with hardware to receive
FIP solication frames on a well-known multicast address.
Before FIP support, the firmware interface allowed multicast address
registrations only for enic devices. This is a minor change in fnic to
allow the firmware interface to now register mcast addresses for fnic too.

Signed-off-by: Brian Uchino <buchino@cisco.com>
Signed-off-by: Herman Lee <hermlee@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 17:43:49 -06:00
Robert Love e9ee2cf438 [SCSI] fcoe: Only rmmod fcoe.ko if there are no active connections
Currently we're gracefully tearing down each active connection
when fcoe.ko is removed. We shouldn't allow the user to destroy
connections by removing the module. We should force the user to
destroy each connection and then the module can be removed.

This patch makes it so a refrerence count on the module is taken
each time a fcoe_interface is created. The reference count
is dropped when the fcoe_interface is destroyed. This makes it
so that module_exit() doesn't get called unless all fcoe_interfaces
have been destroyed.

This patch leaves the removal of interfaces in the module_exit
routine so that if the user does a 'rmmod -f' we'll clean everything
up before removing the module.

The module_put line was put before the out_putdev goto line because
we should only be decrementing the reference count if a
fcoe_interface is actually destroyed. If we can't find the netdev
or the fcoe_interface then it's assumed that something else has
destroyed the fcoe_interface and it would have decremented the
reference count at that time.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 17:43:45 -06:00
Bhanu Prakash Gollapudi 03bf7a5af5 [SCSI] libfcoe: Send port LKA every FIP_VN_KA_PERIOD secs.
libfcoe module doesnt send port keep alive every
FIP_VN_KA_PERIOD due to improper assignment of timeout value.
Update the port_ka_time appropriately by incrementing it by
FIP_VN_KA_PERIOD in fcoe_ctlr_timeout(), so that the link_work
is scheduled to send the port LKA.

Signed-off-by: Bhanu Gollapudi <bprakash@broadcom.com>
Acked-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 17:43:43 -06:00
Hugh Daschbach 696c1cff52 [SCSI] libfc: Don't assume response request present.
Fix NULL pointer dereference crash occurs in fc_lport_bsg_request()
for bsg requests that do not contain a response request.
Specifically, FC_BSG_HST_ADD_RPORT and FC_BSG_HST_DEL_RPORT bsg
requests are not guaranteed to include a response request.

Signed-off-by: Hugh Daschbach <hdasch@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 17:43:41 -06:00