Commit Graph

349419 Commits

Author SHA1 Message Date
Hiral Patel cfe16d5da8 [SCSI] fnic: Fix SGEs limit
Driver allows IOs with more SGEs than max SGEs supported by Palo. The current
max SGEs supported by the fnic driver is 1024. The current register settings
on Palo supports a max of 256 only. Palo would return any IO with more than
256 SGEs with an error indicating INVALID_SGLS. Fnic driver should limit the
max supported SGLs in the driver to 256 to avoid this error.

Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com>
Signed-off-by: Hiral Patel <hiralpat@cisco.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 17:29:35 +00:00
Hiral Patel 03298552cb [SCSI] fnic: fixing issues in device and firmware reset code
1. Handling overlapped firmware resets
     This fix serialize multiple firmware resets to avoid situation where fnic
     device fails to come up for link up event, when firmware resets are issued
     back to back. If there are overlapped firmware resets are issued,
     the firmware reset operation checks whether there is any firmware reset in
     progress, if so it polls for its completion in a loop with 100ms delay.

2. Handling device reset timeout
     fnic_device_reset code has been modified to handle Device reset timeout:
     - Issue terminate on device reset timeout.
     - Introduced flags field (one of the scratch fields in scsi_cmnd).
     With this, device reset request would have DEVICE_RESET flag set for other
     routines to determine the type of the request.
     Also modified fnic_terminate_rport_io, fnic_rport_exch_rset, completion
     routines to handle SCSI commands with DEVICE_RESET flag.

3. LUN/Device Reset hangs when issued through IOCTL using utilities like
   sg_reset.
     Each SCSI command is associated with a valid tag, fnic uses this tag to
     retrieve associated scsi command on completion. the LUN/Device Reset issued
     through IOCTL resulting into a SCSI command that is not associated with a
     valid tag. So fnic fails to retrieve associated scsi command on completion,
     which causes hang. This fix allocates tag, associates it with the
     scsi command and frees the tag, when the operation completed.

4. Preventing IOs during firmware reset.
     Current fnic implementation allows IO submissions during firmware reset.
     This fix synchronizes IO submissions and firmware reset operations.
     It ensures that IOs issued to fnic prior to reset will be issued to the
     firmware before firmware reset.

Signed-off-by: Narsimhulu Musini <nmusini@cisco.com>
Signed-off-by: Hiral Patel <hiralpat@cisco.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 17:28:19 +00:00
Sakthivel K bfb4809f7f [SCSI] pm80xx: fix for memory region free
All memory regions are allocated based on variables total_len
and alignment but free was based on element_size.

Signed-off-by: Sakthivel K <DL.Team.PMC.SPC.Linux.open.source@pmcs.com>
Signed-off-by: Anand Kumar S <DL.Team.PMC.SPC.Linux.open.source@pmcs.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 15:44:40 +00:00
adam radford 5eca4a67b8 [SCSI] megaraid_sas: Version and Changelog update
This patch updates the megaraid_sas driver version and updates
Documentation/scsi/ChangeLog.megaraid_sas.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 15:37:15 +00:00
adam radford 9c5ebd09e5 [SCSI] megaraid_sas: Dont load DevHandle unless FastPath enabled
The following patch for megaraid_sas will fix an issue where the
driver should not be loading the DevHandle unless FastPath is enabled.
 If FastPath was not enabled, this means the hardware raid map
validation failed for some reason, or the map was corrupted, which
could mean the DevHandle could be invalid.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 15:31:41 +00:00
adam radford 046c9ec259 [SCSI] megaraid_sas: Add 4k FastPath DIF support
The following patch for megaraid_sas will allow Fastpath T10PI/DIF
frame builds to work with 4k sector size.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 15:25:18 +00:00
Chad Dupuis f356bef134 [SCSI] qla2xxx: Wait for IDC complete event to finish loopback operation.
Wait for the IDC complete AEN before returning the loopback operation back to
the application to make sure the port is put back into normal operations.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 15:06:24 +00:00
Joe Carnuccio fe52f6e121 [SCSI] qla2xxx: Integrate generic card temperature with mezz card temperature.
Give priority to I2C thermal.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 14:39:27 +00:00
Saurav Kashyap 6c3943cdb8 [SCSI] qla2xxx: Don't process state change aen for reset owner.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 14:37:32 +00:00
Chad Dupuis bb4cf5b73b [SCSI] qla2xxx: Don't process RSCNs for a vport on the same physical adapter.
Currently,the driver is processes RSCNs for each new NPIV ports that is created.
Processing the RSCN includes a name server query to see what has changed at the
name server side.  The name server query is performed by the physical port and
each virtual port on the physical adapter (since the RSCN is passed to each
virtual port for processing).  As the number of virtual ports being created
increases, this causes a lot of traffic and busies the firmware.

Processing the RSCN for a virtual port we already have a priori knowledge of is
not necessary so check the 24-bit fabric ID of the RSCN entry and skip
processing it if the RSCN is for a virtual port we already know about.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 14:31:24 +00:00
Joe Carnuccio 3a11711ad0 [SCSI] qla2xxx: Add setting of driver version string for vendor application.
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 14:28:10 +00:00
Joe Carnuccio 90687a1e15 [SCSI] qla2xxx: Correction of comment in MBC opcode defines.
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 14:21:18 +00:00
Andrew Vasquez 4ac8d4ca5d [SCSI] qla2xxx: Correct list-iteration bug in Report-ID Acquisition codes.
Code in qla24xx_report_id_acquisition() incorrectly assumed that
upon completion of list iteration (with no match), the 'pos'
(vp) variable passed to list_for_each_entry() would be set to
NULL.  In this context, if the firmware were to return an
unrecognized vp_idx, the follow-on assignments to vp-members
could result in corruption of the structure.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 14:11:46 +00:00
Joe Carnuccio 827210ba2a [SCSI] Revert "[SCSI] qla2xxx: Optimize existing port name server query matching."
This reverts commit c0822b63cc.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 14:04:01 +00:00
Joe Carnuccio e452ceb636 [SCSI] Revert "[SCSI] qla2xxx: Avoid losing any fc ports when loop id's are exhausted."
This reverts commit 4dc77c36f8.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:55:45 +00:00
Paul Bolle f24b697ba4 [SCSI] qla2xxx: silence two GCC warnings.
Compiling qla_gs.o (part of the qla2xxx module) triggers two GCC
warnings:
    drivers/scsi/qla2xxx/qla_gs.c: In function ‘qla2x00_fdmi_rhba’:
    drivers/scsi/qla2xxx/qla_gs.c:1339:7: warning: array subscript is above array bounds [-Warray-bounds]
    drivers/scsi/qla2xxx/qla_gs.c: In function ‘qla2x00_fdmi_register’:
    drivers/scsi/qla2xxx/qla_gs.c:1663:15: warning: array subscript is above array bounds [-Warray-bounds]

It seems that the sequence of a strcpy followed by a strlen confuses GCC
when it is keeping track of array bounds here. (It is not clear to me
which array triggers this warning and by how much GCC thinks the
subscript is above its bounds. Neither is it clear to me why comparable
code in these two functions doesn't trigger this warning.)

An easy way to silence these warnings is to use preprocessor macros and
strncpy, as that apparently gives GCC enough information to keep track
of array bounds.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:53:31 +00:00
Saurav Kashyap 1e63395ce0 [SCSI] qla2xxx: Update the copyright information.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:49:22 +00:00
Saurav Kashyap 6c31555328 [SCSI] qla2xxx: Display the lock owner on lock acquire failure.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:43:05 +00:00
Chad Dupuis 992357c651 [SCSI] qla2xxx: Move loopback mode reset after chip reset check.
If we need to do a chip reset because of a serious loopback error don't try to
reset the loopback mode on the port as the mailbox command will timeout.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:41:20 +00:00
Chad Dupuis 67b2a31f51 [SCSI] qla2xxx: Extra loopback error handling for ISP83xx.
Add the following error handling for loopback diagnostic mode with ISP83xx:

1. If we do not receive an MBA_DCBX_COMPLETE after our initial set port
configuration command, try to reset the port back into normal operation.
If that fails, take a FCoE dump and then reset the chip.
2. After completing the loopback diagnostic operation, if the reset of the port
back into normal operation fails then reset the port so we take a FCoE dump
and then reset the chip.
3. When we receive an IDC notification and the requested operation is loopback
extend the loop down timer so the link does not appear to down for an
extended period of time.

[jejb: fix checkpatch issue]
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:39:56 +00:00
Chad Dupuis b00ee7d770 [SCSI] qla2xxx: Unload hangs after issuing BSG commands to vport.
BSG code path increments ref count in the send path, but does not
decrement in the return path leading to hang during unload of the
driver.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:35:40 +00:00
Saurav Kashyap 619d5a0ded [SCSI] qla2xxx: Do MPI reset only for ISP81xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:34:59 +00:00
Joe Carnuccio 61e1b269be [SCSI] qla2xxx: Do link initialization on get loop id failure.
To avoid continually doing ISP resets when get loop id fails to
obtain the adapter loop id, first try to do a link initialization.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:31:36 +00:00
Giridhar Malavali e9454a883b [SCSI] qla2xxx: Update the FTP site references in the driver sources.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:30:48 +00:00
Chad Dupuis 1bcc46cb74 [SCSI] qla2xxx: Reject loopback request if one is already in progress.
If another function on the port has initiated a loopback operation do not
process the current request.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:24:42 +00:00
Joe Carnuccio 37f489b580 [SCSI] qla2xxx: Print thermal unsupported message.
When the Read SFP mailbox command fails on the thermal device,
print a message explaining that thermal is not supported.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:23:59 +00:00
Masanari Iida 552f3f9aca [SCSI] qla2xxx: Avoid null pointer dereference in shutdown routine.
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:21:49 +00:00
Saurav Kashyap a865c50a64 [SCSI] qla2xxx: Get VPD information from common location for CNA.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:17:38 +00:00
Andrew Vasquez 0b7e7c5330 [SCSI] qla2xxx: Correct race in loop_state assignment during reset handling.
There's a subtle race in the loop/bus-reset handling whereby a
VHA's loop-state can get incorrectly set to 'down' after the
loop-reset and firmware's completion of link re-negotiation.  The
original code incorrectly assumes that firmware AENs would arrive
only after mailbox-command execution to initiate the link-flap.

Here's a good case with the old code (AENs arrive after
mailbox-command completion):

	qla2xxx [0000:03:00.1]-8012:91: BUS RESET ISSUED nexus=91:0:4.
	qla2xxx [0000:03:00.1]-287d:91: FCPort state transitioned from ONLINE to LOST - portid=010100.
	qla2xxx [0000:03:00.1]-580e:91: Asynchronous P2P MODE received.
	qla2xxx [0000:03:00.1]-287d:91: FCPort state transitioned from ONLINE to LOST - portid=010400.
	qla2xxx [0000:03:00.1]-802b:91: BUS RESET SUCCEEDED nexus=91:0:4.
	qla2xxx [0000:03:00.1]-480b:91: Reset marker scheduled.
	qla2xxx [0000:03:00.1]-5812:91: Port database changed ffff 0006 0000.
	qla2xxx [0000:03:00.1]-505f:91: Link is operational (4 Gbps).
	qla2xxx [0000:03:00.1]-480c:91: Reset marker end.
	qla2xxx [0000:03:00.1]-480f:91: Loop resync scheduled.
	qla2xxx [0000:03:00.1]-8837:91: F/W Ready - OK.
	qla2xxx [0000:03:00.1]-883a:91: fw_state=3 (7, 0, 0, 0) curr time=170b8f315.
	qla2xxx [0000:03:00.1]-280e:91: HBA in F P2P topology.
	qla2xxx [0000:03:00.1]-2812:91: qla2x00_configure_hba success
	qla2xxx [0000:03:00.1]-2814:91: Configure loop -- dpc flags = 0x5260.

notice how the 'Port database changed' (8014) arrived after the
bus-reset handler completed 'BUS RESET SUCCEEDED'.

Now, here's a failing case with the old code (AENs arrive before
mailbox-command completion):

	qla2xxx [0000:03:00.1]-8012:91: BUS RESET ISSUED nexus=91:0:0.
	qla2xxx [0000:03:00.1]-580e:91: Asynchronous P2P MODE received.
	qla2xxx [0000:03:00.1]-287d:91: FCPort state transitioned from ONLINE to LOST - portid=010100.
	qla2xxx [0000:03:00.1]-287d:91: FCPort state transitioned from ONLINE to LOST - portid=010400.
	qla2xxx [0000:03:00.1]-4800:91: DPC handler sleeping.
	qla2xxx [0000:03:00.1]-5812:91: Port database changed ffff 0006 0000.
	qla2xxx [0000:03:00.1]-505f:91: Link is operational (4 Gbps).
	qla2xxx [0000:03:00.1]-802b:91: BUS RESET SUCCEEDED nexus=91:0:0.
	qla2xxx [0000:03:00.1]-480b:91: Reset marker scheduled.
	qla2xxx [0000:03:00.1]-480c:91: Reset marker end.
	qla2xxx [0000:03:00.1]-480f:91: Loop resync scheduled.
	qla2xxx [0000:03:00.1]-8837:91: F/W Ready - OK.
	qla2xxx [0000:03:00.1]-883a:91: fw_state=3 (7, 0, 0, 0) curr time=170be9eb2.
	qla2xxx [0000:03:00.1]-280e:91: HBA in F P2P topology.
	qla2xxx [0000:03:00.1]-2812:91: qla2x00_configure_hba success
	qla2xxx [0000:03:00.1]-2814:91: Configure loop -- dpc flags = 0x5260.
	qla2xxx [0000:03:00.1]-281e:91: Needs RSCN update and loop transition.
	qla2xxx [0000:03:00.1]-286a:91: qla2x00_configure_loop *** FAILED ***.
	qla2xxx [0000:03:00.1]-4810:91: Loop resync end.
	qla2xxx [0000:03:00.1]-4800:91: DPC handler sleeping.

This race would ultimately lead to devices go unexpectedly
offline until another link-flap or chip-reset would cause driver
re-discovery to take place.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:16:45 +00:00
Saurav Kashyap 78d56df617 [SCSI] qla2xxx: Correction to the message ids.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:12:47 +00:00
Arun Easi 33c36c0a55 [SCSI] qla2xxx: Prevent enabling target mode for unsupported HBAs.
Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 12:05:51 +00:00
Arun Easi b8aa4bdfe1 [SCSI] qla2xxx: Allow ISP81xx to create ATIO queues.
Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 11:51:22 +00:00
Arun Easi aa230bc55c [SCSI] qla2xxx: Enable target mode support for ISP83xx.
Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 11:32:12 +00:00
Chad Dupuis 3c290d0b5f [SCSI] qla2xxx: Ramp down queue depth for attached SCSI devices when driver resources are low.
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 11:29:49 +00:00
Chad Dupuis 8d93f55022 [SCSI] qla2xxx: Determine the number of outstanding commands based on available resources.
Base the number of outstanding requests the driver will keep track of on the
available resources instead of being hard-coded.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 11:28:49 +00:00
Dan Carpenter 6d1f6621fa [SCSI] libosd: check for kzalloc() failure
There wasn't any error handling for this kzalloc().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 11:26:40 +00:00
Dan Carpenter 50e9291578 [SCSI] qla4xxx: don't free NULL dma pool
The error path calls dma_pool_free() on this path but "chap_table" is
NULL and "chap_dma" is uninitialized.  It's cleaner to just return
directly.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 11:24:22 +00:00
Xiangliang Yu 7c237c5f6d [SCSI] mvsas: fixed timeout issue when removing module
Root cause is libsas will clear asd_sas_port phy_mask value in sas_port_deform
after triggering destruct workqueue, but the workqueue will send sync cmd and
still need phy_mask value.  Now, mvsas using asd_sas_phy setting instead of
asd_sas_port setting.

Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-22 11:18:33 +00:00
Mahesh Rajashekhara 2b4df6ea53 [SCSI] aacraid: 1024 max outstanding command support for Series 7 and above
Signed-off-by: Mahesh Rajashekhara <Mahesh_Rajashekhara@pmc-sierra.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 14:07:48 +11:00
Julia Lawall b0d5e15cc4 [SCSI] bnx2fc: adjust duplicate test
Delete successive tests to the same location.  The code tested the result
of a previous allocation, that itself was already tested.  It is changed to
test the result of the most recent allocation.

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

// <smpl>
@s exists@
local idexpression y;
expression x,e;
@@

*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
 { ... when forall
   return ...; }
... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
    when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
 { ... when forall
   return ...; }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 14:04:54 +11:00
Vikas Chaudhary 72da7bcd68 [SCSI] qla4xxx: Update driver version to 5.03.00-k4
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 14:01:45 +11:00
Manish Rangankar c7a5e0d0eb [SCSI] qla4xxx: Fix return code for qla4xxx_session_get_param.
While reading sysfs chap_in_idx and chap_out_idx attribute, if chap
authentication is not set we get an error as "Invalid argument".

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:59:00 +11:00
Manish Rangankar 1dc8ed5d38 [SCSI] qla4xxx: wait for boot target login response during probe.
Boot from SAN fails in some cases where boot target login response
is slow. In this case, probe finishes early and triggers init, which
doesn't find remote disk to mount root which leads to BFS failure.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:55:50 +11:00
Vikas Chaudhary 9661975f17 [SCSI] qla4xxx: Added support for force firmware dump
This patch force driver to collect firmware dump using following command:-
"echo 2 > /sys/class/scsi_host/hostX/device/fw_dump"

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:53:19 +11:00
Poornima Vonti 137257da9e [SCSI] qla4xxx: Re-register IRQ handler while retrying initialize of adapter
Problem:
If initialization of adapter fails for some reason, then the interrupt handlers
are released. The interrupt handlers are not registered again when initialization
of adapter is retried.

Solution:
Re-register the interrupt handler when adapter initialization is retried.

Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:50:19 +11:00
Karen Higgins 5b1c1bff07 [SCSI] qla4xxx: Throttle active IOCBs to firmware limits
Problem:
QLA4xxx firmware may assert if given more IOCBs than it can handle.

Solution:
The driver was updated to throttle the number of active IOCBs based
on the total number of IOCB buffers received from get_firmware_status
mbx_sts[2].

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:47:16 +11:00
Karen Higgins ff4108dce9 [SCSI] qla4xxx: Remove unnecessary code from qla4xxx_init_local_data
Removed unnecessary calls to qla4xxx_get_firmware_status from
function qla4xxx_init_local_data

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:43:50 +11:00
Nilesh Javali 026fbd3aaa [SCSI] qla4xxx: Quiesce driver activities while loopback
Quiesce all different activities performed by driver upon the link events
while loopback diagnostics is in progress.

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:40:23 +11:00
Nilesh Javali 9cb33f184e [SCSI] qla4xxx: Rename MBOX_ASTS_IDC_NOTIFY to MBOX_ASTS_IDC_REQUEST_NOTIFICATION
Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:36:34 +11:00
Nilesh Javali ff2477baca [SCSI] qla4xxx: Add spurious interrupt messages under debug level 2
The spurious interrupt messages are seen when interrupt lines are
shared between different adapters or modules. Example, interrupt
lines are shared between qlcnic and qla4xxx and USB modules, then the
console is flooded with flurry of spurious interrupt messages
which are expected in such scenario.

Hence put these messages under debug level 2 for INTx interrupt mode.

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-01-30 13:32:25 +11:00