Commit graph

505844 commits

Author SHA1 Message Date
James Smart 6eae430328 lpfc: Fix internal loopback failure.
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:49:52 -07:00
James Smart be6bb94100 lpfc: Fix premature release of rpi bit in bitmask
Currently, the driver plays off the fact that older sli4 adapters have a
different rpi access pattern that allowed for the rpi reference to be
released earlier in the teardown sequence, allowing the driver to recycle
the rpi value sooner. Newer sli4 adapters have a different access pattern that
requires us to wait for a later mailbox completion. This changes the put
call location on the newer sli4 adapters.

Symptoms of the error are "0110 ELS" and the "0372 iotag" errors.

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:49:39 -07:00
James Smart 34154e05bc lpfc: Initiator sends wrong BBCredit value for either FLOGI or FLOGI_ACC
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:49:23 -07:00
James Smart 63e480fd2f lpfc: Fix null ndlp dereference in target_reset_handler
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:49:10 -07:00
James Smart 76b2c34aeb lpfc: Fix FDMI Fabric support in driver for Brocade
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:48:57 -07:00
James Smart f0bf5f9190 lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:48:45 -07:00
James Smart 26d830ec7f lpfc: Parse the new 20G, 25G and 40G link speeds in the lpfc driver
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:48:08 -07:00
James Smart a0683bf67a lpfc: Add support for reporting option_rom_version on newer adapters
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:47:39 -07:00
James Smart 2c9c5a0010 lpfc: Fix setting of EQ (interrupt) delay Multiplier
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:47:27 -07:00
James Smart ea4142f6b1 lpfc: Fix host reset escalation killing all IOs.
Fix host reset escalation killing all IOs.

SLI-3 adapters will use a new host template. The template differs
from SLI-4 adapters in that it does not have an eh_host_reset_handler.

Lpfc has traditionally never had a host_reset. The host reset
handler was added when we ran into a stuck hardware condition on a
SLI-4 adapter. The host_reset will reset and reinit the pci function,
clearing the hardware condition.

Unfortunately, the host reset handler uses attach/detach code paths,
which makes scsi_add_host() and scsi_remove_host() calls. Meaning, a
host_reset will completely remove the scsi_host from the system. As a
new call to scsi_add_host() is made, the shost# changes, which results
in completely new scsi_devices and device names. All the older scsi
devices on the old shost# are now orphaned and unrecoverable.

We realize we need to re-implement the host_reset_handler so the scsi_host
stays registered across the host_reset, but that will be a rather
lengthy effort. In the short term, we had an immediate need to restore
the SLI-3 devices to their working behavior, with the easiest path being
to remove their host_reset handler.

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:46:35 -07:00
James Smart 85c0f17720 lpfc: Linux lpfc driver doesn't re-establish the link after a cable pull on LPe12002
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:46:08 -07:00
James Smart ed4afe7405 lpfc: Fix to handle PLOGI when already logged in
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:45:54 -07:00
James Smart c637797020 lpfc: Add new mbx cmd recognition
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:45:36 -07:00
James Smart 946727dc07 lpfc: Add Lancer Temperature Event support to the lpfc driver
This will detect and send an async event if overtemp is detected

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:45:03 -07:00
James Smart 77d093fb00 lpfc: Fix the iteration count to match the 30 sec comment in the routine lpfc_pci_function_reset
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:44:33 -07:00
James Smart c749e6bca5 scsi_transport_fc: Add support for 25Gbit speed
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-10 07:40:32 -07:00
Ondrej Zary eef77801b5 aha1542: remove loop from aha1542_outb
The loop in aha1542_outb with double-check is no longer needed, remove it.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:09:35 -07:00
Ondrej Zary 7061dec40c aha1542: Fix bus reset
Bus reset always fails because aha1542_reset waits for the controller to assert
the INIT bit (Mailbox Initialization Required) which it never does. This bit is
asserted only after host reset.

Remove the requirement for INIT bit (we really need only the IDLE bit).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:09:30 -07:00
Ondrej Zary 1b0224b0ec aha1542: rework locking
Remove aha1542_lock and use host_lock instead.
Remove interrupt and queuecommand function wrappers.
Remove locking from lowlevel _out and _in functions, they now can
onle be called (at runtime) with host_lock being held.
Remove ssleep(4) in aha1542_reset as we can't sleep while holding a spinlock.
It's useless anyway as wait_mask will wait until the controller is idle and
kernel waits for 10 seconds (HOST_RESET_SETTLE_TIME) after that.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:09:24 -07:00
Ondrej Zary 764a0c7e84 aha1542: Don't reduce functionality with DEBUG enabled
Enabling DEBUG disables write commands and devices with ID > 1.
Remove this "feature" to allow real debugging.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:09:18 -07:00
Ondrej Zary 6ddc8cf40a aha1542: Use print_hex_dump_bytes in debug code
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:09:13 -07:00
Ondrej Zary fde1fb8a4a aha1542: remove DEB macro and simplify debug code
Remove DEB macro and join ifdef DEBUG blocks

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:09:08 -07:00
Ondrej Zary 2906b3ceb1 aha1542: Use shost_printk instead of printk
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:09:01 -07:00
Ondrej Zary 37d607bd79 aha1542: Change aha1542_set_bus_times parameters
Pass struct Scsi_Host *sh and dma parameters instead of index to
aha1542_set_bus_times.
This is required for printk conversion.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:56 -07:00
Ondrej Zary 68ea9de3a6 aha1542: Pass struct Scsi_Host * to functions
Pass struct Scsi_Host * to functions instead of base address.
This reduces the number of parameters and is also required for printk
conversion.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:49 -07:00
Ondrej Zary 954a9fd79b aha1542: cleanup includes
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:44 -07:00
Ondrej Zary 1d084d200d aha1542: remove useless changelog
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:39 -07:00
Ondrej Zary e51dacbf4e aha1542: fix include guard and remove useless changelog
Fix include guard in header file and remove useless changelog

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:31 -07:00
Ondrej Zary c2532f6826 aha1542: Always name Scsi_Host variables sh
Make Scsi_Host variable names consistent - use sh everywhere.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:26 -07:00
Ondrej Zary 55b28f9fc0 aha1524: Use struct scsi_cmnd
Use struct scsi_cmnd instead of Scsi_Cmnd and also rename the variables
to get rid of SC prefix

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:21 -07:00
Ondrej Zary cad2fc72cf aha1542: clean up cmd variables
Make sure that there's no variable named cmd

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:16 -07:00
Ondrej Zary 17787a09fd aha1542: Simplify aha1542_biosparam
Simplify aha1542_biosparam, use sector_div, remove unused BIOS_TRANSLATION_1632.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:10 -07:00
Ondrej Zary f71429ab53 aha1542: rework configuration parameters
Remove __setup and introduce separate io, bus_on, bus_off and dma_speed
module parameters.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:05 -07:00
Ondrej Zary 3a70c006ed aha1542: rework hw_init
Cleanup hw_init, use goto for error handling.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:08:00 -07:00
Ondrej Zary 23e6940a9e aha1542: Call wait_mask from aha1542_out
aha1542_out call is always followed by wait_mask.
Move the call into aha1542_out to simplify code.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:54 -07:00
Ondrej Zary b847fd0d85 aha1542: split out code from aha1542_hw_init
Split out bus times related block of aha1542_hw_init into separate function
aha1542_set_bus_times.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:48 -07:00
Ondrej Zary 8537cba8b6 aha1542: Merge aha1542_host_reset and aha1542_bus_reset
aha1542_host_reset and aha1542_bus_reset are almost same, merge them
into aha1542_reset

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:42 -07:00
Ondrej Zary dfd7c991f3 aha1542: Remove aha1542_restart
aha1542_restart does nothing (except useless printk), remove it

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:37 -07:00
Ondrej Zary bdebe2241e aha1542: remove useless code from aha1542_test_port
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:32 -07:00
Ondrej Zary a13b3722a3 aha1542: Remove unneeded gotos
Remove gotos that are no longer needed.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:26 -07:00
Ondrej Zary 0c2b648191 aha1542: Split aha1542_out
aha1542_out are in fact two separate functions.
Split them into aha1542_out and aha1542_outb to simplify the code.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:20 -07:00
Ondrej Zary f8846be334 aha1542: Unify aha1542_in and aha1542_in1
Unify aha1542_in and aha1542_in1 functions, they differ only in timeout
and printk.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:13 -07:00
Ondrej Zary 2093bfa136 aha1542: Remove WAIT and WAITd macros
Convert the ugly WAIT and WAITd macros into wait_mask function.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:07:05 -07:00
Ondrej Zary 6d9ffe6a01 aha1542: Use BIT() macro
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:06:58 -07:00
Ondrej Zary f232d53801 aha1542: remove empty aha1542_stat
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:06:53 -07:00
Ondrej Zary 09a4483388 aha1542: Reorder functions to remove forward declarations
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:06:47 -07:00
Ondrej Zary cb5b570ce3 aha1542: Use u8 instead of unchar
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:06:40 -07:00
Ondrej Zary f1bbef6344 aha1542: Convert aha1542_intr_reset to function
Convert aha1542_intr_reset macro to inline function

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:06:32 -07:00
Ondrej Zary e98878f737 aha1542: Remove HOSTDATA macro
Remove HOSTDATA macro and use shost_priv instead

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:06:22 -07:00
Ondrej Zary 10be62506f aha1542: Remove SCSI_BUF_PA, SCSI_SG_PA, AHA1542_SCATTER and AHA1542_CMDLUN
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-04-09 18:03:33 -07:00