Commit Graph

116 Commits (a26ac2455ffcf3be5c6ef92bc6df7182700f2114)

Author SHA1 Message Date
Jing Huang 3e98cc013f [SCSI] bfa: add PBC port disable handling
Add PBC port disable handling in BFA and return the appropriate status from
BFA APIs. In bfa_fcs_lport.c, handle OFFLINE event to avoid BFA_ASSERT.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:13 -05:00
Jing Huang 41188cf5a6 [SCSI] bfa: fix prli retry issues
Add a max retry limit for PRLI retries. Max retry limit (5) is same as used
in rport PLOGI. Once the retries are exhausted, invoke rport offline so that
existing logic of rport re-discovery can kick-in. Also fixed a bug in rport.c
where one less retry was happening.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:11 -05:00
Jing Huang c507341713 [SCSI] bfa: fix rport speed setting
When a rport goes offline, its speed setting was not reset. Subsequently, if
the rport was not deleted due to it coming back online within rport del
timeout, previously discovered speed would continue to show up. The fix is to
reset the speed when processing rport offline transition.

In rport attributes, rport's with unknown speed were indicated as TRL
enforced.  The right thing do to would be to use TRL default speed to
determine if TRL is enforced, when TRL is enabled.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:10 -05:00
Jing Huang 7c8146510c [SCSI] bfa: fix interrupt coalescing setting
Do not update the coalesce flag of the intr_attr struct in driver config area
on config response.  This is to prevent the coalesce flag being reported as on
after an ioc disable/enable even if it was set to off before disable.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:09 -05:00
Jing Huang 4f1806bc3c [SCSI] bfa: use standards defined timeout for ELS/CT
Use standards defined 2 * RA_TOV as a timeout for ELS Request retries.
And standards defined 3 * RA_TOV as a timeout for FC-CT Request retries.
Also, added a check to send RPSC2 to a Brocade Fabric only.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:08 -05:00
Jing Huang b85d045ee8 [SCSI] bfa: statistics and typo fix
- Added time stamp for fcport stats reset
- Added new fileds to the statistics data structures.
- Typo removal and minor cleanup.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:07 -05:00
Jing Huang 15b64a835d [SCSI] bfa: ioc attributes fix
This patch fixes the APIs to obtain ioc attributes
- fix API to obtain wwpn, wwnn, and mac.
- add API to get mfg wwpn, wwnn, and mac.
- fix API to obtain wwn of boot target.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:06 -05:00
Jing Huang 1769f990fc [SCSI] bfa: vport state machine fix
Vport state machine does not cleanup associated lport in some states: while
waiting for fdisc response or fdisc failure state. The fixe is to cleanup lport
on vport delete in all states.  In fdisc state, discard fdisc response and
delete lport and wait for lport deletecompletion. in error state, delete lport
and wait for delete completion.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:05 -05:00
Jing Huang d9883548a0 [SCSI] bfa: PBC vport create
This patch enables creating PBC vport.
During fcs init, fcs will read PBC vport using bfa iocfc API and invoke fcb
callback to add the pbc vport entries into a list. The pbc vport list will be
traversed in the subsequent pci probe process and vport will be created using
fc transport provided vport create function.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:04 -05:00
Jing Huang ed96932470 [SCSI] bfa: enable basic PBC support
The patch includes the driver side changes to enable basic PBC (PreBoot
Configuration) feature.
- Data structure changes and new definitions for PBC.
- APIs to access PBC info.
- Remove unused code.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:04 -05:00
Jing Huang 293f82d59e [SCSI] bfa: enable new hardware
This patch enables support of new mezzanine cards for HP and IBM blade server.

- Add new pciids for HP and IBM mezzanine card.
- Add a new firmware image for HP mezzanine card, which is running in
  FC only mode. Rename firmware image to reflect the difference. Change the
  firmware download code accordingly for the above changes.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-07-27 12:04:03 -05:00
Kulikov Vasiliy 501af8d110 scsi: bfa: use ARRAY_SIZE
Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-07-20 17:14:35 +02:00
Uwe Kleine-König 698f93159a fix comment/printk typos concerning "already"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-07-11 21:45:40 +02:00
Jiri Kosina f1bbbb6912 Merge branch 'master' into for-next 2010-06-16 18:08:13 +02:00
Uwe Kleine-König 421f91d21a fix typos concerning "initiali[zs]e"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-06-16 18:05:05 +02:00
Krishna Gudipati 7873ca4e44 [SCSI] bfa: fix system crash when reading sysfs fc_host statistics
The port data structure related to fc_host statistics collection is
not initialized. This causes system crash when reading the fc_host
statistics. The fix is to initialize port structure during driver
attach.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-25 10:05:40 -05:00
Linus Torvalds 33cf23b0a5 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (182 commits)
  [SCSI] aacraid: add an ifdef'd device delete case instead of taking the device offline
  [SCSI] aacraid: prohibit access to array container space
  [SCSI] aacraid: add support for handling ATA pass-through commands.
  [SCSI] aacraid: expose physical devices for models with newer firmware
  [SCSI] aacraid: respond automatically to volumes added by config tool
  [SCSI] fcoe: fix fcoe module ref counting
  [SCSI] libfcoe: FIP Keep-Alive messages for VPorts are sent with incorrect port_id and wwn
  [SCSI] libfcoe: Fix incorrect MAC address clearing
  [SCSI] fcoe: fix a circular locking issue with rtnl and sysfs mutex
  [SCSI] libfc: Move the port_id into lport
  [SCSI] fcoe: move link speed checking into its own routine
  [SCSI] libfc: Remove extra pointer check
  [SCSI] libfc: Remove unused fc_get_host_port_type
  [SCSI] fcoe: fixes wrong error exit in fcoe_create
  [SCSI] libfc: set seq_id for incoming sequence
  [SCSI] qla2xxx: Updates to ISP82xx support.
  [SCSI] qla2xxx: Optionally disable target reset.
  [SCSI] qla2xxx: ensure flash operation and host reset via sg_reset are mutually exclusive
  [SCSI] qla2xxx: Silence bogus warning by gcc for wrap and did.
  [SCSI] qla2xxx: T10 DIF support added.
  ...
2010-05-21 07:19:18 -07:00
Jing Huang 8637ac3340 [SCSI] bfa: fix compilation warning in powerpc
Fix the compilation warning in powerpc. The same change also fixes endian
issue we found in powerpc test. This patch has been tested in x86 and
powerpc platform. it is created using scsi-misc-2.6.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-05-01 14:12:11 -05:00
Jiri Kosina 6c9468e9eb Merge branch 'master' into for-next 2010-04-23 02:08:44 +02:00
Jing Huang 077424e2e2 [SCSI] bfa: sg addr big endian fix
sg address in IO request is not set up correctly for big endian platform.
add new macros to properly swap the address.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:23 -05:00
Jing Huang 42b426ecb4 [SCSI] bfa: protect idr using bfad_mutex
idr is a global resource, protect it with global bfad_mutex.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:20 -05:00
Jing Huang b3522f08ec [SCSI] bfa: use pci_iomap() and pci_iounmap()
Use pci_iomap() and pci_iounmap() to simplify the code. Remove uncessary #ifdef
check for ia64 (it was added as a workaound for some RHEL 5.x release which
doesn't export iounmap function)

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:19 -05:00
Jing Huang 2eba0d4c00 [SCSI] bfa: fix the issue of not handling scsi_cmnd sg chaining case
Currently the driver doesn't take into consideraion of possible sg chaining
when it walks through the sg list. This is fixed by using the sg_next()
which automatically handles the chaining case. Obosolete code is removed
as a result of this change.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:17 -05:00
Jing Huang b504293fe9 [SCSI] bfa: add fc transport class based vport create/delete
Use duplicate fc transport template for physical and vitual port. Add
vport create/delete/disalbe functions in the transport template of physical
port. Changes to make the vport create/delete function to work under this
framework.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:24:16 -05:00
Julia Lawall 4644efabde [SCSI] bfa: eliminate useless code
The variable bfa_itnim is initialized twice to the same (side effect-free)
expression.  Drop one initialization.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@forall@
idexpression *x;
identifier f!=ERR_PTR;
@@

x = f(...)
... when != x
(
x = f(...,<+...x...+>,...)
|
* x = f(...)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Jing Huang <huangj@brocade.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-04-11 09:23:32 -05:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Thomas Weber 8839316121 Fix typos in comments
[Ss]ytem => [Ss]ystem
udpate => update
paramters => parameters
orginal => original

Signed-off-by: Thomas Weber <swirl@gmx.li>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-03-16 11:47:56 +01:00
Krishna Gudipati d55f88f027 [SCSI] bfa: Update the driver version to 2.1.2.1.
Upgrade the upstream driver from 2.0.0.0 to 2.1.2.1.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:28:38 +05:30
Krishna Gudipati d1c61f8ef5 [SCSI] bfa: Remove unused header files and did some cleanup.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:27:51 +05:30
Krishna Gudipati 95aa060dec [SCSI] bfa: Handle SCSI IO underrun case.
When IO is completed with underrun and with good SCSI status, check if
the transferred bytes against scsi_cmnd->underflow, which is set to
minimum number of bytes that must be transferred for this command, if
is less than required minimum, complete the IO with DID_ERROR.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:12:38 +05:30
Krishna Gudipati 25e2934c26 [SCSI] bfa: FCS and include file changes.
MS module did not invoke fdmi offline in all cases,
call fdmi offline when ms module receives a port offline,
so that fdmi offline is from one place in the ms module.

Make changes to handle 10G speed in the conversion routine.

Replaced the usage of bfa_adapter_attr_s struct with specific API's.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:12:04 +05:30
Krishna Gudipati ca8b4327e4 [SCSI] bfa: Modified the portstats get/clear logic
Modified the portstats get/clear logic for port physical/FCoE/QoS stats.
Added more stats to FC
Fixed some issues with FCoE stats collection.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:10:13 +05:30
Krishna Gudipati 0a4b1fc0b2 [SCSI] bfa: Replace bfa_get_attr() with specific APIs
bfa_ioc_attr_s is a big structure and some times could cause
stack overflow if defined locally, so add specific APIs that
are needed to replace the use of ioc_attr local var.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:07:00 +05:30
Krishna Gudipati f58e9ebbf7 [SCSI] bfa: New portlog entries for events (FIP/FLOGI/FDISC/LOGO).
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:06:36 +05:30
Krishna Gudipati 1c8a4c3749 [SCSI] bfa: Rename pport to fcport in BFA FCS.
Rename pport structures to fcport in BFA FCS, to resolve confusion
about the port structures in the firmware, and make sure the SG page
is setup correctly.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:05:10 +05:30
Krishna Gudipati 13cc20c5e7 [SCSI] bfa: IOC fixes, check for IOC down condition.
Currently BFA was not checking for IOC down condition when issuing
getstats/clearstats

Add check to see if IOC is operational, before issuing
getstats/clearstats.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:03:50 +05:30
Krishna Gudipati 78f915f7b0 [SCSI] bfa: In MSIX mode, ignore spurious RME interrupts when FCoE ports are in FW mismatch state.
Use dummy interrupt handlers till chip initialization is complete.
Install real interrupt handlers after chip initialization.

Also removed msix installation code in bfa_iocfc_init().

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:02:45 +05:30
Krishna Gudipati f5713c5dfb [SCSI] bfa: Fix Command Queue (CPE) full condition check and ack CPE interrupt.
Fixed the issue of not acknowledging the command queue
full-to-non-full interrupt.  Implemented separate acknowledging
functions for different ASIC and interrupt mode.

Fixed the case of missing CPE interrupt by always processing the
pending requests in the completion path.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:02:14 +05:30
Krishna Gudipati 816e49b8ed [SCSI] bfa: IOC recovery fix in fcmode.
ioc_recover failed to work in fcmode.

Fixed the code to initialize the ioc_regs.err_set during the
notify_hbfail.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:01:42 +05:30
Krishna Gudipati 2993cc71d1 [SCSI] bfa: AEN and byte alignment fixes.
Replace enum types with int and rearrange the fields to fix some
alignment issue.

Local var ioc_attr is causing the stack to overflow, so removed the
usage of the local ioc_attr var and now invoking an API to return the
ioc_type.

Fix some AEN issues.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 13:01:23 +05:30
Krishna Gudipati 9693e7dff5 [SCSI] bfa: Introduce a link notification state machine.
Introduce a link notification state machine to handle next incoming
link events while the current event is being delivered to the driver.

When the event has been processed by the driver, the link notification
state machine will queue the next event (if there is any) to the
driver.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:59:36 +05:30
Krishna Gudipati 738c9e66dc [SCSI] bfa: Added firmware save clear feature for BFA driver.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:58:59 +05:30
Krishna Gudipati f926a05f5c [SCSI] bfa: FCS authentication related changes.
Made FCS authentication related changes to state machines and header
files.

Made changes in FCS state machines to handle the case when secret
string is NULL.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:58:41 +05:30
Krishna Gudipati 7af074dc9d [SCSI] bfa: PCI VPD, FIP and include file changes.
Changed PCI VPD to incorporate specific OEM vendors.

Added FCoE specific interrupt latency and delay params.

Added some variables needed by FIP 2.0.

Added some new logging and tracing definitions.

Added reserved members to make the structures (IOC, IOCFC) 64bit aligned.

Changed the module identifiers, as some files were moved.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:57:35 +05:30
Krishna Gudipati 86e32dabba [SCSI] bfa: Fix to copy fpma MAC when requested by user space application.
Copy fpma MAC when requested by user space application.  Added FPMA
mac address to the lport attributes structure.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:57:05 +05:30
Krishna Gudipati 72041ed8fc [SCSI] bfa: RPORT state machine: direct attach mode fix.
Make sure that in direct attach mode, we do not query the name server
after a target is marked offline.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:54:38 +05:30
Krishna Gudipati e641de37e6 [SCSI] bfa: Replace bfa_assert() with bfa_sm_fault()
Replace bfa_assert() with bfa_sm_fault() to get unhandled events for
debugging.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:54:18 +05:30
Krishna Gudipati 8b651b4294 [SCSI] bfa: Clear LL_HALT and PSS_ERR bit when IOC crashes.
Clear LL_HALT and PSS_ERR bit in the interrupt status register on an IOC crash.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:53:53 +05:30
Krishna Gudipati 0a20de446c [SCSI] bfa: IOC changes: Support faster recovery and split bfa_ioc.c into ASIC specific code.
Add support for faster IOC recovery after failure.

Split bfa_ioc.c into three files:
  bfa_ioc.c:    Common code shared between crossbow and catapult ASIC's.

  bfa_ioc_cb.c: Code specific to the crossbow, reg mapping and
                interrupt related routines.

  bfa_ioc_ct.c: Code specific to the catapult, reg mapping and
                interrupt related routines.

Fix to make sure IOC reinitialize's properly on enable request -
update the ioc_fwstate reg with BFI_IOC_FAIL on ioc disable mbox cmd
timeout.

Makefile changes to support the 2 newly added files bfa_ioc_cb.c and
bfa_ioc_ct.c.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-07 12:49:48 +05:30
Krishna Gudipati e67143243a [SCSI] bfa: Resume BFA operations after firmware mismatch is resolved.
bfad.c & bfad_drv.h:
  * Created a kernel thread from pci_probe that does the bfad start
    operations after BFA init done on a firmware mismatch.
  * The kernel thread on a fw mismatch waits for an event from IOC
    call back and is woken up from bfa_cb_init() on BFA init success.
  * In normal cases of no firmware mismatch this thread is terminated
    in pci_probe.

bfa_fcs_lport.c, fabric.c, fcs_lport.h & vport.c:
  * Split the lport init to attach time and init time code, so that
    proper config attributes are set after firmware mismatch.

bfa_iocfc.c:
  * Handle an IOC timer issue, where the IOC timer would expire before
    the init completion and send Init fail event to the driver,
    however IOC init continues and completes successfully at the later
    stage. The bfa and driver were not handling this kind of deferred
    init completion.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:17:02 +05:30
Krishna Gudipati a046bf0559 [SCSI] bfa: Fix to allow creation of only 190 vports on CNA.
Brocade CNA currently supports only 190 vports (instead of 191),
since there are only 192 unicast cam entries reserved for FCoE.

Brocade CNA has a total of 256 unicast cam entries (192 FCoE + 64 LL)

192 cam entries = 1 burned in mac + 1 baseport FPMA mac + 190 vport
FPMA macs.

Made changes to the code to support only 190 vports.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:15:24 +05:30
Krishna Gudipati 82794a2e41 [SCSI] bfa: New interface to handle firmware upgrade scenario
Split bfa_fcs_init() into bfa_fcs_attach() and bfa_fcs_init().

Removed empty function definitions in FCS modules

Modified driver to call bfa_fcs_attach() and bfa_fcs_init() as needed.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:14:10 +05:30
Krishna Gudipati 5b098082e2 [SCSI] bfa: Changes to support FDMI Driver Parameter
Added a FCS function to be called during driver init, to set the FDMI
 Driver parameter.

fdmi.c: Created a disabled state when fdmi is disabled.

bfad.c:
  * Added fdmi_enable driver parameter.
  * Added support to call bfa_fcs_set_fdmi_param() to initialize fcs
    fdmi setting.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:13:40 +05:30
Krishna Gudipati ab5336189a [SCSI] bfa: Enable new halt interrupt in BFA.
bfa_intr.c:  Enable new halt interrupt in BFA.
bfi_ctreg.h: Expose new halt interrupt bit definition to host.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:12:58 +05:30
Krishna Gudipati 2f9b8857a9 [SCSI] bfa: Enable IOC auto-recovery and IOC type fix.
bfa_ioc.c:
  - Enable IOC auto-recovery by default.
  - When CNA is in FC mode, return IOC type as FC (not FCoE)

bfa_iocfc.c:
  - Set fcmode before pci initialization/setup.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:10:02 +05:30
Krishna Gudipati 5c1fb1d556 [SCSI] bfa: Defined a new LPS event to clear virtual link on a vport
Clear virtual links was not propagated upwards to bfa from fw.
This resulted in HBA and switch being in an inconsistent state.

So defined a new LPS event for clear virtual link on a vport,
and also now clear virtual link on a baseport, is sent as a
link down event from the fw.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 16:09:37 +05:30
Krishna Gudipati 4c147dd819 [SCSI] bfa: Added separate MSI-X module parameters.
Added separate MSI-X module parameters to selectively
enable / disable MSI-X interrupts for both Brocade HBA and CNA's.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-03-04 15:29:46 +05:30
Linus Torvalds 4ef58d4e2a Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits)
  tree-wide: fix misspelling of "definition" in comments
  reiserfs: fix misspelling of "journaled"
  doc: Fix a typo in slub.txt.
  inotify: remove superfluous return code check
  hdlc: spelling fix in find_pvc() comment
  doc: fix regulator docs cut-and-pasteism
  mtd: Fix comment in Kconfig
  doc: Fix IRQ chip docs
  tree-wide: fix assorted typos all over the place
  drivers/ata/libata-sff.c: comment spelling fixes
  fix typos/grammos in Documentation/edac.txt
  sysctl: add missing comments
  fs/debugfs/inode.c: fix comment typos
  sgivwfb: Make use of ARRAY_SIZE.
  sky2: fix sky2_link_down copy/paste comment error
  tree-wide: fix typos "couter" -> "counter"
  tree-wide: fix typos "offest" -> "offset"
  fix kerneldoc for set_irq_msi()
  spidev: fix double "of of" in comment
  comment typo fix: sybsystem -> subsystem
  ...
2009-12-09 19:43:33 -08:00
Linus Torvalds 382f51fe2f Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits)
  [SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP
  [SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class
  [SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED
  [SCSI] zfcp: Update FSF error reporting
  [SCSI] zfcp: Improve ELS ADISC handling
  [SCSI] zfcp: Simplify handling of ct and els requests
  [SCSI] zfcp: Remove ZFCP_DID_MASK
  [SCSI] zfcp: Move WKA port to zfcp FC code
  [SCSI] zfcp: Use common code definitions for FC CT structs
  [SCSI] zfcp: Use common code definitions for FC ELS structs
  [SCSI] zfcp: Update FCP protocol related code
  [SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport
  [SCSI] zfcp: Assign scheduled work to driver queue
  [SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore
  [SCSI] zfcp: Implement module unloading
  [SCSI] zfcp: Merge trace code for fsf requests in one function
  [SCSI] zfcp: Access ports and units with container_of in sysfs code
  [SCSI] zfcp: Remove suspend callback
  [SCSI] zfcp: Remove global config_mutex
  [SCSI] zfcp: Replace local reference counting with common kref
  ...
2009-12-09 19:42:25 -08:00
Jiri Kosina d014d04386 Merge branch 'for-next' into for-linus
Conflicts:

	kernel/irq/chip.c
2009-12-07 18:36:35 +01:00
Adam Buchbinder 6070d81eb5 tree-wide: fix misspelling of "definition" in comments
"Definition" is misspelled "defintion" in several comments; this
patch fixes them. No code changes.

Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 23:41:47 +01:00
Jing Huang f8ceafde6f [SCSI] bfa: fixed checkpatch errors for bfad files
This patch fixes checkpatch errors/warnings in bfad files.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-04 12:00:09 -06:00
André Goddard Rosa af901ca181 tree-wide: fix assorted typos all over the place
That is "success", "unknown", "through", "performance", "[re|un]mapping"
, "access", "default", "reasonable", "[con]currently", "temperature"
, "channel", "[un]used", "application", "example","hierarchy", "therefore"
, "[over|under]flow", "contiguous", "threshold", "enough" and others.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-04 15:39:55 +01:00
Ben Hutchings 1a0f437235 [SCSI] bfa: declare MODULE_FIRMWARE
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-11-11 12:21:06 -05:00
Roel Kluin 7542fa72e2 [SCSI] bfa: fix test in bfad_os_fc_host_init()
BFA_PORT_ROLE_FCP_IPFC is 0x04 so this always evaluates to true

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Jing Huang <huangj@Brocade.COM>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-11-03 09:29:58 -06:00
Jing Huang 7725ccfda5 [SCSI] bfa: Brocade BFA FC SCSI driver
Add new driver for Brocade Hardware

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-10-02 09:47:40 -05:00