Commit graph

1153 commits

Author SHA1 Message Date
Chad Dupuis cba1e47f4d [SCSI] qla2xxx: Move initialization of some variables before iospace_config.
Some variables need to be initialized before we config PCI I/O config space
or else strange firmware initialization errors may occur.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:11 +04:00
Andrew Vasquez 5780790ee6 [SCSI] qla2xxx: Ensure there's enough request-queue space for passthru IOCBs.
The driver should ensure there's a sufficient number of IOCBs
to satisfy the number of scatter-gather entries specified in the
command.  Add a 'count' to the control structure, srb_ctx, to use
in qla2x00_alloc_iocbs().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:11 +04:00
Saurav Kashyap a00f6296aa [SCSI] qla2xxx: Implement FCP priority tagging for 82xx adapters.
This provides a capability to set a priority in the FCP packet.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:10 +04:00
Giridhar Malavali 5162cf0c4e [SCSI] qla2xxx: Consolidated IOCB processing routines.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:10 +04:00
Giridhar Malavali 99b8212c49 [SCSI] qla2xxx: Process marker IOCB request on request queue 0.
When multiple request queues are created process the marker IOCB request
on request queue 0.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:10 +04:00
Giridhar Malavali 706f457d00 [SCSI] qla2xxx: Added a new entry to ISP specific function pointers structure.
Add a new function to ISP specific pointers structure to take care of ISP
specific PCI IO space configuration.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:04 +04:00
Giridhar Malavali 2e26426917 [SCSI] qla2xxx: Corrected the display of firmware dump availability for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:04 +04:00
Giridhar Malavali 6e96fa7b8b [SCSI] qla2xxx: Corrected the default setting of the help text of Minidump capture mask.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:04 +04:00
Joe Carnuccio 71dfe9e776 [SCSI] qla2xxx: Corrections to returned sysfs error codes.
Correct the erroneous return codes introduced by the following patch:
"Return sysfs error codes appropriate to conditions".

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:03 +04:00
Giridhar Malavali 882a917bfc [SCSI] qla2xxx: Correct report-id acquisition check
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:03 +04:00
Giridhar Malavali 3cb0a67d6d [SCSI] qla2xxx: Fix to include FCE data as part of dump.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:03 +04:00
Andrew Vasquez c142caf0ab [SCSI] qla2xxx: Limit excessive DPC cycles.
The 'continue' cases neglected to place the thread in an
interruptible state, causing the DPC routine to wake immediately.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:03 +04:00
Andrew Vasquez 4fa94f83ff [SCSI] qla2xxx: Only read requested mailbox registers.
When reading the incoming mailbox registers, read only the specified ones.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:02 +04:00
Giridhar Malavali c4631191c4 [SCSI] qla2xxx: Proper cleanup of pass through commands when firmware returns error.
[jejb: fixed up checkpatch and casting errors]
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:02 +04:00
Chad Dupuis cfb0919c12 [SCSI] qla2xxx: Update to dynamic logging.
This patch contains minor fixes to our new logging infrastructure:

- Remove extranous messages.
- Re-add 'nexus' and 'hdl' information.
- Adjusted the message ids to fill up the holes.
- Display FCP_CMND priority on update.
- Log only mail box error conditions.
- Do not print "Firmware ready **** FAILED ****" if cable is unplugged.
- Drop noisy 'fw_state...curr time...' message.
- Correct nexus display during abort.
- Add a special case error-logging set to '1'.
- Catagorize I/O exception display handling.
- Correct the bsg msg code printing.
- Dont use dynamic logging after host is removed.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:02 +04:00
Joe Perches d8424f68c0 [SCSI] qla2xxx: Make the logging functions verify their arguments and fixed the current broken uses as appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:02 +04:00
Joe Perches 086b3e8a39 [SCSI] qla2xxx: Use less stack to emit logging messages.
Return early when logging level too low.
Use normal kernel codeing style for function braces.
Add const where appropriate to logging functions.
Remove now unused #define QL_DBG_BUF_LEN.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-15 10:55:01 +04:00
Chad Dupuis 09b4402d2c [SCSI] qla2xxx: Update version number to 8.03.07.12-k.
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 14:08:58 +04:00
Giridhar Malavali 0d2aa38ee9 [SCSI] qla2xxx: Submit all chained IOCBs for passthrough commands on request queue 0.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 14:08:58 +04:00
Saurav Kashyap 49e85c23be [SCSI] qla2xxx: Correct fc_host port_state display.
[jejb: checkpatch fixes]
Add more fine grain parsing of vha->loop_state to export a more accurate
fc_host port_state.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 14:08:58 +04:00
Giridhar Malavali 6315491698 [SCSI] qla2xxx: Disable generating pause frames when firmware hang detected for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 14:08:58 +04:00
Giridhar Malavali 8937f2f1c4 [SCSI] qla2xxx: Clear mailbox busy flag during premature mailbox completion for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 14:08:15 +04:00
Chad Dupuis c8f6544e6d [SCSI] qla2xxx: Encapsulate prematurely completing mailbox commands during ISP82xx firmware hang.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:37:58 +04:00
Chad Dupuis 10a340e641 [SCSI] qla2xxx: Display IPE error message for ISP82xx.
[jejb: fixup checkpatch error]
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:37:11 +04:00
Andrew Vasquez 1806fcd5d3 [SCSI] qla2xxx: Return the correct value for a mailbox command if 82xx is in reset recovery.
We need to return QLA_FUNCTION_TIMEOUT immediately otherwise we mess up the
mailbox command state machine.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:36:02 +04:00
Giridhar Malavali 3aadff356b [SCSI] qla2xxx: Enable Minidump by default with default capture mask 0x1f.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:35:28 +04:00
Giridhar Malavali 841c5e5cee [SCSI] qla2xxx: Stop unconditional completion of mailbox commands issued in interrupt mode during firmware hang.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:34:55 +04:00
Giridhar Malavali 0cd33fcfb5 [SCSI] qla2xxx: Revert back the request queue mapping to request queue 0.
If there is an error creating multiple response queues then we need to revert
the request queue mapping back to request queue 0.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:34:17 +04:00
Saurav Kashyap be5ea3cfa1 [SCSI] qla2xxx: Don't call alloc_fw_dump for ISP82XX.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:33:50 +04:00
Arun Easi 4e85e3d92f [SCSI] qla2xxx: Check for SCSI status on underruns.
Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:33:22 +04:00
Saurav Kashyap ad537689c3 [SCSI] qla2xxx: Remove qla2x00_wait_for_loop_ready function.
This function can wait for 5min under certain scenarios. One of them is when
the port is down from switch and bus reset is issued. The bus reset used to
wait for 5 minutes for the loop and upper layer callers used to hang and give
stack trace because of getting stuck for 120 sec. It is legacy code that was
used when the driver used to do queuing of the commands.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-12-12 12:31:34 +04:00
Andrew Vasquez d424754cbe [SCSI] qla2xxx: Correct inadvertent clearing of RISC_INTR status.
During heavy I/O (CPU-affinity mode enabled) and CLI/Agent
interactions, the driver would report periodic mailbox command
timeout statuses.  Within the CPU-affinity ISR handler, the
driver should check the 'disable-msix-handshake' flag in deciding
whether or not to clear HCCRX_CLR_RISC_INT.  The mode is not
specific to a dedicated queue, instead, applies to the current
'ha' context.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-30 14:08:15 +04:00
Linus Torvalds ec7ae51753 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: (204 commits)
  [SCSI] qla4xxx: export address/port of connection (fix udev disk names)
  [SCSI] ipr: Fix BUG on adapter dump timeout
  [SCSI] megaraid_sas: Fix instance access in megasas_reset_timer
  [SCSI] hpsa: change confusing message to be more clear
  [SCSI] iscsi class: fix vlan configuration
  [SCSI] qla4xxx: fix data alignment and use nl helpers
  [SCSI] iscsi class: fix link local mispelling
  [SCSI] iscsi class: Replace iscsi_get_next_target_id with IDA
  [SCSI] aacraid: use lower snprintf() limit
  [SCSI] lpfc 8.3.27: Change driver version to 8.3.27
  [SCSI] lpfc 8.3.27: T10 additions for SLI4
  [SCSI] lpfc 8.3.27: Fix queue allocation failure recovery
  [SCSI] lpfc 8.3.27: Change algorithm for getting physical port name
  [SCSI] lpfc 8.3.27: Changed worst case mailbox timeout
  [SCSI] lpfc 8.3.27: Miscellanous logic and interface fixes
  [SCSI] megaraid_sas: Changelog and version update
  [SCSI] megaraid_sas: Add driver workaround for PERC5/1068 kdump kernel panic
  [SCSI] megaraid_sas: Add multiple MSI-X vector/multiple reply queue support
  [SCSI] megaraid_sas: Add support for MegaRAID 9360/9380 12GB/s controllers
  [SCSI] megaraid_sas: Clear FUSION_IN_RESET before enabling interrupts
  ...
2011-10-28 16:44:18 -07:00
Roland Dreier 9bfacd01dc [SCSI] qla2xxx: Fix crash in qla2x00_abort_all_cmds() on unload
I hit a crash in qla2x00_abort_all_cmds() if the qla2xxx module is
unloaded right after it is loaded.  I debugged this down to the abort
handling improperly treating a command of type SRB_ADISC_CMD as if it
had a bsg_job to complete when that command actually uses the iocb_cmd
part of the union.  (I guess to hit this one has to unload the module
while the async FC initialization is still in progress)

It seems we should only look for a bsg_job if type is SRB_ELS_CMD_RPT,
SRB_ELS_CMD_HST or SRB_CT_CMD, so switch the test to make that explicit.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-02 11:58:30 -05:00
Randy Dunlap 8ec9c7fb15 scsi: fix qla2xxx printk format warning
sector_t can be different types, so cast it to its largest possible
type.

  drivers/scsi/qla2xxx/qla_isr.c:1509:5: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'sector_t'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-23 16:02:33 -07:00
Chad Dupuis e5fdae5583 [SCSI] qla2xxx: Fix "active_mask" may be used uninitialized warning.
Since active_mask is first assigned in an "else" block, the compiler throws
a warning saying that the active_mask variable may be used uninitialized in
a print statement later.  Initialize active_mask to 0 in the declaration to
stop the warning.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:57 -07:00
Giridhar Malavali 3173167f01 [SCSI] qla2xxx: Issue mailbox command only when firmware hung bit is reset for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:57 -07:00
Joe Carnuccio b668ae37f1 [SCSI] qla2xxx: Return sysfs error codes appropriate to conditions.
Return sysfs error codes that match the conditions encountered.
This prevents sysfs from retrying a request which is conditioned
to fail under the current circumstance.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:57 -07:00
Joe Carnuccio 697a4bc691 [SCSI] qla2xxx: Provide method for updating I2C attached VPD.
Provide bsg interface for updating VPD attached on the I2C serial bus.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:57 -07:00
Joe Carnuccio 1fedd80f9c [SCSI] qla2xxx: Correction to sysfs edc interface.
Corrects the return value for the cases where read/write edc fails;
this prevents sysfs from retrying the operation until forever.

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

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:56 -07:00
Saurav Kashyap 491118dff9 [SCSI] qla2xxx: During loopdown perform Diagnostic loopback.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:56 -07:00
Saurav Kashyap 63d92d3e2e [SCSI] qla2xxx: Fix array out of bound warning.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:56 -07:00
Saurav Kashyap 54883291ff [SCSI] qla2xxx: check for marker IOCB during response queue processing.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:56 -07:00
Chad Dupuis 86e45bf66f [SCSI] qla2xxx: Enable write permission to some debug related module parameters to be changed dynamically.
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:55 -07:00
Saurav Kashyap c8582ad95b [SCSI] qla2xxx: Prevent CPU lockups when "ql2xdontresethba" module param is set.
Driver is not releasing the lock if ql2xdontresethba is set, this might lead
to a lockup.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:55 -07:00
Saurav Kashyap 999916dc59 [SCSI] qla2xxx: Implemeted beacon on/off for ISP82XX.
[jejb: fix up checkpatch.pl errors]
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:14:55 -07:00
Giridhar Malavali 08de2844c6 [SCSI] qla2xxx: Add support for ISP82xx to capture dump (minidump) on failure.
Minidump allows us to catpure a snapshot of the firmware/hardware states at the
time of failure for further analysis.

[jejb: added missing #include <linux/vmalloc.h>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> ]
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-29 00:12:26 -07:00
Chad Dupuis 7ca3c803e8 [SCSI] qla2xxx: Update version number to 8.03.07.07-k.
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 08:23:28 -06:00
Saurav Kashyap 51cc9a8e5f [SCSI] qla2xxx: Set the task attributes after memsetting fcp cmnd.
The memset of the fcp_cmnd struct needs to be moved so that it will not
zero-out valid data.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 08:22:09 -06:00
Andrew Vasquez 58b4857696 [SCSI] qla2xxx: Correct inadvertent loop state transitions during port-update handling.
Transitioning to a LOOP_UPDATE loop-state could cause the driver
to miss normal link/target processing.  LOOP_UPDATE is a crufty
artifact leftover from at time the driver performed it's own
internal command-queuing.  Safely remove this state.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 08:21:26 -06:00
Saurav Kashyap 3553d343e7 [SCSI] qla2xxx: Save and restore irq in the response queue interrupt handler.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 08:20:18 -06:00
Chad Dupuis bc91ade9b7 [SCSI] qla2xxx: Double check for command completion if abort mailbox command fails.
Close a small window where we could falsely fail an abort request if the mailbox
command fails but the command was returned during interrupt context.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 08:19:56 -06:00
Saurav Kashyap 7594206493 [SCSI] qla2xxx: Acquire hardware lock while manipulating dsd list.
The dsd list shouldn't be manipulated without taking the per host hardware
lock to prevent multiple callers from trampling upon one another.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 08:19:37 -06:00
Chad Dupuis 42cd4f5dc2 [SCSI] qla2xxx: Fix qla24xx revision check while enabling interrupts.
Since we enable interrupts before initializing the firmware, use the chip
revision from PCI config space directly to perform the chip revision check.
Also remove the unnecessary firmware attributes test.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 08:18:47 -06:00
Arun Easi e02587d777 [SCSI] qla2xxx: T10 DIF - Fix incorrect error reporting.
This fix:
    - Disables app tag peeking; correct tag check will be added when the
      SCSI API is available.
    - Always derive ref_tag from scsi_get_lba()
    - Removes incorrect swap of FCP_LUN in FCP_CMND
    - Moves app-tag error check before ref-tag check. The reason being,
      currently there is no interface in SCSI to retrieve the app-tag
      for protection I/Os, so driver puts zero for app-tag in the
      firmware interface, but requests not to validate it, but when a
      ref-tag error is detected by firmware, it would put
      expected/actual tags for all the protection tags (guard/app/ref).
      As driver checks for app tag error first, a ref-tag error is
      incorrectly flagged as app-tag error.
    - Convert HBA specific checks to capability based.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 08:13:52 -06:00
Arun Easi 8cb2049c74 [SCSI] qla2xxx: T10 DIF - Handle uninitalized sectors.
Driver needs to update protection bytes for uninitialized sectors as they are
not DMA-d.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Reviewed-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-08-27 07:55:46 -06:00
Saurav Kashyap 92fd65c095 [SCSI] qla2xxx: Cleanup of previous infrastructure.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27 14:16:34 +04:00
Saurav Kashyap 7c3df1320e [SCSI] qla2xxx: Code changes to support new dynamic logging infrastructure.
The code is changed to support the new dynamic logging infrastructure.
Following are the levels added.
Default is 0 - no logging.  0x40000000 - Module Init & Probe.
0x20000000 - Mailbox Cmnds. 0x10000000 - Device Discovery.
0x08000000 - IO tracing.    0x04000000 - DPC Thread.
0x02000000 - Async events.  0x01000000 - Timer routines.
0x00800000 - User space.    0x00400000 - Task Management.
0x00200000 - AER/EEH.       0x00100000 - Multi Q.
0x00080000 - P3P Specific.  0x00040000 - Virtual Port.
0x00020000 - Buffer Dump.   0x00010000 - Misc.
0x7fffffff - For enabling all logs, can be too many logs.

Setting ql2xextended_error_logging module parameter to any of the above
value, will enable the debug for that particular level.
Do LOGICAL OR of the value to enable more than one level.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27 14:16:17 +04:00
Saurav Kashyap 3ce8866cea [SCSI] qla2xxx: Basic infrastructure for dynamic logging.
This patch adds the dynamic logging framework to the qla2xxx driver.
The user will be able to change the logging levels on the fly i.e.
without load/unload of the driver. This also enables logging to be
enabled for a particular section of the driver such as initialization,
device discovery etc.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-07-27 14:12:25 +04:00
Justin P. Mattock a06a0f8e3e scsi: qla_isr.c: fix comment typo 'hammmer'
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-06-27 12:30:59 +02:00
Linus Torvalds 57d19e80f4 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: (39 commits)
  b43: fix comment typo reqest -> request
  Haavard Skinnemoen has left Atmel
  cris: typo in mach-fs Makefile
  Kconfig: fix copy/paste-ism for dell-wmi-aio driver
  doc: timers-howto: fix a typo ("unsgined")
  perf: Only include annotate.h once in tools/perf/util/ui/browsers/annotate.c
  md, raid5: Fix spelling error in comment ('Ofcourse' --> 'Of course').
  treewide: fix a few typos in comments
  regulator: change debug statement be consistent with the style of the rest
  Revert "arm: mach-u300/gpio: Fix mem_region resource size miscalculations"
  audit: acquire creds selectively to reduce atomic op overhead
  rtlwifi: don't touch with treewide double semicolon removal
  treewide: cleanup continuations and remove logging message whitespace
  ath9k_hw: don't touch with treewide double semicolon removal
  include/linux/leds-regulator.h: fix syntax in example code
  tty: fix typo in descripton of tty_termios_encode_baud_rate
  xtensa: remove obsolete BKL kernel option from defconfig
  m68k: fix comment typo 'occcured'
  arch:Kconfig.locks Remove unused config option.
  treewide: remove extra semicolons
  ...
2011-05-23 09:12:26 -07:00
Joe Carnuccio 6ad11eaa8a [SCSI] qla2xxx: Refactor call to qla2xxx_read_sfp for thermal temperature.
Eliminate duplicate code by refactoring the calls to qla2xxx_read_sfp()
in qla2x00_get_thermal_temp(). This keeps the parameter values separate
from the mailbox register mechanics. This also allows qla2xxx_read_sfp()
to be the sole "spec" for READ SFP semantics.

Signed-off_by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:39:25 +04:00
Joe Carnuccio 6766df9e8a [SCSI] qla2xxx: Unify the read/write sfp mailbox command routines.
Make the read/write sfp mailbox command routines uniform, and remove redundancy.
Also protect against attempting to do a single byte dma in these routines.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:36:23 +04:00
Andrew Vasquez 773120e4df [SCSI] qla2xxx: Clear complete initialization control block.
Use proper init_cb_size member which takes into account
MID/non-MID init-cb structure sizes.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:35:57 +04:00
Andrew Vasquez 82515920b6 [SCSI] qla2xxx: Allow an override of the registered maximum LUN.
The 'max_lun' value registered for each scsi_host is currently
capped at 0xffff.  The new module parameter can allow for
2nd-level flat-space addressing method-infrastructure to be
supported.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:34:56 +04:00
Saurav Kashyap 24014d0464 [SCSI] qla2xxx: Add host number in reset and quiescent message logs.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:34:37 +04:00
Joe Carnuccio 1bff6cc8fb [SCSI] qla2xxx: Correctly read sfp single byte mailbox register.
When reading a single byte using the READ SFP mailbox command, the
single byte of data is returned in MB[1] and not MB[8].

The reason that MB[8] was being used is that the spec was unclear
as it evolved over time; and we have not needed to read a single
byte until recently.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:34:20 +04:00
Chad Dupuis d652e09370 [SCSI] qla2xxx: Add qla82xx_rom_unlock() function.
Encapsulate the unlocking of the ROM lock in a function for better
code readability.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:32:39 +04:00
Chad Dupuis 875efad774 [SCSI] qla2xxx: Log if qla82xx firmware fails to load from flash.
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:32:11 +04:00
Madhuranath Iyengar 134ae07850 [SCSI] qla2xxx: Use passed in host to initialize local scsi_qla_host in queuecommand function
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:31:57 +04:00
Joe Carnuccio 93d29cc63f [SCSI] qla2xxx: Correct buffer start in edc sysfs debug print.
The debug print prints the first byte of the buffer which is buf[8].

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:31:31 +04:00
Saurav Kashyap 53296788f4 [SCSI] qla2xxx: Update firmware version after flash update for ISP82xx.
The driver keeps a copy of the fw_version within the ha structure.
For ISP82xx, this local copy doesn't get updated, and as a result,
the old firmware version ends up getting displayed. This patch fixes
this issue.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:31:04 +04:00
Arun Easi 43ebf16d76 [SCSI] qla2xxx: Fix hang during driver unload when vport is active.
Bumping ref count during fc_vport_terminate() was the cause. vport
delete would wait for ref count to drop to zero and that would never
happen.

Cc: stable@kernel.org
Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:29:10 +04:00
Andrew Vasquez fa96d92736 [SCSI] qla2xxx: Properly set the dsd_list_len for dsd_chaining in cmd type 6.
The firmware spec has the fcp_data_dseg_len defined as a 32-bit
value, while the corresponding field in the driver structure has
it defined as a 16-bit value.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:28:03 +04:00
Saurav Kashyap cefcaba67a [SCSI] qla2xxx: Fix virtual port failing to login after chip reset.
This patch ensures qla82xx_watchdog is not being run for the vport. It also
makes sure that beacon ON is not done for the vport, as it will lead to the
waking up of the dpc thread again and again.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:27:32 +04:00
Arun Easi 9f40682e28 [SCSI] qla2xxx: Fix vport delete hang when logins are outstanding.
Timer is required to flush out entries that may be present in work queues.

Cc: stable@kernel.org
Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:25:38 +04:00
Madhuranath Iyengar c9c2a14047 [SCSI] qla2xxx: Update version number to 8.03.07.03-k.
A minor change in the versioning. We'll be attaching the "-k"
in the end.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:15:51 -05:00
Chad Dupuis ec426e106c [SCSI] qla2xxx: Log fcport state transitions when debug messages are enabled.
Add the inline function qla2x00_set_port_state() so that when a fcport state
transition happens we can log the state transition if debug messages are
enabled.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:14:42 -05:00
Andrew Vasquez a4f92a32a0 [SCSI] qla2xxx: Verify login-state has transitioned to PRLI-completed.
Before driver's own internal state is marked as PLOGI/PRLI
complete. This additional check closes a window seen with
dual-personality initiator/target devices where a driver's
PLOGI/PRLI request occurs within the window after the target's
PLOGI request has completed, but prior to the target's PRLI
arriving and processed by the firmware. Without this additional
check, the firmware will return port-information stating that the
port neither supports target nor initiator functions, causing the
driver to register the rport prematurely to the FC-transport
without the proper 'roles' being set.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:14:17 -05:00
Giridhar Malavali 92dbf27392 [SCSI] qla2xxx: Limit the logs in case device state does not change for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:13:55 -05:00
Giridhar Malavali ed0de87ce6 [SCSI] qla2xxx: Add the ql2xdontresethba module_param.
Also, change the ISP82xx code to only reset if this module_param is set
and reset is intended via the QLA82XX_DEV_NEED_RESET case.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:12:18 -05:00
Giridhar Malavali 0e8edb0303 [SCSI] qla2xxx: Display hardware/firmware registers to get more information about the error for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:11:59 -05:00
Joe Carnuccio 03bcfb57c0 [SCSI] qla2xxx: Add test for valid loop id to qla2x00_relogin().
If fabric device has invalid loop id (FC_NO_LOOP_ID) then call
qla2x00_find_new_loop_id() to attempt to obtain valid loop id.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:10:47 -05:00
Giridhar Malavali 8f7daead3c [SCSI] qla2xxx: Perform FCoE context reset before trying adapter reset for ISP82xx.
For certain failures, try to recover first by doing FCoE context reset before
attempting big hammer approach(adpater reset).

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:10:23 -05:00
Giridhar Malavali aee3dbcdd1 [SCSI] qla2xxx: Remove extra call to qla82xx_check_fw_alive().
The stanadlone call to qla82xx_check_fw_alive() in qla82xx_watchdog()
is a typo, so remove it.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:10:05 -05:00
Giridhar Malavali 02be221556 [SCSI] qla2xxx: Updated the reset sequence for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:08:53 -05:00
Andrew Vasquez 07e264b76d [SCSI] qla2xxx: Update copyright banner.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:07:23 -05:00
Andrew Vasquez c8d6691b95 [SCSI] qla2xxx: Free firmware PCB on logout request.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 10:03:45 -05:00
Mike Hernandez a74ec14ffb [SCSI] qla2xxx: Include request queue ID in the upper 16-bits of the I/O handle for Abort I/O IOCBs.
The upper 16-bits of the handle for all I/O in multi-queue supported
drivers carries the ID of the request queue it was submitted on. When
using Abort I/O IOCB, the driver needs to also populate the upper
16-bits in the handle_to_abort field so the fw can correlate with the
actual I/O.

Signed-off-by: Mike Hernandez <michael.hernandez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 09:57:57 -05:00
Andrew Vasquez 3e8bb8410f [SCSI] qla2xxx: Remove extraneous setting of FCF_ASYNC_SENT during login-done completion.
The bit is already set upon entry.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 09:57:25 -05:00
Andrew Vasquez f28a0a9613 [SCSI] qla2xxx: Check for a match before attempting to set FCP-priority information.
Modifying qla24xx_get_fcp_prio() to return a 'found' status
allows the driver to short circuit the 'set FCP-priority' call
and reduce the amount of noise generated in the messages file:

	scsi(5): Unable to activate fcp priority,  ret=0x102
	scsi(5): Unable to activate fcp priority,  ret=0x102

Also make qla24xx_get_fcp_prio() static.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 09:56:57 -05:00
Andrew Vasquez 80d79440ad [SCSI] qla2xxx: Correct calling contexts of qla2x00_mark_device_lost() in async paths.
The respective done() functions are called from process context,
so there's no reason to 'defer' the request.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 09:56:28 -05:00
Andrew Vasquez 1940ce7317 [SCSI] qla2xxx: Display PortID information during FCP command-status handling.
To provide a clearer translation of the command-status origin in
relation to the midlayer's standard SCSI nexus.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-01 09:55:09 -05:00
Jiri Kosina 07f9479a40 Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be
applied for files that didn't exist on the old branch.
2011-04-26 10:22:59 +02:00
Justin P. Mattock 6eab04a876 treewide: remove extra semicolons
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-10 17:01:05 +02:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Linus Torvalds c55d267de2 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: (170 commits)
  [SCSI] scsi_dh_rdac: Add MD36xxf into device list
  [SCSI] scsi_debug: add consecutive medium errors
  [SCSI] libsas: fix ata list corruption issue
  [SCSI] hpsa: export resettable host attribute
  [SCSI] hpsa: move device attributes to avoid forward declarations
  [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26)
  [SCSI] sd: Logical Block Provisioning update
  [SCSI] Include protection operation in SCSI command trace
  [SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try)
  [SCSI] target: Fix volume size misreporting for volumes > 2TB
  [SCSI] bnx2fc: Broadcom FCoE offload driver
  [SCSI] fcoe: fix broken fcoe interface reset
  [SCSI] fcoe: precedence bug in fcoe_filter_frames()
  [SCSI] libfcoe: Remove stale fcoe-netdev entries
  [SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h
  [SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument
  [SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs
  [SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out"
  [SCSI] libfc: Fixing a memory leak when destroying an interface
  [SCSI] megaraid_sas: Version and Changelog update
  ...

Fix up trivial conflicts due to whitespace differences in
drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}
2011-03-17 17:54:40 -07:00
Madhuranath Iyengar 76f0c37a26 [SCSI] qla2xxx: Update version number to 8.03.07.00
We'll be using the new version number scheme from now on.
The 'k' in the version in the past will be removed.

The format will be: <major>.<minor>.<sub_minor>.<iter>
A scsi-misc submission increments <sub_minor> and resets <iter>.
An scsi-rc-fixes submission, increments <iter>.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 13:01:18 -05:00
Andrew Vasquez 4e98d3b8ac [SCSI] qla2xxx: Check return value of fc_block_scsi_eh()
The fc_block_scsi_eh() might return with status FAST_IO_FAIL
indicating I/O has been terminated due to fast_io_fail timeout.
In this case the rport is still blocked, so any error recovery
will be failing on this port. Hence we need to check if the
return value from fc_block_scsi_eh() is something other than 0,
in which case it should just return with that status.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 13:00:57 -05:00
Saurav Kashyap e46ef004f8 [SCSI] qla2xxx: The ISP82XX should be online while waiting for commands completion.
If adapter is not online, the driver will not process the response queue, even
on getting an interrupt.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 13:00:38 -05:00
Andrew Vasquez ff2fc42e74 [SCSI] qla2xxx: Propagate block-layer tags on submitted I/Os.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 13:00:08 -05:00
Andrew Vasquez 97dec564fd [SCSI] qla2xxx: Adjust FCP_RSP response-info field check after TMF completion.
Based on reading of the FCP2/4 specification, the driver cannot
expect the storage device to send FCP_RSP information. Instead,
the driver should interpret the data which is present in the frame
to base decisions on the success or failure of the system.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:59:13 -05:00
Andrew Vasquez 6aef87bea9 [SCSI] qla2xxx: Clear any stale login-states during an adapter reset.
By not clearing the 'login needed' nor 'login outstanding' states
for an fcport after a big-hammer (adapter reset), the driver may
not properly perform a PLOGI/PRLI sequence (and lose visibility
to the rport) during a follow-on SNS scan.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:58:18 -05:00
Andrew Vasquez 7a78ceda1c [SCSI] qla2xxx: Pass right CT command string for CT status processing.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:56:11 -05:00
Giridhar Malavali 862cd01e5c [SCSI] qla2xxx: Don't wait for active mailbox command completion when firmware is hung.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:53:49 -05:00
Giridhar Malavali 7190575f7a [SCSI] qla2xxx: Abort pending commands for faster recovery during ISP reset.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:51:44 -05:00
Giridhar Malavali cf2d771255 [SCSI] qla2xxx: Display nport_id when any SNS command fails.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:48:14 -05:00
Giridhar Malavali 0060ddf8f7 [SCSI] qla2xxx: Reinitialize the device initialize timeout value after reset on ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:41:37 -05:00
Chad Dupuis 7c8cf2fee1 [SCSI] qla2xxx: Fix array subscript is above array bounds in qla2xx_build_scsi_type_6_iocbs().
The additional increment of dsd_seg was causing the compiler to throw an array
out of bounds warning. This patch moves to a direct assignment of
cmd_pkt->fcp_data_dseg_len so that the compiler doesn't generate an array out
bounds warning.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:24:59 -05:00
Madhuranath Iyengar f5e3e40b39 [SCSI] qla2xxx: Remove host_lock in queuecommand function
Also in qla_os.c, rename the function, remove DEF_SCSI_QCMD, etc.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:21:52 -05:00
Tejun Heo 43d133c18b Merge branch 'master' into for-2.6.39 2011-02-21 09:43:56 +01:00
Andrew Vasquez 1621dbbdb9 [SCSI] qla2xxx: Return DID_NO_CONNECT when FC device is lost.
If the target device gets lost, this fix is needed, as it causes
negative unintended responses on basic I/O tests. If the target device
gets lost, the upstream qla2xxx driver returns
SCSI_MLQUEUE_TARGET_BUSY which causes an immediate retry without drop
in the number of allowed retries. This semantic change, as a result of
removing FC_DEVICE_LOST check is reasonable, as it only extends a
short transitional period, until the transport is called to notify
that the rport as lost (fc_remote_port_delete()). Once transport
notification is done, fc_remote_port_chkready() check will take over.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-15 11:12:17 -06:00
Madhuranath Iyengar 044d78e1ac [SCSI] qla2xxx: Change from irq to irqsave with host_lock
Make the driver safer by using irqsave/irqrestore with host_lock.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:52:40 -06:00
James Bottomley 563585ec4b [SCSI] qla2xxx: Fix race that could hang kthread_stop()
There is a small race window in qla2x00_do_dpc() between
checking for kthread_should_stop() and going to sleep after
setting TASK_INTERRUPTIBLE. If qla2x00_free_device() is called
in this window, kthread_stop will wait forever because there
will be no one to wake up the process.

Fix by making sure we only set TASK_INTERRUPTIBLE before checking
kthread_stop().

Reported-by: Bandan Das <bandan.das@stratus.com>
Acked-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:17:13 -06:00
Tejun Heo 278274d544 scsi/be2iscsi,qla2xxx: convert to alloc_workqueue()
Switch to new workqueue interface alloc_workqueue().  These are
identity conversions.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Cc: Jayamohan Kallickal <jayamohank@serverengines.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org
2011-02-01 11:42:42 +01:00
Giridhar Malavali aa5cbf8a70 [SCSI] qla2xxx: Use sg_next to fetch next sg element while walking sg list.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:09:47 -06:00
Giridhar Malavali 900a36e327 [SCSI] qla2xxx: Fix to avoid recursive lock failure during BSG timeout.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:09:33 -06:00
Giridhar Malavali 0ce8791149 [SCSI] qla2xxx: Remove code to not reset ISP82xx on failure.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:07:55 -06:00
Andrew Vasquez bc5c2aad17 [SCSI] qla2xxx: Display mailbox register 4 during 8012 AEN for ISP82XX parts.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:07:42 -06:00
Andrew Vasquez 7a44b86e77 [SCSI] qla2xxx: Don't perform a BIG_HAMMER if Get-ID (0x20) mailbox command fails on CNAs.
The semantics we employ now in the driver, performing a
BIG_HAMMER in the event of Get-ID (0x20) mailbox command
failing, should only be done for FC.  On FC configurations, it
makes sense since advertising is only really performed once,
so a BIG_HAMMER to reinitiate the process is needed to
restart.  Under FCoE, this is not needed, as there's a
continous stream of advertisements/ACks at the protocol layer
to initiate a relogin/reinitialization process.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:06:39 -06:00
Joe Carnuccio f2019cb117 [SCSI] qla2xxx: Remove redundant module parameter permission bits
For driver module parameters that have permission bits set to
(S_IRUGO|S_IRUSR), remove the second term since it is already
included in the first term.

S_IRUGO comes defined as (S_IRUSR|S_IRGRP|S_IROTH).

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:06:18 -06:00
Andrew Vasquez 794a569114 [SCSI] qla2xxx: Add sysfs node for displaying board temperature.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:04:37 -06:00
Giridhar Malavali 10fbb7dd36 [SCSI] qla2xxx: Code cleanup to remove unwanted comments and code.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:02:22 -06:00
Madhuranath Iyengar c9e8fd5cfb [SCSI] qla2xxx: Fix for memory wedge on fw halt for ISP82XX
Signed-off-by: Swapnil Nagle <swapnil.nagle@qlogic.com>
Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:56:17 -06:00
Madhuranath Iyengar 21090cbe95 [SCSI] qla2xxx: Update FCP priority information to firmware before sending IOs
The FCP priority info was not being updated properly in certain situations.
Here are the changes that needs to be done to take care of this issue:
1. No need to check fcport->state for FCS_UNCONFIGURED in
qla24xx_update_fcport_fcp_prio(), since an invalid loop id check is
already performed which is sufficient.
2. Add the missing qla24xx_update_fcport_fcp_prio() function call
within qla2x00_update_fcport() function, so that the priority info
is updated on every port addition or change.
3. Perform proper adapter types checking.
4. Other changes, associated with DEBUG/printk's and parameter passing.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:45:02 -06:00
Joe Carnuccio 4052bd5723 [SCSI] qla2xxx: Fixed zero test on new_config in qla2x00_process_loopback().
Fixed the incorrect zero test on array new_config[].

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:44:48 -06:00
Andrew Vasquez ff8073fffc [SCSI] qla2xxx: Populate FCP_PRIO location for no *FLT* case
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:44:28 -06:00
Dan Carpenter 8ae598d025 [SCSI] qla2xxx: list cursors are not null
This is just a cleanup.

The unneeded NULL check annoys static checkers because we already
derefenced it and the we check it and then (if it's not the _safe()
version) we dereference it again without checking.  And the static
checker is all, "Wah?  Is it null or not?"

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:43:32 -06:00
Saurav Kashyap 579d12b58a [SCSI] qla2xxx: Added support for quiescence mode for ISP82xx.
Support is added for quiescence mode. This feature is for P3P
adapters. Any of the functions can put the firmware into quiescence
state. All the others have to ack that request. During quiescence mode
current commands are processed and all the new incoming I/Os are
blocked. Loop resync is performed after firmware comes out of
quiescence state.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:40:55 -06:00
Madhuranath Iyengar 13d38d9df2 [SCSI] qla2xxx: Update version number to 8.03.05-k0.
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-09 13:25:51 -06:00
Saurav Kashyap 69abf61ea1 [SCSI] qla2xxx: Properly set the return value in qla2xxx_eh_abort function.
A return value is not set for the successful case and it has a garbage value.
This fix will set the default value to SUCCESS and in case of any failures
it is changed.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-09 13:25:47 -06:00
Andrew Vasquez 087c621e22 [SCSI] qla2xxx: Correct issue where NPIV-config data was not being allocated for 82xx parts.
This would cause a panic while reading the NPIV-config data.

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-09 13:25:21 -06:00
Mike Hernandez 7992abfc8b [SCSI] qla2xxx: Change MSI initialization from using incorrect request_irq parameter.
IRQF_SHARED flag should not be set when calling request_irq for MSI
since this interrupt mechanism cannot be shared like standard INTx.

Signed-off-by: Mike Hernandez <michael.hernandez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-09 13:25:03 -06:00
Mike Hernandez 85727e1f78 [SCSI] qla2xxx: Populate Command Type 6 LUN field properly.
Use the host_to_fcp_swap call to correctly populate the LUN field
in the Command Type 6 path.  This field is used during LUN reset
cleanup and must match the field used in the FCP command.

Cc: stable@kernel.org
Signed-off-by: Mike Hernandez <michael.hernandez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-09 13:24:11 -06:00
Jeff Garzik f281233d3e SCSI host lock push-down
Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation.  No locking or other behavior should change
with this patch.  All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
	struct Scsi_Host *
and remove one parameter from queuecommand,
	void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change.  Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-16 13:33:23 -08:00
Giridhar Malavali 38170fa8e6 [SCSI] qla2xxx: Avoid depending on SCSI host_lock in queuecommand function.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:04:12 -05:00
Andrew Vasquez 9dac0d9a93 [SCSI] qla2xxx: Correct PRLI failure response code handling.
This patch fixes an issue which causes the firmware to fail with a
'PRLI failed' status code (iop1 = 405). This status triggers the
driver to fall into an incorrect code-path which does not attempt
a login retry.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:03:57 -05:00
Mike Christie 170babc372 [SCSI] qla2xxx: Drop srb reference before waiting for completion.
This patch fixes a regression introduced by commit
083a469db4

qla2xxx_eh_wait_on_command() is waiting for an srb to
complete, which will never happen as the routine took
a reference to the srb previously and will only drop it
after this function. So every command abort will fail.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:03:39 -05:00
Madhuranath Iyengar e30d175648 [SCSI] qla2xxx: Addition of shutdown callback handler.
This patch adds a shutdown handler to qla2xxx driver to make sure that all
DMA and firmware activities are stopped, and any associated driver resources
are released. The need for this handler arose when executing kexec in specific
environments caused the data of the 2nd kernel to be corrupted, due to DMA
activities.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:03:18 -05:00
Andrew Vasquez 339aa70ecb [SCSI] qla2xxx: Initialize the vport_slock spinlock.
Commit feafb7b171 neglected to initialize
the spinlock.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:02:57 -05:00
Madhuranath Iyengar 09d1dc2a00 [SCSI] qla2xxx: Remove scsi_cmnd->serial_number from debug traces
This patch cleans up any printk or debug tracing of the the
serial_number field in the qla2xxx driver.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:02:38 -05:00
Harish Zunjarrao f19af1636b [SCSI] qla2xxx: Add flash read/update support using BSG interface
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:00:40 -05:00
Chad Dupuis ff454b01b4 [SCSI] qla2xxx: Group CS_RESET return status with other link level event statuses.
Currently when we receive a CS_RESET as a response for a SCSI command the
driver will return DID_TRANSPORT_DISRUPTED back to the SCSI mid-layer.  There
are certain circumstances where this could cause the mid-layer to exhaust all of
its retries if the FC port goes away for a short time.  This will result in
commands being prematurly failed.  Moving the CS_RESET return code to be
grouped with other link level events will cause the FC transport layer to block
that target's queue thus preventing the premature exhaustion of retries.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:00:22 -05:00
Chad Dupuis 4d97cc5342 [SCSI] qla2xxx: Change del_timer_sync() to del_timer() in qla2x00_ctx_sp_free().
Using del_timer_sync() in the qla2x00_ctx_sp_free() function may cause a kernel
panic as it is not interrupt context safe and qla2x00_ctx_sp_free() may be
called from a softirq context.  Changing the call from del_timer_sync() to
del_timer() will make the function interrupt context safe.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 16:00:08 -05:00
Chad Dupuis 4da26e162b [SCSI] qla2xxx: Add module parameter to enable/disable GFF_ID device type check.
Add the module parameter ql2xgffidenable to disable/enable the use of the
GFF_ID name server command to prevent non FCP SCSI devices from being added to
the driver's internal fc_port database.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 15:58:28 -05:00
Chad Dupuis 1e6d067092 [SCSI] qla2xxx: Remove port down retry count.
This patch removes the use of the port down retry counter as a mechanism to
update a fcport state. The internal driver counter is a residual carry-over
from pre-FC-transport aware driver inteaction. The ql2xport_down_retry module
parameter and NVRAM set ha->port_down_retry_count remain in order to seed the
fc-host's default dev-loss-tmo.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 15:57:25 -05:00
Dan Carpenter 542bce1f25 [SCSI] qla2xxx: locking problem in qla2x00_init_rings()
IRQs are already disabled here so we don't need to disable them again.
But more importantly, the spin_lock_irqsave() overwrites "flags" and
that breaks things when we want to re-enable the IRQs when we call
spin_unlock_irqrestore(&ha->hardware_lock, flags);

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-25 15:54:55 -05:00
Linus Torvalds c70b5296e7 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: (84 commits)
  [SCSI] be2iscsi: SGE Len == 64K
  [SCSI] be2iscsi: Remove premature free of cid
  [SCSI] be2iscsi: More time for FW
  [SCSI] libsas: fix bug for vacant phy
  [SCSI] sd: Fix overflow with big physical blocks
  [SCSI] st: add MTWEOFI to write filemarks without flushing drive buffer
  [SCSI] libsas: Don't issue commands to devices that have been hot-removed
  [SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive
  [SCSI] lpfc 8.3.17: Update lpfc driver version to 8.3.17
  [SCSI] lpfc 8.3.17: Replace function reset methodology
  [SCSI] lpfc 8.3.17: SCSI fixes
  [SCSI] lpfc 8.3.17: BSG fixes
  [SCSI] lpfc 8.3.17: SLI Additions and Fixes
  [SCSI] lpfc 8.3.17: Code Cleanup and Locking fixes
  [SCSI] zfcp: Remove scsi_cmnd->serial_number from debug traces
  [SCSI] ipr: fix array error logging
  [SCSI] aha152x: enable PCMCIA on 64bit
  [SCSI] scsi_dh_alua: Handle all states correctly
  [SCSI] cxgb4i: connection and ddp setting update
  [SCSI] cxgb3i: fixed connection over vlan
  ...
2010-10-22 17:34:15 -07:00
Arnd Bergmann 6038f373a3 llseek: automatically add .llseek fop
All file_operations should get a .llseek operation so we can make
nonseekable_open the default for future file operations without a
.llseek pointer.

The three cases that we can automatically detect are no_llseek, seq_lseek
and default_llseek. For cases where we can we can automatically prove that
the file offset is always ignored, we use noop_llseek, which maintains
the current behavior of not returning an error from a seek.

New drivers should normally not use noop_llseek but instead use no_llseek
and call nonseekable_open at open time.  Existing drivers can be converted
to do the same when the maintainer knows for certain that no user code
relies on calling seek on the device file.

The generated code is often incorrectly indented and right now contains
comments that clarify for each added line why a specific variant was
chosen. In the version that gets submitted upstream, the comments will
be gone and I will manually fix the indentation, because there does not
seem to be a way to do that using coccinelle.

Some amount of new code is currently sitting in linux-next that should get
the same modifications, which I will do at the end of the merge window.

Many thanks to Julia Lawall for helping me learn to write a semantic
patch that does all this.

===== begin semantic patch =====
// This adds an llseek= method to all file operations,
// as a preparation for making no_llseek the default.
//
// The rules are
// - use no_llseek explicitly if we do nonseekable_open
// - use seq_lseek for sequential files
// - use default_llseek if we know we access f_pos
// - use noop_llseek if we know we don't access f_pos,
//   but we still want to allow users to call lseek
//
@ open1 exists @
identifier nested_open;
@@
nested_open(...)
{
<+...
nonseekable_open(...)
...+>
}

@ open exists@
identifier open_f;
identifier i, f;
identifier open1.nested_open;
@@
int open_f(struct inode *i, struct file *f)
{
<+...
(
nonseekable_open(...)
|
nested_open(...)
)
...+>
}

@ read disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
<+...
(
   *off = E
|
   *off += E
|
   func(..., off, ...)
|
   E = *off
)
...+>
}

@ read_no_fpos disable optional_qualifier exists @
identifier read_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
{
... when != off
}

@ write @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
expression E;
identifier func;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
<+...
(
  *off = E
|
  *off += E
|
  func(..., off, ...)
|
  E = *off
)
...+>
}

@ write_no_fpos @
identifier write_f;
identifier f, p, s, off;
type ssize_t, size_t, loff_t;
@@
ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
{
... when != off
}

@ fops0 @
identifier fops;
@@
struct file_operations fops = {
 ...
};

@ has_llseek depends on fops0 @
identifier fops0.fops;
identifier llseek_f;
@@
struct file_operations fops = {
...
 .llseek = llseek_f,
...
};

@ has_read depends on fops0 @
identifier fops0.fops;
identifier read_f;
@@
struct file_operations fops = {
...
 .read = read_f,
...
};

@ has_write depends on fops0 @
identifier fops0.fops;
identifier write_f;
@@
struct file_operations fops = {
...
 .write = write_f,
...
};

@ has_open depends on fops0 @
identifier fops0.fops;
identifier open_f;
@@
struct file_operations fops = {
...
 .open = open_f,
...
};

// use no_llseek if we call nonseekable_open
////////////////////////////////////////////
@ nonseekable1 depends on !has_llseek && has_open @
identifier fops0.fops;
identifier nso ~= "nonseekable_open";
@@
struct file_operations fops = {
...  .open = nso, ...
+.llseek = no_llseek, /* nonseekable */
};

@ nonseekable2 depends on !has_llseek @
identifier fops0.fops;
identifier open.open_f;
@@
struct file_operations fops = {
...  .open = open_f, ...
+.llseek = no_llseek, /* open uses nonseekable */
};

// use seq_lseek for sequential files
/////////////////////////////////////
@ seq depends on !has_llseek @
identifier fops0.fops;
identifier sr ~= "seq_read";
@@
struct file_operations fops = {
...  .read = sr, ...
+.llseek = seq_lseek, /* we have seq_read */
};

// use default_llseek if there is a readdir
///////////////////////////////////////////
@ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier readdir_e;
@@
// any other fop is used that changes pos
struct file_operations fops = {
... .readdir = readdir_e, ...
+.llseek = default_llseek, /* readdir is present */
};

// use default_llseek if at least one of read/write touches f_pos
/////////////////////////////////////////////////////////////////
@ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read.read_f;
@@
// read fops use offset
struct file_operations fops = {
... .read = read_f, ...
+.llseek = default_llseek, /* read accesses f_pos */
};

@ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write.write_f;
@@
// write fops use offset
struct file_operations fops = {
... .write = write_f, ...
+	.llseek = default_llseek, /* write accesses f_pos */
};

// Use noop_llseek if neither read nor write accesses f_pos
///////////////////////////////////////////////////////////

@ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
identifier write_no_fpos.write_f;
@@
// write fops use offset
struct file_operations fops = {
...
 .write = write_f,
 .read = read_f,
...
+.llseek = noop_llseek, /* read and write both use no f_pos */
};

@ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier write_no_fpos.write_f;
@@
struct file_operations fops = {
... .write = write_f, ...
+.llseek = noop_llseek, /* write uses no f_pos */
};

@ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
identifier read_no_fpos.read_f;
@@
struct file_operations fops = {
... .read = read_f, ...
+.llseek = noop_llseek, /* read uses no f_pos */
};

@ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
identifier fops0.fops;
@@
struct file_operations fops = {
...
+.llseek = noop_llseek, /* no read or write fn */
};
===== End semantic patch =====

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Julia Lawall <julia@diku.dk>
Cc: Christoph Hellwig <hch@infradead.org>
2010-10-15 15:53:27 +02:00
Mike Christie d2b5f10e5b [SCSI] qla2xxx: prep for fc host dev loss tmo support
This removes the driver's get_host_def_dev_loss_tmo
callback and just has the driver set the dev loss
using the fc class fc_host_dev_loss_tmo macro like is
done for other fc params.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-10-07 17:09:39 -05:00
Shyam Sundar e6a4202aa9 [SCSI] qla2xxx: ROM lock recovery if fw hangs while holding the lock.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-16 22:54:10 -04:00
Saurav Kashyap bcc5b6d323 [SCSI] qla2xxx: AER Support-Return recovered from mmio_enable function for 82XX.
Return recovered from pci_mmio_enabled function if it is 82XX.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:36:28 -03:00
Giridhar Malavali 58548cb51a [SCSI] qla2xxx: Increase SG table size to support large IO size per scsi command.
The sg table size is increased from 128 to 1024 to support multiple sg lists
and number of sg elements per scsi command.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:36:25 -03:00
Giridhar Malavali 3fadb80b0f [SCSI] qla2xxx: Clear local references of rport on device loss timeout notification from FC transport.
The clearing of local references to rport was blocked when abort is
active. This code clears the local references unconditionaly upon
device loss timeout callback from FC transport.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:36:21 -03:00
Madhuranath Iyengar b1d46989c1 [SCSI] qla2xxx: Handle MPI timeout indicated by AE8002
In case the MPI times out, the FW issues an async event AE8002
to indicate this to every FCoE function. The FC/FCoE driver is
required to handle this, by doing a soft reset and issuing a
Write MPI register mailbox command to reset the MPI.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:35:01 -03:00
Lalit Chandivade bddd2d65a4 [SCSI] qla2xxx: Update to AER support, do early abort commands.
Currently the IOs are returned back in slot reset, this
could be late and can cause error handler to invoke.
If error handler invokes, eh_abort fails and escalate to
device/bus/host resets causing issues.
The commands need to be returned back to upper layer in
io_error_detected.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:35:00 -03:00
Giridhar Malavali 77e334d240 [SCSI] qla2xxx: Cleanup some dead-code and make some functions static.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:34:58 -03:00
Giridhar Malavali 35e0cbd4b2 [SCSI] qla2xxx: Return proper fabric name based on device state.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:34:56 -03:00
Lalit Chandivade a5b3632191 [SCSI] qla2xxx: Added AER support for ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:33:07 -03:00
Giridhar Malavali 6dbdda4d59 [SCSI] qla2xxx: Pass first 64 bytes of MBX information when vendor commands fail.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:33:03 -03:00
Giridhar Malavali c9afb9a24d [SCSI] qla2xxx: Don't issue set or get port param MBC if port is not online.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:33:00 -03:00
Madhuranath Iyengar 0fb576d825 [SCSI] qla2xxx: Update version number to 8.03.04-k0.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:22:55 -03:00
Giridhar Malavali 1bd58b89e8 [SCSI] qla2xxx: Check for empty slot in request queue before posting Command type 6 request.
For ISP82xx, the check for empty slot in request queue before posting command type 6
request was missing. This could lead to request queue entry corruptions causing
IO timeouts.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:22:53 -03:00
Lalit Chandivade 0374f55ed8 [SCSI] qla2xxx: Cover UNDERRUN case where SCSI status is set.
Currently, if target sets the SCSI Status (with Check condition)
and there is no FCP residual bit set then driver  does not check
for dropped frame.  This could lead to data corruption.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:18:31 -03:00
Giridhar Malavali 4142b1987f [SCSI] qla2xxx: Correctly set fw hung and complete only waiting mbx.
The fw_hung flag should be set ir-respective of if there is a
mbx command pending or not. Also the complete should be called
if there is a mbx waiting.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:18:29 -03:00
Lalit Chandivade efa786cc43 [SCSI] qla2xxx: Reset seconds_since_last_heartbeat correctly.
The seconds_since_last_heartbeat should be checked for consecutive
heartbeat checks. Currently it could happen that seconds_since_last_heartbeat
gets set to max (2 seconds) for non-consecutive heartbeat checks.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:18:28 -03:00
Arun Easi 970ee0c52a [SCSI] qla2xxx: make rport deletions explicit during vport removal
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:13:13 -03:00
Arun Easi feafb7b171 [SCSI] qla2xxx: Fix vport delete issues
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 15:13:12 -03:00
Mike Christie a74bdf4661 [SCSI] qla2xxx: do not reset dev_loss_tmo in slave callout
This fixes a bug where the driver was resetting the
rport dev_loss_tmo when devices were added by adding
support for the get_host_def_dev_loss_tmo callout.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-09-05 13:45:25 -03:00
Joe Perches ae68230c2d drivers/scsi/qla2xxx/qla_os.c: fix continuation line formats
String constants that are continued on subsequent lines with \ will cause
spurious whitespace in the resulting output.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: James E.J. Bottomley <James.Bottomley@suse.de>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Cc: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-11 08:59:01 -07:00
Linus Torvalds 3cfc2c42c1 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (48 commits)
  Documentation: update broken web addresses.
  fix comment typo "choosed" -> "chosen"
  hostap:hostap_hw.c Fix typo in comment
  Fix spelling contorller -> controller in comments
  Kconfig.debug: FAIL_IO_TIMEOUT: typo Faul -> Fault
  fs/Kconfig: Fix typo Userpace -> Userspace
  Removing dead MACH_U300_BS26
  drivers/infiniband: Remove unnecessary casts of private_data
  fs/ocfs2: Remove unnecessary casts of private_data
  libfc: use ARRAY_SIZE
  scsi: bfa: use ARRAY_SIZE
  drm: i915: use ARRAY_SIZE
  drm: drm_edid: use ARRAY_SIZE
  synclink: use ARRAY_SIZE
  block: cciss: use ARRAY_SIZE
  comment typo fixes: charater => character
  fix comment typos concerning "challenge"
  arm: plat-spear: fix typo in kerneldoc
  reiserfs: typo comment fix
  update email address
  ...
2010-08-04 15:31:02 -07:00
Arun Easi 0c47087485 [SCSI] qla2xxx: T10 DIF Type 2 support
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-07-28 09:06:18 -05:00
Andrew Vasquez 3dbe756a66 [SCSI] qla2xxx: Cleanup some dead-code and make some functions static.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:18 -05:00
Giridhar Malavali de7c5d059d [SCSI] qla2xxx: Update copyright banner.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:16 -05:00
Giridhar Malavali 4d78c973ef [SCSI] qla2xxx: Rearranged and cleaned up the code for processing the pending commands.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:15 -05:00
Giridhar Malavali 3711333dfb [SCSI] qla2xxx: Updates for ISP82xx.
Re-organized and cleaned up the ISP82xx specific code.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:14 -05:00
Harish Zunjarrao 08f71e090d [SCSI] qla2xxx: Do not allow ELS Passthru commands for ISP23xx adapters
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:14 -05:00
Harish Zunjarrao 9bc4f4fb44 [SCSI] qla2xxx: Add CT passthru support for ISP23xx adapters
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:13 -05:00
Madhuranath Iyengar 9a15eb4b51 [SCSI] qla2xxx: Don't issue set or get port param MBC if remote port is not logged in
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:12 -05:00
Chad Dupuis 8867048b48 [SCSI] qla2xxx: Add qla2x00_free_fcports() function
This function was added to encapsulate freeing the memory for all the fcports
associated with a particular vha.  Also added a call to qla2x00_free_fcports()
to qla2x00_free_device() to free the memory for all the fcports associated with
a vha during device removal.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:11 -05:00
Andrew Vasquez 14e303d98b [SCSI] qla2xxx: Stop firmware before doing init firmware.
If BIOS is enabled then drivers init firmware fails since
BIOS has done the init once.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:11 -05:00
Duane Grigsby 03c3f563c5 [SCSI] qla2xxx: Propogate transport disrupted status for cable pull conditions for faster failover.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:10 -05:00
Andrew Vasquez 5544213be7 [SCSI] qla2xxx: Correct extended sense-data handling.
Earlier implementation did not take into account the varying
sizes of data buffers returned from structures sts_entry_t and
sts_entry_24xx.  Sense-data after the 20th byte could be
incorrect.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:10 -05:00
Madhuranath Iyengar 0f2d962f4d [SCSI] qla2xxx: Check for golden firmware and show version if available
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:09 -05:00
Chad Dupuis e8c72ba51a [SCSI] qla2xxx: Use GFF_ID to check FCP-SCSI FC4 type before logging into Nx_Ports
The default method that qla2xxx uses is the GID_PT nameserver command to
get a list of Nx_Ports. This patch adds a GFF_ID call for each port
returned by GID_PT to get the FC4 type. If the FC4 type is not FCP SCSI
then the qla2xxx driver will not record that port in it's port database.
For switches that do not support the GFF_ID command, the behavior will be
for qla2xxx to store that port anyways.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:09 -05:00
Madhuranath Iyengar 2f0f3f4f06 [SCSI] qla2xxx: Appropriately log FCP priority data messages
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:08 -05:00
Giridhar Malavali d94d10e727 [SCSI] qla2xxx: Removed dependency for SRB structure for Marker processing
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:07 -05:00
Madhuranath Iyengar 17cf2c5d76 [SCSI] qla2xxx: Don't issue set or get port param MBC if invalid port loop id
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-28 09:06:07 -05:00
Giridhar Malavali c0ff2775a1 [SCSI] qla2xxx: Updated version number to 8.03.03-k0.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:28 -05:00
Andrew Vasquez 5b91490e45 [SCSI] qla2xxx: For ISP 23xx, select user specified login timeout value if greater than minuimum value(4 secs).
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:28 -05:00
Giridhar Malavali 6c7ccf7bb9 [SCSI] qla2xxx: Removed redundant check for ISP 84xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:27 -05:00
Giridhar Malavali 6907869d72 [SCSI] qla2xxx: Enable CRB based doorbell posting for request queue as default for ISP 82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:27 -05:00
Arun Easi ba77ef5354 [SCSI] qla2xxx: T10 DIF enablement for 81XX
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:26 -05:00
Lalit Chandivade 0547fb37ca [SCSI] qla2xxx: Fix flash write failure on ISP82xx.
Driver was not unprotecting correctly, use correct bits
to unprotect the flash on ISP 82xx.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:25 -05:00
Santosh Vernekar cdbb0a4f31 [SCSI] qla2xxx: Handle outstanding mbx cmds on hung f/w scenarios.
Outstanding mailbox commands, have no way to recover on f/w hung, and we
timeout on waiting for mbx response. This in turn affects the recovery process
as follows:
- We might already be in dpc while waiting for mbx to complete, so recovery for
that pci function will never get invoked. Reset Timeout (10 sec) is far less
than mbx timeout (30 sec).
- Other mbx cmds will get stuck due to serial mbx access.

Solution is to identify fw-hung scenario and handle outstanding mbx commands to
have an early-exit instead of waiting for response.
Other mbx commands waiting for access will also do an early-exit if fw-hung is
still applicable.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:25 -05:00
Lalit Chandivade 3f3b6f98cb [SCSI] qla2xxx: Do not enable VP in non fabric topology.
After topology change ISP is reset and VPs are re-enabled.
If the topology is not fabric, VPs could falsely get enabled.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:24 -05:00
Harish Zunjarrao 9c2b297572 [SCSI] qla2xxx: Support for loading Unified ROM Image (URI) format firmware file.
Used bootloder address from FLT while loading FW from flash as well.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:24 -05:00
Andrew Vasquez b0cd579cde [SCSI] qla2xxx: Make the FC port capability mutual exclusive.
In case of both target and initiator capabilities reported by fc port,
the fc port port capability is made mutualy exclusive with priority given
for target capabilities.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:23 -05:00
Sarang Radke 23f2ebd17a [SCSI] qla2xxx: Add internal loopback support for ISP81xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:22 -05:00
Giridhar Malavali 3a6478df74 [SCSI] qla2xxx: Limit rport-flaps during link-disruptions.
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-07-27 12:01:22 -05:00
Andrew Vasquez 6ac5260850 [SCSI] qla2xxx: Correct async-srb issues.
* hold the hardware_lock throughout the duration of ctx-sp
  timeout handling -- could result in use-after-free oops.

* retry a timed-out login-request.

* done() routines are called with the hardware-lock held, issue
qla2x00_mark_device_lost() with proper 'defer' flag.

* FCP2 capabilities are only relevant to target devices.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:21 -05:00
Giridhar Malavali 083a469db4 [SCSI] qla2xxx: Correct use-after-free oops seen during EH-abort.
Hold a reference to the srb (sp) while aborting an I/O -- as the
I/O can/will complete from within the interrupt-context.

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-07-27 12:01:20 -05:00
Giridhar Malavali 7e2b895b93 [SCSI] qla2xxx: Fix cpu-affinity usage for non-capable ISPs.
The TMFs used for pre-24xx ISPs incorrectly assumed 'cpu' tag
data could be valid.  These chips have no multi-q/cpu-affinity
support.  This corrects an oops seen on ISP23xx parts.

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-07-27 12:01:20 -05:00
Andrew Vasquez d3fa9e7d27 [SCSI] qla2xxx: Add portid to async-request messages.
This helps to correlate submission/completion messages during
triaging.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:19 -05:00
Giridhar Malavali b963752f47 [SCSI] qla2xxx: Clear drive active CRB register when not in use.
The CRB drive active register is cleared when driver is unloaded
or when driver enters failed state.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:01:19 -05:00
Uwe Kleine-König 65155b3708 fix typos concerning "management"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-06-16 18:03:16 +02:00
Chris Wright 2c3c8bea60 sysfs: add struct file* to bin_attr callbacks
This allows bin_attr->read,write,mmap callbacks to check file specific data
(such as inode owner) as part of any privilege validation.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-21 09:37:31 -07:00
Giridhar Malavali f1af6208c8 [SCSI] qla2xxx: Updates to ISP82xx support.
1) Allow transition to NEED RESET state only from READY state for ISP82xx.
2) Avoid infinite ISP aborts when chip reset fails.
3) Code cleanup to remove some of the unused debug code.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
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-05-16 18:22:11 -04:00
Giridhar Malavali f4c496c1fb [SCSI] qla2xxx: Optionally disable target reset.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:22:09 -04:00
Lalit Chandivade 86fbee86e9 [SCSI] qla2xxx: ensure flash operation and host reset via sg_reset are mutually exclusive
The problem occurring is a hw-race where there's an outstanding read-flash
operation occurring while the chip is being reset (done via an sg_reset script).
After the chip is paused, the read-flash operation never completes and the
DPC thread, while trying to complete the reset, is never able to recover,
as the HW appears to be hung...

The fix is to wait for outstanding flash operation prior to doing a sg_reset -h.
And to wait for reset to complete before any flash operations.

Note, during the wait, if any of the operation (reset/flash) does not complete,
failure is returned to the upper layer. The upper layer either need to
fail or retry.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:22:07 -04:00
Mike Waychison 1516ef4483 [SCSI] qla2xxx: Silence bogus warning by gcc for wrap and did.
The qla2xxx driver uses a port_id_t to mark the start of its enumerations.  gcc
is complaining that wrap.b24 may be used uninitialized, but this doesn't look
to be possible.  Silence it.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:22:06 -04:00
Arun Easi bad7500289 [SCSI] qla2xxx: T10 DIF support added.
Signed-off-by: Duane Grigsby <duane.grigsby@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:59 -04:00
Madhuranath Iyengar 3822263eb1 [SCSI] qla2xxx: Support for asynchronous TM and Marker IOCBs.
Currently we can only issue the task management (TM)
commands via the mailbox mechanism. This is a limitation,
since only one mailbox command can be issued at a time.
The purpose of this effort is to provide support for
issuing and processing the respose to TM and Marker
IOCBs asynchronously. Towards achieving this, the
consolidated srb architecture that is currently used for
BSG and IOCB/Logio commands has been enhanced and used.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:57 -04:00
Madhuranath Iyengar 4916392b56 [SCSI] qla2xxx: Provide common framework for BSG and IOCB commands.
Currently, BSG and IOCB/Logio commands have a different
framework (srb structs). The purpose of this effort is to
consolidate them into a generalized framework for these
as well as other asynchronous operations in the future.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:56 -04:00
Andrew Vasquez b7d2280c15 [SCSI] qla2xxx: Cleanup FCP-command-status processing debug statements.
Migrate to a consistent set of debug entries during status-IOCB
handling:

* group CS_TIMEOUT handling with CS_PORT_UNAVAILABLE and the like
  (more regrouping of common behaviour).

* drop CS_DATA_OVERRUN handling as it now falls into the
  'default' case (still returns DID_ERROR).

* consolidate CS_RESET and CS_ABORTED handling, as we the only
  functional difference was a printk() (still returns DID_RESET).

* dropped all the earlier inconsistent [qla_]printk()s sprinkled
  throught the needlessly large case-statement.  Failure case
  I/Os are now logged with a 'standard' format:

	<command failure details>
	<command generic details>

  so, for example a dropped-frame is logged as:

	qla2xxx 0000:13:00.0: scsi(16:0:0) Dropped frame(s) detected (4000 of 4000 bytes).
	qla2xxx 0000:13:00.0: scsi(16:0:0) FCP command status: 0x15-0x18 (70018) \
    oxid=78 ser=76 cdb=280000 len=4000 rsp_info=0 resid=0 fw_resid=4000

  which should now convey all relevant information.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:54 -04:00
Andrew Vasquez 5ff1d58410 [SCSI] qla2xxx: Limit mailbox command contention for ADISC requests.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:47 -04:00
Andrew Vasquez 99b0bec7bb [SCSI] qla2xxx: Further generalization of SRB CTX infrastructure.
Prepare CTX infrastructure for additional asynchronous
executions, add generic done() operator, pull CMD definitions.

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-05-16 18:21:44 -04:00
Harish Zunjarrao 6a03b4cd78 [SCSI] qla2xxx: Add char device to increase driver use count
The driver should not be unloaded if any application is using it.
To disallow driver unload, driver use count must be incremented.
Application uses this char device as handle and increases driver
use count to avoid possible driver unload.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:42 -04:00
Lalit Chandivade 3e46f03132 [SCSI] qla2xxx: Clear error status after uncorrectable non-fatal errors.
Currently error status is cleared only after the uncorrectable fatal errors
in the qla2xxx_pci_slot_reset. This fix is added to clear the error status in
qla2xxx_pci_resume. This way for both fatal and non-fatal errors the error
status gets cleared properly.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=572258

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:34 -04:00
Andrew Vasquez 62542f4b05 [SCSI] qla2xxx: Display proper link state for disconnected ports.
With qla2xxx using mid-layer async-scsi-scanning, the link state for
disconnected port is displayed wrong. Additional check for cable presence
is considered to display proper link state.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:31 -04:00
Andrew Vasquez 0b9dae6aeb [SCSI] qla2xxx: Check for ISP84xx before processing to get 84xx firmware version.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-16 18:21:30 -04:00
Giridhar Malavali a9083016a5 [SCSI] qla2xxx: Add ISP82XX support.
Enhanced the driver to support new FCoE host bus adapter.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-01 14:11:17 -05:00
Ferenc Wagner 7794a5af67 [SCSI] qla2xxx: Fix documentation of ql2xfdmienable module parameter
The default is enabled since 7e47e5ca18.

Signed-off-by: Ferenc Wagner <wferi@niif.hu>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:54 -05:00
Andrew Vasquez 6c452a45e5 [SCSI] qla2xxx: General checkpatch corrections.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:53 -05:00
Sarang Radke bfdaa761d3 [SCSI] qla2xxx: Fix to make conditional decision based on port number.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:52 -05:00
Harish Zunjarrao d5459083af [SCSI] qla2xxx: Free DMA memory only if it is allocated in vendor specific BSG command
The qla84xx_mgmt_cmd function supports multiple subcommands.
Some subcommands require DMA memory and some do not.
Therefore check before freeing DMA memory whether it is allocated or not.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:50 -05:00
Sarang Radke 09ff701a17 [SCSI] qla2xxx: Add APEX support.
Allows priority setting for FCP_CMNDs.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:45:50 -05:00
Giridhar Malavali 6e98016ca0 [SCSI] qla2xxx: Re-organized BSG interface specific code.
1. Segregate BSG interface specific code to new files.
2. Handle multiple vendor specific commands indepedently.
3. Reorganised support for reset, management and update FCoE firmware commands.
4. Fixed memory leak issue in Loopback.
5. Added new vendor command to support iiDMA using BSG interface.
6. Proper cleanup of dma mapped and dma allocated buffers for BSG request.

[jejb: fix up conflict and merge in Jiri Slaby lock imbalance patch]
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:44:10 -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
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
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
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
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
Roel Kluin 08002af25a [SCSI] qla2xxx: negative error return in qla2x00_change_queue_depth()
The *change_queue_depth functions usually return a negative error return.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 13:15:39 -06:00
Anirban Chakraborty a67093d46e [SCSI] qla2xxx: Obtain proper host structure during response-queue processing.
Original code incorrectly assumed only status-type-0
IOCBs would be queued to the response-queue, and thus all
entries would safely reference a VHA from the IOCB
'handle.'

Cc: stable@kernel.org
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-08 13:45:55 -06:00
Xiaotian Feng 0f19bc681e [SCSI] qla2xxx: make msix interrupt handler safe for irq
Yinghai has reported a lockdep warning on qla2xxx:

[   77.965784] WARNING: at kernel/lockdep.c:2332
trace_hardirqs_on_caller+0xc6/0x14b()
[   77.977492] Hardware name: Sun
[   77.979485] Modules linked in:
[   77.994337] Pid: 0, comm: swapper Not tainted
2.6.33-rc4-tip-yh-03949-g3a8e3f5-dirty #64
[   78.000120] Call Trace:
[   78.013298]  <IRQ>  [<ffffffff81076b54>] warn_slowpath_common+0x7c/0x94
[   78.017746]  [<ffffffff81cd712c>] ? _raw_spin_unlock_irq+0x30/0x36
[   78.035171]  [<ffffffff81076b80>] warn_slowpath_null+0x14/0x16
[   78.040152]  [<ffffffff810a2ae8>] trace_hardirqs_on_caller+0xc6/0x14b
[   78.055400]  [<ffffffff810a2b7a>] trace_hardirqs_on+0xd/0xf
[   78.058951]  [<ffffffff81cd712c>] _raw_spin_unlock_irq+0x30/0x36
[   78.074889]  [<ffffffff816461ef>] qla24xx_msix_default+0x243/0x281
[   78.091598]  [<ffffffff810a5752>] ? __lock_release+0xa5/0xae
[   78.096799]  [<ffffffff810c02ae>] handle_IRQ_event+0x53/0x113
[   78.111568]  [<ffffffff810c2061>] handle_edge_irq+0xf3/0x13b
[   78.116255]  [<ffffffff81035109>] handle_irq+0x24/0x2f
[   78.132063]  [<ffffffff81cdc4b4>] do_IRQ+0x5c/0xc3
[   78.134684]  [<ffffffff81cd7393>] ret_from_intr+0x0/0xf
[   78.137903]  <EOI>  [<ffffffff81039a56>] ? mwait_idle+0xaf/0xbb
[   78.155674]  [<ffffffff81039a4d>] ? mwait_idle+0xa6/0xbb
[   78.158600]  [<ffffffff81031c7c>] cpu_idle+0x61/0xa1
[   78.174333]  [<ffffffff81c85d7a>] rest_init+0x7e/0x80
[   78.178122]  [<ffffffff82832d1f>] start_kernel+0x316/0x31d
[   78.193623]  [<ffffffff82832297>] x86_64_start_reservations+0xa7/0xab
[   78.198924]  [<ffffffff8283237f>] x86_64_start_kernel+0xe4/0xeb
[   78.214540] ---[ end trace be4529f30a2e4ef5 ]---

This was happened when qla2xxx msix interrupt handler is trying to enable
IRQs by spin_unlock_irq(). We should make interrupt handler safe for IRQs,
use spin_lock_irqsave/spin_unlock_irqrestore, this will not break the IRQs
status in interrupt handler.

Reported-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-08 13:40:18 -06:00
Giridhar Malavali e8a392444d [SCSI] qla2xxx: Update version number to 8.03.02-k0.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-01-18 16:51:59 -06:00
Giridhar Malavali f8ac60855e [SCSI] qla2xxx: Remove firmware hint for 81xx parts.
Firmware is loaded from flash for these ISP types.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-01-18 16:51:58 -06:00
Giridhar Malavali 9a069e1967 [SCSI] qla2xxx: Add BSG support for FC ELS/CT passthrough and vendor commands.
[jejb: fixed printk casting issues]
Signed-off-by: Sarang Radke <sarang.radke@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-01-18 16:51:05 -06:00
Joe Carnuccio 90a86fc05f [SCSI] qla2xxx: Enhance EEH support and enable AER support.
qla2xxx: EEH added call to pci_restore_state.
qla2xxx: EEH added delay in slot reset routine.
qla2xxx: EEH moved call to pci_save_state(), see (1).
qla2xxx: EEH additional changes for RHEL5.5.
qla2xxx: EEH added function call, removed function call, see (2).

(1) In qla2xxx_probe_one the call to pci_save_state() has been
    moved to after the call to qla2xxx_request_irqs().

(2) Add call to pci_disable_pcie_error_reporting() in remove_one.
    Delete call to pci_cleanup_aer_uncorrect_error_status() in pci_resume.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-01-18 10:48:26 -06:00
Giridhar Malavali 22c24734ce [SCSI] qla2xxx: Update version number to 8.03.01-k10.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-01-17 12:36:35 -06:00
Andrew Vasquez 368bbe0777 [SCSI] qla2xxx: Perform fast mailbox read of flash regardless of size nor address alignment.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-01-17 12:36:31 -06:00
Andrew Vasquez f08b7251c4 [SCSI] qla2xxx: Correct FCP2 recovery handling.
The driver did not account for non-tape devices needing to employ
proper FCP2 recovery.  Driver now checks the FCP2-capable flag
only, rather than using a midlayer-determined flag (TYPE_TAPE).

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-01-17 12:36:28 -06:00
Giridhar Malavali 3b9c212a5c [SCSI] qla2xxx: Update version number to 8.03.01-k9.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-30 11:09:53 -06:00
Duane Grigsby ca79cf6648 [SCSI] qla2xxx: Added to EEH support.
Added fundamental reset and pci save state.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-30 11:09:50 -06:00
Andrew Vasquez 8588080193 [SCSI] qla2xxx: Extend base EEH support in qla2xxx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-30 11:09:49 -06:00
Anirban Chakraborty 5c66f5d193 [SCSI] qla2xxx: Fix for a multiqueue bug in CPU affinity mode
Hold the hardware lock while do the response completion in work queue threads as
it involves sharing a common request queue among multiple threads.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-30 11:09:47 -06:00
Michael Hernandez 3064ff39b8 [SCSI] qla2xxx: Get the link data rate explicitly during device resync.
When the hba port gets logged out of the fabric, or other
such transitional state when the physical link is still present,
the driver doesn't receive a loop up asyn event (where the link
data rate currently gets set). Hence send a explicit mailbox command
to get the link rate in such conditions.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-30 11:09:45 -06:00
Giridhar Malavali 7729cb785d [SCSI] qla2xxx: Update version number to 8.03.01-k8.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-10 08:54:20 -06:00
Anirban Chakraborty 3155754a6b [SCSI] qla2xxx: fix for multiqueue in MISX disabled case
Fix to accommodate a hardware bug in multiqueue mode that does not
 work properly when acknowledgement of MSIX Interrupts is disabled.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-10 08:54:19 -06:00
Giridhar Malavali c45dd30551 [SCSI] qla2xxx: Queue depth ramp up/down modification changes.
Removed the module parameters ql2xqfulltracking and ql2xqfullrampup
since the queue depth ramp up/down functionality is moved to scsi-ml.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-10 08:54:18 -06:00
Michael Reed 1486400f7e [SCSI] qla2xxx: dpc thread can execute before scsi host has been added
Fix crash in qla2x00_fdmi_register() due to the dpc
thread executing before the scsi host has been fully
added.

Unable to handle kernel NULL pointer dereference (address 00000000000001d0)
qla2xxx_7_dpc[4140]: Oops 8813272891392 [1]

Call Trace:
 [<a000000100016910>] show_stack+0x50/0xa0
                                sp=e00000b07c59f930 bsp=e00000b07c591400
 [<a000000100017180>] show_regs+0x820/0x860
                                sp=e00000b07c59fb00 bsp=e00000b07c5913a0
 [<a00000010003bd60>] die+0x1a0/0x2e0
                                sp=e00000b07c59fb00 bsp=e00000b07c591360
 [<a0000001000681a0>] ia64_do_page_fault+0x8c0/0x9e0
                                sp=e00000b07c59fb00 bsp=e00000b07c591310
 [<a00000010000c8e0>] ia64_native_leave_kernel+0x0/0x270
                                sp=e00000b07c59fb90 bsp=e00000b07c591310
 [<a000000207197350>] qla2x00_fdmi_register+0x850/0xbe0 [qla2xxx]
                                sp=e00000b07c59fd60 bsp=e00000b07c591290
 [<a000000207171570>] qla2x00_configure_loop+0x1930/0x34c0 [qla2xxx]
                                sp=e00000b07c59fd60 bsp=e00000b07c591128
 [<a0000002071732b0>] qla2x00_loop_resync+0x1b0/0x2e0 [qla2xxx]
                                sp=e00000b07c59fdf0 bsp=e00000b07c5910c0
 [<a000000207166d40>] qla2x00_do_dpc+0x9a0/0xce0 [qla2xxx]
                                sp=e00000b07c59fdf0 bsp=e00000b07c590fa0
 [<a0000001000d5bb0>] kthread+0x110/0x140
                                sp=e00000b07c59fe00 bsp=e00000b07c590f68
 [<a000000100014a30>] kernel_thread_helper+0xd0/0x100
                                sp=e00000b07c59fe30 bsp=e00000b07c590f40
 [<a00000010000a4c0>] start_kernel_thread+0x20/0x40
                                sp=e00000b07c59fe30 bsp=e00000b07c590f40

crash> dis a000000207197350
0xa000000207197350 <qla2x00_fdmi_register+2128>:        [MMI]       ld1 r45=[r14];;
crash> scsi_qla_host.host 0xe00000b058c73ff8
  host = 0xe00000b058c73be0,
crash> Scsi_Host.shost_data 0xe00000b058c73be0
  shost_data = 0x0,  <<<<<<<<<<<

The fc_transport fc_* workqueue threads have yet to be created.

crash> ps | grep _7
   3891      2   2  e00000b075c80000  IN   0.0       0      0  [scsi_eh_7]
   4140      2   3  e00000b07c590000  RU   0.0       0      0  [qla2xxx_7_dpc]

The thread creating adding the Scsi_Host is blocked due to other
activity in sysfs.

crash> bt 3762
PID: 3762   TASK: e00000b071e70000  CPU: 3   COMMAND: "modprobe"
 #0 [BSP:e00000b071e71548] schedule at a000000100727e00
 #1 [BSP:e00000b071e714c8] __mutex_lock_slowpath at a0000001007295a0
 #2 [BSP:e00000b071e714a8] mutex_lock at a000000100729830
 #3 [BSP:e00000b071e71478] sysfs_addrm_start at a0000001002584f0
 #4 [BSP:e00000b071e71440] create_dir at a000000100259350
 #5 [BSP:e00000b071e71410] sysfs_create_subdir at a000000100259510
 #6 [BSP:e00000b071e713b0] internal_create_group at a00000010025c880
 #7 [BSP:e00000b071e71388] sysfs_create_group at a00000010025cc50
 #8 [BSP:e00000b071e71368] dpm_sysfs_add at a000000100425050
 #9 [BSP:e00000b071e71310] device_add at a000000100417d90
#10 [BSP:e00000b071e712d8] scsi_add_host at a00000010045a380
#11 [BSP:e00000b071e71268] qla2x00_probe_one at a0000002071be950
#12 [BSP:e00000b071e71248] local_pci_probe at a00000010032e490
#13 [BSP:e00000b071e71218] pci_device_probe at a00000010032ecd0
#14 [BSP:e00000b071e711d8] driver_probe_device at a00000010041d480
#15 [BSP:e00000b071e711a8] __driver_attach at a00000010041d6e0
#16 [BSP:e00000b071e71170] bus_for_each_dev at a00000010041c240
#17 [BSP:e00000b071e71150] driver_attach at a00000010041d0a0
#18 [BSP:e00000b071e71108] bus_add_driver at a00000010041b080
#19 [BSP:e00000b071e710c0] driver_register at a00000010041dea0
#20 [BSP:e00000b071e71088] __pci_register_driver at a00000010032f610
#21 [BSP:e00000b071e71058] (unknown) at a000000207200270
#22 [BSP:e00000b071e71018] do_one_initcall at a00000010000a9c0
#23 [BSP:e00000b071e70f98] sys_init_module at a0000001000fef00
#24 [BSP:e00000b071e70f98] ia64_ret_from_syscall at a00000010000c740

So, it appears that qla2xxx dpc thread is moving forward before the
scsi host has been completely added.

This patch moves the setting of the init_done (and online) flag to
after the call to scsi_add_host() to hold off the dpc thread.

Found via large lun count testing using 2.6.31.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-10 08:54:17 -06:00
James Bottomley d139b9bd0e [SCSI] scsi_lib_dma: fix bug with dma maps on nested scsi objects
Some of our virtual SCSI hosts don't have a proper bus parent at the
top, which can be a problem for doing DMA on them

This patch makes the host device cache a pointer to the physical bus
device and provides an extra API for setting it (the normal API picks
it up from the parent).  This patch also modifies the qla2xxx and lpfc
vport logic to use the new DMA host setting API.

Acked-By: James Smart  <james.smart@emulex.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04 12:01:30 -06:00
Christof Schmitt 65d430fa99 [SCSI] scsi_transport_fc: Introduce helper function for blocking scsi_eh
Move the duplicated code from FC LLDs to SCSI FC transport class.

Acked-by: James Smart <james.smart@emulex.com>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Acked-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04 12:00:52 -06:00
Mike Christie e881a172da [SCSI] modify change_queue_depth to take in reason why it is being called
This patch modifies scsi_host_template->change_queue_depth so that
it takes an argument indicating why it is being called. This will be
used so that if a LLD needs to do some extra processing when
handling queue fulls or later ramp ups, it can do so.

This is a simple port of the drivers setting a change_queue_depth
callback. In the patch I just have these LLDs adjust the queue depth
if the user was requesting it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>

[Vasu.Dev: v2
	Also converted pmcraid_change_queue_depth and then verified
all modules compile  using "make allmodconfig" for any new build
warnings on X86_64.

	Updated original description after combing two original
patches from Mike to make this patch git bisectable.]
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
[jejb: fixed up 53c700]
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04 12:00:41 -06:00
Giridhar Malavali 54a3b30e75 [SCSI] qla2xxx: Update version number to 8.03.01-k7
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04 12:00:14 -06:00
Lalit Chandivade 0f00a206cc [SCSI] qla2xxx: Properly handle UNDERRUN completion statuses.
Correct issues where the lower scsi-status would be improperly
cleared, instead, allow the midlayer to process the status after
the proper residual-count checks are performed.  Finally,
validate firmware status flags prior to assigning values from the
FCP_RSP frame.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Michael Hernandez <michael.hernandez@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
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>
2009-12-04 12:00:14 -06:00
Andrew Vasquez 531a82d1bd [SCSI] qla2xxx: Properly re-register FC4/FDMI after physical and logical link disruptions.
Original code would not register FC4 nor FDMI information after a
logical tear-down of an VFC link.  Code now triggers registration
date during processing of a 'Report ID Acquisition IOCB', which
is submitted after a FLOGI or FDISC completes.

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>
2009-12-04 12:00:13 -06:00
Andrew Vasquez 9ca1d01f7a [SCSI] qla2xxx: Properly check FCP_RSP response-info field after TMF completion.
Original code discarded response-info field information and
assumed the command completed successfully without verifying the
target's status within the FCP_RSP packet.

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>
2009-12-04 12:00:13 -06:00
Andrew Vasquez f3a0a77e8d [SCSI] qla2xxx: Retrieve firmware's maximum number of supported FCFs.
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>
2009-12-04 12:00:12 -06:00
Giridhar Malavali b5d0329f42 [SCSI] qla2xxx: Set the size of the host buffer used to fetch DCBX and XGMAC parameters to 4K.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04 12:00:11 -06:00
Lalit Chandivade 29c5397fc1 [SCSI] qla2xxx: Reread firmware versions information after an ISP abort.
In some case, the MPI and PHY versions when retrieved after the
Execute-FW mailbox-command are incorrect (255.255.255.255).
Instead, query the information after the check for firmware ready
is done in the abort ISP path.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
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>
2009-12-04 12:00:11 -06:00
Andrew Vasquez bdab23da71 [SCSI] qla2xxx: Display additional mailbox registers during AEN handling.
The mailbox register values may assist in debugging efforts.

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>
2009-12-04 12:00:10 -06:00
Andrew Vasquez 3420d36cac [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
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>
2009-12-04 12:00:10 -06:00
Anirban Chakraborty c7922a911c [SCSI] qla2xxx: Fix NULL ptr deref bug in fail path during queue create
Current code attempts to clean up resources when queue create fails and there it
invokes queue free call with a (NULL) pointer to the queue which could not be
allocated in the first place. Fix it by returning directly without invoking the
queue free call as no resources has been allocated at that point of time.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-10-02 14:13:04 -05:00
Giridhar Malavali 073ed91e24 [SCSI] qla2xxx: Update version number to 8.03.01-k6.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-09-12 09:35:23 -05:00
Andrew Vasquez 67becc0041 [SCSI] qla2xxx: Properly delete rports attached to a vport.
Original code would inadvertently skip the deferred
fc_remote_port_delete() call for rports hanging off any vport.

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>
2009-09-12 09:35:23 -05:00
Andrew Vasquez 0d6e61bc6a [SCSI] qla2xxx: Correct various NPIV issues.
* Consolidate vport-count processing.
* Correct vp_idx restrictions during RSCN processing.
* Push topology verification check to qla2x00_do_dpc_all_vps().
* Don't skip vport full-login-lip/lip-reset mailbox handling.

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>
2009-09-12 09:35:22 -05:00
Lalit Chandivade d970432c48 [SCSI] qla2xxx: Correct qla2x00_eh_wait_on_command() to wait correctly.
Original code would break-out of loop after only one iteration.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
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>
2009-09-12 09:35:21 -05:00
Andrew Vasquez ab67114935 [SCSI] qla2xxx: Further limit device-table (qla_devtbl) lookup to non-24xx.
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>
2009-09-12 09:35:21 -05:00
Santosh Vernekar 8474f3a02a [SCSI] qla2xxx: Correctly set FCF_TAPE_PRESENT flag based on scsi-device.
In fabric-login based on iop BIT_8 firmware notifies presence of
a FCP2 device and not necessarily a TAPE device.  So instead of
setting FCF_TAPE_PRESENT flag there we set it using
scsi_device->type after mid-layer scan recognises "type" of the
device.

It also adds a new flag FCF_FCP2_DEVICE for any future use.

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>
2009-09-12 09:35:20 -05:00
Andrew Vasquez ac280b670e [SCSI] qla2xxx: Add asynchronous-login support.
ISPs which support this feature include 23xx and above.

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>
2009-09-05 09:41:57 -05:00
Andrew Vasquez cf53b069f5 [SCSI] qla2xxx: Generalize srb structure usage.
Lay groundwork for adding alternative asynchronous operations by
generalize and extending the SRB structure.  This allows for
follow-on patches to add support for:

- Asynchronous logins.
- ELS/CT passthru requests.
- Loopback requests.
- Non-blocking mailbox commands (ABTS, Task Management, etc).

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>
2009-09-05 09:41:55 -05:00
Giridhar Malavali d430ddc660 [SCSI] qla2xxx: Update version number to 8.03.01-k5
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:21 -05:00
Anirban Chakraborty 7163ea8151 [SCSI] qla2xxx: Fix to ensure driver works in sinlge queue mode if multiqueue fails
When the multiqueue mode fails to work, the driver falls back on single
queue mode. This ensures that the firmware is reinitialized with single
queue options and all the resources are readjusted accordingly.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:20 -05:00
Andrew Vasquez 09ccbcc628 [SCSI] qla2xxx: Correct display of vp_count in debug printk.
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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:20 -05:00
Anirban Chakraborty eb94114bfd [SCSI] qla2xxx: Fix a bug that clears the interrupt status register for the base queue
The interrupt handler clears the interrupt status register for response
updates in the base queue while working in the multique mode. This could lead
to missing interrupt for async events, mail box completions etc. as these are
also handled in the base queue.  The fix ensures that the interrupt bit is not
cleared for response updates in the ISR when the driver is working in
multiqueue mode.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:19 -05:00
Andrew Vasquez 80de7efa6d [SCSI] qla2xxx: ISP21xx/22xx do not support FDMI registrations.
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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:19 -05:00
Shyam Sundar f9e899ebe5 [SCSI] qla2xxx: Pad IOCB structure for size requirements.
One byte added to make the IOCB structure satisfy
size requirements.

Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:19 -05:00
Santosh Vernekar a2d301e8d6 [SCSI] qla2xxx: Handle RSCN's per master/slave vn-port basis.
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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:18 -05:00
Lalit Chandivade 4b785241ad [SCSI] qla2xxx: Process DPC requests within valid Fabric topologies.
If vports are created and topology is changed to Loop only, the
driver continuously gets a LIP reset occurred and keeps trying to
enable the vport.  Only manage requests during F_Port.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:17 -05:00
Santosh Vernekar faadc5e71c [SCSI] qla2xxx: Mark all devices lost on loss of fc port.
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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:17 -05:00
Santosh Vernekar 55903b9d15 [SCSI] qla2xxx: Skip RSCN processing on vha if event is global.
The RSCN processing is skipped if the event received is global and vha is not recipient.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:16 -05:00
Andrew Vasquez 9764ff8807 [SCSI] qla2xxx: Correctly handle 'global port-unavailable' AEN.
Treat a global port-unavailable PORT_UPDATE (8014h) AEN as a
loop-down event.  For this case, within the FCoE domain, the
'logical' interface has been terminated, but the driver will
not receive the classic LOOP_DOWN AEN.

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:16 -05:00
Ravi Anand 8f1f3ece89 [SCSI] qla2xxx: Pass the command's data residual to upper-layer callers.
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:52:15 -05:00
Dave Jones 0fd30f7769 [SCSI] qla2xxx: Fix __LITTLE_ENDIAN definition warnings
On ppc64, gcc 4.4 spews lots of..

drivers/scsi/qla2xxx/qla_def.h:1485:7: warning: "__LITTLE_ENDIAN" is not defined

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-08-22 17:51:55 -05:00
Alexey Dobriyan 405f55712d headers: smp_lock.h redux
* Remove smp_lock.h from files which don't need it (including some headers!)
* Add smp_lock.h to files which do need it
* Make smp_lock.h include conditional in hardirq.h
  It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

  This will make hardirq.h inclusion cheaper for every PREEMPT=n config
  (which includes allmodconfig/allyesconfig, BTW)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-12 12:22:34 -07:00
Andrew Vasquez e0420029de qla2xxx: Update version number to 8.03.01-k4.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-21 10:52:44 -05:00
Andrew Vasquez e18e963b7e qla2xxx: Correct (again) overflow during dump-processing on large-memory ISP23xx parts.
Commit 7b867cf76f ([SCSI] qla2xxx:
Refactor qla data structures) inadvertently reverted
e792121ec8 ([SCSI] qla2xxx: Correct
overflow during dump-processing on large-memory ISP23xx parts.).

Cc: stable@kernel.org
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-21 10:52:44 -05:00
Andrew Vasquez 9d2683c05c qla2xxx: Limit querying to supported mailbox-registers while reading FW state.
Pre-ISP24xx chips have dedicated uses for mailbox 4 and 5 which
software should typically not query nor update.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-21 10:52:44 -05:00
Harish Zunjarrao 1bb3954851 qla2xxx: Correct iiDMA-update calling conventions.
* To set iiDMA speeds for ISP81XX, bits 5-0 are used whereas for
  other older ISPs bits 2-0 are used.
* Pass proper VP index

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-21 10:52:43 -05:00
Anirban Chakraborty 27dc9c5a3d qla2xxx: Fixed a bug in number of response queue creation logic.
Cc: stable@kernel.org
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-21 10:52:43 -05:00
Anirban Chakraborty 43fac4d97a [SCSI] qla2xxx: Resolve a performance issue in interrupt
Reverted back a change in qla*_intr_handler code that caused an increase in
cpu cycles by allowing interrupts to occur while the instance hardware lock
was being held.  Fix by taking the lock in irqsave mode.

Reported-and-tested-by: Douglas W. Styner <douglas.w.styner@intel.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-15 10:09:32 -05:00
Randy Dunlap 18020ba791 [SCSI] qla2xxx: fix printk format warnings
Fix qla2xxx printk format warnings:

drivers/scsi/qla2xxx/qla_sup.c:915: warning: long long unsigned int format, u64 arg (arg 5)
drivers/scsi/qla2xxx/qla_sup.c:915: warning: long long unsigned int format, u64 arg (arg 6)
drivers/scsi/qla2xxx/qla_sup.c:923: warning: long long unsigned int format, u64 arg (arg 5)
drivers/scsi/qla2xxx/qla_sup.c:923: warning: long long unsigned int format, u64 arg (arg 6)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-15 10:09:31 -05:00
Andrew Vasquez 714df9399b [SCSI] qla2xxx: Update version number to 8.03.01-k3.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:47:02 -05:00
Andrew Vasquez 18e7555a38 [SCSI] qla2xxx: Synchronize MPI settings after a PE Reset.
Ensure MPS remains in synchronization across all NIC/FCoE
functions after a reset.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:47:00 -05:00
Andrew Vasquez 656e89122a [SCSI] qla2xxx: Export additional firmware-states for application support.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:58 -05:00
Andrew Vasquez f999f4c196 [SCSI] qla2xxx: Reduce lock-contention during do-work processing.
Queued work processing will now be serialized with its own
lower-priority spinlock.  This also simplifies the work-queue
interface for future work-queue consumers.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:57 -05:00
Andrew Vasquez 6805c1504e [SCSI] qla2xxx: Avoid explicit LOGO during driver host tear-down.
As firmware will ultimately terminate (stop) and port
states-cleared.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:55 -05:00
Andrew Vasquez aed1088112 [SCSI] qla2xxx: Query supported RISC registers bits in determining a paused-state.
ISP24xx and above must query the host-status register, not HCCR.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:54 -05:00
Andrew Vasquez e8233ca40b [SCSI] qla2xxx: Avoid redundant RISC reset during (re)-initialization.
ISP24xx and above ISPs perform a RISC reset in
qla24xx_reset_chip(), which is called prior to
qla24xx_chip_diag().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:53 -05:00
Andrew Vasquez eeebcc9223 [SCSI] qla2xxx: Fallback enode-mac should not be a multicast address.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:51 -05:00
Andrew Vasquez 81eb9b4985 [SCSI] qla2xxx: Add notification message when an NPIV fails to acquire a port-id.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:50 -05:00
Andrew Vasquez 9f8fddeef2 [SCSI] qla2xxx: Add 10Gb iiDMA support.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:49 -05:00
Andrew Vasquez f4658b6ccc [SCSI] qla2xxx: Mark a port's state as needing-rediscovery during link disruptions.
With RSCN states not being kept across qla2x00_configure_loop()
invocations, loop-resync distruptions during fabric-discovery may
cause ports to remain in a lost state.  Force state
renegotiation during a follow-on configure-loop iteration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:47 -05:00
Andrew Vasquez ca9e9c3eb1 [SCSI] qla2xxx: Check status of qla2x00_get_fw_version() call.
Unlike earlier ISPs, recent ISPs (ISP81xx) can in fact fail this
mailbox command.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:46 -05:00
Anirban Chakraborty 59e0b8b088 [SCSI] qla2xxx: Correct NULL pointer bug in cpu affinity mode.
This patch fixes a NULL pointer bug that occurs when IO is being
carried out on a vport for which the cpu affinity mode is turned on.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:44 -05:00
Andrew Vasquez 94b3aa47ac [SCSI] qla2xxx: Use 'proper' DID_* status code for dropped-frame scenarios.
The SCSI-midlayer's fast-fail codes consider an DID_ERROR status
as a driver-error and the failed I/O would then be retried in the
midlayer without being fast-failed to dm-multipath.  DID_BUS_BUSY
status returns would induce unneeded path-failures events being
propagated to the DM/MD.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:43 -05:00
Andrew Vasquez cbc8eb67da [SCSI] qla2xxx: Fallback to 'golden-firmware' operation on supported ISPs.
In case the onboard firmware is unable to be read or loaded for
operation, attempt to fallback to a limited-operational firmware
image stored in a different flash region.  This will allow a user
to reflash and correct a board with proper operational firmware.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:41 -05:00
Anirban Chakraborty 40859ae5f1 [SCSI] qla2xxx: Correct queue-creation bug when driver loaded in QoS mode.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:39 -05:00
Andrew Vasquez 1b91a2e671 [SCSI] qla2xxx: Correct logic-bug in set-model-info().
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:38 -05:00
Andrew Vasquez 11bbc1d896 [SCSI] qla2xxx: Export TLV data on supported ISPs.
Firmware currently provides PB and PGF TLVs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:36 -05:00
Andrew Vasquez ce0423f4a2 [SCSI] qla2xxx: Export XGMAC statistics on supported ISPs.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:34 -05:00
Andrew Vasquez 7f77402517 [SCSI] qla2xxx: Export negotiated fabric-parameters for application support.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 14:46:32 -05:00
Andrew Vasquez a03706017e [SCSI] qla2xxx: Update version number to 8.03.01-k2.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:11 -05:00
Anirban Chakraborty e5b68a61e1 [SCSI] qla2xxx: Use port number to compute nvram/vpd parameter offsets.
Read adapter's physical port number from interrupt pin register
and use it instead of pci function number to offset into the
nvram to obtain the port's configuration parameters.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:11 -05:00
Andrew Vasquez e337d9070e [SCSI] qla2xxx: Add an override option to specify ISP firmware load semantics.
As it may be useful during debugging to use a specific firmware
image.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:11 -05:00
Andrew Vasquez b469a7cbe9 [SCSI] qla2xxx: Don't try to 'stop' firmware if already in ROM code.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:10 -05:00
Michael Reed a13d8ac057 [SCSI] qla2xxx: Conditionally disable automatic queue full tracking.
Changing a lun's queue depth (/sys/block/sdX/device/queue_depth)
isn't sticky when the device is connected via a QLogic fibre
channel adapter.

The QLogic qla2xxx fibre channel driver dynamically adjusts a
lun's queue depth.  If a user has a specific need to limit the
number of commands issued to a lun (say a tape drive, or a shared
raid where the total commands issued to all luns is limited at
the controller level, for example) and writes a limiting value to
/sys/block/sdXX/device/queue_depth, the qla2xxx driver will
silently and gradually increase the queue depth back to the
driver limit of ql2xmaxqdepth.  While reducing this value (module
parameter) or increasing the interval between ramp ups
(ql2xqfullrampup) offers the potential for a work around it would
be better to have the option of just disabling the dynamic
adjustment of queue depth.

This patch implements an "off switch" as a module parameter.

Signed-off-by: Michael Reed <mdr@sgi.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:10 -05:00
Joe Carnuccio e1f916035f [SCSI] qla2xxx: Perform an implicit login to the Management Server.
Set the conditional plogi option bit whenever logging in the
fabric management server (if it is already logged in, it does not
need an explicit login; an implicit login suffices).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:09 -05:00
Andrew Vasquez 7d0dba174a [SCSI] qla2xxx: Restrict model-name/description device-table usage.
Information present in static table is only valid for pre-ISP25xx
adapters.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:09 -05:00
Harish Zunjarrao fc3ea9bcb8 [SCSI] qla2xxx: Correct hard-coded address of a second-port's NVRAM.
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:09 -05:00
Andrew Vasquez 8f97975136 [SCSI] qla2xxx: Correct typo in read_nvram() callback.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:08 -05:00
Anirban Chakraborty 67c2e93ae7 [SCSI] qla2xxx: Remove reference to request queue from scsi request block.
srbs used to maintain a reference to the request queue on which
it was enqueued. This is no longer required as the request queue
pointer is now maintained in the scsi host that issues the srb.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:08 -05:00
Anirban Chakraborty 68ca949cdb [SCSI] qla2xxx: Add CPU affinity support.
Set the module parameter ql2xmultique_tag to 1 to enable this
feature. In this mode, the total number of response queues
created is equal to the number of online cpus. Turning the block
layer's rq_affinity mode on enables requests to be routed to the
proper cpu and at the same time it enables completion of the IO
in a response queue that is affined to the cpu in the request
path.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:08 -05:00
Anirban Chakraborty 2afa19a937 [SCSI] qla2xxx: Add QoS support.
Set the number of request queues to the module paramater
ql2xmaxqueues.  Each vport gets a request queue. The QoS value
set to the request queues determines priority control for queued
IOs. If QoS value is not specified, the vports use the default
queue 0.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:07 -05:00
Andrew Vasquez 7640335ea5 [SCSI] qla2xxx: Correct compilation failures when DEBUG'n' options are enabled.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:07 -05:00
Andrew Vasquez bad7001c20 [SCSI] qla2xxx: Export additional FCoE attributes for application support.
Cull and export VN_Port MAC address and VLAN_ID information on
supported FCoE ISPs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:07 -05:00
Seokmann Ju d53b48d512 [SCSI] qla2xxx: Correct bus-reset behaviour with recent ISPs.
The short-circuit to skip the non-applicable 'full-login-lip'
process on 81xx ISPs was nested too deeply in the 'bus-reset'
routine, as the code in qla2x00_loop_reset() should skip the
whole enable_lip_full_login process.  The original code could
cause device tear-down due to the qla2x00_wait_for_loop_ready()
call taking a large amount of time.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-05-20 17:21:06 -05:00
Yang Hongyang 284901a90a dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07 08:31:11 -07:00
Yang Hongyang 6a35528a83 dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)
Replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07 08:31:10 -07:00
Andrew Vasquez c59c61493f [SCSI] qla2xxx: Update version number to 8.03.01-k1.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-03 09:22:55 -05:00
Harish Zunjarrao 79c13a747d [SCSI] qla2xxx: Get FLT address in dword format.
FLTDS provides FLT address in the byte address format,
convert it to dword address for further use.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-03 09:22:54 -05:00
Seokmann Ju b9b12f73df [SCSI] qla2xxx: Correct several PCI-EEH issues.
In addition to checking for potentially unnecessary iomem
readX()/writeX() operations, a pci_channel_io_perm_failure should
not trigger a full internal removal.  Found during additional
testing with pSeries blade systems.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-03 09:22:53 -05:00
Andrew Vasquez 6749ce362d [SCSI] qla2xxx: Don't cache VPD data for newer ISPs.
As updates will occur using low-level option-rom manipulation
routines.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-03 09:22:52 -05:00
Andrew Vasquez 24a081386e [SCSI] qla2xxx: Explicitly set the execution-throttle with recent ISPs.
Firmware semantics changed for 24xx and above ISPs in their
handling of the specified execution-throttle passed during
firmware initialization.  The original codes use of a theoretical
maximum (0xffff, as carried over from earlier ISPs) could in fact
act as a throttle in some circumstances.  Now set the value based
of the firmware's own 'resource' (exchange IOCBs) capabilities.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-03 09:22:52 -05:00
Andrew Vasquez d743de6675 [SCSI] qla2xxx: Reduce request queue-size overhead with recent ISPs.
The original code to 'resize request-queues' based on iocb-counts
and employed during early ISP23xx testing was too
overly-pessimistic with regards to latencies in the firmware
pulling requests.  Recent ISPs can easily keep up processing a
stream of commands from an abbreviated (effectively, half the
original size) queue.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-03 09:22:52 -05:00