Commit Graph

7518 Commits (4711ba10b13891edf228944a9d0a21dfe7fe90f0)

Author SHA1 Message Date
James Smart 9940b97bb3 [SCSI] lpfc 8.3.22: Add support for PCI Adapter Failure
Periodically poll adapter registers to detect pci adapter failure
(reads return -1). On failure, take port offline, set error indicators
and wake up worker threads. Threads will take adapter offline.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-23 11:36:09 -05:00
James Smart 7f86059ac0 [SCSI] lpfc 8.3.22: T10-DIF corrections
T10-DIF corrections
- Add selective reset jump table entry
- Split T10-DIF BDEs that cross 4K boundary

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-23 11:36:07 -05:00
James Smart 5a6f133eea [SCSI] lpfc 8.3.22: Add new mailbox command and new BSG fix
- Add new Queue Create Mailbox version support
- Make lpfc_bsg_wake_mbox_wait routine check the mailboxes job reference before
  using it.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-23 11:36:03 -05:00
HighPoint Linux Team 463b8977ec [SCSI] mvsas: Add support for HighPoint RR27xx series HBA
This patch is to add support for HighPoint RR27xx SAS/SATA HBA which
is based on Marvell 88SE9480 chipset.

Signed-off-by: HighPoint Linux Team <linux@highpoint-tech.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-23 11:35:59 -05:00
Vasiliy Kulikov 523f3c80bc [SCSI] scsi_transport_iscsi: make priv_sess file writeable only by root
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-23 11:35:58 -05:00
John Hughes 877a55979c [SCSI] ses: show devices for enclosures with no page 7
enclosure page 7 gives us the "pretty" names of the enclosure slots.
Without a page 7, we can still use the enclosure code as long as we
make up numeric names for the slots. Unfortunately, the current code
fails to add any devices because the check for page 10 is in the wrong
place if we have no page 7.  Fix it so that devices show up even if
the enclosure has no page 7.

Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-23 11:35:57 -05:00
Martin K. Petersen 09b9cc44c9 sd: Fail discard requests when logical block provisioning has been disabled
Ensure that we kill discard requests after logical block provisioning
has been disabled in sysfs.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-22 09:35:53 -07:00
Jesper Juhl 0bf8c86970 Reduce sequential pointer derefs in scsi_error.c and reduce size as well
This patch reduces the number of sequential pointer derefs in
drivers/scsi/scsi_error.c

This has been submitted a number of times over a couple of years.  I
believe this version adresses all comments it has gathered over time.
Please apply or reject with a reason.

The benefits are:

 - makes the code easier to read.  Lots of sequential derefs of the same
   pointers is not easy on the eye.

 - theoretically at least, just dereferencing the pointers once can
   allow the compiler to generally slightly faster code, so in theory
   this could also be a micro speed optimization.

 - reduces size of object file (tiny effect: on x86-64, in at least one
   configuration, the text size decreased from 9439 bytes to 9400)

 - removes some pointless (mostly trailing) whitespace.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-21 15:54:35 -07:00
Linus Torvalds a44f99c7ef Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (25 commits)
  video: change to new flag variable
  scsi: change to new flag variable
  rtc: change to new flag variable
  rapidio: change to new flag variable
  pps: change to new flag variable
  net: change to new flag variable
  misc: change to new flag variable
  message: change to new flag variable
  memstick: change to new flag variable
  isdn: change to new flag variable
  ieee802154: change to new flag variable
  ide: change to new flag variable
  hwmon: change to new flag variable
  dma: change to new flag variable
  char: change to new flag variable
  fs: change to new flag variable
  xtensa: change to new flag variable
  um: change to new flag variables
  s390: change to new flag variable
  mips: change to new flag variable
  ...

Fix up trivial conflict in drivers/hwmon/Makefile
2011-03-20 18:14:55 -07:00
Linus Torvalds e16b396ce3 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: (47 commits)
  doc: CONFIG_UNEVICTABLE_LRU doesn't exist anymore
  Update cpuset info & webiste for cgroups
  dcdbas: force SMI to happen when expected
  arch/arm/Kconfig: remove one to many l's in the word.
  asm-generic/user.h: Fix spelling in comment
  drm: fix printk typo 'sracth'
  Remove one to many n's in a word
  Documentation/filesystems/romfs.txt: fixing link to genromfs
  drivers:scsi Change printk typo initate -> initiate
  serial, pch uart: Remove duplicate inclusion of linux/pci.h header
  fs/eventpoll.c: fix spelling
  mm: Fix out-of-date comments which refers non-existent functions
  drm: Fix printk typo 'failled'
  coh901318.c: Change initate to initiate.
  mbox-db5500.c Change initate to initiate.
  edac: correct i82975x error-info reported
  edac: correct i82975x mci initialisation
  edac: correct commented info
  fs: update comments to point correct document
  target: remove duplicate include of target/target_core_device.h from drivers/target/target_core_hba.c
  ...

Trivial conflict in fs/eventpoll.c (spelling vs addition)
2011-03-18 10:37:40 -07:00
Linus Torvalds c55d267de2 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: (170 commits)
  [SCSI] scsi_dh_rdac: Add MD36xxf into device list
  [SCSI] scsi_debug: add consecutive medium errors
  [SCSI] libsas: fix ata list corruption issue
  [SCSI] hpsa: export resettable host attribute
  [SCSI] hpsa: move device attributes to avoid forward declarations
  [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26)
  [SCSI] sd: Logical Block Provisioning update
  [SCSI] Include protection operation in SCSI command trace
  [SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try)
  [SCSI] target: Fix volume size misreporting for volumes > 2TB
  [SCSI] bnx2fc: Broadcom FCoE offload driver
  [SCSI] fcoe: fix broken fcoe interface reset
  [SCSI] fcoe: precedence bug in fcoe_filter_frames()
  [SCSI] libfcoe: Remove stale fcoe-netdev entries
  [SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h
  [SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument
  [SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs
  [SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out"
  [SCSI] libfc: Fixing a memory leak when destroying an interface
  [SCSI] megaraid_sas: Version and Changelog update
  ...

Fix up trivial conflicts due to whitespace differences in
drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}
2011-03-17 17:54:40 -07:00
matt mooney bfbec92075 scsi: change to new flag variable
Replace EXTRA_CFLAGS with ccflags-y.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
2011-03-17 14:05:35 +01:00
Linus Torvalds 4c5811bf46 Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6: (21 commits)
  tty: serial: altera_jtaguart: Add device tree support
  tty: serial: altera_uart: Add devicetree support
  dt: eliminate of_platform_driver shim code
  dt: Eliminate of_platform_{,un}register_driver
  dt/serial: Eliminate users of of_platform_{,un}register_driver
  dt/usb: Eliminate users of of_platform_{,un}register_driver
  dt/video: Eliminate users of of_platform_{,un}register_driver
  dt/net: Eliminate users of of_platform_{,un}register_driver
  dt/sound: Eliminate users of of_platform_{,un}register_driver
  dt/spi: Eliminate users of of_platform_{,un}register_driver
  dt: uartlite: merge platform and of_platform driver bindings
  dt: xilinx_hwicap: merge platform and of_platform driver bindings
  ipmi: convert OF driver to platform driver
  leds/leds-gpio: merge platform_driver with of_platform_driver
  dt/sparc: Eliminate users of of_platform_{,un}register_driver
  dt/powerpc: Eliminate users of of_platform_{,un}register_driver
  dt/powerpc: move of_bus_type infrastructure to ibmebus
  drivercore/dt: add a match table pointer to struct device
  dt: Typo fix.
  altera_ps2: Add devicetree support
  ...
2011-03-16 17:28:10 -07:00
Linus Torvalds f74b944419 Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
  BKL: That's all, folks
  fs/locks.c: Remove stale FIXME left over from BKL conversion
  ipx: remove the BKL
  appletalk: remove the BKL
  x25: remove the BKL
  ufs: remove the BKL
  hpfs: remove the BKL
  drivers: remove extraneous includes of smp_lock.h
  tracing: don't trace the BKL
  adfs: remove the big kernel lock
2011-03-16 17:21:00 -07:00
Linus Torvalds 7a6362800c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1480 commits)
  bonding: enable netpoll without checking link status
  xfrm: Refcount destination entry on xfrm_lookup
  net: introduce rx_handler results and logic around that
  bonding: get rid of IFF_SLAVE_INACTIVE netdev->priv_flag
  bonding: wrap slave state work
  net: get rid of multiple bond-related netdevice->priv_flags
  bonding: register slave pointer for rx_handler
  be2net: Bump up the version number
  be2net: Copyright notice change. Update to Emulex instead of ServerEngines
  e1000e: fix kconfig for crc32 dependency
  netfilter ebtables: fix xt_AUDIT to work with ebtables
  xen network backend driver
  bonding: Improve syslog message at device creation time
  bonding: Call netif_carrier_off after register_netdevice
  bonding: Incorrect TX queue offset
  net_sched: fix ip_tos2prio
  xfrm: fix __xfrm_route_forward()
  be2net: Fix UDP packet detected status in RX compl
  Phonet: fix aligned-mode pipe socket buffer header reserve
  netxen: support for GbE port settings
  ...

Fix up conflicts in drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
with the staging updates.
2011-03-16 16:29:25 -07:00
Linus Torvalds fc82e1d59a Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: (21 commits)
  PM / Hibernate: Reduce autotuned default image size
  PM / Core: Introduce struct syscore_ops for core subsystems PM
  PM QoS: Make pm_qos settings readable
  PM / OPP: opp_find_freq_exact() documentation fix
  PM: Documentation/power/states.txt: fix repetition
  PM: Make system-wide PM and runtime PM treat subsystems consistently
  PM: Simplify kernel/power/Kconfig
  PM: Add support for device power domains
  PM: Drop pm_flags that is not necessary
  PM: Allow pm_runtime_suspend() to succeed during system suspend
  PM: Clean up PM_TRACE dependencies and drop unnecessary Kconfig option
  PM: Remove CONFIG_PM_OPS
  PM: Reorder power management Kconfig options
  PM: Make CONFIG_PM depend on (CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME)
  PM / ACPI: Remove references to pm_flags from bus.c
  PM: Do not create wakeup sysfs files for devices that cannot wake up
  USB / Hub: Do not call device_set_wakeup_capable() under spinlock
  PM: Use appropriate printk() priority level in trace.c
  PM / Wakeup: Don't update events_check_enabled in pm_get_wakeup_count()
  PM / Wakeup: Make pm_save_wakeup_count() work as documented
  ...
2011-03-16 09:24:44 -07:00
Linus Torvalds abab012a52 Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (29 commits)
  ahci: add another PCI ID for marvell
  libata: Use 'bool' return value for ata_id_XXX
  sata_fsl: Update RX_WATER_MARK for TRANSCFG
  sata_fsl: Fix wrong Device Error Register usage
  libata: Include WWN ID in inquiry VPD emulation
  ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv
  ata: pata: Convert pr_*(DRV_NAME ...) to pr_fmt/pr_<level>
  pata_arasan_cf: fix printk format string warning
  pata_arasan_cf: Adding support for arasan compact flash host controller
  libata-sff: add ata_sff_queue_work() & ata_sff_queue_delayed_work()
  ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller
  ahci: recognize Marvell 88se9125 PCIe SATA 6.0 Gb/s controller
  libata: remove ATA_FLAG_LPM
  libata: remove ATA_FLAG_NO_LEGACY
  libata: remove ATA_FLAG_MMIO
  libata: remove ATA_FLAG_{SRST|SATA_RESET}
  ipr/sas_ata: use mode mask macros from <linux/ata.h>
  sata_dwc_460ex: add debugging options
  sata_dwc_460ex: fix misuse of ata_get_cmd_descript()
  sata_dwc_460ex: fix return value of dma_dwc_xfer_setup()
  ...
2011-03-16 08:57:32 -07:00
Linus Torvalds bd2895eead Merge branch 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
* 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: fix build failure introduced by s/freezeable/freezable/
  workqueue: add system_freezeable_wq
  rds/ib: use system_wq instead of rds_ib_fmr_wq
  net/9p: replace p9_poll_task with a work
  net/9p: use system_wq instead of p9_mux_wq
  xfs: convert to alloc_workqueue()
  reiserfs: make commit_wq use the default concurrency level
  ocfs2: use system_wq instead of ocfs2_quota_wq
  ext4: convert to alloc_workqueue()
  scsi/scsi_tgt_lib: scsi_tgtd isn't used in memory reclaim path
  scsi/be2iscsi,qla2xxx: convert to alloc_workqueue()
  misc/iwmc3200top: use system_wq instead of dedicated workqueues
  i2o: use alloc_workqueue() instead of create_workqueue()
  acpi: kacpi*_wq don't need WQ_MEM_RECLAIM
  fs/aio: aio_wq isn't used in memory reclaim path
  input/tps6507x-ts: use system_wq instead of dedicated workqueue
  cpufreq: use system_wq instead of dedicated workqueues
  wireless/ipw2x00: use system_wq instead of dedicated workqueues
  arm/omap: use system_wq in mailbox
  workqueue: use WQ_MEM_RECLAIM instead of WQ_RESCUER
2011-03-16 08:20:19 -07:00
Yanqing_Liu@Dell.com bc898c97f7 [SCSI] scsi_dh_rdac: Add MD36xxf into device list
This patch is to add Dell MD36xxf array into the RDAC handler device list.

Singed-off-by: Yanqing Liu <Yanqing_Liu@Dell.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 19:05:07 -05:00
Douglas Gilbert 32f7ef7358 [SCSI] scsi_debug: add consecutive medium errors
A useful test case for error recovery is multiple,
consecutive medium errors. When scsi_debug is started
with "opts=2" a MEDIUM ERROR is generated when block
0x1234 (4660) is read. The patch extends that to
10 consecutive blocks from 0x1234 (i.e. blocks 4660 to
4669 inclusive).

[0:0:0:0]  disk  ATA    INTEL SSD  2CV1 /dev/sda /dev/sg0 80.0GB
[10:0:0:0] disk  Linux  scsi_debug 0004 /dev/sdb /dev/sg1 1.09TB

Output file not specified so no copy, just reading input
 >> unrecovered read error at blk=4660, substitute zeros
...
 >> unrecovered read error at blk=4669, substitute zeros
4670+10 records in
0+0 records out
10 unrecovered read errors
lowest unrecovered read lba=4660, highest unrecovered lba=4669
time to read data: 0.047943 secs at 49.87 MB/sec

BTW Change /dev/sg1 (bsg device works just as well) to
/dev/sdb to see why, with faulty media, you do not want
to use the block layer interface. Reason: time block
layer takes to do useless retries and collateral damage
to data in its 4 KB blocks (O_DIRECT mitigates the
latter).

ChangeLog:
    - extend opts=2 medium error generation at block
      0x1234 to 10 consecutive blocks (i.e. blocks
      0x1234 to 0x123d).

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 18:59:57 -05:00
Jiri Pirko cc8bdf0623 fcoe: correct checking for bonding
Check for bonding master and refuse to use that.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Acked-by: Robert Love <robert.w.love@intel.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-14 16:51:46 -07:00
James Bottomley a82058a730 [SCSI] libsas: fix ata list corruption issue
I think this stems from a misunderstanding of how the ata error handler
works.  ata_scsi_cmd_error_handler() gets called with a passed in list
of commands to handle.  However, that list may still not be empty when
it exits.  The command ata_scsi_port_error_handler() must be called
(which takes no list) before the list will be completely emptied.  This
bites the sas error handler because the two are called from different
functions and the original list has gone out of scope before
ata_scsi_port_error_handler() is called. leading to some commands
dangling on bare stack, which is a potential memory corruption issue.
Fix this by manually deleting all outstanding commands from the on-stack
list before it goes out of scope.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 18:46:25 -05:00
Stephen M. Cameron 941b1cdae8 [SCSI] hpsa: export resettable host attribute
This attribute, requested by Redhat, allows kexec-tools to know
whether the controller can honor the reset_devices kernel parameter
and actually reset the controller.  For kdump to work properly it
is necessary that the reset_devices parameter be honored.  This
attribute enables kexec-tools to warn the user if they attempt to
designate a non-resettable controller as the dump device.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 18:44:41 -05:00
Rafael J. Wysocki aa33860158 PM: Remove CONFIG_PM_OPS
After redefining CONFIG_PM to depend on (CONFIG_PM_SLEEP ||
CONFIG_PM_RUNTIME) the CONFIG_PM_OPS option is redundant and can be
replaced with CONFIG_PM.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2011-03-15 00:43:15 +01:00
Stephen M. Cameron 3f5eac3a04 [SCSI] hpsa: move device attributes to avoid forward declarations
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 18:40:20 -05:00
Martin K. Petersen 5b94e23292 [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26)
Update scsi_debug to support the Logical Block Provisioning commands and
bits as defined in SBC3r26. The old tp* parameters have been
transitioned to the new lbp* scheme found in the draft standard.

The old tpu option to enable UNMAP is now called lbpu. tpws to signal
support for WRITE SAME(16) with the UNMAP bit set is now lbpws. Support
for WRITE SAME(10) with the UNMAP bit set is also available using the
lpuws10 parameter.

Limiting the maximum number of blocks per WRITE SAME command has been
implemented and is available via the write_same_length module parameter.

As part of the renaming process the parameter lists have been sorted
alphabetically (request from Doug).

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 18:38:44 -05:00
Martin K. Petersen c98a0eb0e9 [SCSI] sd: Logical Block Provisioning update
SBC3r26 contains many changes to the Logical Block Provisioning
interfaces (formerly known as Thin Provisioning ditto). This patch
implements support for both the old and new schemes using the same
heuristic as before (whether the LBP VPD page is present).

The new code also allows the provisioning mode (i.e. choice of command)
to be overridden on a per-device basis via sysfs. Two additional modes
are supported in this version:

 - WRITE SAME(10) with the UNMAP bit set

 - WRITE SAME(10) without the UNMAP bit set. This allows us to support
   devices that predate the TP/LBP enhancements in SBC3 and which work
   by way zero-detection

Switching between modes has been consolidated in a helper function that
also updates the block layer topology according to the limitations of
the chosen command.

I experimented with trying WRITE SAME(16) if UNMAP fails, WRITE SAME(10)
if WRITE SAME(16) fails, etc. but found several devices that got
cranky. So for now we'll disable discard if one of the commands
fail. The user still has the option of selecting a different mode in
sysfs.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 18:37:34 -05:00
Martin K. Petersen 72f7d322fd [SCSI] Include protection operation in SCSI command trace
When debugging DIF/DIX it is very helpful to be able to see which DIX
operation is associated with the scsi_cmnd. Include the protection op in
the SCSI command trace.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 18:36:02 -05:00
scameron@beardog.cce.hp.com 9143a96122 [SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try)
My first attempt was botched, got the wrong PCI Device ID
(used PCI_DEVICE_ID_HP_CISSE, should have been PCI_DEVICE_ID_HP_CISSF)

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-03-14 18:34:58 -05:00
David S. Miller 78fbfd8a65 ipv4: Create and use route lookup helpers.
The idea here is this minimizes the number of places one has to edit
in order to make changes to how flows are defined and used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-12 15:08:42 -08:00
Jens Axboe 4c63f5646e Merge branch 'for-2.6.39/stack-plug' into for-2.6.39/core
Conflicts:
	block/blk-core.c
	block/blk-flush.c
	drivers/md/raid1.c
	drivers/md/raid10.c
	drivers/md/raid5.c
	fs/nilfs2/btnode.c
	fs/nilfs2/mdt.c

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-03-10 08:58:35 +01:00
Jens Axboe 7eaceaccab block: remove per-queue plugging
Code has been converted over to the new explicit on-stack plugging,
and delay users have been converted to use the new API for that.
So lets kill off the old plugging along with aops->sync_page().

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-03-10 08:52:07 +01:00
Jens Axboe a488e74976 scsi: convert to blk_delay_queue()
It was always abuse to reuse the plugging infrastructure for this,
convert it to the (new) real API for delaying queueing a bit. A
default delay of 3 msec is defined, to match the previous
behaviour.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-03-10 08:45:54 +01:00
David S. Miller 0a0e9ae1bd Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/bnx2x/bnx2x.h
2011-03-03 21:27:42 -08:00
Dimitris Michailidis 1558310d49 cxgb{3,4}*: improve Kconfig dependencies
- Remove the dependency of cxgb4 and cxgb4vf on INET.  cxgb3 really
  depends on INET, keep it but add it directly to the driver's Kconfig
  entry.
- Make the iSCSI drivers cxgb3i and cxgb4i available in the SCSI menu
  without requiring any options in the net driver menu to be enabled
  first.  Add needed selects so the iSCSI drivers can build their
  corresponding net drivers.
- Remove CHELSIO_T*_DEPENDS.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-02 22:22:51 -08:00
David S. Miller b23dd4fe42 ipv4: Make output route lookup return rtable directly.
Instead of on the stack.

Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-02 14:31:35 -08:00
Tejun Heo 1654e7411a block: add @force_kblockd to __blk_run_queue()
__blk_run_queue() automatically either calls q->request_fn() directly
or schedules kblockd depending on whether the function is recursed.
blk-flush implementation needs to be able to explicitly choose
kblockd.  Add @force_kblockd.

All the current users are converted to specify %false for the
parameter and this patch doesn't introduce any behavior change.

stable: This is prerequisite for fixing ide oops caused by the new
        blk-flush implementation.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jan Beulich <JBeulich@novell.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-03-02 08:48:05 -05:00
Sergei Shtylyov 9cbe056f6c libata: remove ATA_FLAG_NO_LEGACY
All checks of ATA_FLAG_NO_LEGACY have been removed by the commits
c791c30670 ([libata] minor PCI IDE probe
fixes and cleanups) and f0d36efdc6 (libata:
update libata core layer to use devres), so I think it's time to finally
get rid of this flag...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-03-02 02:36:46 -05:00
Sergei Shtylyov 3696df3099 libata: remove ATA_FLAG_MMIO
Commit 0d5ff56677 (libata: convert to iomap)
removed all checks of ATA_FLAG_MMIO but neglected to remove the flag itself.
Do it now, at last...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-03-02 02:36:46 -05:00
Sergei Shtylyov c10f97b9d8 libata: remove ATA_FLAG_{SRST|SATA_RESET}
These flags are marked as obsolete and the checks for them have been removed
by commit 294440887b (libata-sff: kill unused
ata_bus_reset()), so I think it's time to finally get rid of them...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-03-02 02:36:46 -05:00
Sergei Shtylyov 0f2e0330a8 ipr/sas_ata: use mode mask macros from <linux/ata.h>
Commit 14bdef982c ([libata] convert drivers to
use ata.h mode mask defines) didn't convert these two libata driver outside
drivers/ata/...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-03-02 02:36:46 -05:00
James Bottomley 00dd4998a6 libsas: convert to libata new error handler
The conversion is quite complex given that the libata new error
handler has to be hooked into the current libsas timeout and error
handling.  The way this is done is to process all the failed commands
via libsas first, but if they have no underlying sas task (and they're
on a sata device) assume they are destined for the libata error
handler and send them accordingly.

Finally, activate the port recovery of the libata error handler for
each port known to the host.  This is somewhat suboptimal, since that
port may not need recovering, but given the current architecture of
the libata error handler, it's the only way; and the spurious
activation is harmless.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-03-02 02:36:45 -05:00
Arnd Bergmann 5edc341313 drivers: remove extraneous includes of smp_lock.h
These were missed the last time I cleaned this up
globally, because of code moving around or new code
getting merged.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2011-03-02 00:02:40 +01:00
David S. Miller 273447b352 ipv4: Kill can_sleep arg to ip_route_output_flow()
This boolean state is now available in the flow flags.

Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-01 14:27:04 -08:00
David S. Miller 420d44daa7 ipv4: Make final arg to ip_route_output_flow to be boolean "can_sleep"
Since that is what the current vague "flags" argument means.

Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-01 14:19:23 -08:00
Bhanu Gollapudi 853e2bd210 [SCSI] bnx2fc: Broadcom FCoE offload driver
This driver is for Broadcom Netxtreme II 57712 chip. The following
patch contains the driver sources for bnx2fc driver.  libfc/libfcoe
changes to enable bnx2fc have already gone through the fcoe
tree. bnx2fc is a SCSI low level driver that interfaces with SCSI
midlayer, libfc, libfcoe, cnic modules.  bnx2fc driver uses services
of libfc for slow path operations such as FIP and fabric
discovery. The fast path IO perations are performed after offloading
the session information to the underlying FCoE firmware.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 18:40:27 -06:00
Vasu Dev d2f809528a [SCSI] fcoe: fix broken fcoe interface reset
Reset using "fcoeadm -r" also needs to restart FIP before
doing libfc lport reset, this is needed for new switch firmware
requiring FIP solicitation before doing FLOGI again during reset.
So this patch does this by doing fcoe_ctlr_link_down and then
fcoe_ctlr_link_up to reset the interface.

The fcoe_ctlr_link_down call path also does lport reset
and then fcoe_ctlr_link_up re-starts the fabric login after
doing FIP solicitation first to get reset feature working
again.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 18:34:18 -06:00
Dan Carpenter f2f96d2070 [SCSI] fcoe: precedence bug in fcoe_filter_frames()
Negate has higher precedence than bitwise AND.  FCPHF_CRC_UNCHECKED is
0x1 so the original code is equivalent to: if (!fr_flags(fp)) { ...

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 18:34:03 -06:00
Bhanu Prakash Gollapudi 70be6344ea [SCSI] libfcoe: Remove stale fcoe-netdev entries
When L2 driver is unloaded, libfcoe_destroy tries to access the fcoe
transport structure matching the netdev. However, since the netdev is
unregistered by that time, it fails to do so. Hence the stale mappings
exists in the fcoe-netdev list. Handle NETDEV_UREGISTER device
notification mechanism to remove the stale fcoe-netdev mapping.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 18:33:46 -06:00
Bhanu Prakash Gollapudi f4d2b2b6ea [SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h
both fcoe and bnx2fc drivers can access the common definition of
FCOE_MTU.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 18:33:12 -06:00
Vasu Dev 72fa396bf5 [SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs
EM anchors list initialization for only master port was not enough to
keep npiv working as described here:-
https://lists.open-fcoe.org/pipermail/devel/2011-January/011063.html

So this patch moves fc_exch_mgr_list_clone to update npiv ports
EMs once EM anchors list initialized.

Also some cleanup, no need to set lport = NULL as that always
get initialized later.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 18:31:53 -06:00
Parikh, Neerav f31624831a [SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out"
When abort for an exchange timed out it didn't release the reference to
the exchange resulting in a memory leak.

After discussion with the author of the patch (CC) that introduced this
bug it was suggested to revert that patch.

This reverts commit ea3e2e72ee.

Signed-off by: Neerav Parikh <Neerav.Parikh@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 18:31:13 -06:00
Parikh, Neerav fe5e3f1aec [SCSI] libfc: Fixing a memory leak when destroying an interface
When an fcoe interface is being destroyed; in the process the
fcoe driver will try to release all the resources it had allocated
for that interface including rports. But, it seems that it does not
release the reference held for the name server rport in that process
resulting into a memory leak. This patch fixes that memory leak.

Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 18:28:45 -06:00
adam radford 00fa2b191b [SCSI] megaraid_sas: Version and Changelog update
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 12:05:07 -06:00
adam radford ebf054b00b [SCSI] megaraid_sas: Fix iMR OCR support to work correctly
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 12:04:14 -06:00
adam radford 42a8d2b34d [SCSI] megaraid_sas: Fix max_sectors for IEEE SGL
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 12:02:52 -06:00
adam radford 1ac515ef3f [SCSI] megaraid_sas: Fix fault state handling
The following patch for megaraid_sas fixes fault state handling in
megasas_transition_to_ready().

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 12:01:41 -06:00
adam radford f86c5424b0 [SCSI] megaraid_sas: Fix tasklet_init call
The following patch fixes an incorrect tasklet_init() call in
megasas_init_fw() to use instancet->tasklet.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 12:00:35 -06:00
adam radford 4c598b2380 [SCSI] megaraid_sas: Add CFG_CLEARED AEN
The following patch for megaraid_sas adds a missing check for
MR_EVT_CFG_CLEARED in megasas_aen_polling().

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:57:44 -06:00
adam radford eaa3c240de [SCSI] megaraid_sas: Fix megasas_build_dcdb_fusion to use correct LUN field
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:56:22 -06:00
adam radford f512440589 [SCSI] megaraid_sas: Fix megasas_build_dcdb_fusion to not filter by TYPE_DISK
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:53:53 -06:00
adam radford 66192dfe1e [SCSI] megaraid_sas: Fix probe_one to clear MSI-X flags in kdump
The following patch for megaraid_sas fixes megasas_probe_one() to
clear MSI-X flags in kdump when the 'reset_devices' kernel parameter
is passed in.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:47:48 -06:00
adam radford e1419191d8 [SCSI] megaraid_sas: Call tasklet_schedule for MSI-X
The following patch for megaraid_sas calls tasklet_schedule() even if
outbound_intr_status == 0 for MFI based boards in MSI-X mode.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:46:53 -06:00
adam radford 0a77066acc [SCSI] megaraid_sas: Enable MSI-X before calling megasas_init_fw
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:45:54 -06:00
adam radford 53ef2bbd20 [SCSI] megaraid_sas: Add missing check_and_restore_queue_depth call
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:43:58 -06:00
adam radford eb1b123773 [SCSI] megaraid_sas: Fix failure gotos
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:42:36 -06:00
jack_wang 183ce896d7 [SCSI] libsas: fix loopback topology bug during discovery
In some test envirenment, there is loopback topology test. We should
handle this during discovery.

Signed-off-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:40:34 -06:00
Mike Christie 3496343df5 [SCSI] lpfc: block target when port queueing limit is hit
Instead of blocking the entire host when the port's
queueing limit is hit, we should only block the port's
target. This will allow IO to other ports to execute.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: James Smart  <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:21:53 -06:00
Mike Christie f55ca84d92 [SCSI] lpfc: force retry in queuecommand when port is transitioning
If the port takes a while to transition we could exhaust
the retries when using DID_TRANSPORT_DISRUPTED. For this
case we do not want to use any of the cmd's
retries, because if the command was running then when
it got failed the retry counter was already incremented.
And if this is the first time we are seeing the command,
(it got queued because it slipped through during the race)
then it should not have its retries incremented. The
fc class will decide the correct handling later.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: James Smart  <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-28 11:17:44 -06:00
Grant Likely 4ebb24f707 dt/sparc: Eliminate users of of_platform_{,un}register_driver
Get rid of old users of of_platform_driver in arch/sparc.  Most
of_platform_driver users can be converted to use the platform_bus
directly.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-02-28 01:36:39 -07:00
Madhuranath Iyengar 76f0c37a26 [SCSI] qla2xxx: Update version number to 8.03.07.00
We'll be using the new version number scheme from now on.
The 'k' in the version in the past will be removed.

The format will be: <major>.<minor>.<sub_minor>.<iter>
A scsi-misc submission increments <sub_minor> and resets <iter>.
An scsi-rc-fixes submission, increments <iter>.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 13:01:18 -05:00
Andrew Vasquez 4e98d3b8ac [SCSI] qla2xxx: Check return value of fc_block_scsi_eh()
The fc_block_scsi_eh() might return with status FAST_IO_FAIL
indicating I/O has been terminated due to fast_io_fail timeout.
In this case the rport is still blocked, so any error recovery
will be failing on this port. Hence we need to check if the
return value from fc_block_scsi_eh() is something other than 0,
in which case it should just return with that status.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 13:00:57 -05:00
Saurav Kashyap e46ef004f8 [SCSI] qla2xxx: The ISP82XX should be online while waiting for commands completion.
If adapter is not online, the driver will not process the response queue, even
on getting an interrupt.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 13:00:38 -05:00
Andrew Vasquez ff2fc42e74 [SCSI] qla2xxx: Propagate block-layer tags on submitted I/Os.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 13:00:08 -05:00
Andrew Vasquez 97dec564fd [SCSI] qla2xxx: Adjust FCP_RSP response-info field check after TMF completion.
Based on reading of the FCP2/4 specification, the driver cannot
expect the storage device to send FCP_RSP information. Instead,
the driver should interpret the data which is present in the frame
to base decisions on the success or failure of the system.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:59:13 -05:00
Andrew Vasquez 6aef87bea9 [SCSI] qla2xxx: Clear any stale login-states during an adapter reset.
By not clearing the 'login needed' nor 'login outstanding' states
for an fcport after a big-hammer (adapter reset), the driver may
not properly perform a PLOGI/PRLI sequence (and lose visibility
to the rport) during a follow-on SNS scan.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:58:18 -05:00
Andrew Vasquez 7a78ceda1c [SCSI] qla2xxx: Pass right CT command string for CT status processing.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:56:11 -05:00
Giridhar Malavali 862cd01e5c [SCSI] qla2xxx: Don't wait for active mailbox command completion when firmware is hung.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:53:49 -05:00
Giridhar Malavali 7190575f7a [SCSI] qla2xxx: Abort pending commands for faster recovery during ISP reset.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:51:44 -05:00
Giridhar Malavali cf2d771255 [SCSI] qla2xxx: Display nport_id when any SNS command fails.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:48:14 -05:00
Giridhar Malavali 0060ddf8f7 [SCSI] qla2xxx: Reinitialize the device initialize timeout value after reset on ISP82xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:41:37 -05:00
Chad Dupuis 7c8cf2fee1 [SCSI] qla2xxx: Fix array subscript is above array bounds in qla2xx_build_scsi_type_6_iocbs().
The additional increment of dsd_seg was causing the compiler to throw an array
out of bounds warning. This patch moves to a direct assignment of
cmd_pkt->fcp_data_dseg_len so that the compiler doesn't generate an array out
bounds warning.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:24:59 -05:00
Madhuranath Iyengar f5e3e40b39 [SCSI] qla2xxx: Remove host_lock in queuecommand function
Also in qla_os.c, rename the function, remove DEF_SCSI_QCMD, etc.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-25 12:21:52 -05:00
Mike Christie c7f7fd5b7e [SCSI] be2iscsi: fix null ptr ref in conn get param
The ep_disconnect function could be freeing the ep
while beiscsi_conn_get_param is running. This has
the driver use the get ep param callback instead
of the get conn param to fix this.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:41:26 -05:00
Mike Christie d8585bcd7d [SCSI] bnx2i: fix null ptr ref in conn get param
bnx2i has some checks to try and make sure the ep
is not destroyed while the addr/port is getting
read. However, if after this check:

if (!(bnx2i_conn && bnx2i_conn->ep && bnx2i_conn->ep->hba))
	goto out;

bnx2i_conn->ep is cleared by ep_disconnect then we will
oops.

This patches fixes the problem by having the driver
use the get_ep_param callback instead of get_conn_param.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:41:20 -05:00
Mike Christie c71b9b669e [SCSI] cxgbi: convert to use iscsi_conn_get_addr_param
This has cxgbi use the iscsi_conn_get_addr_param helper
and the get ep callback.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:41:15 -05:00
Mike Christie 289324b0c6 [SCSI] iscsi class: add callout to get iscsi_endpoint values
For drivers using the ep callbacks the addr and port
are attached to the endpoint instead of the conn.
This adds a callout to the iscsi_transport to get
ep values. It also adds locking around the get
param call to make sure that ep_disconnect does
not free the LLD's ep interconnect structs from
under us (the ep has a refcount so it will not
go away but the LLD may have structs from other
subsystems that are not allocated in the ep so
we need to protect them from getting freed).

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:41:12 -05:00
Mike Christie a79af8a64d [SCSI] iscsi_tcp: use iscsi_conn_get_addr_param libiscsi function
This has iscsi_tcp use the iscsi_conn_get_addr_param
libiscsi function. It also drops the use of the libiscsi
session portal buffers, so they can be removed in
the next patches. Instead of copying the values
at bind time we get them during get() time. If we are
not connected userspace will now get -ENOTCONN,
so it knows that connection is disconnected instead
of a possible stale value.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:41:10 -05:00
Mike Christie 00f3708e6e [SCSI] libiscsi: add helper to convert addr to string
This adds a helper to convert a addr struct to
a string. This will be used by the drivers in
the next patches.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:41:08 -05:00
Mike Christie bbc5261b2c [SCSI] iscsi class: remove unused active variable
The active variable on the iscsi_cls_conn is not used
so this patch removes it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:41:07 -05:00
Mike Christie 22a39fbbfe [SCSI] iscsi: fix iscsi_endpoint leak
When iscsid restarts it does not know the connection's
endpoint, so it is getting leaked. This fixes the problem
by having the iscsi class force a disconnect before a
new connection is bound.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:41:05 -05:00
Mike Christie fdafd4dfc7 [SCSI] cxgbi: enable TEXT PDU support
cxgb3i and cxgb4i support TEXT PDU offloading, so set
the bits to enable it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:40:36 -05:00
Eddie Wai fc336387db [SCSI] bnx2i: Updated to version 2.6.2.3
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:40:26 -05:00
Eddie Wai 09813ba5bc [SCSI] bnx2i: Added iSCSI text pdu support for iSCSI offload
This is part of an effort to support send target discovery via
the iSCSI offload path.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:40:05 -05:00
Eddie Wai 45188354eb [SCSI] bnx2i: Added jumbo MTU support for the no shost case
For scenarios where the shost is not being passed to bnx2i for the
iSCSI offload connection request, the code would consult the routing
table to select the CNIC device.
This code path will erroneously error out if the corresponding L2
interface's MTU has been setup to > 1500.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:39:30 -05:00
Eddie Wai 8a4a0f3ad0 [SCSI] bnx2i: Added support for the 57712(E) devices
Moved all PCI_DEVICE_ID_NX2_57712(E) definitions to pci_ids.h

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:39:08 -05:00
Eddie Wai a977d2c9dc [SCSI] bnx2i: Added handling for unsupported iSCSI offload hba
The hba will now be unregistered and freed when iSCSI offload
is not supported by the NIC.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:38:52 -05:00
Eddie Wai ee15bd2da6 [SCSI] bnx2i: Fixed the 32-bit swapping of the LUN field for nopouts for 5771X
Fixed a bug where the 64-bit LUN field for nopouts were 32-bit swapped.
This only pertains to 5771X devices.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:38:29 -05:00
Eddie Wai ec8933b4bc [SCSI] bnx2i: Allow ep CONNECT_FAILED condition to go through proper cleanup
Allow CNIC to go through the proper cleanup procedure for an endpoint
which failed to connect.  Proper cleanup is necessary for the chip
to reset back to the initial state for the offloaded endpoint.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-24 12:38:02 -05:00
Tejun Heo 43d133c18b Merge branch 'master' into for-2.6.39 2011-02-21 09:43:56 +01:00
James Smart 6fc124697a [SCSI] lpfc 8.3.21: Change lpfc driver version to 8.3.21
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 15:36:34 -06:00
James Smart 2a622bfbe1 [SCSI] lpfc 8.3.21: Debugfs additions
- Add the driver debugfs framework for supporting debugfs read and write
  operations, and iDiag command structure.
- Add read and write to SLI4 device PCI config space registers.
- Add the driver support of debugfs PCI config space register bits set/clear
  methods to the provided bitmask.
- Add iDiag driver support for SLI4 device queue diagnostic.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 15:36:33 -06:00
James Smart ab56dc2e1d [SCSI] lpfc 8.3.21: Initialization and user interface changes
- Make link speed not supported by port message an error message.
- Add support for new SLI failure codes add sysfs parameter to reflect the
  security setting and current state.
- Add all lpfc module parameters to the /sys/modules/lpfc/parameters directory.

[jejb: fix up compile failure]
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 15:35:52 -06:00
James Smart 924941444b [SCSI] lpfc 8.3.21: FC Discovery changes
FC Discovery changes

- Treat received PLOGI while logged in as a relogin (unregister and reregister).
- Added a timer to delay Nport discovery when clean bit is cleared and Fabric
  portname/nodename/FCID is changed.
- Invalidate Port's DID when receiving PLOGI from p2p port with CONFIG_PORT
  mailbox command.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:47:20 -06:00
James Smart 1151e3ec15 [SCSI] lpfc 8.3.21: RRQ Implementation fixes
RRQ Implementation fixes

- Added checks to prevent a call to findnode_did in clr_active_rrq
- Added the del_sync_timer call for the rrq_tmr to the stop_hba_timers routine.
- Added a check in __lpfc_set_active_rrq for the driver unloading to prevent
  adding an rrq when the driver is being removed.
- Add code to scsi_iocb_cmpl to check for the remote stop and add the rrq.
- Added the same check to els retry.
- Added code to compare the source did in the els rrq to the vports did and
  chose the right exchange ID.
- Initialize the start_cmd pointer to indicate when we have looped through
  all of the scsi buffers.
- Remove the need for the lock around the clearing of the active bit in the
  rrq.
- Added code to clean the els and fcp xri aborted list and remove the all of
  the RRQs for a deleted vport.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:45:21 -06:00
James Smart fedd3b7b93 [SCSI] lpfc 8.3.21: Critical Errors and Bug Fixes
Critical Errors:
- Correctly handle non-zero return lpfc_workq_post_event and return ENOMEM
- Save the irq level when locking the host_lock in lpfc_findnode_did

Bug Fixes:
- Adjust payload_length and request_length for sli4_config mailbox commands.
- Add the freed sgl/XRI to the tail of the list rather than to the head.
- Set the FC_VPORT_NEEDS_INIT_VPI on vport deletes and check it before
  issuing a fdisc on an els retry.
- Only call lpfc_hba_init_link() if phba->cfg_suppress_link_up
  is LPFC_INITIALIZE_LINK.
- Add support for SLI-4 Performance Hints

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:39:18 -06:00
Dan Carpenter 382be668c5 [SCSI] hpsa: fix bad comparison
'!' has higher precedence than '&'.  CFGTBL_ChangeReq is 0x1 so the
original code is equivelent to if (!doorbell_value) {...

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:34:38 -06:00
Stephen M. Cameron ba95e2ac6b [SCSI] hpsa: Do not attempt kdump if we detect resetting controller failed.
We can get completions left over from before the attempted reset which
will interfere with the kdump.  Better to just not make the attempt in
that case.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:34:14 -06:00
Stephen M. Cameron 960a30e7a7 [SCSI] hpsa: Inform controller we are using 32-bit tags.
Controller will transfer only 32-bits on completion if it
knows we are only using 32-bit tags.  Also, some newer controllers
apparently (and erroneously) require that we only use 32-bit tags,
and that we inform the controller of this.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:33:52 -06:00
Stephen M. Cameron 745a7a25bc [SCSI] hpsa: Add transport_mode host attribute in /sys
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:33:06 -06:00
Stephen M. Cameron a9a3a2739a [SCSI] hpsa: make hpsa.hpsa_simple_mode=1 module parameter actually work
It's not enough to simple avoid putting the board into performant
mode, as we have to set up the interrupts differently, etc.  When
I originally tested this module parameter, I tested it incorrectly
without realizing it, and the driver was running in performant mode
the whole time unbeknownst to me.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:32:30 -06:00
Stephen M. Cameron 9e0fc764ea [SCSI] hpsa: do not re-order commands in internal queues
Driver's internal queues should be FIFO, not LIFO.
This is a port of an almost identical patch from cciss by Jens Axboe.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:31:19 -06:00
Kleber Sacilotto de Souza 5767a1c498 [SCSI] ipr: Fix a race on multiple configuration changes
In a multiple configuration change scenario a remove notification can be
followed by an immediate add notification for the same device, which
will cause the device to be removed but never added back. This patch
fixes the problem by ensuring that in such situations the device will be
added back.

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-18 12:29:15 -06:00
Justin P. Mattock cd09b2c3d0 drivers:scsi Change printk typo initate -> initiate
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-02-17 17:42:17 +01:00
Andrew Vasquez 1621dbbdb9 [SCSI] qla2xxx: Return DID_NO_CONNECT when FC device is lost.
If the target device gets lost, this fix is needed, as it causes
negative unintended responses on basic I/O tests. If the target device
gets lost, the upstream qla2xxx driver returns
SCSI_MLQUEUE_TARGET_BUSY which causes an immediate retry without drop
in the number of allowed retries. This semantic change, as a result of
removing FC_DEVICE_LOST check is reasonable, as it only extends a
short transitional period, until the transport is called to notify
that the rport as lost (fc_remote_port_delete()). Once transport
notification is done, fc_remote_port_chkready() check will take over.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-15 11:12:17 -06:00
Jiri Kosina 0a9d59a246 Merge branch 'master' into for-next 2011-02-15 10:24:31 +01:00
James Bottomley c299190b93 [SCSI] libsas: convert to libata new error handler
The conversion is quite complex given that the libata new error
handler has to be hooked into the current libsas timeout and error
handling.  The way this is done is to process all the failed commands
via libsas first, but if they have no underlying sas task (and they're
on a sata device) assume they are destined for the libata error
handler and send them accordingly.

Finally, activate the port recovery of the libata error handler for
each port known to the host.  This is somewhat suboptimal, since that
port may not need recovering, but given the current architecture of
the libata error handler, it's the only way; and the spurious
activation is harmless.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-13 13:17:46 -06:00
Moger, Babu a0b990c62c [SCSI] scsi_dh_rdac : Adding MODULE VERSION for rdac device handler
Adding MODULE_VERSION for scsi_dh_rdac. This will be helpful sometimes
to get the code level without looking at the code.

Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 14:14:11 -06:00
Hillf Danton 9dfeb3157e [SCSI] scsi_dh: cosmetic change to sizeof()
instead of doing sizeof(struct X) it's better to do sizeof(*v) where v
is the variable pointing to struct X.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 14:13:34 -06:00
Moger, Babu 04b6e153b6 [SCSI] scsi_dh_rdac: fix for lun_table update for rdac device handler
During one of our testing, we noticed that mode select command sent
from the host did not have the lun_table updated.

Problem is root caused to the way lun table is updated. Lun table
update was done after the call to blk_rq_map_kern is made. This was
causing problem because kernel uses bounce buffer(bio_copy_kern) if
the address is not aligned.  The command buffer updated after the
call(blk_rq_map_kern) was not going on the wire. Moved the code to
update the lun_table before the call to fix the problem.

Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Signed-off-by: Yanling Qi <Yanling.Qi@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 14:05:08 -06:00
Darrick J. Wong a361cc0025 [SCSI] scsi_debug: Fix 32-bit overflow in do_device_access causing memory corruption
If I create a scsi_debug device that is larger than 4GB, the multiplication of
(block * scsi_debug_sector_size) can produce a 64-bit value.  Unfortunately,
the compiler sees two 32-bit quantities and performs a 32-bit multiplication,
thus truncating the bits above 2^32.  This causes the wrong memory location to
be read or written.  Change block and rest to be unsigned long long.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:21:56 -06:00
Bhanu Prakash Gollapudi 8597ae8bfe [SCSI] libfcoe: Move common code from fcoe to libfcoe module
To facilitate LLDDs to reuse the code, skb queue related functions are moved to
libfcoe, so that both fcoe and bnx2fc drivers can use them. The common structures
fcoe_port, fcoe_percpu_s are moved to libfcoe. fcoe_port will now have an
opaque pointer that points to corresponding driver's interface structure.
Also, fcoe_start_io and fcoe_fc_crc are moved to libfcoe.

As part of this change, fixed fcoe_start_io to return ENOMEM if
skb_clone fails.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:18:18 -06:00
Tejun Heo 2ca32b4848 [SCSI] fcoe: use dedicated workqueue instead of system_wq
fcoe uses the system_wq to destroy ports and the work items need to be
flushed before the driver is unloaded.  As the work items free the
containing data structure, they can't be flushed directly.  The
workqueue should be flushed instead.

Also, the destruction works can be chained - ie. destruction of a port
may lead to destruction of another port where the work item for the
former queues the work for the latter.  Currently, the depth of chain
can be at most two and fcoe_exit() makes sure everything is complete
by calling flush_scheduled_work() twice.

With commit c8efcc25 (workqueue: allow chained queueing during
destruction), destroy_workqueue() can take care of chained works on
workqueue destruction.  Add and use fcoe_wq instead.  Simply
destroying fcoe_wq on driver unload takes care of flushing.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:17:50 -06:00
Bhanu Prakash Gollapudi 75a2792df2 [SCSI] libfc: introduce LLD event callback
This patch enables LLD to listen to rport events and perform LLD
specific operations based on the rport event. This patch also stores
sp_features and spp_type in rdata for further reference by LLD.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:09:04 -06:00
Kiran Patil acc1a92165 [SCSI] libfc: Extending lport's roles for target if there is a registered target.
Problem:

From initaitor machine, when queried role of target (other end of connection),
it is "initiator", hence SCSI-ml doesn't send any LUN Inquiry commands.

Fix:

If there is a registered target for FC_TYPE_FCP, extend lport's params
(capability) to be target as well, By default lport params are
INITIATOR only. Having this fix, caused initiator to send SCSI LUN
inquiry command to target.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:08:22 -06:00
Yi Zou 78a582463c [SCSI] fcoe: convert fcoe.ko to become an fcoe transport provider driver
Remove the existing sysfs entry points of the fcoe.ko module parameters that
are used to create/destroy/enable/disable an FCoE instance, rather, use the
newly added fcoe transport code to attach itself as an FCoE transport provider
when fcoe.ko gets loaded. There is no functionality change on the logic of
fcoe interacts with upper libfc and lower netdev. The fcoe transport only acts
as thin layer to provide a unified interface for all fcoe transport providers
so all FCoE instances on any network interfaces from all vendors can be
managed through the same Open-FCoE.org's user space tool package, which also
has full DCB support.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:07:33 -06:00
Yi Zou 8ca86f84dd [SCSI] fcoe: prepare fcoe for using fcoe transport
Prepare the fcoe to convert it to use the newly added fcoe transport, making
it as the default fcoe transport provider for libfcoe. This patch is to rename
some of the variables to avoid any confusing names later as now there are
several transports in the same file.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:07:11 -06:00
Yi Zou e01efc33bc [SCSI] libfcoe: include fcoe_transport.c into kernel libfcoe module
Now we can include the fcoe_transport.c to the build of the kernel libfcoe
module. Move the module information to fcoe_transport, and it will have
all the module parameters later for the create/destroy/enable/disable of an
FCoE instance.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:06:52 -06:00
Yi Zou 0095a92133 [SCSI] libfcoe: rename libfcoe.c to fcoe_cltr.c for the coming fcoe_transport.c
The existing libfcoe.c is mostly for FIP support, rename it to reflect that
fact and so we can add fcoe_transport.c to the make file to include both
into the libfcoe kernel module.

[ Minor modifications by Robert Love converting a few
  "__attribute__((packed))" modifiers to "__packed" to remove new
  checkpatch.pl WARNINGS ]

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:06:25 -06:00
Yi Zou fdecf31b7c [SCSI] libfcoe: add implementation to support fcoe transport
Add the new fcoe_transport.c file that implements basic fcoe transport
interface. Eventually, the sysfs entries to create/destroy/enable/disable
an FCoE instance will be coming to the fcoe transport layer, who does a
look-up to find the corresponding transport provide and pass the corresponding
action over to the identified provider.

The fcoe.ko will become the default fcoe transport provider that can support
FCoE on any given netdev interfaces, as the Open-FCoE.org's default software
FCoE HBA solution. Any vendor specific FCoE HBA driver that is built on top
of Open-FCoE's kernel stack of libfc & libfcoe as well as the user land tool
of fcoe-utils can easily plug-in and start running FCoE on their network
interfaces. The fcoe.ko will be converted to act as the default provider if
no vendor specific transport provider is found, as it is always added to the
very end of the list of attached transports.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:06:06 -06:00
Yi Zou 21b7b2f557 [SCSI] libfcoe: move logging macros into the local libfcoe.h header file
libfcoe kernel module debug macros will used by the fcoe transport code
as well when later it gets added.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:05:22 -06:00
Kiran Patil 6c8cc1c003 [SCSI] libfc: Enhanced exchange ID selection mechanism and fix related EMA selection logic.
Problem:

In case of exchange responder case, EMA selection was defaulted to the
last EMA from EMA list (lport.ema_list).  If exchange ID is selected
from offload pool and not setup DDP, resulting into incorrect
selection of EMA, and eventually dropping the packet because unable to
find exchange.

Fix:

Enhanced the exchange ID selection (depending upon request type and
exchange responder) Made necessary enhancement in EMA selection
algorithm.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:04:27 -06:00
Joe Eykholt 62bdb6455e [SCSI] libfc: export seq_release() for users of seq_assign()
Target modules using lport->tt.seq_assign() get a hold on the
exchange but have no way of releasing it.  Add that.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:03:40 -06:00
Robert Love 04885b16a1 [SCSI] libfc: Remove usage of the Scsi_Host's host_lock
This patch removes the use of the Scsi_Host's host_lock
within fc_queuecommand. It also removes the DEF_SCSI_QCMD
usage so that libfc has fully moved on to the new
queuecommand interface.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Reviewed-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:02:25 -06:00
Joe Eykholt 925cedae2b [SCSI] libfc: use PRLI hook to get parameters when sending outgoing PRLI
When sending an outgoing PRLI as an initiator, get the parameters
from registered providers so that they all get a chance to decide
on roles.

The passive provider is called last, and could override the
initiator role.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:02:22 -06:00
Joe Eykholt 70d53b046a [SCSI] libfc: add hook to notify providers of local port changes
When an SCST provider is registered, it needs to know what
local ports are available for configuration as targets.

Add a notifier chain that is invoked when any local port
that is added or deleted.

Maintain a global list of local ports and add an
interator function that calls a given function for
every existing local port.  This is used when first
loading a provider.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:02:20 -06:00
Joe Eykholt 1a5c2d7e5c [SCSI] libfc: add method for setting handler for incoming exchange
Add a method for setting handler for incoming exchange.
For multi-sequence exchanges, this allows the target driver
to add a response handler for handling subsequent sequences,
and exchange manager resets.

The new function is called fc_seq_set_resp().

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:01:21 -06:00
Joe Eykholt 96ad846445 [SCSI] libfc: add hook for FC-4 provider registration
Allow FC-4 provider modules to hook into libfc, mostly for targets.
This should allow any FC-4 module to handle PRLI requests and maintain
process-association states.

Each provider registers its ops with libfc and then will be called for
any incoming PRLI for that FC-4 type on any instance.   The provider
can decide whether to handle that particular instance using any method
it likes, such as ACLs or other configuration information.

A count is kept of the number of successful PRLIs from the remote port.
Providers are called back with an implicit PRLO when the remote port
is about to be deleted or has been reset.

fc_lport_recv_req() now sends incoming FC-4 requests to FC-4 providers,
and there is a built-in provider always registered for handling
incoming ELS requests.

The call to provider recv() routines uses rcu_read_lock()
so that providers aren't removed during the call.  That lock is very
cheap and shouldn't affect any performance on ELS requests.
Providers can rely on the RCU lock to protect a session lookup as well.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:00:40 -06:00
Randy Dunlap 55204909bb [SCSI] libfc: fix sparse static and non-ANSI warnings
Fix sparse warning for non-ANSI function declaration.
Declare workqueue structs as static.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc:	Robert Love <robert.w.love@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:00:08 -06:00
Vasu Dev 52ee832195 [SCSI] fcoe: drop FCoE LOGO in FIP mode
Allowing FCoE LOGO followed by CVL in this case prevents
FIP login back to the FCF and then keeps lport offline,
only FIP LOGO and CLV needs to be processed while in
FIP mode, therefore this patch drops FCoE LOGO in FIP mode.

Added fcoe_filter_frames() to filter out above mentioned LOGO
in fcoe rx path along with other existing filtering in code
for bad CRC frames. Adding separate fcoe_filter_frames function
helped with better code indentations and if needed then same
will allow adding more filters at one place in future.

This LOGO drop is added after FCP frames passed up to avoid
any additional checks on fast path for this.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 11:00:04 -06:00
Robert Love 7287fb9114 [SCSI] fcoe: Fix module reference count for vports
vports are not grabbing module references but are
releasing them. This causes the module reference count
to decrement too many times and it wraps around past 0.

The solution is to do a module_put() in
fcoe_interface_release() so that the reference is only
released when the fcoe_interface is released. There is a
one-to-one relationship between the N_Port and the
fcoe_interface, so the module reference will only be
dropped when the N_Port is destroyed

To create symetry in the code this patch moves the
try_module_get() call into fcoe_interface_create(). This
means that only the N_Port will grab a reference to the
module when its corresponding fcoe_interface is created.

This patch also makes it so that the fcoe_interface_create()
routine encodes any error codes in the fcoe_interface
pointer returned. This way its caller, fcoe_create(), can
return an accurate error code.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:59:30 -06:00
Venkata Siva Vijayendra Bhamidipati 6da92d3463 [SCSI] fnic: Bumping up fnic version from 1.4.0.145 to 1.5.0.1.
Signed-off-by: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:59:26 -06:00
Venkata Siva Vijayendra Bhamidipati c954f8aed4 [SCSI] fnic: fix memory leak
Fix memory leak arising due to incorrect freeing of allocated memory
for vnic stats when unregistering a vnic.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Venkata Siva Vijayendra Bhamidipati <vbhamidi@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:58:02 -06:00
Dan Carpenter e4a9a98289 [SCSI] libfc:prevent dereferencing ERR_PTR in fc_tm_done()
If we goto out, then it tries to call kfree_skb() on an ERR_PTR which
will oops.  Just return directly.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:57:54 -06:00
Hillf Danton 28a4af1e43 [SCSI] libfc: Cleanup return paths in fc_rport_error_retry
This patch makes it so that we only have one call to
fc_rport_error. This patch does not completely
consolidate return statements, there is still one return
used when not calling fc_rport_error, but alternative
solutions made the code more confusing.

[ Patch modified by Robert Love ]
[ Patch title and commit message edited by Robert Love
  to make it more relevant ]

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:57:22 -06:00
Hillf Danton fa79dbdbdd [SCSI] libfc: Return a valid return code in fc_fcp_pkt_abort()
Here ticks_left is added to record the result of
wait_for_completion_timeout().

[ Patch title and description edited by Robert Love
  to make it more descriptive  ]

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:57:06 -06:00
Yi Zou f56635a869 [SCSI] libfc: always initialize the FCoE DDP exchange id for fsp as FC_XID_UNKNOWN
The fsp's xfer_ddp is used as indication of the exchange id for the DDPed
I/O. We should always initialize it as FC_XID_UNKNOWN for a newly allocated
fsp, otherwise the fsp allocated in fc_fcp, i.e., not from queuecommand like
LUN RESET that is not doing DDP may still think DDP is setup for it since xid
0 is valid and goes on to call fc_fcp_ddp_done() in fc_fcp_resp() from
fc_tm_done(). So, set xfer_ddp as FC_XID_UNKNOWN in fc_fcp_pkt_alloc() now.

Also removes the setting of fsp->lp as it's already done when fsp is allocated.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:56:53 -06:00
Madhuranath Iyengar 044d78e1ac [SCSI] qla2xxx: Change from irq to irqsave with host_lock
Make the driver safer by using irqsave/irqrestore with host_lock.

Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:52:40 -06:00
Hannes Reinecke 63583cca74 [SCSI] Add detailed SCSI I/O errors
Instead of just passing 'EIO' for any I/O error we should be
notifying the upper layers with more details about the cause
of this error.

Update the possible I/O errors to:

- ENOLINK: Link failure between host and target
- EIO: Retryable I/O error
- EREMOTEIO: Non-retryable I/O error
- EBADE: I/O error restricted to the I_T_L nexus

'Retryable' in this context means that an I/O error _might_ be
restricted to the I_T_L nexus (vulgo: path), so retrying on another
nexus / path might succeed.

'Non-retryable' in general refers to a target failure, so this
error will always be generated regardless of the I_T_L nexus
it was send on.

I/O errors restricted to the I_T_L nexus might be retried
on another nexus / path, but they should _not_ be queued
if no paths are available.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:33:08 -06:00
Mike Snitzer 7a1e9d829f [SCSI] scsi_dh_hp_sw: fix deadlock in start_stop_endio
The use of blk_execute_rq_nowait() implies __blk_put_request() is needed
in start_stop_endio() rather than blk_put_request() --
blk_finish_request() is called with queue lock already held.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:31:04 -06:00
Bjørn Mork 98cb7e4413 [SCSI] megaraid_sas: Sanity check user supplied length before passing it to dma_alloc_coherent()
The ioc->sgl[i].iov_len value is supplied by the ioctl caller, and can be
zero in some cases.  Assume that's valid and continue without error.

Fixes (multiple individual reports of the same problem for quite a while):

http://marc.info/?l=linux-ide&m=128941801715301
http://bugs.debian.org/604627
http://www.mail-archive.com/linux-poweredge@dell.com/msg02575.html

megasas: Failed to alloc kernel SGL buffer for IOCTL

and

[   69.162538] ------------[ cut here ]------------
[   69.162806] kernel BUG at /build/buildd/linux-2.6.32/lib/swiotlb.c:368!
[   69.163134] invalid opcode: 0000 [#1] SMP
[   69.163570] last sysfs file: /sys/devices/system/cpu/cpu3/cache/index2/shared_cpu_map
[   69.163975] CPU 0
[   69.164227] Modules linked in: fbcon tileblit font bitblit softcursor vga16fb vgastate ioatdma radeon ttm drm_kms_helper shpchp drm i2c_algo_bit lp parport floppy pata_jmicron megaraid_sas igb dca
[   69.167419] Pid: 1206, comm: smartctl Tainted: G        W  2.6.32-25-server #45-Ubuntu X8DTN
[   69.167843] RIP: 0010:[<ffffffff812c4dc5>]  [<ffffffff812c4dc5>] map_single+0x255/0x260
[   69.168370] RSP: 0018:ffff88081c0ebc58  EFLAGS: 00010246
[   69.168655] RAX: 000000000003bffc RBX: 00000000ffffffff RCX: 0000000000000002
[   69.169000] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88001dffe000
[   69.169346] RBP: ffff88081c0ebcb8 R08: 0000000000000000 R09: ffff880000030840
[   69.169691] R10: 0000000000100000 R11: 0000000000000000 R12: 0000000000000000
[   69.170036] R13: 00000000ffffffff R14: 0000000000000001 R15: 0000000000200000
[   69.170382] FS:  00007fb8de189720(0000) GS:ffff88001de00000(0000) knlGS:0000000000000000
[   69.170794] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   69.171094] CR2: 00007fb8dd59237c CR3: 000000081a790000 CR4: 00000000000006f0
[   69.171439] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   69.171784] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   69.172130] Process smartctl (pid: 1206, threadinfo ffff88081c0ea000, task ffff88081a760000)
[   69.194513] Stack:
[   69.205788]  0000000000000034 00000002817e3390 0000000000000000 ffff88081c0ebe00
[   69.217739] <0> 0000000000000000 000000000003bffc 0000000000000000 0000000000000000
[   69.241250] <0> 0000000000000000 00000000ffffffff ffff88081c5b4080 ffff88081c0ebe00
[   69.277310] Call Trace:
[   69.289278]  [<ffffffff812c52ac>] swiotlb_alloc_coherent+0xec/0x130
[   69.301118]  [<ffffffff81038b31>] x86_swiotlb_alloc_coherent+0x61/0x70
[   69.313045]  [<ffffffffa002d0ce>] megasas_mgmt_fw_ioctl+0x1ae/0x690 [megaraid_sas]
[   69.336399]  [<ffffffffa002d748>] megasas_mgmt_ioctl_fw+0x198/0x240 [megaraid_sas]
[   69.359346]  [<ffffffffa002f695>] megasas_mgmt_ioctl+0x35/0x50 [megaraid_sas]
[   69.370902]  [<ffffffff81153b12>] vfs_ioctl+0x22/0xa0
[   69.382322]  [<ffffffff8115da2a>] ? alloc_fd+0x10a/0x150
[   69.393622]  [<ffffffff81153cb1>] do_vfs_ioctl+0x81/0x410
[   69.404696]  [<ffffffff8155cc13>] ? do_page_fault+0x153/0x3b0
[   69.415761]  [<ffffffff811540c1>] sys_ioctl+0x81/0xa0
[   69.426640]  [<ffffffff810121b2>] system_call_fastpath+0x16/0x1b
[   69.437491] Code: fe ff ff 48 8b 3d 74 38 76 00 41 bf 00 00 20 00 e8 51 f5 d7 ff 83 e0 ff 48 05 ff 07 00 00 48 c1 e8 0b 48 89 45 c8 e9 13 fe ff ff <0f> 0b eb fe 0f 1f 80 00 00 00 00 55 48 89 e5 48 83 ec 20 4c 89
[   69.478216] RIP  [<ffffffff812c4dc5>] map_single+0x255/0x260
[   69.489668]  RSP <ffff88081c0ebc58>
[   69.500975] ---[ end trace 6a2181b634e2abc7 ]---

Reported-by: Bokhan Artem <aptem@ngs.ru>
Reported by: Marc-Christian Petersen <m.c.p@gmx.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: "Benz, Michael" <Michael.Benz@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:31:03 -06:00
Tejun Heo 429305e465 [SCSI] pm8001: simplify workqueue usage
pm8001 manages its own list of pending works and cancel them on device
free.  It is unnecessarily complex and has a race condition - the
works are canceled but not synced, so the work could still be running
during and after the data structures are freed.

This patch simplifies workqueue usage.

* A driver specific workqueue pm8001_wq is created to serve these
  work items.

* To avoid confusion, the "queue" suffixes are dropped from work items
  and functions.

* Delayed queueing was never used.  pm8001_work now uses work_struct
  instead.

* The driver no longer keeps track of pending works.  All pm8001_works
  are queued to pm8001_wq and the workqueue is flushed as necessary.

flush_scheduled_work() usage is removed during conversion.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:31:03 -06:00
Tejun Heo a684b8da35 [SCSI] remove flush_scheduled_work() usages
Simple conversions to drop flush_scheduled_work() usages in
drivers/scsi.  More involved ones will be done in separate patches.

* NCR5380, megaraid_sas: cancel_delayed_work() +
  flush_scheduled_work() -> cancel_delayed_work_sync().

* mpt2sas_scsih: drop unnecessary flush_scheduled_work().

* arcmsr_hba, ipr, pmcraid: flush the used work explicitly instead of
  using flush_scheduled_work().

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:31:02 -06:00
James Bottomley 563585ec4b [SCSI] qla2xxx: Fix race that could hang kthread_stop()
There is a small race window in qla2x00_do_dpc() between
checking for kthread_should_stop() and going to sleep after
setting TASK_INTERRUPTIBLE. If qla2x00_free_device() is called
in this window, kthread_stop will wait forever because there
will be no one to wake up the process.

Fix by making sure we only set TASK_INTERRUPTIBLE before checking
kthread_stop().

Reported-by: Bandan Das <bandan.das@stratus.com>
Acked-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-02-12 10:17:13 -06:00
Justin P. Mattock 8e572bab39 fix typos 'comamnd' -> 'command' in comments
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
2011-02-02 11:31:21 +01:00
Tejun Heo 40f38ffb72 scsi/scsi_tgt_lib: scsi_tgtd isn't used in memory reclaim path
Workqueue scsi_tgtd isn't used during memory reclaim.  Convert to
alloc_workqueue() without WQ_MEM_RECLAIM.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: FUJITA Tomonori <tomof@acm.org>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org
2011-02-01 11:42:42 +01:00
Tejun Heo 278274d544 scsi/be2iscsi,qla2xxx: convert to alloc_workqueue()
Switch to new workqueue interface alloc_workqueue().  These are
identity conversions.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Cc: Jayamohan Kallickal <jayamohank@serverengines.com>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org
2011-02-01 11:42:42 +01:00
Boaz Harrosh 4977c82504 [SCSI] libosd: osd_req_read_sg, optimize the single entry case
Since sg-read is a bidi operation, it is a gain to convert
a single sg entry into a regular read. Better do this in the
generic layer then force each caller to do so.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 12:06:31 -06:00
James Bottomley 1e34c83873 [SCSI] libsas: remove spurious sata control register read/write
Originally, libata required the illusion that it could access the sata
control register.  Now, however, it can run perfectly well without
them, so remove the dummy routines from libsas which tried to emulate
them (but only ended up causing confusion).

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 12:05:45 -06:00
James Bottomley 96db6fa992 [SCSI] libsas: convert to standard kernel debugging
Instead of using a config option for debugging, just dump the
messages with KERN_DEBUG.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 12:05:38 -06:00
James Bottomley 75c0b3867b [SCSI] libsas: fix ATAPI check condition termination
ATAPI check condition needs to be treated the same as a success or
protocol return.  The register returns from the PACKET command are all
correctly positioned in the device to host register FIS and so we
should collect them properly.  Right at the moment this doesn't matter
because libata sends a request sense always for ATAPI errors, but if
it ever checked the registers, we should have the correct contents
just in case.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 12:05:22 -06:00
Peter Jones 940d7faa48 [SCSI] scsi_dh: Use scsi_devinfo functions to do matching of device_handler tables.
Previously we were using strncmp in order to avoid having to include
whitespace in the devlist, but this means "HSV1000" matches a device
list entry that says "HSV100", which is wrong.  This patch changes
scsi_dh.c to use scsi_devinfo's matching functions instead, since they
handle these cases correctly.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 12:02:09 -06:00
Peter Jones 38a039be2e [SCSI] Add scsi_dev_info_list_del_keyed()
For scsi_dh.c to use devinfo lists, we have to be able to remove entries
before rmmod.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 12:01:07 -06:00
James Bottomley 9ee91f7fb5 [SCSI] libsas: fix runaway error handler problem
libsas makes use of scsi_schedule_eh() but forgets to clear the
host_eh_scheduled flag in its error handling routine.  Because of this,
the error handler thread never gets to sleep; it's constantly awake and
trying to run the error routine leading to console spew and inability to
run anything else (at least on a UP system).  The fix is to clear the
flag as we splice the work queue.

Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:52:33 -06:00
kxie@chelsio.com 716163ff90 [SCSI] cxgb3i: fixed connection problem with iscsi private ip
fixed the connection problem when the private iscsi ipv4 address is
provisioned on the interface.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:45:17 -06:00
Eddie Wai 70e1472271 [SCSI] bnx2i: Added reconnect fix connecting against Lefthand targets
The nopout's reserved field was not being initialized to zero
before being reused.  Stale CDB values from previous SCSI cmds
of the same BHS offset was the cause of the disconnection
initiated by the Lefthand target.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:40:30 -06:00
kxie@chelsio.com b8ce8b59b8 [SCSI] cxgbi: get rid of gl_skb in cxgbi_ddp_info
Remove gl_skb from cxgbi_ddp_info as it is only used by cxgb3i.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:38:35 -06:00
kxie@chelsio.com c343a01cca [SCSI] cxgbi: set ulpmode only if digest is on
There is no need to set ulpmode on the tx skbs if no digest is enabled.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:36:00 -06:00
Vasiliy Kulikov 938abd8449 [SCSI] hpsa: avoid leaking stack contents to userland
memset arg64 to zero in the passthrough ioctls to avoid leaking contents
of kernel stack memory to userland via uninitialized padding fields
inserted by the compiler for alignment reasons.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:34:05 -06:00
Stephen M. Cameron 1d5e2ed080 [SCSI] hpsa: Fix problem that CMD_UNABORTABLE command status was treated as unknown
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:33:54 -06:00
Stephen M. Cameron c4f8a299d0 [SCSI] hpsa: fix use of uninitialized variable in hpsa_add_msa2xxx_enclosure_device()
Thanks to Scott Teel for noticing this.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:33:32 -06:00
Stephen M. Cameron 94a136495a [SCSI] hpsa: Add a per controller commands_outstanding entry in /sys
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:31:10 -06:00
Stephen M. Cameron 60d3f5b068 [SCSI] hpsa: use usleep_range not msleep for small sleeps
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:30:56 -06:00
Stephen M. Cameron 02ec19c82e [SCSI] hpsa: allow driver to put controller in either simple or performant mode
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:30:43 -06:00
Stephen M. Cameron 6eaf46fdc7 [SCSI] hpsa: take the adapter lock in hpsa_wait_for_mode_change_ack
Need to take the lock while accessing the register to check to
see if config table changes have taken effect.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:30:26 -06:00
Stephen M. Cameron 25c1e56a04 [SCSI] hpsa: do not reset unknown boards on reset_devices
This is to prevent hpsa from resetting older boards
which the cciss driver may be controlling.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:30:11 -06:00
Stephen M. Cameron 72ceeaecb7 [SCSI] hpsa: limit commands allocated on reset_devices
This is to conserve memory in a memory-limited kdump scenario

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:29:58 -06:00
Stephen M. Cameron 270d05de2b [SCSI] hpsa: Use kernel provided PCI state save and restore functions
and use the doorbell reset method if available (which doesn't
lock up the controller if you properly save and restore all
the PCI registers that you're supposed to.)

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:29:46 -06:00
Stephen M. Cameron fe5389c87f [SCSI] hpsa: fix board status waiting code
After a reset, we should first wait for the board to become "not ready",
and then wait for it to become "ready", instead of immediately
waiting for it to become "ready", and do this waiting *after*
restoring PCI config space registers.  Also, only wait 10 secs
for board to become "not ready" after a reset (it should quickly
become not ready.)

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:29:32 -06:00
Stephen M. Cameron 922a9e4da3 [SCSI] hpsa: Remove duplicate defines of DIRECT_LOOKUP_ constants
They are defined in hpsa_cmd.h

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:29:19 -06:00
Stephen M. Cameron d896f3f3d1 [SCSI] hpsa: fixup DMA address before freeing.
Some low bits might have been set by the driver, causing
a message like this to come out:

 [   13.288062] ------------[ cut here ]------------
 [   13.293211] WARNING: at lib/dma-debug.c:803 check_unmap+0x1a1/0x654()
 [   13.300387] Hardware name: ProLiant DL180 G6
 [   13.305335] hpsa 0000:06:00.0: DMA-API: device driver tries to free
 DMA memory it has not allocated [device address=0x000000007f81e001]
 [size=640 bytes]

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:29:05 -06:00
Stephen M. Cameron b03a7771c8 [SCSI] hpsa: defend against zero sized buffers in passthru ioctls
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:28:48 -06:00
NickCheng 97b991277a [SCSI] arcmsr: Fix the issue of system hangup after commands timeout on ARC-1200
[jejb: fix up patch problems and checkpatch.pl issues]
Signed-off-by: Nick Cheng <nick.cheng@areca.com.tw>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:19:59 -06:00
Mike Snitzer 5fd1062fdf [SCSI] scsi_dh_alua: add scalable ONTAP lun to dev list
Currently NetApp's VID/PID details in the INQUIRY response shows up as
'NETAPP' and 'LUN'.  With upcoming scalable SAN ONTAP version on NetApp
controllers, the PID entry alone is being modified to 'LUN C-Mode' (to
distinguish current ONTAP LUNs from scalable ONTAP LUNs).

'LUN' would still suffice for matching 'LUN C-Mode' but best to
explicitly add these new NetApp LUNs to the device list.

Reported-by: Martin George <marting@netapp.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:13:48 -06:00
Ilgu Hong a3b1eff70b [SCSI] scsi_dh_alua: Add Promise VTrak to dev list
Adds Promise VTrak devices to the ALUA device handler.

Signed-off-by: Ilgu Hong <ilgu.hong@promise.com>
Signed-off-by: Joseph Gruher <joseph.r.gruher@intel.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:13:37 -06:00
Joseph Gruher 9349923d3f [SCSI] scsi_dh_alua: fix stpg_endio group state reporting
Initialize stpg_endio() 'err' to SCSI_DH_OK and only change it to
SCSI_DH_IO accordingly.  This allows the switching of target group state
to be properly reported when no error has occurred.

Signed-off-by: Joseph Gruher <joseph.r.gruher@intel.com>
Signed-off-by: Ilgu Hong <ilgu.hong@promise.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:13:25 -06:00
Joseph Gruher ed0f36bc57 [SCSI] scsi_dh_alua: fix deadlock in stpg_endio
The use of blk_execute_rq_nowait() implies __blk_put_request() is needed
in stpg_endio() rather than blk_put_request() -- blk_finish_request() is
called with queue lock already held.

Signed-off-by: Joseph Gruher <joseph.r.gruher@intel.com>
Signed-off-by: Ilgu Hong <ilgu.hong@promise.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:13:13 -06:00
Joseph Gruher 7c66e9a5e6 [SCSI] scsi_dh_alua: fix submit_stpg return
submit_stpg() will always return failure so alua_activate() will report
failure via dm-multipath callback function.  Even though the stpg fired
successfuly dm-multipath does not know and always fails to change the
valid path.

By returning SCSI_DH_OK we're now skipping alua_activate()'s call to
activate_complete 'fn'.  But this is fine because stpg_endio() will call
it via h->callback_fn().

Signed-off-by: Joseph Gruher <joseph.r.gruher@intel.com>
Signed-off-by: Ilgu Hong <ilgu.hong@promise.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 11:11:58 -06:00
Kashyap, Desai aa023b8b2f [SCSI] mpt2sas: Bump version 08.100.00.00
Upgrade driver version from 7.100.00.00 to 8.100.00.00

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:35:12 -06:00
Kashyap, Desai d5bd3491c8 [SCSI] mpt2sas: Basic Code Cleanup in mpt2sas_base
Basic Code Cleanup:
(1) _base_get_cb_idx and mpt2sas_base_free_smid were reorganized in
similar fashion so the order of obtaining the cbx and smid are
scsiio,
hi_priority, and internal.
(2) The hi_priority and internal request queue struct was made
smaller
by removing the scmd and chain_tracker, thus saving memory
allocation.
(3) For scsiio request, a new structure was created having the same
elements from the former request tracker struct.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:34:49 -06:00
Kashyap, Desai fb396bec76 [SCSI] mpt2sas: Add support for Customer specific branding messages
Add support for Customer specific branding messages when device driver loads,
based on specific customer subsystem vendor and device Ids

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:32:22 -06:00
Kashyap, Desai 9af05d90e9 [SCSI] mpt2sas: Revision P MPI Header Update
Revision P MPI Header Update:
a) Added enable/disable SATA NCQ operations to SAS IO Unit Control
Request.
b) Modified Host Based Discovery Action Request message format.
c) Removed Device Path bit from IO Unit Page 1 Flags field.
d) Added description of ChainOffset field for Diagnostic Data Upload
Tool.Chaining is not allowed.

Removed mpi2_history.txt file

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:32:18 -06:00
Kashyap, Desai 3a9c913a3e [SCSI] mpt2sas: fix Integrated Raid unsynced on shutdown problem
Issue:
IR shutdown(sending) and IR shutdown(complete) messages not
listed in /var/log/messages when driver is removed.

The driver needs to issue a MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED
request when the driver is unloaded so the IR metadata journal is updated.
If this request is not sent, then the volume would need a "check
consistency" issued on the next bootup if the volume was roamed from one
initiator to another. The current driver supports this feature only when the
system is rebooted, however this also need to be supported if the driver is
unloaded

Fix:
To fix this issue, the driver is going
to need to call the _scsih_ir_shutdown prior to reporting
the volumes missing from the OS, hence the device handles
are still present.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:30:29 -06:00
Kashyap, Desai 4224489f45 [SCSI] mpt2sas: Kernel Panic during Large Topology discovery
There was a configuration page timing out during the initial port
enable at driver load time. The port enable would fail, and this would
result in the driver unloading itself, meanwhile the driver was accessing
freed memory in another context resulting in the panic.  The fix is to
prevent access to freed memory once the driver had issued the diag reset
which woke up the sleeping port enable process.  The routine
_base_reset_handler was reorganized so the last sleeping process woken up was
the port_enable.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:28:00 -06:00
Kashyap, Desai ec07a05359 [SCSI] mpt2sas: Fix the race between broadcast asyn event and scsi command completion
False timeout after hard resets, there were two issues which leads
to timeout.
(1) Panic because of invalid memory access in the broadcast asyn
event processing routine due to a race between accessing the scsi command
pointer from broadcast asyn event processing thread and completing
the same scsi command from the interrupt context.
(2)  Broadcast asyn event notifcations are not handled due to events
ignored while the broadcast asyn event is activity being processed
from the event process kernel thread.

In addition, changed the ABRT_TASK_SET to ABORT_TASK in the
broadcast async event processing routine.   This is less disruptive to other
request that generate Broadcast Asyn Primitives besides target
reset. e.g clear reservations, microcode download,and mode select.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:24:28 -06:00
Kashyap, Desai 11e1b961ab [SCSI] mpt2sas: Correct resizing calculation for max_queue_depth
The ioc->hba_queue_depth is not properly resized when the controller
firmware reports that it supports more outstanding IO than what can be fit
inside the reply descriptor pool depth. This is reproduced by setting the
controller global credits larger than 30,000. The bug results in an
incorrect sizing of the queues. The fix is to resize the queue_size by
dividing queue_diff by two.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:22:24 -06:00
Kashyap, Desai efe82a16bc [SCSI] mpt2sas: fix internal device reset for older firmware prior to MPI Rev K
The "internal device reset complete" event is not supported
for older firmware prior to MPI Rev K We added
a check in the driver so the "internal device reset" event is
ignored for older firmware.  When ignored, the tm_busy flag doesn't
get set nor cleared.  Without this fix, IO queues would be froozen
indefinetly after the "internal device reset" event, as the "complete" event
never sent to clear the flag.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:15:38 -06:00
Kashyap, Desai 4dc2757a2e [SCSI] mpt2sas: Fix device removal handshake for zoned devices
When zoning end devices, the driver is not sending device
removal handshake alogrithm to firmware. This results in controller
firmware not sending sas topology add events the next time the device is
added. The fix is the driver should be doing the device removal handshake
even though the PHYSTATUS_VACANT bit is set in the PhyStatus of the
event data. The current design is avoiding the handshake when the
VACANT bit is set in the phy status.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-24 09:12:05 -06:00
Justin P. Mattock 5a3a765886 Comment typo fixes for 'descriptor'
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-01-19 15:37:19 +01:00
Jesper Juhl 2099973abf scsi: Remove unnecessary casts of void ptr returning alloc function return values
The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.

This patch removes such casts from drivers/scsi/

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-01-19 15:26:40 +01:00
Linus Torvalds 38567333a6 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-post-merge-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-post-merge-2.6:
  [SCSI] target: Add LIO target core v4.0.0-rc6
  [SCSI] sd,sr: kill compat SDEV_MEDIA_CHANGE event
  [SCSI] sd: implement sd_check_events()
2011-01-14 16:29:49 -08:00
Linus Torvalds d73b388459 Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI/PM: Report wakeup events before resuming devices
  PCI/PM: Use pm_wakeup_event() directly for reporting wakeup events
  PCI: sysfs: Update ROM to include default owner write access
  x86/PCI: make Broadcom CNB20LE driver EMBEDDED and EXPERIMENTAL
  x86/PCI: don't use native Broadcom CNB20LE driver when ACPI is available
  PCI/ACPI: Request _OSC control once for each root bridge (v3)
  PCI: enable pci=bfsort by default on future Dell systems
  PCI/PCIe: Clear Root PME Status bits early during system resume
  PCI: pci-stub: ignore zero-length id parameters
  x86/PCI: irq and pci_ids patch for Intel Patsburg
  PCI: Skip id checking if no id is passed
  PCI: fix __pci_device_probe kernel-doc warning
  PCI: make pci_restore_state return void
  PCI: Disable ASPM if BIOS asks us to
  PCI: Add mask bit definition for MSI-X table
  PCI: MSI: Move MSI-X entry definition to pci_regs.h

Fix up trivial conflicts in drivers/net/{skge.c,sky2.c} that had in the
meantime been converted to not use legacy PCI power management, and thus
no longer use pci_restore_state() at all (and that caused trivial
conflicts with the "make pci_restore_state return void" patch)
2011-01-14 09:29:05 -08:00
Tejun Heo f4013c3879 [SCSI] sd,sr: kill compat SDEV_MEDIA_CHANGE event
SDEV_MEDIA_CHANGE event was first added by commit a341cd0f (SCSI: add
asynchronous event notification API) for SATA AN support and then
extended to cover generic media change events by commit 285e9670
([SCSI] sr,sd: send media state change modification events).

This event was mapped to block device in userland with all properties
stripped to simulate CHANGE event on the block device, which, in turn,
was used to trigger further userspace action on media change.

The recent addition of disk event framework kept this event for
backward compatibility but it turns out to be unnecessary and causes
erratic and inefficient behavior.  The new disk event generates proper
events on the block devices and the compat events are mapped to block
device with all properties stripped, so the block device ends up
generating multiple duplicate events for single actual event.

This patch removes the compat event generation from both sr and sd as
suggested by Kay Sievers.  Both existing and newer versions of udev
and the associated tools will behave better with the removal of these
events as they from the beginning were expecting events on the block
devices.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-14 09:17:35 -06:00
Tejun Heo 2bae0093ca [SCSI] sd: implement sd_check_events()
Replace sd_media_change() with sd_check_events().

* Move media removed logic into set_media_not_present() and
  media_not_present() and set sdev->changed iff an existing media is
  removed or the device indicates UNIT_ATTENTION.

* Make sd_check_events() sets sdev->changed if previously missing
  media becomes present.

* Event is reported only if sdev->changed is set.

This makes media presence event reported if scsi_disk->media_present
actually changed or the device indicated UNIT_ATTENTION.  For backward
compatibility, SDEV_EVT_MEDIA_CHANGE is generated each time
sd_check_events() detects media change event.

[jejb: fix boot failure]
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-14 09:17:34 -06:00
Linus Torvalds 275220f0fc Merge branch 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block: (43 commits)
  block: ensure that completion error gets properly traced
  blktrace: add missing probe argument to block_bio_complete
  block cfq: don't use atomic_t for cfq_group
  block cfq: don't use atomic_t for cfq_queue
  block: trace event block fix unassigned field
  block: add internal hd part table references
  block: fix accounting bug on cross partition merges
  kref: add kref_test_and_get
  bio-integrity: mark kintegrityd_wq highpri and CPU intensive
  block: make kblockd_workqueue smarter
  Revert "sd: implement sd_check_events()"
  block: Clean up exit_io_context() source code.
  Fix compile warnings due to missing removal of a 'ret' variable
  fs/block: type signature of major_to_index(int) to major_to_index(unsigned)
  block: convert !IS_ERR(p) && p to !IS_ERR_NOR_NULL(p)
  cfq-iosched: don't check cfqg in choose_service_tree()
  fs/splice: Pull buf->ops->confirm() from splice_from_pipe actors
  cdrom: export cdrom_check_events()
  sd: implement sd_check_events()
  sr: implement sr_check_events()
  ...
2011-01-13 10:45:01 -08:00
Linus Torvalds 008d23e485 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
  Documentation/trace/events.txt: Remove obsolete sched_signal_send.
  writeback: fix global_dirty_limits comment runtime -> real-time
  ppc: fix comment typo singal -> signal
  drivers: fix comment typo diable -> disable.
  m68k: fix comment typo diable -> disable.
  wireless: comment typo fix diable -> disable.
  media: comment typo fix diable -> disable.
  remove doc for obsolete dynamic-printk kernel-parameter
  remove extraneous 'is' from Documentation/iostats.txt
  Fix spelling milisec -> ms in snd_ps3 module parameter description
  Fix spelling mistakes in comments
  Revert conflicting V4L changes
  i7core_edac: fix typos in comments
  mm/rmap.c: fix comment
  sound, ca0106: Fix assignment to 'channel'.
  hrtimer: fix a typo in comment
  init/Kconfig: fix typo
  anon_inodes: fix wrong function name in comment
  fix comment typos concerning "consistent"
  poll: fix a typo in comment
  ...

Fix up trivial conflicts in:
 - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
 - fs/ext4/ext4.h

Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.
2011-01-13 10:05:56 -08:00
Linus Torvalds 1542dec1c9 Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  pata_platform: Remove CONFIG_HAVE_PATA_PLATFORM's dependencies.
  pata_hpt37x: actually limit HPT370 to UltraDMA/66
  pata_hpt3x2n: coding style cleanup
  pata_hpt37x: coding style cleanup
  pata_hpt366: coding style cleanup
  pata_hpt3x2n: calculate average f_CNT
  pata_hpt3x2n: clarify about HPT371N support
  pata_hpt{37x|3x2n}: SATA mode filtering
  [libata] avoid needlessly passing around ptr to SCSI completion func
  [libata] new driver acard_ahci, for ATP8620 host controller
2011-01-10 08:22:33 -08:00
Linus Torvalds da40d036fd 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: (147 commits)
  [SCSI] arcmsr: fix write to device check
  [SCSI] lpfc: lower stack use in lpfc_fc_frame_check
  [SCSI] eliminate an unnecessary local variable from scsi_remove_target()
  [SCSI] libiscsi: use bh locking instead of irq with session lock
  [SCSI] libiscsi: do not take host lock in queuecommand
  [SCSI] be2iscsi: fix null ptr when accessing task hdr
  [SCSI] be2iscsi: fix gfp use in alloc_pdu
  [SCSI] libiscsi: add more informative failure message during iscsi scsi eh
  [SCSI] gdth: Add missing call to gdth_ioctl_free
  [SCSI] bfa: remove unused defintions and misc cleanups
  [SCSI] bfa: remove inactive functions
  [SCSI] bfa: replace bfa_assert with WARN_ON
  [SCSI] qla2xxx: Use sg_next to fetch next sg element while walking sg list.
  [SCSI] qla2xxx: Fix to avoid recursive lock failure during BSG timeout.
  [SCSI] qla2xxx: Remove code to not reset ISP82xx on failure.
  [SCSI] qla2xxx: Display mailbox register 4 during 8012 AEN for ISP82XX parts.
  [SCSI] qla2xxx: Don't perform a BIG_HAMMER if Get-ID (0x20) mailbox command fails on CNAs.
  [SCSI] qla2xxx: Remove redundant module parameter permission bits
  [SCSI] qla2xxx: Add sysfs node for displaying board temperature.
  [SCSI] qla2xxx: Code cleanup to remove unwanted comments and code.
  ...
2011-01-07 12:47:02 -08:00
Jeff Garzik b27dcfb067 [libata] avoid needlessly passing around ptr to SCSI completion func
It's stored in struct scsi_cmnd->scsi_done, making several 'done'
parameters to functions redundant.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-01-05 19:43:22 -05:00
roel kluin c32e061fa1 [SCSI] arcmsr: fix write to device check
Use command->sc_data_direction instead of trying (incorrectly) to
figure it out from the command itself

[jejb: fix up compile failure]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: NickCheng <nick.cheng@areca.com.tw>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-03 10:41:18 -06:00
Tomas Henzl 474ffb74c7 [SCSI] lpfc: lower stack use in lpfc_fc_frame_check
according to checkstack the lpfc_fc_frame_check occupies the first
place in stack usage:

make checkstack
objdump -d vmlinux $(find . -name '*.ko') | \
	perl /root/rpmbuild/BUILD/kernel-2.6.32/linux-2.6.32.x86_64/scripts/checkstack.pl x86_64
0x000013f4 lpfc_fc_frame_check [lpfc]:			1936
...
This change makes the rctl_names static, thus not on stack.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-03 10:34:15 -06:00
Alan Stern 41511704b6 [SCSI] eliminate an unnecessary local variable from scsi_remove_target()
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-01-03 10:30:27 -06:00
Justin P. Mattock 48e34d0f4f drivers: fix comment typo diable -> disable.
The below patch fixes a typo "diable" to "disable" and also fixes another typo in a comment.
Please let me know if this is correct or not.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-01-03 16:08:59 +01:00
Mike Christie bfcf72e442 [SCSI] libiscsi: use bh locking instead of irq with session lock
The session lock is taken in threads, timers, and bottom halves
like softirqs and tasklets. All the code but
iscsi_conn/session_failure take the session lock with the spin_lock_bh
call. This was done because I thought some offload drivers
would be calling these functions from a irq. They never did,
so this patch has iscsi_conn/session_failure use the bh
locking.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:53:09 -06:00
Mike Christie f41d472179 [SCSI] libiscsi: do not take host lock in queuecommand
iscsi_tcp, ib_iser, cxgb*, be2iscsi and bnx2i do not use
the host lock and do not take the session lock against
a irq, so this patch drops the DEF_SCSI_QCMD use. Instead
we just take the session lock and disable bhs.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:52:44 -06:00
Mike Christie 1227633a44 [SCSI] be2iscsi: fix null ptr when accessing task hdr
If alloc_pdu fails then the task->hdr pointer may not be
set. This adds a check for this case in the cleanup callback.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:52:42 -06:00
Mike Christie bc7accec87 [SCSI] be2iscsi: fix gfp use in alloc_pdu
The pdu allication callout is called from a spin lock
and in the IO path so we cannot use GFP_KERNEL. This
has the driver use GFP_ATOMIC.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:52:22 -06:00
Mike Christie df4da5cdfc [SCSI] libiscsi: add more informative failure message during iscsi scsi eh
This adds a more informative error code and message
for the iscsi scsi eh session drop paths. This allows
you to distinguish if the session was dropped due to
a connection failure vs the iscsi layer dropping
the session due to scsi eh failure processing.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:51:54 -06:00
Julia Lawall 5c10007560 [SCSI] gdth: Add missing call to gdth_ioctl_free
Add missing call to gdth_ioctl_free before aborting.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression buf,ha,len,addr,E;
@@

buf = gdth_ioctl_alloc(ha, len, FALSE, &addr)
... when != false buf != NULL
    when != true buf == NULL
    when != \(E = buf\|buf = E\)
    when != gdth_ioctl_free(ha, len, buf, addr)
*return ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:50:09 -06:00
Jing Huang 8f4bfadd20 [SCSI] bfa: remove unused defintions and misc cleanups
This patch removes unused functions, data strucutres, and definitions.  It
also includes misc comment and formatting cleanups.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:43:31 -06:00
Jing Huang 2f2f40a458 [SCSI] bfa: remove inactive functions
This patch removes some inactive functions and macros.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:38:53 -06:00
Jing Huang d4b671c58e [SCSI] bfa: replace bfa_assert with WARN_ON
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-31 09:36:53 -06:00
David S. Miller 17f7f4d9fc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	net/ipv4/fib_frontend.c
2010-12-26 22:37:05 -08:00
Linus Torvalds 08da5a32b7 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] fix up documentation for change in ->queuecommand to lockless calling
  [SCSI] bfa: rename log_level to bfa_log_level
2010-12-24 12:58:43 -08:00
Giridhar Malavali aa5cbf8a70 [SCSI] qla2xxx: Use sg_next to fetch next sg element while walking sg list.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:09:47 -06:00
Giridhar Malavali 900a36e327 [SCSI] qla2xxx: Fix to avoid recursive lock failure during BSG timeout.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:09:33 -06:00
Giridhar Malavali 0ce8791149 [SCSI] qla2xxx: Remove code to not reset ISP82xx on failure.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:07:55 -06:00
Andrew Vasquez bc5c2aad17 [SCSI] qla2xxx: Display mailbox register 4 during 8012 AEN for ISP82XX parts.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:07:42 -06:00
Andrew Vasquez 7a44b86e77 [SCSI] qla2xxx: Don't perform a BIG_HAMMER if Get-ID (0x20) mailbox command fails on CNAs.
The semantics we employ now in the driver, performing a
BIG_HAMMER in the event of Get-ID (0x20) mailbox command
failing, should only be done for FC.  On FC configurations, it
makes sense since advertising is only really performed once,
so a BIG_HAMMER to reinitiate the process is needed to
restart.  Under FCoE, this is not needed, as there's a
continous stream of advertisements/ACks at the protocol layer
to initiate a relogin/reinitialization process.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:06:39 -06:00
Joe Carnuccio f2019cb117 [SCSI] qla2xxx: Remove redundant module parameter permission bits
For driver module parameters that have permission bits set to
(S_IRUGO|S_IRUSR), remove the second term since it is already
included in the first term.

S_IRUGO comes defined as (S_IRUSR|S_IRGRP|S_IROTH).

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:06:18 -06:00
Andrew Vasquez 794a569114 [SCSI] qla2xxx: Add sysfs node for displaying board temperature.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:04:37 -06:00
Giridhar Malavali 10fbb7dd36 [SCSI] qla2xxx: Code cleanup to remove unwanted comments and code.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 16:02:22 -06:00
Madhuranath Iyengar c9e8fd5cfb [SCSI] qla2xxx: Fix for memory wedge on fw halt for ISP82XX
Signed-off-by: Swapnil Nagle <swapnil.nagle@qlogic.com>
Signed-off-by: Karen Higgins <karen.higgins@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:56:17 -06:00
Madhuranath Iyengar 21090cbe95 [SCSI] qla2xxx: Update FCP priority information to firmware before sending IOs
The FCP priority info was not being updated properly in certain situations.
Here are the changes that needs to be done to take care of this issue:
1. No need to check fcport->state for FCS_UNCONFIGURED in
qla24xx_update_fcport_fcp_prio(), since an invalid loop id check is
already performed which is sufficient.
2. Add the missing qla24xx_update_fcport_fcp_prio() function call
within qla2x00_update_fcport() function, so that the priority info
is updated on every port addition or change.
3. Perform proper adapter types checking.
4. Other changes, associated with DEBUG/printk's and parameter passing.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:45:02 -06:00
Joe Carnuccio 4052bd5723 [SCSI] qla2xxx: Fixed zero test on new_config in qla2x00_process_loopback().
Fixed the incorrect zero test on array new_config[].

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:44:48 -06:00
Andrew Vasquez ff8073fffc [SCSI] qla2xxx: Populate FCP_PRIO location for no *FLT* case
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:44:28 -06:00
Dan Carpenter 8ae598d025 [SCSI] qla2xxx: list cursors are not null
This is just a cleanup.

The unneeded NULL check annoys static checkers because we already
derefenced it and the we check it and then (if it's not the _safe()
version) we dereference it again without checking.  And the static
checker is all, "Wah?  Is it null or not?"

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:43:32 -06:00
Saurav Kashyap 579d12b58a [SCSI] qla2xxx: Added support for quiescence mode for ISP82xx.
Support is added for quiescence mode. This feature is for P3P
adapters. Any of the functions can put the firmware into quiescence
state. All the others have to ack that request. During quiescence mode
current commands are processed and all the new incoming I/Os are
blocked. Loop resync is performed after firmware comes out of
quiescence state.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-23 15:40:55 -06:00
Jon Mason 1d3c16a818 PCI: make pci_restore_state return void
pci_restore_state only ever returns 0, thus there is no benefit in
having it return any value.  Also, a large majority of the callers do
not check the return code of pci_restore_state.  Make the
pci_restore_state a void return and avoid the overhead.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-12-23 12:53:09 -08:00
Michael Chan 939b82e5bd cnic: Improve ->iscsi_nl_msg_send()
1. Change first parameter from cnic_dev to ulp_handle which is the hba
pointer.  All other similar upcalls are using hba pointer.  The callee
can then directly reference the hba without conversion.

2. Change return value from void to int so that an error code can be
passed back.  This allows the operation to be retried.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-23 11:44:29 -08:00
adam radford 9c915a8c99 [SCSI] megaraid_sas: Add 9565/9285 specific code
This patch adds MegaRAID 9265/9285 (Device id 0x5b) specific code

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-22 23:26:53 -06:00
adam radford cd50ba8ede [SCSI] megaraid_sas: Add struct megasas_instance_template changes
The following patch adds struct megasas_instance_template changes to
the megaraid_sas driver, and changes all code to use the new instance
entries:

   irqreturn_t (*service_isr )(int irq, void *devp);
   void (*tasklet)(unsigned long);
   u32 (*init_adapter)(struct megasas_instance *);
   u32 (*build_and_issue_cmd) (struct megasas_instance *, struct scsi_cmnd *);
   void (*issue_dcmd) (struct megasas_instance *instance,
                              struct megasas_cmd *cmd);

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-22 23:26:52 -06:00
adam radford b6d5d8808b [SCSI] megaraid_sas: Use lowest memory bar for SR-IOV VF support
The following patch modifies the megaraid_sas driver to select the
lowest memory bar available so the driver will work in SR-IOV VF
environments where the memory bar mapping changes.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-22 23:26:52 -06:00
adam radford 80d9da98b4 [SCSI] megaraid_sas: Add MSI-X support and msix_disable module parameter
This patch adds MSI-X support and 'msix_disable' module parameter to
the megaraid_sas driver.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-22 23:26:51 -06:00
FUJITA Tomonori 46081b1664 [SCSI] st: Increase success probability in driver buffer allocation
Modify allocation to try the minimum possible page order allowed by the HBA
scatter/gather segment limit in allocation of the driver's internal
buffer. This increases the probability of successful allocation. The
allocation may still fail if this minimum order is > 0.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
Reported-by: Lukas Kolbe <lkolbe@techfak.uni-bielefeld.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-22 23:26:50 -06:00
Kai Makisara 373daacfce [SCSI] st: Store page order before driver buffer allocation
The order of the pages allocated for the driver buffer must be stored before
allocation because it is used in freeing already allocated pages if
allocation fails.

Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
Reported-by: Lukas Kolbe <lkolbe@techfak.uni-bielefeld.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-22 23:26:50 -06:00
Douglas Gilbert a87e3a67d5 [SCSI] scsi_debug: set resid to indicate no data-in when medium error
set resid to the requested data-in length when a MEDIUM ERROR is
simulated. This implies no valid data is returned in the data-in
buffer

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-22 23:26:49 -06:00
James Bottomley a8733c7baf [SCSI] fix medium error problems with some arrays which can cause data corruption
Our current handling of medium error assumes that data is returned up
to the bad sector.  This assumption holds good for all disk devices,
all DIF arrays and most ordinary arrays.  However, an LSI array engine
was recently discovered which reports a medium error without returning
any data.  This means that when we report good data up to the medium
error, we've reported junk originally in the buffer as good.  Worse,
if the read consists of requested data plus a readahead, and the error
occurs in readahead, we'll just strip off the readahead and report
junk up to userspace as good data with no error.

The fix for this is to have the error position computation take into
account the amount of data returned by the driver using the scsi
residual data.  Unfortunately, not every driver fills in this data,
but for those who don't, it's set to zero, which means we'll think a
full set of data was transferred and the behaviour will be identical
to the prior behaviour of the code (believe the buffer up to the error
sector).  All modern drivers seem to set the residual, so that should
fix up the LSI failure/corruption case.

Reported-by: Douglas Gilbert <dgilbert@interlog.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-22 23:26:48 -06:00
Jiri Kosina 4b7bd36470 Merge branch 'master' into for-next
Conflicts:
	MAINTAINERS
	arch/arm/mach-omap2/pm24xx.c
	drivers/scsi/bfa/bfa_fcpim.c

Needed to update to apply fixes for which the old branch was too
outdated.
2010-12-22 18:57:02 +01:00
Jens Axboe fcc57045d5 Revert "sd: implement sd_check_events()"
This reverts commit c8d2e93735.

We run into merging problems with the SCSI tree, revert this one
so it can be handled by a postmerge tree there.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-12-22 09:48:49 +01:00
adam radford 3f1530c1e1 [SCSI] megaraid_sas: Update GPL headers.
This patch updates the GPL headers in megaraid_sas_base.c and megaraid_sas.h.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:29 -06:00
adam radford 0d49016bba [SCSI] megaraid_sas: Rename megaraid_sas.c to megaraid_sas_base.c
This patch renames megaraid_sas.c to megaraid_sas_base.c to facilitate
other files in the compile.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:29 -06:00
Hillf Danton fd01a6632d [SCSI] fix the return value of scsi_target_queue_read()
It seems that zero should be returned if scsi_target_is_busy(starget) is
true, no matter if sdev is on the starved list.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:28 -06:00
Menny Hamburger db422318cb [SCSI] scsi_dh: propagate SCSI device deletion
Currently, when scsi_dh_activate() returns with an error
(e.g. SCSI_DH_NOSYS) the activate_complete callback is not called and
the error is not propagated to DM mpath.

When a SCSI device attached to a device handler is deleted, userland
processes currently performing I/O on the device will have their I/O
hang forever.

- Set SCSI_DH_NOSYS error when the handler is in the process of being
  deleted (e.g. the SCSI device is in a SDEV_CANCEL or SDEV_DEL state).

- Set SCSI_DH_DEV_OFFLINED error when device is in SDEV_OFFLINE state.

- Call the activate_complete callback function directly from
  scsi_dh_activate if an error has been set (when either the scsi_dh
  internal data has already been deleted or is in the process of being
  deleted).

The patch was tested in an iSCSI environment, RDAC H/W handler and
multipath.  In the following reproduction process, dd will I/O hang
forever and the only way to release it will be to reboot the machine:
1) Perform I/O on a multipath device:
    dd if=/dev/dm-0 of=/dev/zero bs=8k count=1000000 &
2) Delete all slave SCSI devices contained in the mpath device:
   I)  In an iSCSI environment, the easiest way to do this is by
   stopping iSCSI:
       /etc/init.d/iscsi stop
   II) Another way to delete the devices is by applying the following
   bash scriptlet:
       dm_devs=$(ls /sys/block/ | grep dm- | xargs)
       for dm_dev in $dm_devs; do
         devices=$(ls /sys/block/$dm_dev/slaves)
         for device in $devices; do
            echo 1 > /sys/block/$device/device/delete
         done
       done

NOTE: when DM mpath's fail_path uses blk_abort_queue this scsi_dh change
isn't strictly required.  However, DM mpath's call to blk_abort_queue
will soon be reverted because it has proven to be unsafe due to a race
(between blk_abort_queue and scsi_request_fn) that can lead to list
corruption.  Therefore we cannot rely on blk_abort_queue via fail_path,
but even if we could this scsi_dh change is still preferrable.

Signed-off-by: Menny Hamburger <Menny_Hamburger@Dell.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:27 -06:00
Stephen M. Cameron 35dd3039e0 [SCSI] hpsa: do not consider RAID level to be part of device identity
Otherwise, after doing a RAID level migration, the disk will be
disruptively removed and re-added as a different disk on rescan.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:27 -06:00
Stephen M. Cameron a0b89872b3 [SCSI] hpsa: do not consider firmware revision when looking for device changes.
The firmware may have been updated, in which case, it's the same device,
and in that case, we do not want to remove and add the device, we want to
let it continue as is.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:26 -06:00
James Smart 774342844f [SCSI] lpfc 8.3.20: Update lpfc driver version to 8.3.20
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:25 -06:00
James Smart 4042629e42 [SCSI] lpfc 8.3.20: Updates to FC discovery commands
Updated commands used for ELS to utilize VPI
Allocate RPI at node creation time and pass in ELS commnads.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:24 -06:00
James Smart 2fcee4bf87 [SCSI] lpfc 8.3.20: Implement new SLI4 init procedures based on if_type
Implement new SLI4 init procedures based on if_type:

- Add structure changes for new SLIPORT registers and BAR changes.
- Update register names to be consistent with inteface spec terms.
- Added union to encapsulate Hardward error registers.
- Rework lpfc_sli4_post_status_check() around SLI-4's SLI_INTF type
- Removed the lpfc_sli4_fw_cfg_check routine
- Segmented driver logic to include evaluation of the if_type to
  engage different behaviors.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:23 -06:00
James Smart 70f3c07336 [SCSI] lpfc 8.3.20: Implement the FC and SLI async event handlers
Implement the FC and SLI async event handlers:

- Updated MQ_CREATE_EXT mailbox structure to include fc and SLI async events.
- Added the SLI trailer code.
- Split physical field into type and number to reflect latest SLI spec.
- Changed lpfc_acqe_fcoe to lpfc_acqe_fip to reflect latest Spec changes.
- Added lpfc_acqe_fc_la structure for FC link attention async events.
- Added lpfc_acqe_sli structure for sli async events.
- Added lpfc_sli4_async_fc_evt routine to handle fc la async events.
- Added lpfc_sli4_async_sli routine to handle sli async events.
- Moved LPFC_TRAILER_CODE_FC to be handled by its own handler function.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:20 -06:00
James Smart be858b65cf [SCSI] lpfc 8.3.20: Critical fixes
- Use for iocbq->context1 to hold the ndlp pointer.
- Set ndlp in all iocbs generated from ioctl functions.
- Turn parity and serr bits back on after performing sli4 board reset.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:19 -06:00
Krishna Gudipati 395eb20238 [SCSI] bfa: Update the driver version to 2.3.2.3
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:18 -06:00
Krishna Gudipati 15821f05b7 [SCSI] bfa: io tag handling and minor bug fix.
Fix iotag handling:

1) Update and check io tag for retry case.
2) Clearing upper 3 bits in io tag when an IO completes.
   The 3 upper bits in io tags are used for counting FCP exchange retry.
   Un-cleared bits will cause firmware to access invalid memory when the
   same io tag is used for an IO to a target that doesn't support FCP
   exchange retry.
3) Only check the effective bits when validating an iotag.

Other minor fixes:

1) Added trace to get FC header type with assert of unhandled packet received.
   Ignore the type FC_TYPE_FC_FSS (FC_XS).
2) Fixed the adapter info display check - to check for fcmode flag even.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:17 -06:00
Krishna Gudipati b704495c67 [SCSI] bfa: direct attach mode fix.
- Direct attach is not working due to the check of PID in fcxp_send request.
- Added logic to set the lps->lp_pid with the PID assigned for n2n mode.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:16 -06:00
Krishna Gudipati f1d584d70f [SCSI] bfa: IOC auto recovery fix.
- Made IOC auto_recovery synchronized and not timer based.
- Only one PCI function will attempt to recover and reinitialize
  the ASIC on a failure, after all the active PCI fns
  acknowledge the IOC failure.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:15 -06:00
Krishna Gudipati f3a060ca57 [SCSI] bfa: Store port configuration in flash for persistency.
When the bfa driver is loaded a flogi is sent without the knowledge of
trunking configuration. This normal flogi causes the switch ports
which had trunking enabled to go to persistent offline.  Solution is
to store the port configuration (which has trunking info) in the flash
for persistency. The firmware will read this configuration when the
very first fcport enable is received.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:12 -06:00
Krishna Gudipati 4e78efefa3 [SCSI] bfa: IOC fwtrace save logic & state machine fixes.
- Move fw trace save logic to bfa_ioc_sm_fail_entry(),
  so that fw trace is saved irrespective of the cause of the failure.
- Make bfa_ioc_sm_fail() a failure parking state.
- Rename bfa_ioc_sm_initfail() to a more appropriate bfa_ioc_sm_fail_retry()
  as it is no longer a parking state.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:37:11 -06:00
Maggie Zhang da99dcc98d [SCSI] bfa: remove unused functions and misc cleanups
Remove unused functions and fix checkpatch errors. Misc cleanups in
comment and formatting.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:32:58 -06:00
Maggie Zhang f16a17507b [SCSI] bfa: remove all OS wrappers
Remove OS wrapper functions/macros, and as a result remove bfa_os_inc.h.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:32:56 -06:00
Maggie Zhang f314878ab9 [SCSI] bfa: remove all SCSI IO callbacks
Remove SCSI IO callbacks, and as a result remove bfa_cb_ioim.h.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:32:47 -06:00
Maggie Zhang e3e7d3eebb [SCSI] bfa: scatter gather processing change
Modified scatter gather processing to use the kernel provided
scsi_for_each_sg() macro.

1) Instead of allocating and setting up sgpg in bfa_ioim_sge_setup(),
   we only do allocation.  As a result, we remove
   bfa_ioim_sgpg_setup() and rename bfa_ioim_sge_setup() to
   bfa_ioim_sgpg_alloc().

2) bfa_ioim_send_ioreq() call scsi_for_each_sg() to handle both inline
   and sgpg setup.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:32:45 -06:00
Maggie Zhang b77ee1fb10 [SCSI] bfa: remove a file with small size
Removed bfa_drv.c, merged it to bfa_core.c and modified Makefile.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:32:44 -06:00
Maggie Zhang f7f73812e9 [SCSI] bfa: clean up one line functions
Cleaned up one line functions.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:32:43 -06:00
Maggie Zhang df0f1933eb [SCSI] bfa: remove unused and empty functions
Removed unused and empty functions.

Signed-off-by: Maggie Zhang <xmzhang@brocade.com>
Signed-off-by: Jing Huang <xmzhang@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:50 -06:00
Robert Jennings 402c6eec1b [SCSI] ibmvfc: Improve ibmvfc_async_desc memory layout
By changing field ordering we can avoid a couple of memory holes in
the tables that use the ibmvfc_async_desc structure.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:49 -06:00
Stephen Hemminger 058548ae23 [SCSI] iscsi: add module alias
Since iscsi transport can be built as a module and uses netlink socket
to communicate. The module should have an alias to autoload when socket
of NETLINK_ISCSI type is requested.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:48 -06:00
Vikas Chaudhary 6b57b15970 [SCSI] qla4xxx: Update driver version to 5.02.00-k5
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>
2010-12-21 12:24:44 -06:00
Vikas Chaudhary 7d01d0698f [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>
2010-12-21 12:24:43 -06:00
Vikas Chaudhary 3930b8c1f3 [SCSI] qla4xxx: do not reset hba if ql4xdontresethba is set
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>
2010-12-21 12:24:43 -06:00
Lalit Chandivade d56a1f7b39 [SCSI] qla4xxx: do not check for fw hung if reset retry is in progress
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:42 -06:00
Prasanna Mumbai e128271b7b [SCSI] qla4xxx: cache new IP address acquired via DHCP
Prior to firmware state change from ACQUIRING to READY, an
0x8029 AEN is received. Added code to check previous state
being ACQUIRING in order to update the ip address in the driver.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:41 -06:00
Lalit Chandivade 4cd83cbef8 [SCSI] qla4xxx: Fail initialization if qla4_8xxx_pci_mem_write_2M fails
Since if fw load is failing, running on incomplete fw load would
be fatal.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:41 -06:00
Lalit Chandivade fe998527e3 [SCSI] qla4xxx: put device in FAILED state for 82XX initialization failure
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:40 -06:00
Lalit Chandivade e6b07df8b0 [SCSI] qla4xxx: do not process interrupt unconditionally
in mailbox command do not process interrupt unconditionally,
process interrupt only in polling mode

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:38 -06:00
Karen Higgins 6790d4fecf [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>
2010-12-21 12:24:37 -06:00
Swapnil Nagle a1fc26baae [SCSI] qla4xxx: memory wedge with peg_halt test in loop
Signed-off-by: Swapnil Nagle <swapnil.nagle@qlogic.com>
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>
2010-12-21 12:24:36 -06:00
Shyam Sundar 61391d314e [SCSI] qla4xxx: initialize MSI in correct way
IRQF_SHARED flag should not be set when calling request_irq for MSI since
this interrupt mechanism cannot be shared like standard INTx

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:35 -06:00
Vikas Chaudhary 3e1350c4dc [SCSI] qla4xxx: Drop use of IRQF_DISABLE
IRQF_DISABLE flag is deprecated and this flag is a NOOP in kernel.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:35 -06:00
Joe Eykholt 5f0e385fda [SCSI] libfc: fix statistics for FCP input/output megabytes
The statistics for InputMegabytes and OutputMegabytes are
misnamed.  They're accumulating bytes, not megabytes.

The statistic returned via /sys must be in megabytes, however,
which is what the HBA-API wants.  The FCP code needs to accumulate
it in bytes and then divide by 1,000,000 (not 2^20) before it
presented via sysfs.

This affects fcoe.ko only, not fnic.  The fnic driver
correctly by accumulating bytes and then converts to megabytes.

I checked that libhbalinux is using the /sys file directly without
conversion.

BTW, qla2xxx does divide by 2^20, which I'm not fixing here.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:34 -06:00
Joe Eykholt ba9cd5d095 [SCSI] libfcoe: change fip_select to return new FCF
Neaten several calls to fip_select() by having it return the
pointer to the new FCF.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:34 -06:00
Joe Eykholt 981c1154b2 [SCSI] libfcoe: reorder FCF list to put latest advertiser first
When there are several FCFs to choose from, the one most likely
to accept a FLOGI on certian switches is the one that last
answered a multicast solicit.

So, when receiving an advertisement, move the FCF to the front
of the list so that it gets chosen first among those with the
same priority.

Without this, more FLOGIs need to be sent in a test with
multiple FCFs and a switch in NPV mode, but it still
eventually finds one that accepts the FLOGI.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:33 -06:00
Joe Eykholt 9069f5c433 [SCSI] libfcoe: add debug message for FCF destination MAC
When multiple FCFs to the same fabric exist, the debug messages
all look alike.   Change the message to include the MAC address.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:33 -06:00
Joe Eykholt 794d98e77f [SCSI] libfcoe: retry rejected FLOGI to another FCF if possible
Switches using multiple-FCFs may reject FLOGI in order to
balance the load between multiple FCFs.  Even though the FCF
was available, it may have more load at the point we actually
send the FLOGI.

If the FLOGI fails, select a different FCF
if possible, among those with the same priority.  If no other
FCF is available, just deliver the reject to libfc for retry.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:32 -06:00
Joe Eykholt b69ae0ae3f [SCSI] libfcoe: fix checking of conflicting fabrics in fcoe_ctlr_select()
The check for conflicting fabrics in fcoe_ctlr_select()
ignores any FCFs that aren't usable.  This is a minor
problem now but becomes more pronounced after later patches.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:32 -06:00
Joe Eykholt c47036a7cd [SCSI] libfcoe: move some timer code to make it reusable.
Move some of the code in fcoe_ctlr_timer_work() to
fcoe_ctlr_select() so that it can be shared
with another function in a forthcoming patch.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:29 -06:00
Joe Eykholt 69316ee2e3 [SCSI] libfcoe: update FIP FCF announcements
Move the announcement code to a separate function for reuse in
a forthcoming patch.

For messages regarding FCF timeout and selection, use the
previously-announced FCF MAC address (dest_addr) in the fcoe_ctlr struct.
Only print (announce) the FCF if it is new.   Print MAC for
timed-out or deselected FCFs.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:28 -06:00
Yi Zou b5fe5e953c [SCSI] libfc: fix fc_tm_done not freeing the allocated fsp pkt
Frame should be freed in fc_tm_done, this is an updated patch on the one
initially submitted by Hillf Danton.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:27 -06:00
Yi Zou 3a91090fe0 [SCSI] libfc: the timeout for the REC itself is 2 * R_A_TOV_els
The timeout for the exchange carrying REC itself is 2 * R_A_TOV_els.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:27 -06:00
Yi Zou ea3e2e72ee [SCSI] libfc: fix exchange being deleted when the abort itself is timed out
Should not continue when the abort itself is being timeout since in that case
the exchange will be deleted and relesased. We still want to call the
associated response handler to let the layer, e.g., fcp, know the exchange
itself is being timed out.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:26 -06:00
Yi Zou d889b30a91 [SCSI] libfc: do not fc_io_compl on fsp w/o any scsi_cmnd associated
Do not call fc_io_compl() on fsp w/o any scsi_cmnd, e.g., lun reset is built
inside fc_fcp, not from a scsi command from queuecommnd from scsi-ml, so in
in case target is buggy that is invalid flags in the FCP_RSP, as we have seen
in some SAN Blaze target where all bits in flags are 0, we do not want to call
io_compl on this fsp.

[ Comment block added by Robert Love ]

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:25 -06:00
Yi Zou 9b90dc80ba [SCSI] libfc: add print of exchange id for debugging fc_fcp
This is very helpful to match up the corresponding exchange to the actual I/O
described by the fsp, particularly when you do a side-by-side comparison of
the syslog with your trace.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:25 -06:00
Joe Perches 11aa99001a [SCSI] drivers/scsi/fcoe: Update WARN uses
Add missing newlines.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:24 -06:00
Hillf Danton 0e9e3d3b15 [SCSI] libfc: fix memory leakage in remote port
There seems rdata should get put before return.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:24 -06:00
Hillf Danton 72e0daad55 [SCSI] libfc: fix memory leakage in local port
There seems info should get freed when error encountered.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:23 -06:00
Hillf Danton 2d6dfb005e [SCSI] libfc: fix memory leakage in local port
There seems info should get freed when error encountered.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:23 -06:00
john fastabend 05fee645e9 [SCSI] libfc: remove tgt_flags from fc_fcp_pkt struct
We can easily remove the tgt_flags from fc_fcp_pkt struct
and use rpriv->tgt_flags directly where needed.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:22 -06:00
john fastabend e0883a3c3e [SCSI] libfc: use rport timeout values for fcp recovery
Use the rport value for rec_tov for timeout values when
sending fcp commands. Currently, defaults are being used
which may or may not match the advertised values.

The default may cause i/o to timeout on networks that
set this value larger then the default value. To make
the timeout more configurable in the non-REC mode we
remove the FC_SCSI_ER_TIMEOUT completely allowing the
scsi-ml to do the timeout. This removes an unneeded
timer and allows the i/o timeout to be configured
using the scsi-ml knobs.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:22 -06:00
john fastabend ac17ea8d7d [SCSI] libfc: incorrect scsi host byte codes returned to scsi-ml
The fcp packet recovery handler fc_fcp_recover() is called
when errors occurr in a fcp session. Currently it is
generically setting the status code to FC_CMD_RECOVERY for
all error types. This results in DID_BUS_BUSY errors
being returned to the scsi-ml.

DID_BUS_BUSY errors indicate "BUS stayed busy through time
out period" according to scsi.h. Many of the error reported
by fc_rcp_recovery() are pkt errors. Here we update
fc_fcp_recovery to use better host byte codes.

With certain FAST FAIL flags set DID_BUS_BUSY and DID_ERROR
will have different behaviors this was causing dm multipath
to fail quickly in some cases where a retry would be a
better action.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:21 -06:00
Hillf Danton e90ff5ef0a [SCSI] libfc: fix stats computation in fc_queuecommand()
There seems accumulation needed.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:21 -06:00
Hillf Danton 530994d69e [SCSI] libfc: fix mem leak in fc_seq_assign()
There is a typo cleaned, which triggers memory leakage.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:20 -06:00
Robert Love 3c2c3bf23c [SCSI] libfc: Fix incorrect locking and unlocking in FCP
The error handler grabs the si->scsi_queue_lock, but
in the case where the fsp pointer is NULL it releases
the scsi_host lock. This can lead to a variety of
system hangs depending on which is used first- the
scsi_host lock or the scsi_queue_lock.

This patch simply unlocks the correct lock when fcp
is NULL.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:20 -06:00
Hillf Danton 2034c19ce8 [SCSI] libfc: tune fc_exch_em_alloc() to be O(2)
For allocating new exch from pool,  scanning for free slot in exch
array fluctuates when exch pool is close to exhaustion.

The fluctuation is smoothed, and the scan looks to be O(2).

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:19 -06:00
Hillf Danton 8236554a27 [SCSI] libfc: fix mem leak in fc_exch_recv_seq_resp()
There seems that ep should get released, or it will no longer get freed.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:19 -06:00
Yi Zou 80e736f8a3 [SCSI] libfc: fix NULL pointer dereference bug in fc_fcp_pkt_release
This happens when then tearing down the fcoe interface with active I/O.
The back trace shows dead000000200200 in RAX, i.e., LIST_POISON2, indicating
that the fsp is already being dequeued, which is probably why no complaining
was seen in fc_fcp_destroy() about outstanding fsp not freed, since we dequeue
it in the end of fc_io_compl() before releasing it. The bug is due to the
fact that we have already destroyed lport's scsi_pkt_pool while on-going i/o
is still accessing it through fc_fcp_pkt_release(), like this trace or the
similar code path from scsi-ml to fc_eh_abort, etc. This is fixed by moving
the fc_fcp_destroy() after lport is detached from scsi-ml since fc_fcp_destroy
is supposed to called only once where no lport lock is taken, otherwise the
fc_fcp_pkt_release() would have to grab the lport lock.

 BUG: unable to handle kernel NULL pointer dereference at (null)
 .......
 RIP: 0010:[<0000000000000000>]
 [<(null)>] (null)
 RSP: 0018:ffff8803270f7b88  EFLAGS: 00010282
 RAX: dead000000200200 RBX: ffff880197d2fbc0 RCX: 0000000000005908
 RDX: ffff880195ea6d08 RSI: 0000000000000282 RDI: ffff880180f4fec0
 RBP: ffff8803270f7bc0 R08: ffff880197d2fbe0 R09: 0000000000000000
 R10: ffff88032867f090 R11: 0000000000000000 R12: ffff880195ea6d08
 R13: 0000000000000282 R14: ffff880180f4fec0 R15: 0000000000000000
 FS:  0000000000000000(0000) GS:ffff8801b5820000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
 CR2: 0000000000000000 CR3: 00000001a6eae000 CR4: 00000000000006e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process fc_rport_eq (pid: 5278, threadinfo ffff8803270f6000, task ffff880326254ab0)
 Stack:
 ffffffffa02c39ca ffff8803270f7ba0 ffff88019331cbc0 ffff880197d2fbc0
 0000000000000000 ffff8801a8c895e0 ffff8801a8c895e0 ffff8803270f7c10
 ffffffffa02c4962 ffff8803270f7be0 ffffffff814c94ab ffff8803270f7c10
 Call Trace:
 [<ffffffffa02c39ca>] ? fc_io_compl+0x10a/0x530 [libfc]
 [<ffffffffa02c4962>] fc_fcp_complete_locked+0x72/0x150 [libfc]
 [<ffffffff814c94ab>] ? _spin_unlock_bh+0x1b/0x20
 [<ffffffffa02b98ff>] ? fc_exch_done+0x3f/0x60 [libfc]
 [<ffffffffa02c4a8f>] fc_fcp_retry_cmd+0x4f/0x60 [libfc]
 [<ffffffffa02c6150>] fc_fcp_recv+0x9b0/0xc30 [libfc]
 [<ffffffff8106ba7a>] ? _call_console_drivers+0x4a/0x80
 [<ffffffff8107d5ec>] ? lock_timer_base+0x3c/0x70
 [<ffffffff8107e06b>] ? try_to_del_timer_sync+0x7b/0xe0
 [<ffffffffa02b9dcf>] fc_exch_mgr_reset+0x1df/0x250 [libfc]
 [<ffffffffa02c57a0>] ? fc_fcp_recv+0x0/0xc30 [libfc]
 [<ffffffffa02c1042>] fc_rport_work+0xf2/0x4e0 [libfc]
 [<ffffffff8109203e>] ? prepare_to_wait+0x4e/0x80
 [<ffffffffa02c0f50>] ? fc_rport_work+0x0/0x4e0 [libfc]
 [<ffffffff8108c6c0>] worker_thread+0x170/0x2a0
 [<ffffffff81091d50>] ? autoremove_wake_function+0x0/0x40
 [<ffffffff8108c550>] ? worker_thread+0x0/0x2a0
 [<ffffffff810919e6>] kthread+0x96/0xa0
 [<ffffffff810141ca>] child_rip+0xa/0x20
 [<ffffffff81091950>] ? kthread+0x0/0xa0
 [<ffffffff810141c0>] ? child_rip+0x0/0x20
 Code:
 Bad RIP value.

 RIP
 [<(null)>] (null)
 RSP <ffff8803270f7b88>
 CR2: 0000000000000000

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:18 -06:00
Hillf Danton 12137f5c28 [SCSI] libfc: remove define of fc_seq_exch in fc_exch.c
The define for fc_seq_exch is unnecessary, since it also appears in scsi/libfc.h

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:18 -06:00
Maggie 50444a3400 [SCSI] bfa: fix endianess sparse check warnings
First round of fix for the endianess check warnings from make C=2 CF="-D__CHECK_ENDIAN__".

Signed-off-by: Maggie <xmzhang@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:17 -06:00
Maggie 52f94b6fd0 [SCSI] bfa: fix regular sparse check warnings.
Fix all sparse check warnings from make C=2.

Signed-off-by: Maggie <xmzhang@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:16 -06:00
Eddie Wai 3db86353ab [SCSI] bnx2i: Updated version to 2.6.2.2
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:16 -06:00
Eddie Wai 11cec1e2e9 [SCSI] bnx2i: Updated copyright and maintainer info
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:15 -06:00
Eddie Wai a91031a652 [SCSI] bnx2i: Cleaned up various error conditions in ep_connect/disconnect
Various error conditions inside ep_connect and ep_disconnect were
either not being handled or not being handled correctly.  This patch
fixes all those issues.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:15 -06:00
Eddie Wai bee348770d [SCSI] bnx2i: Added return code check for chip kwqe submission request
Added the handling for cases when a chip request is made to the
CNIC module but the hardware is not ready to accept.  This would
lead to many unnecessary wait timeouts.
This code adds check in the connect establishment and destruction
path.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:14 -06:00
Eddie Wai 842158d7b7 [SCSI] bnx2i: Modified the bnx2i stop path to compensate for in progress ops
The stop path has been augmented to wait a max of 10s for all in
progress offload and destroy activities to complete before proceeding
to terminate all active connections (via iscsid or forcefully).

Note that any new offload and destroy requests are now blocked and
return to the caller immediately.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:14 -06:00
Eddie Wai 016ef69076 [SCSI] bnx2i: Removed the dynamic registration of CNIC
The code no longer needs to dynamically register and unregister
the CNIC device.  The CNIC device will be kept registered until
module unload.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:13 -06:00
Eddie Wai 7a2962c77c [SCSI] bnx2i: Added mutex lock protection to conn_get_param
Added net_dev mutex lock protection before accessing the csk
parameters.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:13 -06:00
Eddie Wai 252e44805b [SCSI] bnx2i: Allow to abort the connection if connect request times out
In the situation where the connect completion response arrives after
the connect request has already timed out, the connection was not being
aborted but only the resource was being freed.  This creates a problem
for 5771X (10g) as the chip flags this with an assertion.

This change will properly aborts the connection before freeing the
resource.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:12 -06:00
Eddie Wai 94810e824d [SCSI] bnx2i: Fixed the remote TCP RST handling for the 570X (1g)
Modified the handling of the remote TCP RST code so the chip can now
flush the tx pipe accordingly upon a remote TCP RST reception.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:12 -06:00
Eddie Wai 5bf3f39f9b [SCSI] bnx2i: Fixed a cid leak issue for 5771X (10g)
A cid leak issue was found when the connect destroy request exceeded
the driver's disconnection timeout.  This will lead to a cid resource
leak issue.
The fix is to allow the cid cleanup even when this happens.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:11 -06:00
Eddie Wai cf464fc5eb [SCSI] bnx2i: Fixed the endian bug in the TMF LUN cmd send
Added a be32_to_cpu call for the TMF LUN wqe.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:11 -06:00
Eddie Wai 8eea2f55a6 [SCSI] bnx2i: Added fix for NOP-Out response panic from unsolicited NOP-In
The patch fixes the following situations where NOP-Out pkt is called for:
- local unsolicited NOP-Out requests (requesting no NOP-In response)
- local NOP-Out responses to unsolicited NOP-In requests

kernel panic is observed due to double session spin_lock requests; one in the
bnx2i_process_nopin_local_cmpl routine in bnx2i_hwi.c and the other in the
iscsi_put_task routine in libiscsi.c

The proposed fix is to export the currently static __iscsi_put_task() routine
and have bnx2i call it directly instead of the iscsi_put_task() routine which
holds the session spin lock.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Acked-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:10 -06:00
Eddie Wai 5ee3257626 [SCSI] bnx2i: Fixed bugs in the handling of unsolicited NOP-Ins
Unsolicited NOP-Ins are placed in the receive queue of the hardware
which requires to be read out regardless if the receive pipe is suspended
or not.  This patch adds the disposal of this RQ element under this
condition.
Also fixed the bug in the unsolicited NOP-In handling routine which
checks for the RESERVED_ITT.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:10 -06:00
Kashyap, Desai f0cebfb017 [SCSI] mpt2sas: Bump version 07.100.00.00
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:09 -06:00
Kashyap, Desai 37aaa78b81 [SCSI] mpt2sas: Debug string changes from target to device.
Changing debug print to correct string.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:09 -06:00
Kashyap, Desai b41c09d1af [SCSI] mpt2sas: Sanity check for phy count is added using max phy count
Fix oops loading driver when there is direct attached
SEP device

The driver set max phys count to the value reported in sas iounit page
zero.  However this page doesn't take into account additional virutal
phys.  When sas topology event arrives, the phy count is larger than
expected, and the driver accesses memory array beyond the end of
allocated space, then oops.  Manufacturing page 8 contains the info
on direct attached phys.

For this fix will making sure that sas topology event is not
processing phys greater than the expected phy count.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:08 -06:00
Kashyap, Desai a93c6b45df [SCSI] mpt2sas: change queue depth with reason argument more appropriately
change_queue_depth callback API changed
The change_queue_depth callback changed where there is now an additional
parameter called reason, with SCSI_QDEPTH_DEFAULT, SCSI_QDEPTH_QFULL,
and SCSI_QDEPTH_RAMP_UP codes.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:07 -06:00
Kashyap, Desai 90d2a67225 [SCSI] mpt2sas: Remove code for TASK_SET_FULL from driver.
remove support for MPI2_EVENT_TASK_SET_FULL
This event is obsoleted, so this processing of this event
needs to be removed from the driver.  The controller firmware is going
to handle TASK_SET_FULL, the driver doesn't need to do anything.
Even though we are removing the EVENT handling, the behavour has not
changed between driver versions becuase fimrware will still be handling
queue throttling, and retrying of commands when the target device queues
are full.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:06 -06:00
Kashyap, Desai 7d06140259 [SCSI] mpt2sas: MPI 2.0 Header updated
MPI2 Rev header files.

1) Removed Task Set Full Event. Modified description of Disable SCSI
Initiator Task Set Full Handling bit in the Flags field of IO Unit
Page 1. Modified the descriptions for the three queue depth fields in
SAS IO Unit Page 1.
(2) Added new value for the Current Operation bits of the Flags field
in the RAID Volume Indicator Structure to indicate that the Make Data
Consistent operation is running.
(3) Added a value of 0x6 to various SAS link rate fields to indicate an
attached PHY that is not using any commonly supported settings.
(4) Added Volume Not Consistent bit to the VolumeStatusFlags field of
RAID Volume Page 0.
(5) Added a new value for the IncompatibleReason field of RAID Physical
Disk Page 0 to indicate an incompatible media type.
(6) Added Diagnostic Data Upload tool for the Toolbox Request.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:05 -06:00
Kashyap, Desai 7f6f794dee [SCSI] mpt2sas: Modify code to support Expander switch
Issue : Switch swap doesn't work when device missing delay is enabled.

(1) add support to individually add and remove phys to and from
existing ports. This replaces the routine
_transport_delete_duplicate_port.
(2) _scsih_sas_host_refresh - was modified to change the link rate
from zero to 1.5 GB rate when the firmware reports there is an
attached device with zero link.
(3) add new function mpt2sas_device_remove, this is wrapper function
deletes some redundant code through out driver by combining into one
subrountine
(4) two subroutines were modified so the sas_device, raid_device, and
port lists are traversed once when objects are deleted from the list.
Previously it was looping back each time an object was deleted from the
list.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:05 -06:00
Kashyap, Desai 35f805b52c [SCSI] mpt2sas: Create a pool of chain buffer instead of dedicated per IOs
Create a pool of chain buffers, instead of dedicated per IO:
This enahancment is to address memory allocation failure when asking
for more than 2300 IOs per host.   There is just not enough contiquious
DMA physical memory to make one single allocation to hold both message
frames and chain buffers when asking for more than 2300 request. In order
to address this problem we will have to allocate memory for each chain
buffer in a seperate individual memory allocation, placing each chain
element of 128 bytes onto a pool of available chains, which can be
shared amoung all request.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:04 -06:00
Kashyap, Desai 6cb8ef573f [SCSI] mpt2sas: Added loadtime para for IOMissingDelay and DMD
Ability to override/set the ReportDeviceMissingDelay and
IODeviceMissingDelay from driver: Add new command line option missing_delay,
this is an array, where the first element is the device missing delay,
and the second element is io missing delay.  The driver will program
sas iounit page 1 with the new setting when the driver loads. This is
programmed to the current and persistent configuration page so this takes
immediately, as will be sticky across host reboots.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:04 -06:00
Kashyap, Desai dd3741d303 [SCSI] mpt2sas: Added sanity check for cb_idx and smid access.
Sometime it is seen that controller
firmware returns an invalid system message id (smid).

the oops is occurring becuase mpt_callbacks pointer is referenced to
either null or invalid virtual address.  this is due to cb_idx set
incorrectly from routine _base_get_cb_idx.  the cb_idx was set incorrectly
becuase there is no check to make sure smid is less than maxiumum
anticapted smid.   to fix this issue, we add a check in
_base_get_cb_idx to make sure smid is not greater than
ioc->hba_queue_depth.   in addition, a similar check was added to make
sure the reply address was less than the largest anticapated address.

Newer firmware has sovled this issue, however it good to have this sanity
check.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:03 -06:00
Kashyap, Desai 363fa50fc3 [SCSI] mpt2sas: Removed compiler warnnings when logging is disabled
The compiler throws warning messages while compiling without
CONFIG_SCSI_MPT2SAS_LOGGING.
Set proper ifdef for CONFIG_SCSI_MPT2SAS_LOGGING to avoid warnnings.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:02 -06:00
James Smart 1f768e91e1 [SCSI] lpfc 8.3.19: Update lpfc driver version to 8.3.19
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:02 -06:00
James Smart eb7a339e67 [SCSI] lpfc 8.3.19: Change heartbeat to default to disabled
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:01 -06:00
James Smart 19ca760979 [SCSI] lpfc 8.3.19: Added support for ELS RRQ command
Added support for ELS RRQ command

- Add new routine lpfc_set_rrq_active() to track XRI qualifier state.
- Add new module parameter lpfc_enable_rrq to control RRQ operation.
- Add logic to ELS RRQ completion handler and xri qualifier timeout
  to clear XRI qualifier state.
- Use OX_ID from XRI_ABORTED_CQE for RRQ payload.
- Tie abort and XRI_ABORTED_CQE andler to RRQ generation.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:24:01 -06:00
James Smart 76a95d75ed [SCSI] lpfc 8.3.19: Add SLI4 FC Discovery support
Add SLI4 FC Discovery support

- Replace READ_LA and READ_LA64 with READ_TOPOLOGY mailbox command.
- Converted the old READ_LA structure to use bf_set/get instead of bit fields.
- Rename HBA_FCOE_SUPPORT flag to HBA_FCOE_MODE. Flag now indicates function
  is running as SLI-4 FC or FCoE port. Make sure flag reset each time
  READ_REV completed as it can dynamically change.
- Removed BDE union in the READ_TOPOLOGY mailbox command and added a define to
  define the ALPA MAP SIZE. Added FC Code for async events.
- Added code to support new 16G link speed.
- Define new set of values to keep track of valid user settable link speeds.
- Used new link speed definitions to define link speed max and bitmap.
- Redefined FDMI Port sppeds to be hax values and added the 16G value.
- Added new CQE trailer code for FC Events.
- Add lpfc_issue_init_vfi and lpfc_init_vfi_cmpl routines.
- Replace many calls to the initial_flogi routine with lpfc_issue_init_vfi.
- Add vp and vpi fields to the INIT_VFI mailbox command.
- Addapt lpfc_hba_init_link routine for SLI4 use.
- Use lpfc_hba_init_link call from lpfc_sli4_hba_setup.
- Add a check for FC mode to register the FCFI before init link.
- Convert lpfc_sli4_init_vpi to be called without a vpi (get it from vport).

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:23:59 -06:00
James Smart 085c647c33 [SCSI] lpfc 8.3.19: Add latest SLI4 Hardware initialization support
- Add the Lancer FC and FCoE PCI IDs
- Add new SLI4 INTF register definitions
- Implement new SLI4 doorbell register

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:23:59 -06:00
James Smart 63e801ce68 [SCSI] lpfc 8.3.19: Fix critical errors and crashes
Fix critical errors and crashes

- Replace LOF_SECURITY with LOG_SECURITY
- When calculating diag test memory size, use full size with header.
- Return LS_RJT with status=UNSUPPORTED on unrecognized ELS's
- Correct NULL pointer dereference when lpfc_create_vport_work_array()
  returns NULL.
- Added code to handle CVL when port is in LPFC_VPORT_FAILED state.
- In lpfc_do_scr_ns_plogi, check the nodelist for FDMI_DID and reuse
  the resource.
- Check for generic request 64 and calculate the sgl offset for the request
  and reply sgls, also calculate the xmit length using only the request bde.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:23:58 -06:00
James Bottomley 98db519573 [SCSI] fix id computation in scsi_eh_target_reset()
The current code in scsi_eh_target_reset() has an off by one error
that actually sends spurious extra resets.  Since there's no real need
to reset the targets in numerical order, simply chunk up the command
recovery list doing target resets and pulling matching targets out of
the list (that also makes the loop O(N) instead of O(N^2).

[mike christie found and fixed a list_splice -> list_splice_init problem]

Reported-by: Hillf Danton<dhillf@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:23:56 -06:00
Wayne Boyer 110def851f [SCSI] ipr: fix mailbox register definition and add a delay before reading
The definition for the mailbox register for new adapters was incorrect.  The
value has been updated to the correct offset.

After an adapter reset, the mailbox register on the new adapters takes a
number of seconds to stabilize.  A delay has been added before reading the
register.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:23:55 -06:00
Wayne Boyer 0cb992eda1 [SCSI] ipr: fix lun assignment and comparison
The lun value was not getting set up correctly for all devices attached to the
new 64 bit adapters.  The fix is to move the logic to earlier in the
ipr_init_res_entry routine such that the value does get set correctly for all
devices.

Then the ipr_is_same_device comparison function was using the wrong lun value
in the logic for the new adapters.  Change this to use the correct lun value.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-12-21 12:23:54 -06:00