Commit Graph

588 Commits (4d3a8534bdbcf4843fc8ad05c9a81a964fc65237)

Author SHA1 Message Date
Yinghai Lu 16dbef4a83 PCI: change MSI-x vector to 32bit
We are using 28bit pci (bus/dev/fn + 12 bits) as irq number, so the
cache for irq number should be 32 bit too.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2008-10-20 10:53:42 -07:00
Mike Christie 056a448349 [SCSI] qla2xxx: use new host byte transport errors.
This has qla2xxx use the new transport error values instead of
DID_BUS_BUSY. I am not sure if all the errors
in qla_isr.c I changed are transport related. We end up blocking/deleting
the rport for all of them so it is better to use the new transport error since
the fc classs will decide when to fail the IO.

With this patch if I pull a cable then IO that had reached
the driver, will be failed with DID_TRANSPORT_DISRUPTED (not including
tape). The fc class will then fail the IO when the fast io fail tmo
has fired, and the driver will flush any other commands running.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:51 -04:00
Mike Christie 9cc328f502 [SCSI] ibmvfc, qla2xxx, lpfc: remove scsi_target_unblock calls in terminate callbacks
The fc class now calls scsi_target_unblock after calling the
terminate callback, so this patch removes the calls from the
drivers.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:48 -04:00
Mike Christie 7b594131c4 [SCSI] qla2xxx: return SCSI_MLQUEUE_TARGET_BUSY when driver has detected rport error or race
If the fcport is not online then we do not want to block IO to all ports on
the host. We just want to stop IO on port not online, so we should be using
the SCSI_MLQUEUE_TARGET_BUSY return value.

For the case where we race with the rport memset initialization
we do not want the queuecommand to be called again so we can just use
SCSI_MLQUEUE_TARGET_BUSY for this.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:46 -04:00
Alexander Beregalov 4a3e1ea8b2 [SCSI] qla2xxx: fix printk format warnings
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:19 -05:00
Andrew Vasquez 36d1cdcffb [SCSI] qla2xxx: Update version number to 8.02.01-k8.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:19 -05:00
Ravi Anand 59d72d873c [SCSI] qla2xxx: Ignore payload reserved-bits during RSCN processing.
As the driver is only interested in bits 0-9 of the 1st
RSCN-payload word:

	rsvd[15:14]RscnEventQualifier[13:10]Fmt[9:8]Domain[7:0]
	Area[15:8]Alpa[7:0]

Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:19 -05:00
Andrew Vasquez 2d13693879 [SCSI] qla2xxx: Additional residual-count corrections during UNDERRUN handling.
Add additional tightening of residual-count handling (originally
from commit 6acf819002) where the
driver should discard any lower SCSI-status during
firmware/transport residual-count mismatches.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:18 -05:00
Bjorn Helgaas cc3ef7bc40 [SCSI] qla2xxx: Fix "occured" spelling errors.
Fix "occured" spelling errors.  Most of these are in comments, which
I wouldn't normally bother with, but a couple are in printks, which
irritate me more.  So I just fixed them all at the same time.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:18 -05:00
Andrew Vasquez 272976ca18 [SCSI] qla2xxx: Add NPIV-Config Table support.
To instatiate pre-configured vport entities defined within an
HBA's flash memory.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:18 -05:00
Andrew Vasquez c00d8994d9 [SCSI] qla2xxx: Add Flash Layout Table support.
The Flash Layout Table (FLT) present on many recent HBAs encodes
flash usage information, organizes data stored into separate
regions and presents the information uniformly to the driver.
Use this information rather than using specific hard-coded values
based on ISP type.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:17 -05:00
Andrew Vasquez 4b89258c73 [SCSI] qla2xxx: Change GFP_ATOMIC to GFP_KERNEL for non-atomic allocations.
Both call-sites are sleeping-capable.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:17 -05:00
Harish Zunjarrao 49fd462a1b [SCSI] qla2xxx: Add input/output byte-count statistics.
Currently Firmware does not have counters for input megabytes and
output megabytes, therefore driver counts these values depending
on the status of the scsi command and direction of the command.
The values are exported in the FC_HOST path.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:16 -05:00
Matthew Wilcox 3fd7f93883 [SCSI] qla2xxx: Remove semaphore.h
Now that qla2xxx has been converted to mutexes, it no longer needs the
semaphore include.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-03 11:46:12 -05:00
Andrew Vasquez 048feec554 [SCSI] qla2xxx: Defer enablement of RISC interrupts until ISP initialization completes.
Josip Rodin noted
(http://article.gmane.org/gmane.linux.ports.sparc/10152) the
driver oopsing during registration of an rport to the
FC-transport layer with a backtrace indicating a dereferencing of
an shost->shost_data equal to NULL.  David Miller identified a
small window in driver logic where this could happen:

    > Look at how the driver registers the IRQ handler before the host has
    > been registered with the SCSI layer.
    >
    > That leads to a window of time where the shost hasn't been setup
    > fully, yet ISRs can come in and trigger DPC thread events, such as
    > loop resyncs, which expect the transport area to be setup.
    >
    > But it won't be setup, because scsi_add_host() hasn't finished yet.
    >
    > Note that in Josip's crash log, we don't even see the
    >
    >         qla_printk(KERN_INFO, ha, "\n"
    >             " QLogic Fibre Channel HBA Driver: %s\n"
    >             "  QLogic %s - %s\n"
    >             "  ISP%04X: %s @ %s hdma%c, host#=%ld, fw=%s\n",
    >  ...
    >
    > message yet.
    >
    > Which means that the crash occurs between qla2x00_request_irqs()
    > and printing that message.

Close this window by enabling RISC interrupts after the host has
been registered with the SCSI midlayer.

Reported-by: Josip Rodin <joy@entuzijast.net>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-09-13 13:12:58 -05:00
Adrian Bunk 7a8fc9b248 removed unused #include <linux/version.h>'s
This patch lets the files using linux/version.h match the files that
#include it.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-23 12:14:12 -07:00
Andrew Vasquez bcd2361d7e [SCSI] qla2xxx: Update version number to 8.02.01-k7.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-08-16 10:24:31 -05:00
Andrew Vasquez c795c1e4b6 [SCSI] qla2xxx: Explicitly tear-down vports during PCI remove_one().
During internal testing, we've seen issues (hangs) with the
'deferred' vport tear-down-processing typically accompanied with
the fc_remove_host() call.  This is due to the current
implementation's back-end vport handling being performed by the
physical-HA's DPC thread where premature shutdown could lead to
latent vport requests without a processor.

This should also address a problem reported by Gal Rosen
(http://marc.info/?l=linux-scsi&m=121731664417358&w=2) where the
driver would attempt to awaken a previously torn-down DPC thread
from interrupt context by implicitly calling wake_up_process()
rather than the driver's qla2xxx_wake_dpc() helper.  Rather, than
reshuffle the remove_one() device-removal code, during unload,
depend on the driver's timer to wake-up the DPC process, by
limiting wake-ups based on an 'unloading' flag.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-08-16 10:24:12 -05:00
Andrew Vasquez 19851f136a [SCSI] qla2xxx: Reference proper ha during SBR handling.
The executing-HA of an SRB can be referenced from the sp->fcport.
Use this correct value while processing status-continuation data
and abort processing.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-08-16 10:23:53 -05:00
Mike Hernandez 946fb8915a [SCSI] qla2xxx: Set npiv_supported flag for FCoE HBAs.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-08-16 10:22:35 -05:00
Andrew Vasquez bed475c4cd [SCSI] qla2xxx: Don't leak SG-DMA mappings while aborting commands.
Original code inadvertently cleared an SRB's 'flags' while
aborting; causing a follow-on scsi_dma_unmap() to be potentially
missed.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-08-16 10:22:17 -05:00
Andrew Vasquez a7a28504bf [SCSI] qla2xxx: Correct vport-state management issues during ISP-ABORT.
* Use correct 'ha' to mark a device lost from ISR.
  I/Os will always be returned on the physical-HA.
  qla2x00_mark_device_lost() should be called with the HA bound
  to the fcport.
* Mark *all* devices lost during ISP-ABORT (bighammer).

These fixes correct issues discovered locally where during
link-perturbation and heavy vport-I/O fcport/rport states would
stray and an rport's scsi-target lost (timed-out).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-08-16 10:22:01 -05:00
Andrew Vasquez 6390d1f33f [SCSI] qla2xxx: Correct synchronization of software/firmware fcport states.
Greg Wettstein (greg@enjellic.com) noted:

	http://article.gmane.org/gmane.linux.scsi/43409

on a reboot of a previously recognized SCST target, the initiator
driver would be unable to re-recognize the device as a target.
It turns out that prior to the SCST software reloading and
returning it's "target-capable" abilities in the PRLI payload,
the HBA would be re-initialized as an initiator-only type port.
Since initiators typically classify themselves as an FCP-2
capable device, both software and firmware do not perform an
explicit logout during port-loss.  Unfortunately, as can be seen
by the failure case, when the port (now target-capable) returns,
firmware performs an ADISC without a follow-on PRLI, leaving
stale 'initiator-only' data in the firmware's port database.

Correct the discrepancy by performing the explicit logout during
the transport's request to terminate-rport-io, thus synchronizing
port states and ensuring a follow-on PRLI is performed.

Reported-by: Greg Wettstein <greg@enjellic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-08-16 10:21:09 -05:00
FUJITA Tomonori 00eabe7c44 [SCSI] qla2xxx: fix msleep compile error
drivers/scsi/qla2xxx/qla_attr.c: In function 'qla24xx_vport_delete':
drivers/scsi/qla2xxx/qla_attr.c:1184: error: implicit declaration of function 'msleep'
make[3]: *** [drivers/scsi/qla2xxx/qla_attr.o] Error 1
make[3]: *** Waiting for unfinished jobs....

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-28 10:13:22 -05:00
Andrew Vasquez 4cfc51017d [SCSI] qla2xxx: Update version number to 8.02.01-k6.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:31:47 -04:00
Andrew Vasquez c9c5ced90a [SCSI] qla2xxx: Additional NPIV corrections.
Minor fixes addressing:
- rport managements during vport deletion.
- acquire proper physical-ha during qla24xx_abort_command() and
  qla24xx_queuecommand()
- do not needlessly acquire the pha for non-NPIV capable ISPs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:31:30 -04:00
Andrew Morton bf6583b583 [SCSI] qla2xxx: suppress uninitialized-var warning
drivers/scsi/qla2xxx/qla_os.c: In function 'qla2x00_post_work':
drivers/scsi/qla2xxx/qla_os.c:2158: warning: 'flags' may be used uninitialized in this function

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:31:09 -04:00
Akinobu Mita b3dc9088f3 [SCSI] qla2xxx: use memory_read_from_buffer()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:30:22 -04:00
Andrew Vasquez 8201e20799 [SCSI] qla2xxx: Issue proper ISP callbacks during stop-firmware.
As the original code would incorrectly call the non-ISP24xx/25xx
callbacks during recovery, a stop-firmware failure could result
in improper bit-banging of the RISC and in some cases manifest in
a NMI-watchdog trigger due to the RISC not coming out of its
reset state.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:29:43 -04:00
Andrew Vasquez f0773b5ff6 [SCSI] qla2xxx: Update version number to 8.02.01-k5.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:47 -04:00
Andrew Vasquez 6d0525292a [SCSI] qla2xxx: Don't hardcode fw_transfer_size for ISP2[45]xx parts.
Use the full buffer size available, as there's no reason to limit
the firwmare-image load-segment size for these parts.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:46 -04:00
Andrew Vasquez 42e421b184 [SCSI] qla2xxx: Verify the RISC is not in ROM code if firmware-load is disabled.
Add an additional check to verify that the current executing
firmware is in fact non-ROM code.  The non-ROM Get-ID mailbox
command is used for verification.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:46 -04:00
Andrew Vasquez e792121ec8 [SCSI] qla2xxx: Correct overflow during dump-processing on large-memory ISP23xx parts.
Total ram words can exceed a 16bit value on large-memory boards.
Safely extend to a 32bit width.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:46 -04:00
Andrew Vasquez 031e134e5f [SCSI] qla2xxx: Skip FDMI registration on ISP21xx/22xx parts.
Firmware does not have the facilities to issue management server
IOCBs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:46 -04:00
Seokmann Ju 5de1f70f41 [SCSI] qla2xxx: Correct rport/fcport visibility-state handling during loop-resync.
There were several issues here, one, during RSCN handling if a
follow-on RSCN occurred (within interrupt context) the DPC thread
could inadvertantly leave the fcport in a stale lost state.
Secondly, scheduled rport removal is handled exclusively by the
'parent' DPC thread, so wake up the proper thread.  Finally,
process vport loop-resync's only when the vport has in an
"active" state (ID acquired).

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>
2008-07-26 15:14:44 -04:00
Seokmann Ju da57bf8f25 [SCSI] qla2xxx: Correct vport management of MBA_PORT_UPDATE.
By allowing the qla2x00_alert_all_vps() to manage per-vport
recognition of the MBA.

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>
2008-07-26 15:14:41 -04:00
Seokmann Ju 8f0d6436d2 [SCSI] qla2xxx: Correct fcport state-management during loss.
All fcport->state management should be done within
qla2x00_mark_device_lost(), the assignment of state within
qla2x00_mark_vp_devices_dead() caused associated rports to not be
removed.

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>
2008-07-26 15:14:41 -04:00
Seokmann Ju 246de42cfc [SCSI] qla2xxx: Always aquire the parent's hardware_lock.
While issuing a marker, manipulating the request/response queues
and modifying the outstanding command array.

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>
2008-07-26 15:14:40 -04:00
Andrew Vasquez 436a7b1123 [SCSI] qla2xxx: Swap enablement order of EFT and FCE.
The firmware group has suggested that FCE (Fibre Channel Event)
tracing be enabled prior to EFT (Extended Firmware Tracing) to
maximize the capturing of data on the wire.  This change has no
real semantic effect on driver operation, as it's mostly a
shuffling of code.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:40 -04:00
Joe Carnuccio 1ee2714632 [SCSI] qla2xxx: Retrieve board serial-number and description from VPD.
Recent ISPs have this information written at manufacturing time,
so use the information.  This also reduces future churn of the
qla_devtbl.h file contents, as the driver can now depend on the
information to be present in VPD.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:39 -04:00
Andrew Vasquez e5896bd5dc [SCSI] qla2xxx: Allow the user the option of disabling iIDMA.
iIDMA support requires the driver issue several additional
fabric-managegment (FM) commands per port discovered during SNS
scanning -- GFPN (Get Fabric Port Name) and GPSC (Get Port Speed
Capabilities).  It has been found during testing that some
switches do not respond as *well* as expected to these commands
(silence -- no ACC nor BS_RJT).  So, to handle such conditions,
allow the user the ability to indirectly disable the FM commands
by disabling iIDMA with the ql2xiidmaenable module-parameter.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:38 -04:00
Seokmann Ju 711c1d916b [SCSI] qla2xxx: Cleanup NPIV related functions
Removed repeated or unnecessary operations during vport
creation/deletion.

Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:37 -04:00
Harish Zunjarrao 032d8dd739 [SCSI] qla2xxx: Add LIP count to FC-transport statistics.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:37 -04:00
Harish Zunjarrao e5f5f6f72b [SCSI] qla2xxx: Track total number of ISP aborts.
This parameter counts the total number of ISP aborts during
driver execution.  The value is exported through a DEVICE_ATTR()
off the scsi_host.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:37 -04:00
Andrew Vasquez 85821c906c [SCSI] qla2xxx: Set an rport's dev_loss_tmo value in a consistent manner.
As there's no point in adding a fixed-fudge value (originally 5
seconds), honor the user settings only.  We also remove the
driver's dead-callback get_rport_dev_loss_tmo function
(qla2x00_get_rport_loss_tmo()).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:36 -04:00
Seokmann Ju 5f3a9a207f [SCSI] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
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>
2008-07-26 15:14:36 -04:00
Andrew Vasquez bbfb21daa3 [SCSI] qla2xxx: Correct locking during NVRAM manipulation.
Commit 2c96d8d0c1 pushed the
acquisition of hardware_lock to too fine a level, which in turn
will cause problems with cond_resched()s added with
40a2e34a94.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26 15:14:35 -04:00
Andrew Vasquez 28d7647de2 [SCSI] qla2xxx: Update version number to 8.02.01-k4.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-30 12:21:12 -05:00
Seokmann Ju 08b95a12cd [SCSI] qla2xxx: Correct handling of AENs postings for vports.
Initialize all proper structure members in order to support
work-list vport processing.  This code also properly acquires the
correct (physical hardware_lock) lock during work submission.

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>
2008-05-30 12:20:57 -05:00
Seokmann Ju 3c39740073 [SCSI] qla2xxx: Revert "qla2xxx: Use proper HA during asynchronous event handling."
This reverts commit bd2a1846b2.
The original (prior to the reverted commit) code was correct.
Additionally, the vp_idx should be checked during MBA_PORT_UPDATE
in order for proper handling to take place for a given vport.

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>
2008-05-30 12:20:43 -05:00
Andrew Vasquez 7853099a70 [SCSI] qla2xxx: Update version number to 8.02.01-k3.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:30 +01:00
Andrew Vasquez a7cd02320e [SCSI] qla2xxx: Revert "qla2xxx: Validate mid-layer 'underflow' during check-condition handling."
This reverts commit 8084fe168a.
The midlayer should be given the oppotunity to interpret the
check-condition and based on scsi_cmnd->resid determine if a
transfer should be retried or failed.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:29 +01:00
Andrew Vasquez d2ba5675d8 [SCSI] qla2xxx: Disable local-interrupts while polling for RISC status.
Matthew Wilcox <matthew@wil.cx> reported the following lockdep
warning:

 > =================================
 > [INFO:inconsistentlockstate]
 > 2.6.26-rc1-00115-g0340eda-dirty#60
 > ---------------------------------
 > inconsistent{hardirq-on-W}->{in-hardirq-W}usage.
 > swapper/1[HC1[1]:SC0[0]:HE0:SE1]takes:
 > (&ha->hardware_lock){+-..},at:[<c035495d>]qla2300_intr_handler+0x35/0x1f5
 > {hardirq-on-W}statewasregisteredat:
 > [<c0139a16>]__lock_acquire+0x459/0xb1d
 > [<c013a091>]__lock_acquire+0xad4/0xb1d
 > [<c013a142>]lock_acquire+0x68/0x82
 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5
 > [<c0506da5>]_spin_lock+0x24/0x4d
 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5
 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5
 > [<c01391e4>]trace_hardirqs_on+0xe7/0x10e
 > [<c034f0a6>]qla2x00_mailbox_command+0x1c6/0x433
 ...
 > other info that might help us debug this:
 > no locks held by swapper/1.
 >
 > stack backtrace:
 > Pid:1,comm:swapperNottainted2.6.26-rc1-00115-g0340eda-dirty#60
 > [<c0138121>]print_usage_bug+0x100/0x10a
 > [<c0138d37>]mark_lock+0xaa/0x395
 > [<c01399af>]__lock_acquire+0x3f2/0xb1d
 > [<c013a091>]__lock_acquire+0xad4/0xb1d
 > [<c013a142>]lock_acquire+0x68/0x82
 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5
 > [<c0506da5>]_spin_lock+0x24/0x4d
 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5
 > [<c035495d>]qla2300_intr_handler+0x35/0x1f5
 > [<c014a37b>]handle_IRQ_event+0x13/0x3d
 > [<c014b366>]handle_fasteoi_irq+0x76/0xab

Which shows that lockdep is detecting the driver's
interrupt-handler is run in both process and interrupt context
with irqs-enabled in the former case.

During init-time and error-recovery (after a RISC reset), the
driver disables interrupts and 'polls' for completions by calling
qla2x00_poll():

	static inline void
	qla2x00_poll(scsi_qla_host_t *ha)
	{
		ha->isp_ops->intr_handler(0, ha);
	}

which in-turn calls the ISP registered interrupt handler.  This
patch corrects it by disabling local interrupts during polling.

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:29 +01:00
Andrew Vasquez 68af081151 [SCSI] qla2xxx: Extend the 'fw_dump' SYSFS node the ability to initiate a firmware dump.
The user-initiated dump can be a useful tool in triaging complex
ISP and FC issues.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:29 +01:00
Andrew Vasquez fa0926df0f [SCSI] qla2xxx: Don't depend on mailbox return values while enabling FCE tracing.
Recent firmwares no longer return the 'number of buffers' in
mailbox6.  The original code may result in a potential panic
during a FW-dump process due to the driver misinterpreting the
size of the allocated buffer.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:29 +01:00
matthias@kaehlcke.net 6c2f527cb8 [SCSI] qla2xxx: Convert vport_sem to a mutex
The semaphore vport_sem is used as a mutex.  Convert it to the
mutex API.

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:29 +01:00
Daniel Walker e1e82b6f0d [SCSI] qla2xxx: firmware semaphore to mutex
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:28 +01:00
Andrew Vasquez 0e973a24f0 [SCSI] qla2xxx: Correct locking within MSI-X interrupt handlers.
Both MSI-X vector handlers attempt to acquire the HA's
hardware_lock.  This though requires that interrupts be
disabled/enabled during acquisition and release of the spinlock.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:28 +01:00
Andrew Vasquez fd9a29f036 [SCSI] qla2xxx: Display driver version at module init-time.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:28 +01:00
Shyam Sundar 2f2fa13d56 [SCSI] qla2xxx: Return correct port_type to FC-transport for Vports.
For Vports, the port_type should be set to FC_PORTTYPE_NPIV.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-05-15 16:39:28 +01:00
Andrew Vasquez a198c3d039 [SCSI] qla2xxx: Update version number to 8.02.01-k2.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:59 -05:00
Andrew Vasquez 666301e673 [SCSI] qla2xxx: Correct regression in relogin code.
Commit 63a8651f25 ([SCSI] qla2xxx:
Correct infinite-login-retry issue.) introduced a small
regression where a successful relogin would result in an fcport's
loop_id to be incorrectly reset to FC_NO_LOOP_ID.  Only clear-out
loopid, if retries have been 'truly' exhausted.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:59 -05:00
Seokmann Ju c6852c4c59 [SCSI] qla2xxx: Correct misc. endian and byte-ordering issues.
There were several places in the driver which could cause byte
ordering problem as provided by Al Viro
<viro@ZenIV.linux.org.uk>.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:59 -05:00
Adrian Bunk 3b8117b837 [SCSI] qla2xxx: make qla2x00_issue_iocb_timeout() static
This patch makes the needlessly global qla2x00_issue_iocb_timeout()
static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:59 -05:00
Adrian Bunk 01ef66bbb6 [SCSI] qla2xxx: qla_os.c, make 2 functions static
This patch makes the following needlessly global functions static:
- qla2x00_alloc_work()
- qla2x00_post_work()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:58 -05:00
Andrew Vasquez 7e47e5ca18 [SCSI] qla2xxx: Re-register FDMI information after a LIP.
Original code would (incorrectly) only re-register after a
loop-down condition.  Also, FDMI registration should be enabled
by default.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:58 -05:00
Andrew Vasquez 0c23b85658 [SCSI] qla2xxx: Correct SRB usage-after-completion/free issues.
The driver is incorrectly assuming that the 'sp' reference held
in qla2[x00|4xx]_abort_command() is valid after the mailbox
command is issued to abort the exchange.  It is *not*, as the
command may be completed during interrupt context before control
is returned to the mailbox caller.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:58 -05:00
Andrew Vasquez c1ec1f1bf9 [SCSI] qla2xxx: Correct ISP84XX verify-chip response handling.
Earlier code could trigger an infinite-retry if 1st invocation
returned a non-CS_COMPLETE status.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:58 -05:00
Andrew Vasquez 550bf57dfb [SCSI] qla2xxx: Wakeup DPC thread to process any deferred-work requests.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:58 -05:00
Andrew Vasquez c5722708c2 [SCSI] qla2xxx: Collapse RISC-RAM retrieval code during a firmware-dump.
Use the more efficient read-DMA'ble-buffer mailbox commands
rather than reading a single word/dword at a time.  We also
remove a bulk of the duplicate mailbox command-handling codes in
favor of more generic read-memory() routines (qla2xxx_dump_ram()
and qla24xx_dump_ram()).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-27 12:19:57 -05:00
Hannes Reinecke bbd1ae412c [SCSI] qla2xxx, lfpc: Rename 'state' attribute to 'link_state'
lpfc and qla2xxx overwrite the standard 'state' attribute with
custom callbacks. So rename the custom attributes to 'link_state'
and retain the original meaning of the 'state' attribute.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Acked-by: James Smart <James.Smart@Emulex.Com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-22 15:16:30 -05:00
Linus Torvalds e80ab411e5 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
  SCSI: convert struct class_device to struct device
  DRM: remove unused dev_class
  IB: rename "dev" to "srp_dev" in srp_host structure
  IB: convert struct class_device to struct device
  memstick: convert struct class_device to struct device
  driver core: replace remaining __FUNCTION__ occurrences
  sysfs: refill attribute buffer when reading from offset 0
  PM: Remove destroy_suspended_device()
  Firmware: add iSCSI iBFT Support
  PM: Remove legacy PM (fix)
  Kobject: Replace list_for_each() with list_for_each_entry().
  SYSFS: Explicitly include required header file slab.h.
  Driver core: make device_is_registered() work for class devices
  PM: Convert wakeup flag accessors to inline functions
  PM: Make wakeup flags available whenever CONFIG_PM is set
  PM: Fix misuse of wakeup flag accessors in serial core
  Driver core: Call device_pm_add() after bus_add_device() in device_add()
  PM: Handle device registrations during suspend/resume
  block: send disk "change" event for rescan_partitions()
  sysdev: detect multiple driver registrations
  ...

Fixed trivial conflict in include/linux/memory.h due to semaphore header
file change (made irrelevant by the change to mutex).
2008-04-21 15:49:58 -07:00
Tony Jones ee959b00c3 SCSI: convert struct class_device to struct device
It's big, but there doesn't seem to be a way to split it up smaller...

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-19 19:10:33 -07:00
Matthew Wilcox 6188e10d38 Convert asm/semaphore.h users to linux/semaphore.h
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
2008-04-18 22:22:54 -04:00
Andrew Vasquez b35c07d007 [SCSI] qla2xxx: Update version number to 8.02.01-k1.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:16 -05:00
Seokmann Ju 221726d41a [SCSI] qla2xxx: Correct vport configuration-change handling.
Upon having configuration changes on vports only, the driver
handles SCR regardless physical port state and, in turn, it
results mailbox error as below:

	Mar 20 11:24:20 dl585 kernel: qla2x00_mailbox_command(9): **** FAILED.  mbx0=4005, mbx1=1, mbx2=8100, cmd=70 ****

With the changes, driver checks physical port loop_state and make
sure the port is ready to take commands.

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>
2008-04-07 12:19:16 -05:00
Seokmann Ju bd2a1846b2 [SCSI] qla2xxx: Use proper HA during asynchrounous event handling.
Changes are added to the driver so that it can behave properly
upon having asynchronous events, for example, addition of target
devices to the VPs.

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>
2008-04-07 12:19:16 -05:00
Seokmann Ju 463717edc9 [SCSI] qla2xxx: Check DFLG_NO_CABLE only on physical port.
As there is no actual cable connection on vports, made change so
that the driver checks DFLG_NO_CABLE against ha->device_flags
only for physical port.

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>
2008-04-07 12:19:16 -05:00
Seokmann Ju d4486fd6de [SCSI] qla2xxx: Consistently access the physical HA port.
There were several places where referencing ha structure of
virtual ports for resources. Among those refereces, certain
fields are get up-to-dated only on ha structure of physical port.

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>
2008-04-07 12:19:15 -05:00
Andrew Vasquez 73f0f0f24a [SCSI] qla2xxx: Remove unused member (dma_handle) from srb_t structure.
The member is not needed as there's no non-scatter-gather
list I/Os submitted by the upper-layers.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:15 -05:00
Harihara Kadayam 4d4df1932b [SCSI] qla2xxx: Add ISP84XX support.
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:15 -05:00
Ravi Anand b93480e319 [SCSI] qla2xxx: Assign mailbox command timeout values in a consistent manner.
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:15 -05:00
Andrew Vasquez 523ec773b8 [SCSI] qla2xxx: Add midlayer target/device reset support.
Now that infrastructure is present within the midlayer and there
is a clear distinction between what is expected from a device and
target reset, convert the current device-reset codes to a
target-reset, and add codes to perform a proper device-reset (LUN
reset).

In the process of adding reset support, collapse and consolidate
large sections of mailbox-command (TMF issuance) codes,
generalize the two 'wait-for-commands-to-complete' functions, and
add a generic-reset routine for use by midlayer reset functions.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:15 -05:00
Andrew Vasquez 3fe7cfb910 [SCSI] qla2xxx: Check alternate 'reason' code during GPSC status handling.
Some switches return 0x09 (Command not supported) as the reason
code for GPSC failure.  Check for this code, and disable
additional GPSC queries if found.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:14 -05:00
Andrew Vasquez 7d232c745e [SCSI] qla2xxx: Add Flash Descriptor Table layout support.
The Flash Descriptor Table (FDT) present on many recent HBAs
encodes flash accessing characteristics of the flash-part used on
the HBA.  Use this information during flash manipulation (writes)
rather than using specific hard-coded values based on queried
manufacturer and device IDs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:14 -05:00
Andrew Vasquez c87a0d8c8d [SCSI] qla2xxx: Use PCI-SIG nomenclature for PCIe bandwidth units.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:14 -05:00
Andrew Vasquez 587f4cae4a [SCSI] qla2xxx: Cruft cleanup of functions and structures.
Strip unused (DEBUG-ONLY) enabled functions, inlines, useless
wrappers, and unused DPC flags from the code.  Another step in
the migration towards a cleaner (less-crusty) driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:14 -05:00
Andrew Vasquez cb8dacbf11 [SCSI] qla2xxx: Add hardware trace-logging support.
Recent ISPs have a region within FLASH which acts as a repository
for the logging of serious hardware and software failures.
Currently, the region is large enough to support up to 255
entries.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:13 -05:00
Andrew Vasquez 0971de7f56 [SCSI] qla2xxx: Add FC-transport Asynchronous Event Notification support.
Supported events include LIP, LIP reset, RSCN, link up, and link
down.

To support AEN (and additional forthcoming features), we also
introduce a simple deferred-work construct to manage events which
require a non-atomic sleeping-capable context.  This work-list is
processed as part of the driver's standard DPC routine.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:13 -05:00
Andrew Vasquez c6952483b0 [SCSI] qla2xxx: Simplify interrupt handler locking.
There's no need to use the heavier (albiet safer)
*_irq[save|restore]() locking primitives within the driver's
interrupt handlers, interrupts are guaranteed to be
non-reentrant.  Use lightweight spin_lock() and spin_unlock()
primitives while acquiring the hardware_lock.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:13 -05:00
Andrew Vasquez 5ab5a4dd54 [SCSI] qla2xxx: Use an rport's scsi_target_id member consistently throughout driver.
Rather than using a duplicate/cached value stored in the driver's
internal fcport structure.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:13 -05:00
Andrew Vasquez 0ddda2d152 [SCSI] qla2xxx: Remove unused and obsolete #define's.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:13 -05:00
Andrew Vasquez 2ae2b37095 [SCSI] qla2xxx: Add support for host supported speeds FC transport attribute.
Use generic FC transport #defines for speed values.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:12 -05:00
Andrew Vasquez 01e58d8eac [SCSI] qla2xxx: Update copyright banner.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:11 -05:00
Andrew Vasquez 203c29102b [SCSI] qla2xxx: Update firmware filenames for new ISP parts.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-07 12:19:11 -05:00
Andrew Vasquez ca3aefb822 [SCSI] qla2xxx: Update version number to 8.02.00-k9.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03 13:11:50 -06:00
Andrew Vasquez 00a537b820 [SCSI] qla2xxx: Correct usage of inconsistent timeout values while issuing ELS commands.
The original code would incorrectly hardcode ELS timeout values
rather than using the traditional '2 * r_a_tov' value.  In some
cases, the hardcoded values would be larger than the
mailbox-command-timeout and result in a needless BIG_HAMMER (ISP
reset), the typical recovery mechanism employed in such cases.

The second defect in the original code was in the assignment of
the default 'ha->r_a_tov' to twice the traditional value.
Correct this by setting the value to 10 seconds.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03 13:11:35 -06:00
Andrew Vasquez 3e8ce320cf [SCSI] qla2xxx: Correct discrepancies during OVERRUN handling on FWI2-capable cards.
For recent ISPs, software must detect OVERRUN conditions by
checking the SS_RESIDUAL_OVER bit during CS_COMPLETE handling.
Update the driver to perform this check, which is consistent with
what earlier firmwares did by explicitly cracking open the
FCP_RSP statuses and returning an CS_DATA_OVERRUN.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03 13:11:18 -06:00
Andrew Vasquez 7c7f1f299b [SCSI] qla2xxx: Correct needless clean-up resets during shutdown.
There's no point in hitting the RISC with what will most
assuredly be an unsucessful reset of the RISC hardware if the
initial stop-firmware mailbox command fails with a time-out
status.  Instead, to avoid what could amount to a lengthy
stop-firmware/detect-failure/reset-risc loop, continue with
driver unloading and discard the stop-firmware requirement.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03 13:10:58 -06:00
FUJITA Tomonori 279e7f5425 [SCSI] qla2xxx: fix compile warning for printk format
scsi/qla2xxx/qla_dfs.c: In function 'qla2x00_dfs_fce_show':
scsi/qla2xxx/qla_dfs.c:26: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'uint64_t'

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-18 08:57:17 -06:00
Andrew Vasquez d7402cd910 [SCSI] qla2xxx: Update version number to 8.02.00-k8.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:40 -06:00
Andrew Vasquez e6e074f175 [SCSI] qla2xxx: Correct issue where incorrect init-fw mailbox command was used on non-NPIV capable ISPs.
BIT_2 of the firmware attributes is only valid on FW-interface-2
type HBAs.  Code in commit
c48339decc would cause the
incorrect initialize-firmware mailbox command to be issued for
non-NPIV capable ISPs.  Correct this by reverting to previously
used (and correct) pre-condition 'if' check.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:40 -06:00
Seokmann Ju da4541b63b [SCSI] qla2xxx: Access the proper 'physical' port in FC-transport callbacks.
For following fc_host specific attributes, vports rely on the pport.
 So, this patch changed way to access the data for those attributes so that
 they can access pport's.
 - get_host_speed (speed)
 - get_host_port_state (port_state)
 - get_host_port_type (port_type)
 - get_fc_host_stats

Also, added PORT_SPEED_8GB case in the speed attribute for 8Gb HBAs.

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>
2008-02-07 18:02:40 -06:00
Seokmann Ju 99363ef81c [SCSI] qla2xxx: Correct issue where vport-state was not updated during an ISP_ABORT_NEEDED requst.
While running IO simultaneously through physical port and virtual
port, if user changes Data Rate (from scli utility), IO through
virtual port fails.  It failed because the vport had not received
the ISP_ABORT_NEEDED notification.

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>
2008-02-07 18:02:39 -06:00
Andrew Vasquez 963b0fdd3a [SCSI] qla2xxx: Move RISC-interrupt-register modifications to qla2x00_request_irqs().
There's no functional change involved with this update, instead
it simply migrates the "set cleared interrupt state" codes to a
more approprate method, qla2x00_request_irqs(), and cleans-up the
driver's probe() logic.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:39 -06:00
Andrew Vasquez 3db0652ef9 [SCSI] qla2xxx: Consolidate RISC-parity enablement codes.
Collapse duplicate codes called during probe() and RISC-reset
into qla2x00_setup_chip().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:39 -06:00
Andrew Vasquez e87110852d [SCSI] qla2xxx: Cleanse memory allocation logic during probe.
- Drop loop-till-allocated structure of code within
  qla2x00_mem_alloc().
- Properly unwind deallcations of memory during failures.
- Drop qla2x00_allocate_sp_pool() and qla2x00_free_sp_pool()
  functions as their implementations can easily be collapsed into
  the callers.
- Defer DMA pool allocation of SFP data until requested.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:39 -06:00
Andrew Vasquez 0afb467b47 [SCSI] qla2xxx: Clear EFT buffer before firmware reinitialization.
To insure that there is no stale data present during EFT
re-registration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:39 -06:00
Andrew Vasquez df4bf0bb5b [SCSI] qla2xxx: Cleanup any outstanding SRB resources during shutdown.
Refactor SRB-failure completion codes in the process.  Also,
signal the DPC routine to complete sooner as backend processing
at shutdown-time is superflous.

[jejb: resolve conflicts with pci_enable_device_bars removal]

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:38 -06:00
Andrew Vasquez 61623fc34f [SCSI] qla2xxx: Add MODULE_FIRMWARE hint for ISP25XX firmware.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:38 -06:00
Andrew Vasquez 948882f6b7 [SCSI] qla2xxx: Correct resource_size_t usages.
Hmm, it looks like the conversion to resource_size_t usage
(3776541d8a) requires some additional
fixups to cleanup the structure-pointer castings used during IO mapped
accesses to the chip.

There's only a small number of locations, where the driver uses IO
mapped accesses to the hardware, the patch below should take care of
it without introducing to many structural changes to code flow.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-07 18:02:38 -06:00
Joe Perches b1c118121a drivers/scsi/: Spelling fixes
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Acked-by: James Smart <james.smart@emulex.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: David Somayajulu <david.somayajulu@qlogic.com>
Acked-by: Mark Salyzyn <mark_salyzyn@adaptec.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2008-02-03 17:28:22 +02:00
Benjamin Herrenschmidt 0948391641 PCI: Remove users of pci_enable_device_bars()
This patch converts users of pci_enable_device_bars() to the new
pci_enable_device_{io,mem} interface.

The new API fits nicely, except maybe for the QLA case where a bit of
code re-organization might be a good idea but I prefer sticking to the
simple patch as I don't have hardware to test on.

I'll also need some feedback on the cs5520 change.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
James Bottomley d3f46f39b7 [SCSI] remove use_sg_chaining
With the sg table code, every SCSI driver is now either chain capable
or broken (or has sg_tablesize set so chaining is never activated), so
there's no need to have a check in the host template.

Also tidy up the code by moving the scatterlist size defines into the
SCSI includes and permit the last entry of the scatterlist pools not
to be a power of two.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-30 13:14:02 -06:00
Linus Torvalds 9b73e76f3c 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: (200 commits)
  [SCSI] usbstorage: use last_sector_bug flag universally
  [SCSI] libsas: abstract STP task status into a function
  [SCSI] ultrastor: clean up inline asm warnings
  [SCSI] aic7xxx: fix firmware build
  [SCSI] aacraid: fib context lock for management ioctls
  [SCSI] ch: remove forward declarations
  [SCSI] ch: fix device minor number management bug
  [SCSI] ch: handle class_device_create failure properly
  [SCSI] NCR5380: fix section mismatch
  [SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
  [SCSI] IB/iSER: add logical unit reset support
  [SCSI] don't use __GFP_DMA for sense buffers if not required
  [SCSI] use dynamically allocated sense buffer
  [SCSI] scsi.h: add macro for enclosure bit of inquiry data
  [SCSI] sd: add fix for devices with last sector access problems
  [SCSI] fix pcmcia compile problem
  [SCSI] aacraid: add Voodoo Lite class of cards.
  [SCSI] aacraid: add new driver features flags
  [SCSI] qla2xxx: Update version number to 8.02.00-k7.
  [SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
  ...
2008-01-25 17:19:08 -08:00
Andrew Vasquez 0c27f5bd00 [SCSI] qla2xxx: Update version number to 8.02.00-k7.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:33 -06:00
Seokmann Ju c48339decc [SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
There is a case where 54xx HBA loads MID firmware as it use 24xx
firmware. In this case, the driver should issue
MBC_MID_INITIALIZE FIRMWARE even though the HBA doesn't support
NPIV.  This patch make changes in the driver so that could behave
accordingly.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:33 -06:00
Andrew Vasquez fc44765f5a [SCSI] qla2xxx: Correct late-memset() of EFT buffer.
Original code would clear the buffer after the firmware had
already been initialized to use the buffer, thus potentially
and inadvertantly clearing data previously DMA'd by the
firmware.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:32 -06:00
Andrew Vasquez df613b9607 [SCSI] qla2xxx: Add Fibre Channel Event (FCE) tracing support.
FCE support enables the firmware to record FC extended link
services and basic link services frames which have been
transmitted and received by the ISP.  This allows for a limited
view of the FC traffic through the ISP without using a FC
analyzer.  This can be useful in situations where a physical
connection to the FC bus is not possible.

The driver exports this information in two ways -- first, via a
debugfs node exported for all supported ISPs under:

	<debugfs_mount_point>/qla2xxx/qla2xxx_<host_no>/fce

where a read of the 'fce' file will provide a snapshot of the
firmware's FCE buffer; and finally, the FCE buffer will be
extracted during a firmware-dump scenario.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:32 -06:00
Andrew Vasquez 00b6bd2516 [SCSI] qla2xxx: Trace-Control naming cleanups.
In preparation for FCE (Fibre Channel Event) tracing support.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:32 -06:00
Adrian Bunk a824ebb37c [SCSI] qla2xxx: Code cleanups.
- make the following needlessly global code static:
  - qla_attr.c: qla24xx_vport_delete()
  - qla_attr.c: qla24xx_vport_disable()
  - qla_mid.c: qla24xx_allocate_vp_id()
  - qla_mid.c: qla24xx_find_vhost_by_name()
  - qla_mid.c: qla2x00_do_dpc_vp()
  - qla_os.c: struct qla2x00_driver_template
  - qla_os.c: qla2x00_stop_timer()
  - qla_os.c: qla2x00_mem_alloc()
  - qla_os.c: qla2x00_mem_free()
  - qla_sup.c: qla2x00_lock_nvram_access()
  - qla_sup.c: qla2x00_unlock_nvram_access()
  - qla_sup.c: qla2x00_get_nvram_word()
  - qla_sup.c: qla2x00_write_nvram_word()
- #if 0 the following unused global functions:
  - qla_mbx.c: qla2x00_system_error()
- qla_os.c: remove some unneeded function prototypes
- removed unused functions:
  - qla_dbg.c: qla2x00_dump_pkt()
  - qla_mbx.c: qla2x00_get_serdes_params()
  - qla_mbx.c: qla2x00_get_idma_speed()
  - qla_mbx.c: qla24xx_get_vp_database()
  - qla_mbx.c: qla24xx_get_vp_entry()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Small modifications and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:32 -06:00
Seokmann Ju 50db6b134c [SCSI] qla2xxx: Add a filter to compare port_name against the physical on vport creation.
During vport creation, there was a possibility to get create a
vport with same port_name as pport.  A new filter has added to
compare given port_name with the port_name of the pport.

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>
2008-01-23 11:29:32 -06:00
Marcus Barrow 0b05a1f0d6 [SCSI] qla2xxx: Use completion routines.
Instead of abusing the semaphore interfaces for mailbox command
completions.

Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:31 -06:00
Andrew Vasquez a4722cf24d [SCSI] qla2xxx: Don't schedule the DPC routine to perform an issue-lip request.
As the driver depends on the DPC routine to handle bottom-half
loop resynchronization in order to recover from the issue-lip
request.  The issue_lip call is sleeping context capable, so just
issue the reset function there.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:31 -06:00
Andrew Vasquez da7429f9ab [SCSI] qla2xxx: Restrict MSI/MSI-X enablement on select ISP2432-type HBAs.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:31 -06:00
Andrew Vasquez 6f13fd57cd [SCSI] qla2xxx: Wait for FLASH write-protection to complete after a write.
Some flash parts have a slow enable write-protection (WP)
operation whereby subsequent FLASH accesses would fail if the WP
operation had not completed.  Software now polls the SPI's
status-register for WP completion.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:31 -06:00
Andrew Vasquez 3776541d8a [SCSI] qla2xxx: Fix for 32-bit platforms with 64-bit resources.
The driver stores the contents of PCI resources into unsigned
long's before ioremapping. This breaks on 32-bit platforms which
support 64-bit MMIO resources.

Correct code by removing the temporary variables used during MMIO
PIO mapping and using resource_size_t where applicable.  Also
correct a small typo in a printk() where the wrong region number
was displayed.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:29 -06:00
Andrew Vasquez 43ef058010 [SCSI] qla2xxx: Retrieve additional HBA port statistics from recent ISPs.
HBAs supporting these additional counters include ISP24xx and
ISP25xx type boards.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:29 -06:00
Andrew Vasquez 4733fcb1fe [SCSI] qla2xxx: Consolidate duplicate sense-data handling codes.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:29 -06:00
FUJITA Tomonori b80ca4f7ee [SCSI] replace sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE
This replaces sizeof sense_buffer with SCSI_SENSE_BUFFERSIZE in
several LLDs. It's a preparation for the future changes to remove
sense_buffer array in scsi_cmnd structure.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:27 -06:00
Adrian Bunk 4c993f7669 scsi/qla2xxx/qla_os.c section fix
WARNING: vmlinux.o(.text+0x2a4462): Section mismatch: reference to .exit.text:qla2x00_remove_one (between 'qla2xxx_pci_error_detected' and 'qla2x00_stop_timer')

qla2x00_remove_one() mustn't be __devexit since it's called from
qla2xxx_pci_error_detected().

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Seokmann Ju <seokmann.ju@qlogic.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-14 08:52:22 -08:00
Andrew Vasquez 3fb8931645 [SCSI] qla2xxx: Update version number to 8.02.00-k6.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-11 18:22:46 -06:00
Shyam Sundar f4a8dbc7f6 [SCSI] qla2xxx: Properly handle Vport state-change-notifications.
Drivers do SCRs for each Vport. When something changes in the
fabric, firmware generates one interrupt for each RSCN. Based on
the current implementation, in each case, we make recursive calls
to handle RSCN for physical and each subsequent virtual ports.
The fix is to also take into consideration the vp_idx, which is
set by the firmware to indicate the vport the RSCN was meant for.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-11 18:22:45 -06:00
Andrew Vasquez eb66dc60be [SCSI] qla2xxx: Correct NPIV support for recent ISPs.
Firmware will export to software the maximum number of vports
supported for any given firmware version and ISP type.  Use this
information rather than the current hardcoding of limitations
within the driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-11 18:22:45 -06:00
Andrew Vasquez 06e23b7470 [SCSI] qla2xxx: Don't explicitly read mbx registers while processing a system-error.
Callers of qla2x00_async_event() already populate the mb[] array
upon invocation, doing so via the appropriate mailbox register
accessors.  The stale codes removed are leftover-bits kept during
the FWI2 transition.  Though relatively benign, the extra-reads
are not valid for FWI2 boards (ISP24xx and above) and peek into
the incorrect regions of registers.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-11 18:22:45 -06:00
Andrew Vasquez af2709fd0d [SCSI] qla2xxx: Update version number to 8.02.00-k5.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-23 15:55:16 -04:00
Andrew Vasquez 8b7afc2a90 [SCSI] qla2xxx: Correct display of ISP serial-number.
The original serial-number calculations based on WWPN no longer
apply to newer ISPs (ISP24xx and ISP25xx).  These newer board's
serial number reside in the VPD.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-23 15:54:54 -04:00
Andrew Vasquez 6acf819002 [SCSI] qla2xxx: Correct residual-count handling discrepancies during UNDERRUN handling.
For recent ISPs, software during CS_UNDERRUN handling must
determine if the two residuals, firmware-calculated and FCP_RSP,
are different to recognize if a frame has been dropped.  Update
the driver to catch this condition, and clear the
SS_RESIDUAL_UNDER and lscsi_status bits.  This logic is
consistent with what earlier firmwares did by explicitly
cracking open the FCP_RSP statuses and clearing
SS_RESIDUAL_UNDER.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-23 15:54:41 -04:00
Andrew Vasquez 285d0321d1 [SCSI] qla2xxx: Make driver (mostly) legacy I/O port free.
Recent ISPs need only the single MMIO BAR to manipulate HW
registers.  Unfortunately, ISP21xx, ISP22xx, ISP23xx, and ISP63xx
type cards still require the I/O mapped region to manipulate the
FLASH via the two HW flash-registers (flash_address and
flash_data).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-23 15:54:28 -04:00
Andrew Vasquez 94d6a2b328 [SCSI] qla2xxx: Fix issue where final flash-segment updates were falling into the slow-path write handler.
Original implementation would not use the burst-write mechanisms
for requests equal to OPTROM_BURST_DWORDS transfer dwords.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-23 15:54:10 -04:00
Andrew Vasquez 2c96d8d0c1 [SCSI] qla2xxx: Handle unaligned sector writes during NVRAM/VPD updates.
Since both NVRAM and VPD regions of the flash reside on unaligned
sector boundaries, during update, the driver must perform a
read-modify-write operation to the composite NVRAM/VPD region.
This affects ISP25xx type boards only.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-23 15:53:55 -04:00
Andrew Vasquez a3a63d55a4 [SCSI] qla2xxx: Defer explicit interrupt-polling processing to init-time scenarios.
As the intermixing may cause issues where HCCR bits could be
cleared inappropriately during MSI/MSI-X interrupt handling.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-23 15:53:41 -04:00
Andrew Vasquez 6557f3a06a [SCSI] qla2xxx: Resync with latest HBA SSID specification -- 2.2u.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-23 15:53:23 -04:00
Andrew Morton 875baf3cbc [SCSI] qla2xxx: printk fixes
drivers/scsi/qla2xxx/qla_sup.c: In function 'qla24xx_write_flash_data':
drivers/scsi/qla2xxx/qla_sup.c:655: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'
drivers/scsi/qla2xxx/qla_sup.c: In function 'qla25xx_read_optrom_data':
drivers/scsi/qla2xxx/qla_sup.c:1853: warning: format '%llx' expects type 'long long unsigned int', but argument 6 has type 'dma_addr_t'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-18 08:28:10 -04:00
FUJITA Tomonori 9cb83c7529 [SCSI] add use_sg_chaining option to scsi_host_template
This option is true if a low-level driver can support sg
chaining. This will be removed eventually when all the drivers are
converted to support sg chaining. q->max_phys_segments is set to
SCSI_MAX_SG_SEGMENTS if false.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-16 11:24:32 +02:00
Andrew Vasquez 095862ab98 [SCSI] qla2xxx: Update version number to 8.02.00-k4.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:44 -04:00
Andrew Vasquez 39bd962269 [SCSI] qla2xxx: Limit iIDMA speed adjustments.
Do not adjust the iIDMA speed on ports which have a faster
link-speed than the HBA itself.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:40 -04:00
Andrew Vasquez 87f27015b8 [SCSI] qla2xxx: Rework MSI-X handlers.
Since MSI-X vectors do not require a clearing "handshake" from
the system perspective, and the registered handler will not be
called more than once for one occurrence of receipt of a vector,
there is no requirement to flush the risc register write clearing
the interrupt condition in the risc. Also, since the msi-x
registered handlers are optimised for a particular vector, it is
preferable to handle the one vector received per invocation of
the handler.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:37 -04:00
Andrew Vasquez 8b3253d10f [SCSI] qla2xxx: Clear options-flags while staging firmware-execution.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:33 -04:00
Andrew Vasquez 26ff776d1d [SCSI] qla2xxx: Sparse cleanups in qla_mid.c
Make several needlessly global functions static:
- qla2x00_mark_vp_devices_dead()
- qla24xx_configure_vp()

Remove unused function qla24xx_modify_vport().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:29 -04:00
Andrew Vasquez 700ca0e701 [SCSI] qla2xxx: Cleanup several 'sparse' warnings.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:26 -04:00
Andrew Vasquez f363b9434a [SCSI] qla2xxx: Use shost_priv().
Drop usage of legacy to_qla_host() macro.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:22 -04:00
Andrew Vasquez e745759a0f [SCSI] qla2xxx: Remove unused member (list) from srb_t structure.
This change reduces by as much as 16% the memory footprint for
each allocated sbr_t structure requested from the mempool.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:17 -04:00
Seokmann Ju 4d0ea24769 [SCSI] qla2xxx: Retrieve max-NPIV support capabilities from FW.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:14 -04:00
Andrew Vasquez c45bcc8e77 [SCSI] qla2xxx: Use the correct pointer-address during NVRAM writes.
Original code, incorrectly passed the address-of a pointer rather
than the pointer value itself.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:10 -04:00
Andrew Vasquez 8a85e17152 [SCSI] qla2xxx: Set correct attribute count during FDMI RPA.
Also remove legacy '/proc' name during OS_DEVICE_NAME
registration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:06 -04:00
Ravi Anand 63a8651f25 [SCSI] qla2xxx: Correct infinite-login-retry issue.
Where the DPC logic would get jammed into continuously
reloging-into a port.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:50:02 -04:00
Andrew Vasquez b583692739 [SCSI] qla2xxx: Query additional RISC registers during ISP25XX firmware dump.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:49:58 -04:00
Andrew Vasquez c3b058afae [SCSI] qla2xxx: Correct staging of RISC while attempting to pause.
There's no need to reset the RISC prior to pausing.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:49:54 -04:00
Andrew Vasquez 05236a050f [SCSI] qla2xxx: Query additional RISC information during a pause.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:49:51 -04:00
Seokmann Ju 14e660e677 [SCSI] qla2xxx: Add PCI error recovery support.
Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:49:47 -04:00
Joe Carnuccio b7cc176c9e [SCSI] qla2xxx: Allow region-based flash-part accesses.
Additional cleanups and
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:49:42 -04:00
Andrew Vasquez 338c9161e4 [SCSI] qla2xxx: Add flash burst-read/write support.
Newer ISPs support a mechanism to read and write flash-memory via
the firmware LOAD/DUMP memory mailbox command routines.  When
supported, utilizing these mechanisms significantly reduces
overall access times.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:49:38 -04:00
Andrew Vasquez c81d04c9e2 [SCSI] qla2xxx: Collapse and simplify ISP2XXX firmware dump routines.
Add IO-base-window accessor functions.  Merge duplicate
RISC-pause and soft-reset code segments.  Drop 'eye-watering'
__iomem casting.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:49:34 -04:00
Mariusz Kozlowski bbfbbbc118 [SCSI] kmalloc + memset conversion to kzalloc
In NCR_D700, a4000t, aic7xxx_old, bvme6000, dpt_i2o, gdth, lpfc,
megaraid, mvme16x osst, pluto, qla2xxx, zorro7xx

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12 14:41:00 -04:00
Andrew Vasquez 604cd794de [SCSI] qla2xxx: Update version number to 8.02.00-k3.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-08-15 13:03:57 -05:00
Andrew Vasquez 6afd9763c1 [SCSI] qla2xxx: Correct mailbox register dump for FWI2 capable ISPs.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-08-15 13:03:43 -05:00
Andrew Vasquez a3cbdfad15 [SCSI] qla2xxx: Correct 8GB iIDMA support.
Original implementation manipulated the FC_GS values for
port-speed.  Transition the codes to use the driver's own
internal representations as this makes for a reduction in
duplicate 'conversion' codes throughout the driver.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-08-15 13:03:20 -05:00
Andrew Vasquez 02d638b4b7 [SCSI] qla2xxx: Correct management-server login-state synchronization issue.
Transitioning link-state via NOS/OLS requires a relogin to a
fabric's Management Server.  Request relogin when the firmware
issues a point-to-point asynchronous event (0x8030).

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-08-15 13:02:57 -05:00
Andrew Vasquez 8fef696b00 [SCSI] qla2xxx: Don't modify parity bits during ISP25XX restart.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-08-15 13:02:36 -05:00
Andrew Vasquez 29856e2841 [SCSI] qla2xxx: Allocate enough space for the full PCI descriptor.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-08-15 13:02:17 -05:00
Seokmann Ju 53772a2cb4 [SCSI] qla2xxx: fix panic caused by previous patch
- this patch will fix a panic caused by omitted memory allocation for the nvram.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-31 10:45:07 -05:00
Seokmann Ju 281afe1947 [SCSI] qla2xxx: fix to honor ignored parameters in sysfs attributes
This is a patch to fix 'segmentation fault' issue which was initiated
by Richard Lary <rlary@us.ibm.com>.  Thanks again Richard.

- on following sysfs attritute function, changes have made so that both
  count and offset input parameters are honored by the functions.
    = qla2x00_sysfs_read_nvram()
    = qla2x00_sysfs_read_vpd()
- made changes so that NVRAM data to be cached to minimize H/W accesses
  during agent querying of the driver's.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-27 09:14:22 -04:00
Boaz Harrosh 4b39c1d983 [SCSI] qla2xxx: Data accessors Cleanup of last merge
- Left overs from last code merges of qla2xxx

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-23 14:27:48 -05:00
Linus Torvalds e6f194d8f6 Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (60 commits)
  [SCSI] libsas: make ATA functions selectable by a config option
  [SCSI] bsg: unexport sg v3 helper functions
  [SCSI] bsg: fix bsg_unregister_queue
  [SCSI] bsg: make class backlinks
  [SCSI] 3w-9xxx: add support for 9690SA
  [SCSI] bsg: fix bsg_register_queue error path
  [SCSI] ESP: Increase ESP_BUS_TIMEOUT to 275.
  [SCSI] libsas: fix scr_read/write users and update the libata documentation
  [SCSI] mpt fusion: update Kconfig help
  [SCSI] scsi_transport_sas: add destructor for bsg
  [SCSI] iscsi_tcp: buggered kmalloc()
  [SCSI] qla2xxx: Update version number to 8.02.00-k2.
  [SCSI] qla2xxx: Add ISP25XX support.
  [SCSI] qla2xxx: Use pci_try_set_mwi().
  [SCSI] qla2xxx: Use PCI-X/PCI-Express read control interfaces.
  [SCSI] qla2xxx: Re-factor isp_operations to static structures.
  [SCSI] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
  [SCSI] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration.
  [SCSI] qla2xxx: Generalize iIDMA support.
  [SCSI] qla2xxx: Generalize FW-Interface-2 support.
  ...
2007-07-22 11:36:49 -07:00
Andrew Vasquez 6585c1b3e2 [SCSI] qla2xxx: Update version number to 8.02.00-k2.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 09:25:47 -05:00
Andrew Vasquez c3a2f0dfe1 [SCSI] qla2xxx: Add ISP25XX support.
Large code-reuse from ISP24xx, consolidate RISC memory
extraction routines during firmware-dump.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 09:25:29 -05:00
Andrew Vasquez af6177d88d [SCSI] qla2xxx: Use pci_try_set_mwi().
As the "must-check" return-value of pci_set_msi() is never
really checked.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 09:24:59 -05:00
Andrew Vasquez f85ec187dc [SCSI] qla2xxx: Use PCI-X/PCI-Express read control interfaces.
Original from Peter Oruba <peter.oruba@amd.com>.  Additional
cleanups included.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 09:24:41 -05:00
Andrew Vasquez fd34f55694 [SCSI] qla2xxx: Re-factor isp_operations to static structures.
In preparation for new ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 09:24:22 -05:00
Shyam Sundar 8084fe168a [SCSI] qla2xxx: Validate mid-layer 'underflow' during check-condition handling.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 09:24:04 -05:00
Andrew Vasquez 5881569bb3 [SCSI] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 09:23:45 -05:00
Andrew Vasquez c76f2c013f [SCSI] qla2xxx: Generalize iIDMA support.
In preparation for new ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 09:02:04 -05:00
Andrew Vasquez e428924ccd [SCSI] qla2xxx: Generalize FW-Interface-2 support.
In preparation for new ISP types.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-20 08:59:09 -05:00
Paul Mundt 20c2df83d2 mm: Remove slab destructors from kmem_cache_create().
Slab destructors were no longer supported after Christoph's
c59def9f22 change. They've been
BUGs for both slab and slub, and slob never supported them
either.

This rips out support for the dtor pointer from kmem_cache_create()
completely and fixes up every single callsite in the kernel (there were
about 224, not including the slab allocator definitions themselves,
or the documentation references).

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-20 10:11:58 +09:00
Linus Torvalds bc06cffdec Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (166 commits)
  [SCSI] ibmvscsi: convert to use the data buffer accessors
  [SCSI] dc395x: convert to use the data buffer accessors
  [SCSI] ncr53c8xx: convert to use the data buffer accessors
  [SCSI] sym53c8xx: convert to use the data buffer accessors
  [SCSI] ppa: coding police and printk levels
  [SCSI] aic7xxx_old: remove redundant GFP_ATOMIC from kmalloc
  [SCSI] i2o: remove redundant GFP_ATOMIC from kmalloc from device.c
  [SCSI] remove the dead CYBERSTORMIII_SCSI option
  [SCSI] don't build scsi_dma_{map,unmap} for !HAS_DMA
  [SCSI] Clean up scsi_add_lun a bit
  [SCSI] 53c700: Remove printk, which triggers because of low scsi clock on SNI RMs
  [SCSI] sni_53c710: Cleanup
  [SCSI] qla4xxx: Fix underrun/overrun conditions
  [SCSI] megaraid_mbox: use mutex instead of semaphore
  [SCSI] aacraid: add 51245, 51645 and 52245 adapters to documentation.
  [SCSI] qla2xxx: update version to 8.02.00-k1.
  [SCSI] qla2xxx: add support for NPIV
  [SCSI] stex: use resid for xfer len information
  [SCSI] Add Brownie 1200U3P to blacklist
  [SCSI] scsi.c: convert to use the data buffer accessors
  ...
2007-07-15 16:51:54 -07:00
Seokmann Ju cad7d7858b [SCSI] qla2xxx: update version to 8.02.00-k1.
Following patch bump up the driver version reflecting NPIV addition to
the qla2xxx.

- version changed from 8.01.07-k7 to 8.02.00-k1.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-14 19:08:13 -05:00
Seokmann Ju 2c3dfe3f6a [SCSI] qla2xxx: add support for NPIV
Following patch adds support for NPIV (N-Port ID Virtualization) to the
qla2xxx.

- supported within switched-fabric topologies only.
- supports up to 63 virtual ports on each physical port.

Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-07-14 19:08:05 -05:00
Linus Torvalds 21ba0f88ae Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (34 commits)
  PCI: Only build PCI syscalls on architectures that want them
  PCI: limit pci_get_bus_and_slot to domain 0
  PCI: hotplug: acpiphp: avoid acpiphp "cannot get bridge info" PCI hotplug failure
  PCI: hotplug: acpiphp: remove hot plug parameter write to PCI host bridge
  PCI: hotplug: acpiphp: fix slot poweroff problem on systems without _PS3
  PCI: hotplug: pciehp: wait for 1 second after power off slot
  PCI: pci_set_power_state(): check for PM capabilities earlier
  PCI: cpci_hotplug: Convert to use the kthread API
  PCI: add pci_try_set_mwi
  PCI: pcie: remove SPIN_LOCK_UNLOCKED
  PCI: ROUND_UP macro cleanup in drivers/pci
  PCI: remove pci_dac_dma_... APIs
  PCI: pci-x-pci-express-read-control-interfaces cleanups
  PCI: Fix typo in include/linux/pci.h
  PCI: pci_ids, remove double or more empty lines
  PCI: pci_ids, add atheros and 3com_2 vendors
  PCI: pci_ids, reorder some entries
  PCI: i386: traps, change VENDOR to DEVICE
  PCI: ATM: lanai, change VENDOR to DEVICE
  PCI: Change all drivers to use pci_device->revision
  ...
2007-07-12 13:40:57 -07:00
Zhang Rui 91a6902958 sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes
Well, first of all, I don't want to change so many files either.

What I do:
Adding a new parameter "struct bin_attribute *" in the
.read/.write methods for the sysfs binary attributes.

In fact, only the four lines change in fs/sysfs/bin.c and
include/linux/sysfs.h do the real work.
But I have to update all the files that use binary attributes
to make them compatible with the new .read and .write methods.
I'm not sure if I missed any. :(

Why I do this:
For a sysfs attribute, we can get a pointer pointing to the
struct attribute in the .show/.store method,
while we can't do this for the binary attributes.
I don't know why this is different, but this does make it not
so handy to use the binary attributes as the regular ones.
So I think this patch is reasonable. :)

Who benefits from it:
The patch that exposes ACPI tables in sysfs
requires such an improvement.
All the table binary attributes share the same .read method.
Parameter "struct bin_attribute *" is used to get
the table signature and instance number which are used to
distinguish different ACPI table binary attributes.

Without this parameter, we need to offer different .read methods
for different ACPI table binary attributes.
This is impossible as there are various ACPI tables on different
platforms, and we don't know what they are until they are loaded.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-11 16:09:09 -07:00
Tejun Heo 7b595756ec sysfs: kill unnecessary attribute->owner
sysfs is now completely out of driver/module lifetime game.  After
deletion, a sysfs node doesn't access anything outside sysfs proper,
so there's no reason to hold onto the attribute owners.  Note that
often the wrong modules were accounted for as owners leading to
accessing removed modules.

This patch kills now unnecessary attribute->owner.  Note that with
this change, userland holding a sysfs node does not prevent the
backing module from being unloaded.

For more info regarding lifetime rule cleanup, please read the
following message.

  http://article.gmane.org/gmane.linux.kernel/510293

(tweaked by Greg to not delete the field just yet, to make it easier to
merge things properly.)

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-11 16:09:06 -07:00
Auke Kok 44c10138fd PCI: Change all drivers to use pci_device->revision
Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.

This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.

In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.

Compile tested with make all{yes,mod}config on x86_64 and i386.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-11 16:02:10 -07:00
FUJITA Tomonori 385d70b4e2 [SCSI] qla2xxx: convert to use the data buffer accessors
- remove the unnecessary map_single path.

- convert to use the new accessors for the sg lists and the
parameters.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-31 12:23:49 -05:00
Bill Nottingham 88f5774b07 [SCSI] qla2xxx: fix timeout in qla2x00_down_timeout
iterations is unsigned, so it is impossible to get out of the loop
and return -ETIMEDOUT.

Signed-off-by: Bill Nottingham <notting@redhat.com>
Acked-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-30 10:15:32 -05:00
Jeff Garzik 476834c25a [SCSI] aacraid,qla2xxx: use irq_handler_t where appropriate
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-24 09:12:47 -05:00
Linus Torvalds 0c23664ee8 Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Optimize fault kprobe handling just like powerpc.
  [SPARC]: Wire up utimensat syscall.
  [SPARC64]: Fix request_irq() ignored result warnings in PCI controller code.
  [SPARC64]: Kill asm-sparc64/pbm.h
  [ATYFB]: Fix sparc includes.
  [QLA2XXX]: Fix build on sparc.
  [SPARC64]: Removal of trivial pci_controller_info uses.
  [SPARC64]: Move index info pci_pbm_info.
  [SPARC64]: Move {setup,teardown}_msi_irq into pci_pbm_info.
  [SPARC64]: Move pci_ops into pci_pbm_info.
  [SPARC64] SBUS: Error interrupt registry cleanups.
  [SPARC64] PCI: Use root list of pbm's instead of pci_controller_info's
  [SPARC64] PCI: Kill PROM_PCIRNG_MAX and PROM_PCIIMAP_MAX.
  [SPARC64] PCI: Use common routine to fetch PBM properties.
2007-05-08 20:32:43 -07:00
David S. Miller 15576bc8ad [QLA2XXX]: Fix build on sparc.
We now use pci_device_to_OF_node() to get properties
and of_get_property() returns const pointers.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-05-08 16:41:49 -07:00
Andrew Vasquez d24f8e8fef [SCSI] qla2xxx: Update version number to 8.01.07-k7.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-08 11:21:59 -05:00
Andrew Vasquez cbedb60186 [SCSI] qla2xxx: Add MSI support.
Supported ISP types include ISP2422 and revision-2 type
ISP2432 chips.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-08 11:21:45 -05:00
Andrew Vasquez a157b1014f [SCSI] qla2xxx: Correct pci_set_msi() usage semantics.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-08 11:21:29 -05:00