History log of /linux-master/drivers/scsi/qla4xxx/ql4_def.h
Revision Date Author Comments
# d7ba1064 06-Mar-2023 Bjorn Helgaas <bhelgaas@google.com>

scsi: qla4xxx: Drop redundant pci_enable_pcie_error_reporting()

pci_enable_pcie_error_reporting() enables the device to send ERR_*
Messages. Since commit f26e58bf6f54 ("PCI/AER: Enable error reporting when
AER is native"), the PCI core does this for all devices during enumeration,
so the driver doesn't need to do it itself.

Remove the redundant pci_enable_pcie_error_reporting() call from the
driver. Also remove the corresponding pci_disable_pcie_error_reporting()
from the driver .remove() path.

Note that this only controls ERR_* Messages from the device. An ERR_*
Message may cause the Root Port to generate an interrupt, depending on the
AER Root Error Command register managed by the AER service driver.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20230307182842.870378-11-helgaas@kernel.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Manish Rangankar <mrangankar@marvell.com>
Cc: GR-QLogic-Storage-Upstream@marvell.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# db22de3e 18-Feb-2022 Bart Van Assche <bvanassche@acm.org>

scsi: iscsi: Stop using the SCSI pointer

Instead of storing the iSCSI task pointer and the session age in the SCSI
pointer, use command-private variables. This patch prepares for removal of
the SCSI pointer from struct scsi_cmnd.

The list of iSCSI drivers has been obtained as follows:
$ git grep -lw iscsi_host_alloc
drivers/infiniband/ulp/iser/iscsi_iser.c
drivers/scsi/be2iscsi/be_main.c
drivers/scsi/bnx2i/bnx2i_iscsi.c
drivers/scsi/cxgbi/libcxgbi.c
drivers/scsi/iscsi_tcp.c
drivers/scsi/libiscsi.c
drivers/scsi/qedi/qedi_main.c
drivers/scsi/qla4xxx/ql4_os.c
include/scsi/libiscsi.h

Note: it is not clear to me how the qla4xxx driver can work without this
patch since it uses the scsi_cmnd::SCp.ptr member for two different
purposes:
- The qla4xxx driver uses this member to store a struct srb pointer.
- libiscsi uses this member to store a struct iscsi_task pointer.

Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Chris Leech <cleech@redhat.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Manish Rangankar <mrangankar@marvell.com>
Cc: Karen Xie <kxie@chelsio.com>
Cc: Ketan Mukadam <ketan.mukadam@broadcom.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>

iscsi

Link: https://lore.kernel.org/r/20220218195117.25689-26-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 47c66248 13-Aug-2021 Kees Cook <keescook@chromium.org>

treewide: Replace 0-element memcpy() destinations with flexible arrays

The 0-element arrays that are used as memcpy() destinations are actually
flexible arrays. Adjust their structures accordingly so that memcpy()
can better reason able their destination size (i.e. they need to be seen
as "unknown" length rather than "zero").

In some cases, use of the DECLARE_FLEX_ARRAY() helper is needed when a
flexible array is alone in a struct.

Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Manish Rangankar <mrangankar@marvell.com>
Cc: GR-QLogic-Storage-Upstream@marvell.com
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Phillip Potter <phil@philpotter.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Fabio Aiuto <fabioaiuto83@gmail.com>
Cc: Ross Schmidt <ross.schm.dev@gmail.com>
Cc: Marco Cesati <marcocesati@gmail.com>
Cc: ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Cc: linux-staging@lists.linux.dev
Signed-off-by: Kees Cook <keescook@chromium.org>


# 014aced1 26-Nov-2020 Ahmed S. Darwish <a.darwish@linutronix.de>

scsi: qla4xxx: Remove in_interrupt() from qla4_82xx_rom_lock()

qla4_82xx_rom_lock() spins on a certain hardware state until it is
updated. At the end of each spin, if in_interrupt() is true, it does 20
loops of cpu_relax(). Otherwise, it yields the CPU.

While in_interrupt() is ill-defined and does not provide what the name
suggests, it is not needed here: qla4_82xx_rom_lock() is always called
from process context. Below is an analysis of its callers:

- ql4_nx.c: qla4_82xx_rom_fast_read(), all process context callers:
=> ql4_nx.c: qla4_82xx_pinit_from_rom(), GFP_KERNEL allocation
=> ql4_nx.c: qla4_82xx_load_from_flash(), msleep() in a loop

- ql4_nx.c: qla4_82xx_pinit_from_rom(), earlier discussed

- ql4_nx.c: qla4_82xx_rom_lock_recovery(), bound to "isp_operations"
->rom_lock_recovery() hook, which has one process context caller,
qla4_8xxx_device_bootstrap(), with callers:
=> ql4_83xx.c: qla4_83xx_need_reset_handler(), process, msleep()
=> ql4_nx.c: qla4_8xxx_device_state_handler(), multiple msleep()s

- ql4_nx.c: qla4_82xx_read_flash_data(), has cond_resched()

Remove the in_interrupt() check. Mark, qla4_82xx_rom_lock(), and the
->rom_lock_recovery() hook, with "Context: task, can sleep".

Change qla4_82xx_rom_lock() implementation to sleep 20ms, instead of a
schedule(), for each spin. This is more deterministic, and it matches
the other implementations bound to ->rom_lock_recovery().

Link: https://lore.kernel.org/r/20201126132952.2287996-9-bigeasy@linutronix.de
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Manish Rangankar <mrangankar@marvell.com>
Cc: <GR-QLogic-Storage-Upstream@marvell.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 3627668c 26-Nov-2020 Ahmed S. Darwish <a.darwish@linutronix.de>

scsi: qla4xxx: Remove in_interrupt() from qla4_82xx_idc_lock()

qla4_82xx_idc_lock() spins on a certain hardware state until it is
updated. At the end of each spin, if in_interrupt() is true, it does 20
loops of cpu_relax(). Otherwise, it yields the CPU.

While in_interrupt() is ill-defined and does not provide what the name
suggests, it is not needed here: qla4_82xx_idc_lock() is always called from
process context. Below is an analysis of its callers:

- ql4_nx.c: qla4_82xx_need_reset_handler(), 1-second msleep() in a
loop.

- ql4_nx.c: qla4_82xx_isp_reset(), calls
qla4_8xxx_device_state_handler(), which has multiple msleep()s.

Beside direct calls, qla4_82xx_idc_lock() is also bound to isp_operations
->idc_lock() hook. Other functions which are bound to the same hook,
e.g. qla4_83xx_drv_lock(), also have an msleep(). For completeness, below
is an analysis of all callers of that hook:

- ql4_83xx.c: qla4_83xx_need_reset_handler(), has an msleep()

- ql4_83xx.c: qla4_83xx_isp_reset(), calls
qla4_8xxx_device_state_handler(), which has multiple msleep()s.

- ql4_83xx.c: qla4_83xx_disable_pause(), all process context callers:
=> ql4_mbx.c: qla4xxx_mailbox_command(), msleep(), mutex_lock()
=> ql4_os.c: qla4xxx_recover_adapter(), schedule_timeout() in loop
=> ql4_os.c: qla4xxx_do_dpc(), workqueue context

- ql4_attr.c: qla4_8xxx_sysfs_write_fw_dump(), sysfs bin_attribute
->write() hook, process context

- ql4_mbx.c: qla4xxx_mailbox_command(), earlier discussed

- ql4_nx.c: qla4_8xxx_device_bootstrap(), callers:
=> ql4_83xx.c: qla4_83xx_need_reset_handler(), process, msleep()
=> ql4_nx.c: qla4_8xxx_device_state_handler(), earlier discussed

- ql4_nx.c: qla4_8xxx_need_qsnt_handler(), callers:
=> ql4_nx.c: qla4_8xxx_device_state_handler(), multiple msleep()s
=> ql4_os.c: qla4xxx_do_dpc(), workqueue context

- ql4_nx.c: qla4_8xxx_update_idc_reg(), callers:
=> ql4_nx.c: qla4_8xxx_device_state_handler(), earlier discussed
=> ql4_os.c: qla4_8xxx_error_recovery(), only called by
qla4xxx_pci_slot_reset(), which is bound to PCI ->slot_reset()
process-context hook

- ql4_nx.c: qla4_8xxx_device_state_handler(), earlier discussed

- ql4_os.c: qla4xxx_recover_adapter(), earlier discussed

- ql4_os.c: qla4xxx_do_dpc(), earlier discussed

Remove the in_interrupt() check. Mark, qla4_82xx_idc_lock(), and the
->idc_lock() hook itself, with "Context: task, can sleep".

Change qla4_82xx_idc_lock() implementation to sleep 100ms, instead of a
schedule(), for each spin. This is more deterministic, and it matches other
PCI HW locking functions in the driver.

Link: https://lore.kernel.org/r/20201126132952.2287996-8-bigeasy@linutronix.de
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Manish Rangankar <mrangankar@marvell.com>
Cc: <GR-QLogic-Storage-Upstream@marvell.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# e3976af5 08-Sep-2020 Thomas Gleixner <tglx@linutronix.de>

scsi/qla4xxx: Convert to SPDX license identifiers

All files in this driver directory contain the following notice:

See LICENSE.qla4xxx for copyright and licensing details.

LICENSE.qla4xxx can be found in Documentation/scsi/. The file contains:

- A copyright notice

This copyright notice is redundant as all files contain the same
copyright notice already

- A license notice

You may modify and redistribute the device driver code under the
GNU General Public License (a copy of which is attached hereto as
Exhibit A) published by the Free Software Foundation (version 2).

- The full GPLv2 license text

This can be replaced with the corresponding SPDX license identifier
(GPL-2.0-only) in the source files which reference this license
file.

- The full GPLv2 license text

A redundant copy of LICENSES/preferred/GPL-2.0

Remove the notices and add the SPDX license identifier GPL-2.0-only to the
source files.

Finally remove the now redundant LICENSE.qla4xxx file.

Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Acked-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1bc5ad3a 11-Feb-2018 Manish Rangankar <manish.rangankar@cavium.com>

scsi: qla4xxx: skip error recovery in case of register disconnect.

A system crashes when continuously removing/re-adding the storage
controller.

Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 2c0f83f3 11-Jan-2017 Christoph Hellwig <hch@lst.de>

scsi: qla4xxx: remove two unused MSI-X related #defines

Spotted while preparing qla2xxx changes as the symbols exist in both
drivers (sigh..).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# f5b893c9 06-Dec-2016 Christoph Hellwig <hch@lst.de>

scsi: qla4xxx: switch to pci_alloc_irq_vectors

And simplify the MSI-X logic in general - just request the two vectors
directly instead of going through an indirection table.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilesh Javali <nilesh.javali@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# c6bfda8d 26-May-2015 Eric Dumazet <edumzet@google.com>

qla4xxx: add a missing include

vmalloc.h used to be included from include/net/inet_hashtables.h
but it is no longer the case.

Fixes: 095dc8e0c368 ("tcp: fix/cleanup inet_ehash_locks_alloc()")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Eric Dumazet <edumzet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 906cbf3d 09-Apr-2014 Nilesh Javali <nilesh.javali@qlogic.com>

qla4xxx: Export sysfs DDBs from DPC handler

Issue:
modprobe qla4xxx is killed by systemd due to timeout.

Solution:
The exporting of sysfs DDBs from qla4xxx_probe_adapter added delay of
approximately 15s due to which system-udevd killed the modprobe of the
driver. Added fix to export the sysfs DDBs from the DPC handler.

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: Christoph Hellwig <hch@lst.de>


# 58e2bbe9 16-Dec-2013 Tej Parkash <tej.parkash@qlogic.com>

[SCSI] qla4xxx: Driver not able to collect minidump for ISP84xx

Issue:
minidump data collection fails as driver reports data mismatch

Fix:
When the driver encounters a new entry type that it cannot process,
it should just skip the entry and adjust the total buffer size by
subtracting the skipped bytes from it. This is to ensure that there
is no data mismatch because of the new entries.

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>


# 61d9a2b6 16-Dec-2013 Tej Parkash <tej.parkash@qlogic.com>

[SCSI] qla4xxx: Fix pending IO completion in reset path before initiating chip reset

Issue:
Pending IO wait does not complete after triggering Graceful reset,
causing ack timeout and call traces.

Fix:
1. Reducing the IO command wait timeout before triggering reset,
as logically also timeout should be less than reset timeout (10sec).
2. Moving the abort IO after chip reset, because only after
chip reset, driver owns the IO otherwise it is with firmware and can
still revert back with response.

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>


# de2efea6 16-Dec-2013 Nilesh Javali <nilesh.javali@qlogic.com>

[SCSI] qla4xxx: Clear DDB index map upon connection close failure

Issue:
qla4xxx Unable to clear DDB indices when logout fails due to
failure of connection close mbox command.

Root cause:
If login to session fail, iscsiadm make call to destroy_session.
qla4xxx driver does not free ddb index map before free_ddb()

Fix:
Clear DDB Index map before free_ddb in "destroy_session"
in case of connection close mailbox command failure with 4005h.

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>


# daa34eb4 16-Dec-2013 Tej Parkash <tej.parkash@qlogic.com>

[SCSI] qla4xxx: Fixed AER reset sequence for ISP83xx/ISP84xx

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>


# 80645dc0 16-Dec-2013 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Use IDC_CTRL bit1 directly instead of AF_83XX_NO_FWDUMP flag.

Removed AF_83XX_NO_FWDUMP flag and directly checking IDC_CTRL bit1
while taking minidump, to check for graceful 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>


# c4e3c368 16-Dec-2013 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Fix comments in code

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>


# df86f771 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>


# f8e93412 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>


# ad8bd45e 17-Sep-2013 Manish Rangankar <manish.rangankar@qlogic.com>

[SCSI] qla4xxx: correctly update session discovery_parent_idx.

Earlier logic for driver created iscsi_session->discovery_parent_idx
was to store ram index of a sendtarget entry, but driver frees
sendtarget ram index as soon as firmware is done with discovery,
which is available for further use. So changing the logic to point
iscsi_session->discovery_parent_idx to store sendtarget flashnode index.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 4a4f51e9 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>


# 7ab284c9 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>


# b37ca418 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>


# eee06a0f 08-Jul-2013 Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>

[SCSI] qla4xxx: Export more firmware info in sysfs

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>


# 99c6a33b 08-Jul-2013 Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>

[SCSI] qla4xxx: Allow removal of failed session using logout.

If logout is performed on a failed session entry then that session
should be gracefully removed.

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>


# c962c18b 25-Mar-2013 Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>

[SCSI] qla4xxx: Replace dev type macros with generic portal type macros

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>


# 1e9e2be3 22-Mar-2013 Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>

[SCSI] qla4xxx: Add flash node mgmt support

This patch allows iscsiadm to manage iSCSI target information stored on
qla4xxx adapter flash on per host basis.

Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 1dc8ed5d 20-Jan-2013 Manish Rangankar <manish.rangankar@qlogic.com>

[SCSI] qla4xxx: wait for boot target login response during probe.

Boot from SAN fails in some cases where boot target login response
is slow. In this case, probe finishes early and triggers init, which
doesn't find remote disk to mount root which leads to BFS failure.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 5b1c1bff 20-Jan-2013 Karen Higgins <karen.higgins@qlogic.com>

[SCSI] qla4xxx: Throttle active IOCBs to firmware limits

Problem:
QLA4xxx firmware may assert if given more IOCBs than it can handle.

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

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 026fbd3a 20-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>


# 5c19b92a 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>


# 320a61de 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>


# c68cdbf0 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>


# 6e7b4292 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>


# 33693c7a 22-Aug-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Added new functions in isp_ops

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>


# de8c72da 22-Aug-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Rename 82XX macros

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>


# 7664a1fd 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>


# d46bdeb1 07-Aug-2012 Manish Rangankar <manish.rangankar@qlogic.com>

[SCSI] qla4xxx: Fix memory corruption issue in qla4xxx_ep_connect.

In qla4xxx_ep_connect(), qla_ep->dst_addr and dst_addr are type
struct sockaddr. We are copying sizeof(struct sockaddr_in6) bytes
from dst_addr to qla_ep->dst_addr which is 12 bytes larger. This
will cause memory corruption. So we change qla_ep->dst_addr to
struct sockaddr_storage which is of 128 byte, large enough to
hold sizeof(struct sockaddr_in6).

Signed-off-by: Manish Rangankar <manish.rangankar@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>


# 1cb78d73 14-Jun-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: multi-session fix for flash ddbs

Allow multi-session to target (for flash ddbs) accesible via
multiple network portal

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 068237c8 18-May-2012 Tej Parkash <tej.parkash@qlogic.com>

[SCSI] qla4xxx: Capture minidump for ISP82XX on firmware failure

Added support to capture dump (Minidump) which allows us to
catpure a snapshot of the firmware/hardware states at the time
of firmware failure

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>


# 173269ef 27-Feb-2012 Manish Rangankar <manish.rangankar@qlogic.com>

[SCSI] qla4xxx: Add support for multiple session per host.

This patch will allow iscsiadm to create multiple session
for the same target on per host.

Signed-off-by: Manish Rangankar <manish.rangankar@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>


# 376738af 27-Feb-2012 Nilesh Javali <nilesh.javali@qlogic.com>

[SCSI] qla4xxx: Add support to display CHAP list and delete CHAP entry

For offload iSCSI like qla4xxx CHAP entries are stored in FLASH.
This patch adds support to list CHAP entries stored in FLASH and
delete specified CHAP entry from FLASH using iscsi tools.

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>


# c0b9d3f7 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>


# ff884430 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>


# 46801ba6 13-Feb-2012 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Proper detection of firmware abort error code for ISP82xx

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>


# 527c8b2e 11-Jan-2012 Nilesh Javali <nilesh.javali@qlogic.com>

[SCSI] qla4xxx: Added error logging for firmware abort

Added debug print with error code in case of firmware error.

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>


# 4f77083e 11-Jan-2012 Mike Hernandez <michael.hernandez@qlogic.com>

[SCSI] qla4xxx: Temperature monitoring for ISP82XX core.

During watchdog, need to monitor temperature of ISP82XX core
and set device state to FAILED when temperature reaches
"Panic" level.

Signed-off-by: Mike Hernandez <michael.hernandez@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>


# 9ee91a38 01-Dec-2011 Shyam Sunder <shyam.sunder@qlogic.com>

[SCSI] qla4xxx: check for FW alive before calling chip_reset

Check for firmware alive and do premature completion of
mbox commands in case of FW hung before doing chip_reset

Signed-off-by: Shyam Sunder <shyam.sunder@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
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>


# 13483730 01-Dec-2011 Mike Christie <michaelc@cs.wisc.edu>

[SCSI] qla4xxx: fix flash/ddb support

With open-iscsi support, target entries persisted in the FLASH were not
login. Added support in the qla4xxx driver to do the login on probe
time to the target entries saved in the FLASH by user.
With this changes upgrade to the new kernel with open-iscsi support in
qla4xxx will ensure users original target entries login on driver load

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 69ca216e 07-Oct-2011 Manish Rangankar <manish.rangankar@qlogic.com>

[SCSI] qla4xxx: Fixed target discovery failed issue.

When sendtargets response is greater then max receive data segment length,
the passthrough IOCB failed with data overrun status. Solution is to
allocate space for iSCSI header in the IOCB response buffer.

JIRA Key: UPSISCSI-147

Signed-off-by: Manish Rangankar <manish.rangankar@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>


# 4549415a 07-Oct-2011 Lalit Chandivade <lalit.chandivade@qlogic.com>

[SCSI] qla4xxx: Do not add duplicate CHAP entry in FLASH

QLogic applications store the CHAP information in FLASH. During login,
authentication information is provided using an index into the CHAP region.

In order to support QLogic applications along with iscsiadm, updated the
LLD to not add duplicate CHAP entries in the CHAP region and preserve the
existing CHAP info in the CHAP region in FLASH.
This allows QLogic applications to pre-write the CHAP entries in the
CHAP region.

With iscsiadm, when the CHAP authentication information is sent to the LLD, the
LLD searches for the entry in CHAP region in FLASH, if exists then do not add.
If CHAP entry does not exist then add the CHAP entry in the CHAP region.

JIRA Key: UPSISCSI-146

Signed-off-by: Lalit Chandivade <lalit.chandivade@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>


# 0854f665 07-Oct-2011 Lalit Chandivade <lalit.chandivade@qlogic.com>

[SCSI] qla4xxx: Fix bidirectional CHAP.

Driver was not setting the bidirectional CHAP bit correctly in
the DDB entry.

JIRA Key: UPSISCSI-108

Signed-off-by: Lalit Chandivade <lalit.chandivade@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>


# 95d31262 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>


# 2ada7fc5 01-Aug-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: added support to update initiator iscsi port

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>


# 91ec7cec 01-Aug-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Added vendor specific sysfs attributes

Added board_id, fw_state, phy_port_cnt, phy_port_num,
iscsi_func_cnt, hba_model

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>


# ef7830bb 01-Aug-2011 Harish Zunjarrao <harish.zunjarrao@qlogic.com>

[SCSI] qla4xxx: Code cleanup for read/update flash using BSG

- Corrected return status
- Added reset active check
- Removed unused dma_map_sg calls
- Added debug prints on failure

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>


# 943c157b 01-Aug-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Added support to update mtu

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>


# 2a991c21 25-Jul-2011 Manish Rangankar <manish.rangankar@qlogic.com>

[SCSI] qla4xxx: Boot from SAN support for open-iscsi

Hook qla4xxx in fw boot sysfs interface so iscsi tools
can use the info to create boot sessions.

Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 0e7e8501 25-Jul-2011 Manish Rangankar <manish.rangankar@qlogic.com>

[SCSI] qla4xxx: Remove reduandant code after open-iscsi integration.

1. Remove device database entry (ddb) state.
2. Remove device database (DDB) list building.
With open-iscsi integration the logins to the target devices are
handled by the user space. So the information of target is now
maintained in the iscsi_session object. This is handled at
libiscsi level so there is no need to maintain a list of DDBs in
the qla4xxx LLD.
3. qla4xxx: Remove add_device_dynamically.
Since autologin in FW is disabled with open-iscsi integration,
driver will never get an AEN for which driver has not requested
a DDB index. So remove the add_device_dynamically function.
4. Remove qla4xxx_tgt_dscvr
Since firmware autologin is disabled this function will not work.
Now user has the ability to do the target discovery and login to
each target individually. Firwmare will not do the login on its own.
5. Remove relogin related code
All relogin is handled by userspace now. qla4xxx just need to
notify userspace of a connection failure, this triggers the
relogin.
6. Remove add_session and alloc_session
Now qla4xxx uses iscsi_session_setup that would do the necessary
allocations for session and ddb_entry.

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>


# b3a271a9 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>


# a355943c 25-Jul-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: add bsg support

This patch adds bsg support to qla4xxx.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# ed1086e0 25-Jul-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: added support to show multiple iface in sysfs

Add support for default ipv4 and ipv6 ifaces in qla4xxx.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Reviewed-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
[make iface creation dynamic]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 2bab08fc 25-Jul-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Added new "struct ipaddress_config"

- Move all ipaddress related param to "struct ipaddress_config"
from "struct scsi_qla_host"
- update function - qla4xxx_update_local_ip()
- Rename IPOPT_IPv4_PROTOCOL_ENABLE to IPOPT_IPV4_PROTOCOL_ENABLE

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
[update for new ISCSI_IFACE values]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 7ad633c0 18-May-2011 Harish Zunjarrao <harish.zunjarrao@qlogic.com>

[SCSI] qla4xxx: Added vendor specific sysfs attributes

Added fw_version, serial_num, iscsi version and boot loader version
sysfs attributes.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@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>


# 1b46807e 18-May-2011 Lalit Chandivade <lalit.chandivade@qlogic.com>

[SCSI] qla4xxx: Remove AF_DPC_SCHEDULED flag from ha.

Since queue_work does not requeue, there is no need to check
if a work is in progress using the AF_DPC_SCHEDULED flag.
queue_work would return if work is pending without adding the
work, do_dpc would again get invoked from qla4xxx_timer if
there is still DPC flags set.

Signed-off-by: Lalit Chandivade <lalit.chandivade@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>


# 185f107e 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>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# 7eece5a0 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>


# 58da51dc 21-Mar-2011 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: remove unused ddb flag DF_NO_RELOGIN

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>


# 7edd9a7b 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>


# 7d01d069 02-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>


# 6790d4fe 02-Dec-2010 Karen Higgins <karen.higgins@qlogic.com>

[SCSI] qla4xxx: use correct fw_ddb_index in abort task

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>


# 7b3595df 06-Oct-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: update AER support for ISP82XX

* Cleanup qla4xxx_pci_mmio_enabled():
don't want to return PCI_ERS_NEED_RESET if firmware hung.
IDC will take care of it.
* Request irq after initialize_adapter() in qla82xx_error_recovery().
* Return all active commands from qla4xxx_pci_error_detected().
* Cleanup ql4_def.h

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>


# f581a3f7 06-Oct-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Trivial cleanup

* cleanup function qla4xxx_recovery_timeout
- No need to wakeup dpc thread from function
qla4xxx_recovery_timeout() as we are not doing anything
in do_dpc() thread when wakeup from
qla4xxx_recovery_timeout()

* cleanup function qla4xxx_wait_for_hba_online
- Remove hard coded value from qla4xxx_wait_for_hba_online().

* cleanup function qla4xxx_start_firmware_from_flash
- display seconds

* cleanup function qla4_8xxx_load_risc
- Remove redundant code.

* cleanup function qla4xxx_get_firmware_status
- update debug statement

* cleanup function qla4_8xxx_try_start_fw
- update return status

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>


# 2232be0d 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>


# 21033639 30-Jul-2010 Nilesh Javali <nilesh.javali@qlogic.com>

[SCSI] qla4xxx: Handle outstanding mbx cmds on hung f/w scenarios

Outstanding mailbox commands, have no way to recover on f/w hung, and we
timeout on waiting for mbx response. This in turn affects the recovery process
as follows:
- We might already be in dpc while waiting for mbx to complete, so recovery for
that pci function will never get invoked. Reset Timeout (10 sec) is far less
than mbx timeout (30 sec).
- Other mbx cmds will get stuck due to serial mbx access.

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

Signed-off-by: Nilesh Javali <nilesh.javali@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>


# 3013cea8 30-Jul-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: set correct value in sess->recovery_tmo

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>


# f4f5df23 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>


# dbaf82ec 10-Jul-2010 Ravi Anand <ravi.anand@qlogic.com>

[SCSI] qla4xxx: Handle one H/W Interrupt at a time

Handle one H/W Interrupt at a time to prevent holding off H/W lock
for longer period of time.

Signed-off-by: Ravi Anand <ravi.anand@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>


# 09a0f719 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>


# 5369887a 28-Apr-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: correct use of cmd->host_scribble

used cmd->host_scribble to store iocb command handle.

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>


# c2393cd2 28-Apr-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: Code Clean up - remove "marker_needed"

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>


# 065aa1b4 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>


# 2a49a78e 28-Apr-2010 Vikas Chaudhary <vikas.chaudhary@qlogic.com>

[SCSI] qla4xxx: added IPv6 support.

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>


# 16ed55f9 15-Jul-2009 Karen Higgins <karen.higgins@qlogic.com>

[SCSI] qla4xxx: Remove hiwat code so scsi eh does not get escalated when we can make progress

Removed unnecessary hiwat code to free up the number available IOCBs.
Eliminates unnecessary eh_ escalations due to inability to obtain IOCB
pkt for marker.

v2.
- Remove define not used anymore and fix req_q_coun accounting.

Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
[michaelc: ported patch from qlogic.com driver to upstream]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# 94bced3c 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>


# 41bbdbeb 15-Jan-2009 Mike Christie <michaelc@cs.wisc.edu>

[SCSI] qla4xxx: do not reuse session when connecting to different target port

qla4xxx does not check the I_T nexus values correctly
so it ends up creating one session to the target. If
a portal should disappear or they should be reported
in different order the driver will think it is already
logged in when it could now be speaking to a different
target portal or accessing it through a different
initiator port (iscsi initiator port is not tied to
hardware and is just the initiator name plus isid
so you could end up with multiple ports through one
host).

This patch has the driver check the iscsi scsi port
values when matching sessions (we do not check
the initiator name because that is static). It results
in a portal from each target portal group getting
logged into instead of just one per target. In the future
the firmware should hopefully send us notification of other
sessions that are created to other portals within the
same tpgt and the sessions should have different isids.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


# b1c11812 03-Feb-2008 Joe Perches <joe@perches.com>

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>


# 5c8bfc94 23-May-2007 David C Somayajulu <david.somayajulu@qlogic.com>

[SCSI] qla4xxx: ql4_def.h log all AENs and cleanup

Add support for logging all AENs and clean up

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>


# 477ffb9d 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>


# d915058f 15-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>


# afaf5a2d 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>