Commit Graph

136 Commits (4e231fa4cbd3ff53fcb7d76eccd6fd86a152a95f)

Author SHA1 Message Date
James Smart d11e31ddb9 [SCSI] lpfc 8.3.3 : Fix a couple of spin_lock and memory issues and a crash
Contains the following changes:
- Fixed error paths retaking a spin lock which they already hold
- Added code to free memory in a couple of error paths
- Added code to free RPI bit map while unloading driver
- Added code to write zero to memory object allocated through dma_alloc_coherent
- Fixed crash/hang with target or LUN resets

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-15 10:09:33 -05:00
James Smart f112668880 [SCSI] lpfc 8.3.3 : Fix various SLI-3 vs SLI-4 differences
Contains the following changes
- Set the CT field of FDISC to 3
- Fixed over allocation of SCSI buffers on SLI4
- Removed unused jump table entries
- Increase LPFC_WQE_DEF_COUNT to 256
- Updated FDISC context to VPI
- Fixed immediate SCSI command for LUN reset translation to WQE
- Extended mailbox handling to allow MBX_POLL commands in between async
  MBQ commands
- Fixed SID used for FDISC
- Fix crash when accessing ctlregs from sysfs for SLI4 HBAs
- Fix SLI4 firmware version not being saved or displayed correctly
- Expand CQID field in WQE structure to 16 bits
- Fix post header template mailbox command timing out
- Removed FCoE PCI device ID 0x0705

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-15 10:09:32 -05:00
James Smart 21e9a0a5fb [SCSI] lpfc 8.3.2 : Persistent Vport Support
Add support for persistent vport definitions at creation at boot time

Also includes a few misc fixes for:
- conversion to vpi name from vport slang name
- couple of small mailbox references
- some additional discovery mods

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 11:26:19 -05:00
James Smart f4b4c68f74 [SCSI] lpfc 8.3.2 : Miscellaneous Changes
Miscellaneous Changes:
- Convert from SLI2_ACTIVE flag to more correct SLI_ACTIVE (generic) flag
- Reposition log verbose messaging definitions
- Update naming for vpi object name from vport slang name
- Handle deferred error attention condition
- Add 10G link support
- Small bug fixup

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 11:26:01 -05:00
James Smart d8e93df13c [SCSI] lpfc 8.3.2 : Update of copyrights
Update of copyrights on modified files

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 11:25:43 -05:00
James Smart 04c6849684 [SCSI] lpfc 8.3.2 : Addition of SLI4 Interface - Mailbox handling
The mailbox commands themselves are the same, or very similar to
their SLI3 counterparts. This patch genericizes mailbox command
handling and adds support for the new SLI4 mailbox queue.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 11:24:50 -05:00
James Smart da0436e915 [SCSI] lpfc 8.3.2 : Addition of SLI4 Interface - Base Support
Adds new hardware and interface definitions.

Adds new interface routines - utilizing the reorganized layout of the
driver. Adds SLI-4 specific functions for attachment, initialization,
teardown, etc.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 11:21:29 -05:00
James Smart 3772a99175 [SCSI] lpfc 8.3.2 : Reorganization for SLI4
Preps the organization of the driver so that the bottom half, which
interacts with the hardware, can share common code sequences for
attachment, detachment, initialization, teardown, etc with new hardware.

For very common code sections, which become specific to the interface
type, the driver uses an indirect function call. The function is set at
initialization. For less common sections, such as initialization, the
driver looks at the interface type and calls the routines relative to
the interface.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-06-08 11:18:10 -05:00
James Smart a257bf905e [SCSI] lpfc 8.3.1: misc fixes/changes
8.3.1 Fixes/Changes :

- Fix incorrect byte-swapping on word 4 of IOCB (data length) which
  caused LUNs to not be discovered on big-endian (e.g. PPC)

- Remove a bad cast of MBslimaddr which loses the __iomem (sparse)

- Make lpfc_debugfs_mask_disc_trc static (sparse)

- Correct misspelled word BlockGuard in lpfc_logmsg.h comment

- Replaced repeated code segment for canceling IOCBs from a list with
  a function call, lpfc_sli_cancel_iocbs().

- Increased HBQ buffers to support 40KB SSC sequences.

- Added sysfs interface to update speed and topology parameter without
  link bounce.

- Fixed bug with sysfs fc_host WWNs not being updated after changing
  the WWNs.

- Check if the active mailbox is NULL in the beginning of the mailbox
  timeout handler - fixes panic in the mailbox timeout handler while
  running IO stress test

- Fixed system panic in lpfc_pci_remove_one() due to ndlp indirect
  reference to phba through vport

- Removed de-reference of scsi device after call to scsi_done() to fix
  panic in scsi completion path while accessing scsi device after
  scsi_done is called.

- Fixed "Nodelist not empty" message when unloading the driver after
  target reboot test

- Added LP2105 HBA model description

- Added code to print all 16 words of unrecognized ASYNC events

- Fixed memory leak in vport create + delete loop

- Added support for handling dual error bit from HBA

- Fixed a driver NULL pointer dereference in lpfc_sli_process_sol_iocb

- Fixed a discovery bug with FC switch reboot in lpfc_setup_disc_node

- Take NULL termintator into account when calculating available buffer space

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-27 09:42:47 -05:00
James Smart 3621a710a7 [SCSI] lpfc 8.3.1 : Fix up kernel-doc function comments
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-04-27 09:41:51 -05:00
Yang Hongyang 284901a90a dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)
Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)

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

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07 08:31:10 -07:00
Julia Lawall 372bd28290 [SCSI] lpfc: Move a dereference below a NULL test
In each case, if the NULL test is necessary, then the dereference should be
moved below the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: James Smart <James.Smart@Emulex.Com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2009-01-02 10:59:38 -06:00
James Smart 81301a9b05 [SCSI] lpfc 8.3.0 : Add BlockGuard support (T10-DIF) structs and defs
Update struct definitions, #defines, sysfs entries, and initialization
to support BlockGuard.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-29 11:24:27 -06:00
James Smart 9f1e1b50ab [SCSI] lpfc 8.3.0 : Fix some memory handling issues
- Fix mailbox buffer leak on dump mailbox completion

- Fix mbuf leak in lpfc_pci_probe_one() SLI-2 mode error path

- Don't allocate HBQs in interrupt context

- Use correct size for FCP response buffer so that all available sense
  data is copied

- Fix jiffies calculation to prevent crash when collecting statistical
  data

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-29 11:24:27 -06:00
James Smart 5b75da2fa2 [SCSI] lpfc 8.3.0 : Add active interrupt test for enabling MSI/MSI-X/INTx
Per the recent discussions at the Linux Plumbers Conference, when
enabling MSI or MSI-X, generate a test interrupt to verify the
interrupt routing is working properly.  If the test interrupt fails,
fall back to MSI first, and if that fails as well, to INTx.  If the
interrupt test fails with INTx, log an error and fail the PCI probe.

Also changed the use of spin_(lock|unlock) to the _irq(save|restore)
variants in the interrupt handlers because with multi-message MSI-X,
both interrupt handlers can now run in parallel.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-29 11:24:27 -06:00
James Smart eaf15d5b56 [SCSI] lpfc 8.3.0 : Fix several minor issues
- Avoid polling HBA Error Attention when HBA's PCI channel is offline
  due to PCI EEH

- Fix handling of RSCN with non-zero event qualifiers

- Remove unnecessary sleeps during HBA initialization which slow down
  driver load

- Fix internal and external loopback on FCoE HBAs

- Fix incorrect decrement of cmd_pending count in lpfc_queuecomand
  error path

- Fix reporting of port busy events to management application

- Rename lpfc_adjust_queue_depth() to lpfc_rampdown_queue_depth() for
  consistency with its partner lpfc_rampup_queue_depth()

- Delete redundant lpfc_cmd->start_time = jiffies assignment in
  lpfc_queuecommand()

- Fix handling for ELS, mailbox and heartbeat time outs in the worker
  thread by removing unnecessary checking of the work_port_events
  flags.

- Fix NULL pointer dereference in lpfc_prep_els_iocb

- In lpfc_device_recov_npr_node(), move clearing of NLP_NPR_2B_DISC
  flag after call to lpfc_cancel_retry_delay_tmo() to keep
  targets-in-discovery count correct

- Remove lpfc_probe_one()'s call to scsi_scan_host() which could cause
  concurrent SCSI scans to step on each other

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-29 11:24:26 -06:00
James Smart 97207482fc [SCSI] lpfc 8.3.0 : Added 3 small features and improve PCI EEH support
- Added FC_REG_VPORTRSCN_EVENT to lpfc_nl.h

- Added code to provide option ROM version from HBA and via sysfs

- Added support for HPS bit in config port mailbox command to tell HBA
  that host group pointers are in host memory.

- Bugfix for Extended Error Handling (EEH) support on IBM PowerPC P6
  platform with MSI enabled

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-29 11:24:26 -06:00
James Smart eada272dfc [SCSI] lpfc 8.3.0 : Fix multiple NPIV issues
- Fix lock up on rmmod with vports defined by having
  lpfc_pci_remove_one() invoke fc_vport_terminate() to remove all the
  vports before invoking fc_remove_host() for the physical port

- Fix echotest failure when NPIV is enabled

- Add the vport_disable function to the physical port's transport
  template to make the vport disable attribute visible

- Set the vport state to DISABLE on create if the disable flag is
  true

- Call lpfc_alloc_sysfs_attr() for vports so that statistical data
  collection works on them

- Support setting a vport's symbolic name via sysfs by writing to
  /sys/class/fc_vport/vportX/symbolic_name

- Fix create vport fails when link is down or in loop mode.  Should be
  able to be create vports any time NPIV is enabled

- Fix slow vport deletes when deleting multiple vports at once

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-29 11:24:26 -06:00
James Smart 3a55b5327b [SCSI] lpfc 8.3.0 : Add support for Power Management Suspend/Resume operations
Implement lpfc_pci_suspend_one() and lpfc_pci_resume_one() and
register them in the pci_driver table.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-29 11:24:25 -06:00
James Smart ddcc50f0f3 [SCSI] lpfc 8.3.0 : Rework RSCN netlink event to send entire RSCN payload
Rework RSCN netlink event to send entire RSCN payload

Also replaces (SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_EMULEX) with
LPFC_NL_VENDOR_ID

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-12-29 11:24:24 -06:00
James Smart ea2151b4e1 [SCSI] lpfc 8.2.8 v2 : Add statistical reporting control and additional fc vendor events
Added support for new sysfs attributes: lpfc_stat_data_ctrl and
lpfc_max_scsicmpl_time. The attributes control statistical reporting
of io load.

Added support for new fc vendor events for error reporting.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:57 -04:00
James Smart 9399627f34 [SCSI] lpfc 8.2.8 : Add MSI-X support
Add support for MSI-X Multi-Message interrupts. We use different vectors
for fast-path interrupts (i/o) and slow-patch interrupts (discovery, etc).

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:55 -04:00
James Smart a8e497d51e [SCSI] lpfc 8.2.8 : Add support for PCI-EEH permanent disabling
Add support for PCI-EEH permanent-disabling a device via lpfc_pci_remove_one()

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:54 -04:00
James Smart 84774a4d0a [SCSI] lpfc 8.2.8 : Add new FCOE hardware support
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:54 -04:00
James Smart d7c255b26d [SCSI] lpfc 8.2.8 : Miscellaneous Bug Fixes
Miscellaneous Fixes:
- Fix the wrong variable name used for checking node active usage status
- Fix numerous duplicate log message numbers
- Fix change KERN_WARNING messages to KERN_INFO.
- Stop sending erroneous LOGO to fabric after vport is already terminated
- Fix HBQ allocates that were kalloc'ing w/ GFP_KERNEL while holding a lock.
- Fix gcc 4.3.2 compiler warnings and a sparse warning
- Fix bugs in handling unsolicited ct event queue
- Reorder some of the initial link up checks, to remove odd VPI states.
- Correct poor VPI handling
- Add debug messages
- Expand Update_CFG mailbox definition
- Fix handling of VPD data offsets
- Reorder loopback flags
- convert to use offsetof()

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:53 -04:00
James Smart 34b02dcdcf [SCSI] lpfc 8.2.8 : Update driver for new SLI-3 features
Update driver for new SLI-3 features:
- interrupt enhancements
- lose adapter doorbell writes
- inlining support for FCP_Ixx cmds

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:53 -04:00
James Smart 90160e010b [SCSI] lpfc 8.2.8 : Miscellaneous Discovery Fixes
Miscellaneous Discovery fixes:
- Fix rejection followed by acceptance in handling RPL and RPS
  unsolicited events
- Fix for vport delete crash
- Fix PLOGI vs ADISC race condition

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:53 -04:00
James Smart e59058c440 [SCSI] lpfc 8.2.8 : Add kernel-doc function headers
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-10-13 09:28:53 -04:00
Harvey Harrison cadbd4a5e3 [SCSI] replace __FUNCTION__ with __func__
[jejb: fixed up a ton of missed conversions.

 All of you are on notice this has happened, driver trees will now
 need to be rebased]

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: SCSI List <linux-scsi@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-27 10:31:49 -04:00
James Smart 495a714c50 [SCSI] lpfc 8.2.7 : Miscellaneous Fixes
Miscellaneous Fixes:
- Fix bug in mbox sysfs interface that locked in EAGAIN if discovery stalled.
- Fix missing error message when npiv and loop are true when link up occurs.
- Fix panic in lpfc_scsi_cmd_iocb_cmpl: scsi_buf was NULL, but created
  race conditions with other code paths.
- Fix error in sysfs mailbox structure that didn't rezero on next use.
- Add missing mempool_free() to attachment failure path
- Fix missing put of ndlp structure during driver unload.
- Fix applications unable to send mailbox commands during discovery.
- Remove unused argument (type) from function lpfc_post_buffer() API
- Fix vport name is not shown after hbacmd vportcreate.
- Remove repeated code statements.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-12 08:22:28 -05:00
James Smart 5e9d9b8276 [SCSI] lpfc 8.2.7 : Rework the worker thread
Rework of the worker thread to make it more efficient.
Make a finer-grain notfication of pending work so less time is
spent checking conditions. Also made other general cleanups.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-12 08:22:28 -05:00
James Smart 0d2b6b8303 [SCSI] lpfc 8.2.7 : Discovery Fixes
- Fix ADISC timeout on initiators causing devloss timeout on targets
- Correct FAN processing : port state vs unreg rpi's wasn't consistent
- Correct mismatches between ASICs and PLOGI that would skip PLOGI

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-12 08:22:27 -05:00
James Smart 97eab63490 [SCSI] lpfc 8.2.6 : Miscellaneous Fixes
Miscellaneous Fixes
- Allow WRITE_VPARAM command when the virtual port is in a stopped state
- Fixed handling of our queue depth max that was unconditionally raising
  the depth on all vports, rather than just the vport affected.
- Fix race in interrupt handler for mailbox processing that did not take
  out the host lock.
- Removed unused functions: find_node, findnode_rpi, and fabric_abort_flogi
- Correct misspelled word unsolicited in message 0146
- Correct HW-error 5 handling - it should not reset the adapter
- Correct handling of IOCBs, which did not null out our pCmd field before
  invoking the midlayer io done function.
- Changed our maximum supported target id to 4096

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-10 07:53:12 -05:00
James Smart 9b37960523 [SCSI] lpfc 8.2.6 : PCI Parity and EEH handling fixes
PCI Parity and EEH handling Fixes:
- Under a PCI Data Parity Error, remove a completion routine callback that
  was on a command that we had already failed and released.
- Under PCI parity error, we were not reinstalling the interrupt handler
  in the slot_reset callback, so we never became functional again.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-10 07:52:36 -05:00
James Smart 58da1ffb2b [SCSI] lpfc 8.2.6 : Multiple discovery fixes
Multiple Discovery Fixes:
- Fix race on discovery due to link events coinciding with vport_delete.
- Use NLP_FABRIC state to filter out switch-based pseudo initiators that
   reuse the same WWNs.
- Correct erroneous setting of DID=0 in lpfc_matchdid()
- Correct extra reference count that was in the lookup path for the
  remoteid from an unsolicited ELS.
- Correct double-free bug in els abort path.
- Correct FDMI server discovery logic for switch that return a WWN of 0.
- Fix bugs in ndlp mgmt when a node changes address
- Correct bug that did not delete RSCNs for vports upon link transitions
- Fix "0216 Link event during NS query" error which pops up when vports
  are swapped to different switch ports.
- Add sanity checks on ndlp structures
- Fix devloss log message to dump WWN correctly
- Hold off mgmt commands that were interferring with discovery mailbox cmds
- Remove unnecessary FC_ESTABLISH_LINK logic.
- Correct some race conditions in the worker thread, resulting in devloss:
  - Clear the work_port_events field before handling the work port events
  - Clear the deferred ring event before handling a deferred ring event
  - Hold the hba lock when waking up the work thread
  - Send an acc for the rscn even when we aren't going to handle it
- Fix locking behavior that was not properly protecting the ACTIVE flag,
  thus allowing mailbox command order to shift.

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-04-10 07:52:11 -05:00
James Smart 3163f725a5 [SCSI] lpfc 8.2.5 : Fix buffer leaks
Fix buffer leaks:
- HBQ dma buffer leak at dma_pool_destroy when unloading driver
- Fix missing buffer free in slow ring buffer handling

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-11 17:52:58 -06:00
James Smart 7f5f3d0d02 [SCSI] lpfc 8.2.5 : Miscellaneous discovery Fixes
Miscellaneous discovery fixes:
- Flush RSCN buffers on vports when reseting HBA.
- Fix incorrect FLOGI after vport reg failed
- Fix a potential fabric ELS race condition
- Fix handling of failed PLOGI command under high lip rates
- Fix FDISC handling
- Fix debug logging for npiv handling

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-11 17:52:58 -06:00
James Smart db2378e091 [SCSI] lpfc 8.2.5 : Add MSI-X single message support
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-11 17:52:57 -06:00
James Smart 1b32f6aa99 [SCSI] lpfc 8.2.5 : Miscellaneous Fixes
Miscellaneous fixes:
- Fix ERRATT flag which was overlapping
- Allow RESTART mbx commands through when stopped.
- Accept incoming PLOGI when connected to an N_Port.
- Fix NPort to NPort pt2pt problems: ADISC and reg_vpi issues
- Fix vport unloading error that erroneously cleaned up RSCN buffers
- Fix memory leak during repeated unloads - in mbox handling
- Fix link bounce vs FLOGI race conditions

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-11 17:52:57 -06:00
James Smart e47c909353 [SCSI] lpfc 8.2.5 : Correct ndlp referencing issues
Correct ndlp referencing issues:
- Fix ndlp kref issues due to race conditions between threads
- Fix cancel els delay retry event which missed an ndlp reference count

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-11 17:52:57 -06:00
Greg Kroah-Hartman d5f78fb0c8 pci: pci_enable_device_bars() fix for lpfc driver
Based on a patch from Ingo Molnar <mingo@elte.hu> as he pointed out that
I wrongly missed this.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-02 12:04:28 -08:00
Benjamin Herrenschmidt 0948391641 PCI: Remove users of pci_enable_device_bars()
This patch converts users of pci_enable_device_bars() to the new
pci_enable_device_{io,mem} interface.

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

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

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
Tomohiro Kusumi 8a4df120b0 [SCSI] lpfc 8.2.4 : Make lpfc legacy I/O port free
This is a patch written by Tomohiro Kusumi and submitted to
linux-scsi:

http://marc.info/?l=linux-scsi&m=118673720712152&w=2

The original patch comment:

This patch makes Emulex lpfc driver legacy I/O port free.
It has already been acked quite long time ago.
So I resubmit the patch.
http://lkml.org/lkml/2006/11/22/28

Current lpfc driver is already using pci_select_bars()
and pci_enable_device_bars() when the PCI bus has been reset.
So I think this patch should also be acked.

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:23 -06:00
James Smart 0937282036 [SCSI] lpfc 8.2.4 : Miscellaneous Fixes
Miscellaneous Fixes:
- Fix a couple of sparse complaints
- Reset the FCP recovery flag when the node is not a FCP2 device.
- Speed up offline prep delays
- Fixed a memory leak in lpfc_mem_alloc failure path
- Fixed external loopback test.
- Fixed error code returned from the driver when HBA is over heated.
- Correct Max NPIV vport to limits read from adapter
- Add missing locks around fc_flag and FC_NEEDS_REG_VPI
- Add missing hba ids for device identification
- Added support for SET_VARIABLE and MBX_WRITE_WWN mailbox commands
- Changed all temperature event messages from warning to error
- Fix reporting of link speed when link is down
- Added support for MBX_WRITE_WWN mailbox command
- Change del_timer_sync() in ISR to del_timer() in interrupt handler
- Correct instances of beXX_to_cpu() that should be cpu_to_beXX()
- Perform target flush before releasing node references on module unload
- Avoid bogus devloss_tmo messages when driver unloads
- Fix panic when HBA generates ERATT interupt
- Fix mbox race condition and a workaround on back-to-back mailbox commands
- Force NPIV off for pt2pt mode between 2 NPorts
- Stop worker thread before removing fc_host.
- Fix up discovery timeout error case due to missing clear_la
- Tighten mailbox polling code to speed up detection of fast completions
- Only allow DUMP_MEMORY if adapter offline due to overtemp errors
- Added extended error information to the log messages in chip init.

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:22 -06:00
James Smart 13815c8344 [SCSI] lpfc 8.2.4 : Add parameters to enable and disable heartbeat and hba resets
Add parameters to enable and disable heartbeat and hba resets

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:22 -06:00
James Smart 0ff10d46cf [SCSI] lpfc 8.2.4 : Miscellaneous Discovery/ELS Fixes
Miscellaneous Discovery/ELS Fixes:
- Delay free's of ELS requests if adapter reject conditions
- Fix concurrent PLOGI vs ADISC state handling
- Add retry mechanism for GFF_ID
- Correct some illegal state transitions around RSCN timeouts
- Fix missing return in FAN handling

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-23 11:29:21 -06:00
Adrian Bunk a6ababd26a [SCSI] lpfc: minor cleanups
This patch contains the following minor cleanups:
- make the following needlessly global functions static:
  - lpfc_els.c: lpfc_register_new_vport()
  - lpfc_els.c: lpfc_issue_els_fdisc()
  - lpfc_els.c: lpfc_issue_fabric_iocb()
  - lpfc_els.c: lpfc_fabric_abort_vport()
  - lpfc_hbadisc.c: lpfc_dev_loss_tmo_handler()
  - lpfc_hbadisc.c: lpfc_mbx_cmpl_clear_la()
  - lpfc_hbadisc.c: lpfc_disc_flush_list()
  - lpfc_hbadisc.c: __lpfc_find_node()
  - lpfc_init.c: lpfc_hb_timeout()
  - lpfc_init.c: lpfc_block_mgmt_io()
  - lpfc_sli.c: __lpfc_sli_release_iocbq()
  - lpfc_sli.c: lpfc_sli_next_hbq_slot()
  - lpfc_sli.c: lpfc_sli_hbqbuf_init_hbqs()
  - lpfc_sli.c: lpfc_sli_hbqbuf_find()
  - lpfc_sli.c: __lpfc_sli_issue_iocb()
- #if 0 the following unused global functions:
  - lpfc_els.c: lpfc_fabric_abort_flogi()
  - lpfc_hbadisc.c: lpfc_find_node()
  - lpfc_hbadisc.c: lpfc_findnode_rpi()
- remove the unused exports

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: James Smart <James.Smart@Emulex.Com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-11 18:22:50 -06:00
James Smart 7af670510d [SCSI] lpfc 8.2.3 : Temperature handling fix
Temperature handling fix - return proper error code indicator for applications

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-11 18:22:33 -06:00
James Smart a8adb83208 [SCSI] lpfc 8.2.3 : Miscellaneous Small Fixes - part 2
Miscellaneous Small Fixes - part 2

- Fix ndlp left in PLOGI state after link up
- Fix cannot rcv unsol ELS frames after running HBA resets for a few minutes
- Fix HBQ buffer_count implemention
- Fix RPI leak
- Fix crash while deleting vports while HBA is reset
- Revert the FCP Fbits offset back to 7
- Fix panic when deleting vports
- Remove unused code in switch statement outside of a case
- Reject PLOGI from invalid PName or NName of 0
- Ignore PLOGI responses from WWPName or WWNName of 0
- Fix debugfs hbqinfo display for ppc
- Added 8G to list of supported speeds for sysfs parameter
- Defer ndlp cleanup to dev-loss timeout handler
- Added support for WRITE_VPARMS mailbox command by applications

Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-01-11 18:22:33 -06:00