History log of /drivers/scsi/qla4xxx/ql4_isr.c
Revision Date Author Comments
9cb78c16f5dadefd8dc5ba0ae5a2f26cd59419b3 25-Jun-2014 Hannes Reinecke <hare@suse.de> scsi: use 64-bit LUNs

The SCSI standard defines 64-bit values for LUNs, and large arrays
employing large or hierarchical LUN numbers become more and more
common.

So update the linux SCSI stack to use 64-bit LUN numbers.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
d43ba46fa226b106c66c7c92c8c512ef8515b6ee 10-Apr-2014 Tej Parkash <tej.parkash@qlogic.com> qla4xxx: Disable INTx interrupt for ISP82XX

Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Christoph Hellwig <hch@lst.de>
659743b02c411075b26601725947b21df0bb29c8 07-Feb-2014 Shlomo Pongratz <shlomop@mellanox.com> [SCSI] libiscsi: Reduce locking contention in fast path

Replace the session lock with two locks, a forward lock and
a backwards lock named frwd_lock and back_lock respectively.

The forward lock protects resources that change while sending a
request to the target, such as cmdsn, queued_cmdsn, and allocating
task from the commands' pool with kfifo_out.

The backward lock protects resources that change while processing
a response or in error path, such as cmdsn_exp, cmdsn_max, and
returning tasks to the commands' pool with kfifo_in.

Under a steady state fast-path situation, that is when one
or more processes/threads submit IO to an iscsi device and
a single kernel upcall (e.g softirq) is dealing with processing
of responses without errors, this patch eliminates the contention
between the queuecommand()/request response/scsi_done() flows
associated with iscsi sessions.

Between the forward and the backward locks exists a strict locking
hierarchy. The mutual exclusion zone protected by the forward lock can
enclose the mutual exclusion zone protected by the backward lock but not
vice versa.

For example, in iscsi_conn_teardown or in iscsi_xmit_data when there is
a failure and __iscsi_put_task is called, the backward lock is taken while
the forward lock is still taken. On the other hand, if in the RX path a nop
is to be sent, for example in iscsi_handle_reject or __iscsi_complete_pdu
than the forward lock is released and the backward lock is taken for the
duration of iscsi_send_nopout, later the backward lock is released and the
forward lock is retaken.

libiscsi_tcp uses two kernel fifos the r2t pool and the r2t queue.

The insertion and deletion from these queues didn't corespond to the
assumption taken by the new forward/backwards session locking paradigm.

That is, in iscsi_tcp_clenup_task which belongs to the RX (backwards)
path, r2t is taken out from r2t queue and inserted to the r2t pool.
In iscsi_tcp_get_curr_r2t which belong to the TX (forward) path, r2t
is also inserted to the r2t pool and another r2t is pulled from r2t
queue.

Only in iscsi_tcp_r2t_rsp which is called in the RX path but can requeue
to the TX path, r2t is taken from the r2t pool and inserted to the r2t
queue.

In order to cope with this situation, two spin locks were added,
pool2queue and queue2pool. The former protects extracting from the
r2t pool and inserting to the r2t queue, and the later protects the
extracing from the r2t queue and inserting to the r2t pool.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
[minor fix up to apply cleanly and compile fix]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
4820002dadff0d6f33bd968e1e94efb12436a17d 16-Dec-2013 Nilesh Javali <nilesh.javali@qlogic.com> [SCSI] qla4xxx: Handle IPv6 AEN notifications

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
1b3d399cf6877c8d9abd63a2aff41b709a38fbd1 16-Dec-2013 Tej Parkash <tej.parkash@qlogic.com> [SCSI] qla4xxx: Fix processing response queue during probe

Issue:
While booting with kdump kernel, driver receive IOCB interrupts
for which it is not ready which results in processing them
before init_firmware during driver probe

Fix:
Two steps solution
1. Make driver ready to process the interrupt before interupts
handlers is registered.
2. Stop driver processing iocb interrupts if not generated as per
firmware protocol i.e R2H bit set

Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
bb5649f3eb43f47d07fdfbfbc1ce5b0dd2aef546 16-Dec-2013 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Return correct error status from func qla4xxx_request_irqs()

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
7f15ebceb174d5588e715c7de714e78595fcefc8 16-Dec-2013 Nilesh Javali <nilesh.javali@qlogic.com> [SCSI] qla4xxx: Rename ACB_STATE macros with IP_ADDRSTATE macros

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
df86f771578209599acc871a03f02346c8d7885b 22-Nov-2013 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Added support for Diagnostics MBOX command

Added support for Diagnostics MBOX command via BSG Vendor HST_VENDOR
interface. This command provides various tests for validating hardware
functionality.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
f8e934122424ab1f9a538fc2b7062d7d5b10fd6f 18-Oct-2013 Harish Zunjarrao <harish.zunjarrao@qlogic.com> [SCSI] qla4xxx: Add support for additional network parameters settings

Added support to display and update additional network parameters
through iscsiadm.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
4a4f51e9b60196a1155e181f5a19240b6b7f1ae9 16-Aug-2013 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Update Copyright header

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
7ab284c9fb8b2e9d6e8e16ebde9c1b015ba607cb 16-Aug-2013 Nilesh Javali <nilesh.javali@qlogic.com> [SCSI] qla4xxx: Implementation of ACB configuration during Loopback for ISP8042

While loopback diagnostic is in progress, disable the ACB which resets
all the active connections to target. Disable ACB would filter out all
the DHCP multicast and broadcast packets which otherwise cause the
diagnostic test to take longer time to complete or failures in some
other cases.

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
b37ca4183c287448ad0096381d030ca5fc788059 16-Aug-2013 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Added support for ISP8042

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
78a4544885037ad95ca1962ffeda767d60dd78b1 05-Apr-2013 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Added print statements to display AENs

Added print statements for following AENs:
1. MBOX_ASTS_INITIALIZATION_FAILED
2. MBOX_ASTS_SYSTEM_WARNING_EVENT
3. MBOX_ASTS_DCBX_CONF_CHANGE
4. MBOX_ASTS_IPV6_DEFAULT_ROUTER_CHANGED

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
a24058f9c2368568aed14593b8a63706408547da 07-Mar-2013 Tej Parkash <tej.parkash@qlogic.com> [SCSI] qla4xxx: Fixed request queue count manipulation on response path

Issue:
Request queue count holds the information about free space in request queue
which has to be manipulated based on request in and out pointer.
But in driver response path, this count was incremented unconditionally,
which could move req_in pointer beyond req_out pointer.
This scenario leads fw hang during IO.

Solution:
Request queue count manipulation has to be done in IO path only, keeping
req_in and req_out pointer two IOCB count away

Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
33338e31839fe45fa794bcc227d292dd7fab786c 07-Mar-2013 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Fix debug level to avoid floods of same message

Move "Incorrect function ID" print message in case INTX interrupt
from DEBUG2 to DEBUG7. This will avoid floods of this message if
DEBUG2 is enabled.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
026fbd3aaae796d2457898497374b68f3477ee2f 21-Jan-2013 Nilesh Javali <nilesh.javali@qlogic.com> [SCSI] qla4xxx: Quiesce driver activities while loopback

Quiesce all different activities performed by driver upon the link events
while loopback diagnostics is in progress.

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
9cb33f184e5d57054caf24c2bd657517e557367c 21-Jan-2013 Nilesh Javali <nilesh.javali@qlogic.com> [SCSI] qla4xxx: Rename MBOX_ASTS_IDC_NOTIFY to MBOX_ASTS_IDC_REQUEST_NOTIFICATION

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
ff2477bacaf26b4733acebc1a65add4e433ef062 21-Jan-2013 Nilesh Javali <nilesh.javali@qlogic.com> [SCSI] qla4xxx: Add spurious interrupt messages under debug level 2

The spurious interrupt messages are seen when interrupt lines are
shared between different adapters or modules. Example, interrupt
lines are shared between qlcnic and qla4xxx and USB modules, then the
console is flooded with flurry of spurious interrupt messages
which are expected in such scenario.

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

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
5c19b92ae82a2b39add78b2d2bc1c4e4d7c4d2ec 23-Nov-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Fix MBOX intr switching from polling to intr mode for ISP83XX

Issue:
Mailbox command timed out after switching from polling mode to interrupt mode.

Events:-
1. Mailbox interrupts are disabled
2. FW generates AEN and at same time driver enables Mailbox Interrupt
3. Driver issues new mailbox to Firmware

In above case driver will not get AEN interrupts generated by FW in step #2 as
FW generated this AEN when interrupts are disabled. During the same time
driver enabled the mailbox interrupt, so driver will not poll for interrupt.
Driver will never process AENs generated in step #2 and issues new mailbox to
FW, but now FW is not able to post mailbox completion as AENs generated before
are not processed by driver.

Fix:
Enable Mailbox / AEN interrupts before initializing FW in case of ISP83XX.
This will make sure we process all Mailbox and AENs in interrupt mode.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
320a61de9dc9ca1ed2b69c9a95968e0207c348df 20-Sep-2012 Nilesh Javali <nilesh.javali@qlogic.com> [SCSI] qla4xxx: IDC implementation for Loopback

Handle IDC Request Notify AEN and post IDC Acknowledgement
while participating in Loopback IDC.

Signed-off-by: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
109a008bfe73322c1e2b16a7d23eb9899afe4352 20-Sep-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Prevent MSI/MSI-X falling back to INTx for ISP82XX

For ISP82xx mixed interrupt mode is not supported.
Hence prevent MSI/MSI-x from falling back to INTx mode.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
c68cdbf045d98f495e39402b3dfab42d0ddaf9ff 22-Aug-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Update Copyright header

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
6e7b429259fc0b7f2d9b1147466656b34d114815 22-Aug-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Added support for ISP83XX

Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
ee996a691752ae55d26c1dd6de7421c1eb64cffb 22-Aug-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Replace all !is_qla8022() with is_qla40XX()

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
7664a1fd76d2eb49b07443f5fc46c75f6a95c98b 22-Aug-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Update structure and variable names

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
f8086f4fd462195a5a824c851997bd12ffceae00 22-Aug-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Update function name from 8xxx to 82xx

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
24c14200947d0c2ca6943fe0353438c3ac9c1c2a 07-Aug-2012 Lalit Chandivade <lalit.chandivade@qlogic.com> [SCSI] qla4xxx: Properly handle SCSI underrun while processing status IOCBs.

The current code would incorrectly return a DID_OK for a
CHECK CONDITION with Recovered error sense key causing incorrect
completion of a command when there is a dropped frame.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Tej Parkash <tej.parkash@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
1a590cabc272d62ffca1427d3010aea2098f414f 06-Mar-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] iscsi_transport: Added error status code for ping comp event

Defined error codes for ping completion status.

This patch take care of Mike Christie's commets

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
c0b9d3f750520ad3005b99144260e486ef01b5d9 13-Feb-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Added ping support

Added ping support for network connection diagnostics.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
ff884430801c08bd909fd95f6cb1a0446afd30db 29-Aug-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: added support for host event

Added support to post kernel host event to application using
netlink interface.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
4c6a794d2c0affde28f46ef5646cd41cd1a35f06 02-Dec-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Perform context resets in case of context failures.

For 4032, context reset was the same as chip reset, and any firmware
issue was recovered by performing a chip reset.
For 82xx, the iSCSI firmware runs along with FCoE and the NIC
firmware contexts, and an error encountered doesnot essentially mean
that a chip reset is necessary.

Perform Chip resets only in the following cases:
1. Mailbox system error.
2. Mailbox command timeout.
3. fw_heartbeat_counter counter stops incrementing.

For all other cases, only perform a context reset.
1. Command Completion with an invalid srb.
2. Other mailbox failures.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Shyam Sunder <shyam.sunder@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
95d31262b3c1ba5b945a6e7b4f679532db622a27 12-Aug-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Added support for adapter and firmware reset

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
b3a271a94d0034dd3bab10b8d8cd432843be629e 25-Jul-2011 Manish Rangankar <manish.rangankar@qlogic.com> [SCSI] qla4xxx: support iscsiadm session mgmt

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

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

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

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

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

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
6d78bd56be54286a72413db82d87fc371867629f 18-May-2011 Prasanna Mumbai <prasanna.mumbai@qlogic.com> [SCSI] qla4xxx: Complete the cmd if sense_len is zero

Complete the cmd if sense length is zero. For cases where sense
data spans across multiple iocb's by FW, we need to hold on to the
I/O (ha->status_srb != NULL) till we have processed them all and
copied the sense data from internal buffer to scsi_cmd sense buffer.

Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
185f107ef9913d9263bc9c2014d16a5a65c4894e 18-May-2011 Prasanna Mumbai <prasanna.mumbai@qlogic.com> [SCSI] qla4xxx: update function qla4xxx_isr_decode_mailbox()

- Added MBOX_ASTS_DUPLICATE_IP AEN handling.
- Update MBOX_AEN_REG_COUNT to 8 so that driver will save status
of all mbox registers in aen_q

Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
7eece5a084264c1bff908b0d6a1b176b39dd272f 21-Mar-2011 Karen Higgins <karen.higgins@qlogic.com> [SCSI] qla4xxx: Prevent other port reinitialization during remove_adapter

remove ha flag AF_HBA_GOING_AWAY and added flag AF_HA_REMOVAL
to mark the other ISP-4xxx port to indicate that the driver is
being removed, so that the other port will not re-initialize
while in the process of removing the ha due to driver unload
or hba hotplug.

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
7edd9a7b28f57d8a5bcdb1a0def2aa09d1dd49d4 21-Mar-2011 Karen Higgins <karen.higgins@qlogic.com> [SCSI] qla4xxx: cleanup DDB relogin logic during initialization

Driver has capability to add device dynamically and present
them to OS, driver no longer need to wait for DDBs to come
online during driver initialization.
Driver still issues a relogin for DDBs that are not online,
but no longer wait for DDB to come online.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
cd09b2c3d0574d17804f8a691433249fa86197d3 28-Jan-2011 Justin P. Mattock <justinmattock@gmail.com> drivers:scsi Change printk typo initate -> initiate

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
7d01d0698f450ed8cc9fd4557f88a3309c868d44 03-Dec-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Updated the Copyright header

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
e128271b7bcb9c8955cadbf2e18f8af288979e6b 03-Dec-2010 Prasanna Mumbai <prasanna.mumbai@qlogic.com> [SCSI] qla4xxx: cache new IP address acquired via DHCP

Prior to firmware state change from ACQUIRING to READY, an
0x8029 AEN is received. Added code to check previous state
being ACQUIRING in order to update the ip address in the driver.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
61391d314e856030b2b40b5d6ea22b93de0f1fed 03-Dec-2010 Shyam Sundar <shyam.sundar@qlogic.com> [SCSI] qla4xxx: initialize MSI in correct way

IRQF_SHARED flag should not be set when calling request_irq for MSI since
this interrupt mechanism cannot be shared like standard INTx

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
3e1350c4dc8900476c4db2066c00f13e9e939817 03-Dec-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Drop use of IRQF_DISABLE

IRQF_DISABLE flag is deprecated and this flag is a NOOP in kernel.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
91a772a4b1840fea39f0377c2cbca4cfc5be05f9 07-Oct-2010 Karen Higgins <karen.higgins@qlogic.com> [SCSI] qla4xxx: dump mailbox registers on System Error

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
6434080b127088606e03d2ecfe5ffdd797e38d63 07-Oct-2010 Shyam Sundar <shyam.sundar@qlogic.com> [SCSI] qla4xxx: Add support for 8130/8131 AENs.

AEN 8130 Corresponds to an event representing the insertion (detection)
of a transceiver. It also reports the type of the SFP+.
AEN 8131 corresponds to the removal of a transceiver.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
735e41543c12c245290cf652727893a66cbd8ab6 07-Oct-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: correct data type of sense_len in qla4xxx_status_cont_entry

change data type of sense_len from uint8_t to uint16_t

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2232be0d5707cd331b92027c0fd7ea5e843c2121 30-Jul-2010 Lalit Chandivade <lalit.chandivade@qlogic.com> [SCSI] qla4xxx: Added AER support for ISP82xx

Added support for PCI error handling

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
c2660df310a3c445194748b54f51b7224639e742 10-Jul-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: replace all dev_info, dev_warn, dev_err with ql4_printk

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
f4f5df23bf72208d0c2f1d8be629839924c2f4c2 28-Jul-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: Added support for ISP82XX

Signed-off-by: Vikas Chaudhary <Vikas Chaudhary@qlogic.com>
Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
09a0f719896659a6c32df11426e55795012c06ff 28-Apr-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: added support for abort task management command

* Handles SCSI command aborts.
* Serialization srb between error handler and command
completion path.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
821d6e5413481a57bbe1c2722dbe1fee4ff675c4 28-Apr-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: do not retry login to CHAP auth failed targets

Per RFC 3720, Login Response Status Code 0x02 should not be retried.
Condensed connection error checking code to a single routine, and
added check for status class 0x02.

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
065aa1b4db63c7fa68a3e889510c4e63404a1ac7 28-Apr-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com> [SCSI] qla4xxx: set device state as per Link UP and LINK DOWN

Link Down -> Mark all devices missing
Previously, the driver took no action on a Link Down,
and waited for the I/O on a dead connection to timeout
in the firmware before marking the DDB missing.

Link Up -> Mark all devices online
F/W will do auto login to all the devices only once.
After that its the responsibility of the driver to
relogin to devices whenever there is :
* Any sort of connection failure or
* KATO expires indicating target has logged out or
* I/O times out etc.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
b06fc73a9ebd352065dd4dd3139fb53ed72ac970 20-Aug-2009 Mike Christie <michaelc@cs.wisc.edu> [SCSI] qla4xxx: Removed residual from overrun debug print

The residual variable is only valid for udnerrun so do
not print it out for the overrun case.

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
[Mike Christie: Fix coding style issues in patch]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
94bced3c1b371014cbd187f2df5539b13a0e3b90 15-Jul-2009 Karen Higgins <karen.higgins@qlogic.com> [SCSI] qla4xxx: Correct Extended Sense Data Errors

Fixed sense data errors occurring above the first 32 bytes,
as required by some third party applications. Sense data
in the first 32 bytes has always been correct.

Patch updated to use srb data variables instead of scsi command
scratchpad data area, as scratchpad area is already used.

Also, corrected debug print alignment bug in dump_buffer routine.
Changed KERN_DEBUG to KERN_INFO in printk statements in this routine.

Changed version number to 5.01.00-k9

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
[michaelc: fixed checkpath.pl errors]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
56d7fcfa815564b40a1b0ec7a30ea8cb3bc0713e 20-Aug-2008 Mike Christie <michaelc@cs.wisc.edu> [SCSI] iscsi class, libiscsi and qla4xxx: convert to new transport host byte values

This patch converts the iscsi drivers to the new host byte values.

v2
Drop some conversions. Want to avoid conflicts with other patches.
v1
initial patch.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
9d56291366cd6ab156be722e42cf487bef20f5fd 19-Mar-2008 David C Somayajulu <david.somayajulu@qlogic.com> [SCSI] qla4xxx: fix scsi command completion, lun reset and target reset code

This patch contains the following:

1. when hba completion status is good, check for iscsi transport
errors (underflow/overflow) prior to checking the scsi status

2. New firmware requires that one marker iocb be issued for each task
management command. The patch issues marker iocb immediately
following a LUN or Target reset.

Signed-off-by: David C Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
65fecc77f3c47c5e8758d133b8ec47dcc16ed207 21-Feb-2008 David Somayajulu <david.somayajulu@qlogic.com> [SCSI] qla4xxx: fix up residual handling

the check in the residual case has an incorrect test of scsi_status
(the logic is reversed, it should be scsi_status != 0 instead of
!scsi_status. Since we checked a few lines above that scsi_status was
non-zero, just eliminate this test

Signed-off-by: David C Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
b80ca4f7ee36c26d300c5a8f429e73372d153379 13-Jan-2008 FUJITA Tomonori <tomof@acm.org> [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>
6ea7e33ee1b74de9b60327fec1a0cd39afac3983 09-Jul-2007 David C Somayajulu <david.somayajulu@qlogic.com> [SCSI] qla4xxx: Fix underrun/overrun conditions

On Wed, 2007-06-06 at 11:55 -0700, David C Somayajulu wrote:
This patch fixes the code handling underrun and overrun conditions.
Also fixed coding style as per Mike Christie's advice.

Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
5f7186c841a13abff0bf81ee93754b4f46e19141 26-May-2007 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> [SCSI] qla4xxx: 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.

Jens Axboe <jens.axboe@oracle.com> did the for_each_sg cleanup.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: David C Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
401425b1ea005b39dcc544bffea833f338ba84f6 24-May-2007 David C Somayajulu <david.somayajulu@qlogic.com> [SCSI] qla4xxx: ql4_isr.c support for new mbx cmds

Add support to log all AENs and service mbx cmd completions for QLA4032

Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
477ffb9d8732f30e7ab2d20f6ed0c22bad37a4a5 22-Jan-2007 David C Somayajulu <david.somayajulu@qlogic.com> [SCSI] qla4xxx: bug fixes

The included patch fixes the following issues:

1. qla3xxx/qla4xxx co-existence issue which can result in a lockup
when qla3xxx driver is unloaded, or when ifdown; ifup is performed on
one of the interfaces correponding to qla3xxx. This is because qla4xxx
HBA supports one ethernet and iscsi interfaces per port. Both iscsi
and ethernet interfaces share the same state machine. The problem has
to do with synchronizing access to the state machine in the event of a
reset

2. mutex_lock() is sometimes not followed by mutex_unlock() prior to
invoking a msleep() in qla4xxx_mailbox_command()

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
d915058f48745c0d5c4582566e5aa63867264f81 16-Nov-2006 David C Somayajulu <david.somayajulu@qlogic.com> [SCSI] qla4xxx: add support for qla4032

This patch provides the following:

1. adds support for the next version of Qlogic's iSCSI HBA, qla4032
(PCI Device ID 4032).

2. removes dead code related to topcat chip and renames
qla4010_soft_reset to qla4xxx_soft_reset (minor changes).

Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
7d12e780e003f93433d49ce78cfedf4b4c52adc5 05-Oct-2006 David Howells <dhowells@redhat.com> IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
afaf5a2d341d33b66b47c2716a263ce593460a08 19-Sep-2006 David Somayajulu <david.somayajulu@qlogic.com> [SCSI] Initial Commit of qla4xxx

open-iSCSI driver for Qlogic Corporation's iSCSI HBAs

Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com>
Signed-off-by: Doug Maxey <dwm@bubba.enoyolf.org>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>