Commit Graph

7518 Commits (4711ba10b13891edf228944a9d0a21dfe7fe90f0)

Author SHA1 Message Date
Dan Williams 3c06c2839d isci: clean up remaining silicon revision ifdefs in phy init
Use the dynamic revision detection code in
scic_sds_phy_link_layer_initialization() and apply some coding style
fixups (long deref chains).  The compile time max link rate setting is
removed in favor of honoring the user-parameter max.

Reported-by: Krzysztof Wierzbicki <Krzysztof.Wierzbicki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Jacek Danecki d9def184b3 isci: Add support for user parameters in SCIC layer
Add support for the following parameters in SCIC:

     /**
       * This field specifies the NOTIFY (ENABLE SPIN UP) primitive
       * insertion frequency for this phy index.
       */
      u32  notify_enable_spin_up_insertion_frequency;

      /**
       * This method specifies the number of transmitted DWORDs within which
       * to transmit a single ALIGN primitive.  This value applies regardless
       * of what type of device is attached or connection state.  A value of
       * 0 indicates that no ALIGN primitives will be inserted.
       */
      u16  align_insertion_frequency;

      /**
       * This method specifies the number of transmitted DWORDs within which
       * to transmit 2 ALIGN primitives.  This applies for SAS connections
       * only.  A minimum value of 3 is required for this field.
       */
      u16  in_connection_align_insertion_frequency;

Signed-off-by: Krzysztof Wierzbicki <Krzysztof.Wierzbicki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Henryk Dembkowski 246214667f isci: Move transport layer registers from port to phy
At init and RNC resume we need to touch every phy in a port to be sure
we have initialized STP properties in the case where port_index !=
phy_index.  Also add some missing __iomem annotations.

Signed-off-by: Henryk Dembkowski <henryk.dembkowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Tomasz Chudy 06fdb32862 isci: fix "no outbound task timeout" default value
The default should be 5us.  The hardware encodes it in 256ns increments,
so the value should be 20 to approximate a 5us timeout.

Signed-off-by: Tomasz Chudy <Tomasz.Chudy@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams 8f31550c77 isci: phy state machine cleanup step1
c99 the struct initializers:
	1/ allows grep to consistently show method name associations.  The
	   naming is mostly consistent (except when it isn't) so this guarantees
	   coverage of present and future exception cases.
	2/ let's the compiler guarantee that the state table array entry
	   correlates with an actual state name and detect accidental reordering or
	   deletion of states.
	/ allows default handler's to be identified easily

Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dave Jiang 858d4aa741 isci: Move firmware loading to per PCI device
Moved the firmware loading from per adapter to per PCI device. This should
prevent firmware from being loaded twice becuase of 2 SCU controller per
PCI device. We do have to do it per PCI device because request_firmware()
requires a struct device passed in.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Havard Skinnemoen 92cd51153d isci: Initialize proc_name field in scsi_host_template
The proc_name field in struct scsi_host_template is exported through sysfs and
allows userspace tools to identify the driver behind a particular SCSI host
controller.

Initialize this field so that userspace tools can easily identify isci host
controllers through sysfs.

Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Edmund Nadolski 5d147e7383 isci: remove scic_controller_get_handler_methods and ilk
This removes scic_controller_get_handler_methods and its
associated unused code.

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
[djbw: kill off the legacy handler, now that we have basic error isr support]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams 83f5eeef59 isci: debug fixes
Some of the chain walks to get back to our dev are invalid.

isci_remote_device_change_state: delete rather than adding conditional deref
chain walking
isci_request_change_state: fix, it was being called too early
isci_request_ssp_io_request_get_lun: fix compile breakage hidden by ifdef DEBUG

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams 83e514301e isci: advertise linkrate
Inform libsas of the linkrate of direct attached links.

Reported-by: Haavard Skinnemoen <hskinnemoen@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams 92f4f0f544 isci: implement error isr
Add basic support for handling/reporting error interrupts.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Edmund Nadolski 77950f51f5 isci: enable interrupts during controller start, and flush discovery
Polling the event queue during scan is an unneeded holdover from the
original driver.

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
[djbw: ensure we flush all port events and domain discovery]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams 0cf89d1d27 isci: cleanup "starting" state handling
The lldd actively disallows requests in the "starting" state.  Retrying
or holding off commands in this state is sub-optimal:
1/ it adds another state check to the fast path
2/ retrying can cause libsas to give up

However, isci's ->lldd_dev_found() routine already waits for controller
start to complete before allowing further progress.  Checking the
"starting" state in isci_task_execute_task and the isr is redundant and
misleading.  Clean this up and introduce a controller-wide event queue
to start reeling in "completion" proliferation in the driver.

The "stopping" state cleanups are in a similar vein, rely on the the isr
and other paths being precluded from occurring rather than implementing
state checking logic.

Reported-by: Christoph Hellwig <hch@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams c7ef4031f0 isci: bypass scic_controller_get_handler_methods()
The indirection is unecessary and broken in the current case that assigns the
handlers based on a not up-to-date pdev->msix_enabled value.

Route the handlers directly to the requisite core routines.

Todo: hook up error interrupt handling

Reported-by: Jeff Garzik <jeff@garzik.org>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams 11c8898629 isci: remove SCIC_DEBUG_ENABLED, and fixup an odd macro
This will be replaced by state machine tracepoints and should have been a part
of the logger removal.

Ran across scic_sds_port_decrement_request_count() which is an ugly macro
which silently hides accounting errors.  Turn it into a WARN_ONCE to see if it
ever triggers.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams f7d36e1872 isci: kill a callback cast
Callbacks are already type unsafe, obfuscating things further by casting the
callback routine is less safe because now function argument number changes
will not be caught by the compiler.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Henryk Dembkowski 27d42e3e79 isci: coding style changes for remote device
Change names from upper to low letters

Signed-off-by: Henryk Dembkowski <henryk.dembkowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:27 -07:00
Dan Williams e574a8c180 isci: cleanup core consolidation leftovers
Remove duplicated license and header file includes that were leftover
from commit 4c1db2d0 "isci: consolidate core" (in the isci.git historical
branch).

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Henryk Dembkowski db48255b32 isci: c99 tables cleanup step1
scic_sds_stp_remote_device_ready_substate_handler_table[]
	scic_sds_smp_remote_device_ready_substate_handler_table[]

c99 the struct initializers:
	1/ allows grep to consistently show method name associations.  The
	   naming is mostly consistent (except when it isn't) so this guarantees
	   coverage of present and future exception cases.
	2/ let's the compiler guarantee that the state table array entry
	   correlates with an actual state name and detect accidental reordering or
	   deletion of states.
	3/ allows default handler's to be identified easily

Signed-off-by: Henryk Dembkowski <henryk.dembkowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Henryk Dembkowski 2f02f556ab isci: coding style changes for remote device
Change names from upper to low letters

Signed-off-by: Henryk Dembkowski <henryk.dembkowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Henryk Dembkowski 7fbafaa519 isci: remote device and node cleanup step1
c99 the struct initializers (scic_sds_remote_device_state_handler_table[]):
	1/ allows grep to consistently show method name associations.  The
	   naming is mostly consistent (except when it isn't) so this guarantees
	   coverage of present and future exception cases.
	2/ let's the compiler guarantee that the state table array entry
	   correlates with an actual state name and detect accidental reordering or
	   deletion of states.
	3/ allows default handler's to be identified easily

Change names from upper to low letters

Cleanup empty lines

Signed-off-by: Henryk Dembkowski <henryk.dembkowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Dave Jiang 6e473dd112 isci: removing unused loglevel module param
We no longer use the loglevel parameter. Remove.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Edmund Nadolski b5739b6050 isci: kill sci_types.h
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
[rebased after killing SCI_IO_REQUEST_DATA_DIRECTION]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Dan Williams 82d29928c1 isci: kill SCI_IO_REQUEST_DATA_DIRECTION
It's an unnecessary typedef that mirrors the kernel's enum
dma_data_direction.

Also cleanup some long variable names along the way.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Edmund Nadolski a7e536c7d6 isci: remove SCI_INVALID_HANDLE
Replace SCI_INVALID_HANDLE with NULL

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Edmund Nadolski 74ea9c163a isci: remove unused SC_LIBRARY_HANDLE_T typedef
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 00:36:31 -07:00
Dan Williams 6f231dda68 isci: Intel(R) C600 Series Chipset Storage Control Unit Driver
Support for the up to 2x4-port 6Gb/s SAS controllers embedded in the
chipset.

This is a snapshot of the first publicly available version of the driver,
commit 4c1db2d0 in the 'historical' branch.

   git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git historical

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-02 22:56:22 -07:00
James Bottomley e73e079bf1 [SCSI] Fix oops caused by queue refcounting failure
In certain circumstances, we can get an oops from a torn down device.
Most notably this is from CD roms trying to call scsi_ioctl.  The root
cause of the problem is the fact that after scsi_remove_device() has
been called, the queue is fully torn down.  This is actually wrong
since the queue can be used until the sdev release function is called.
Therefore, we add an extra reference to the queue which is released in
sdev->release, so the queue always exists.

Reported-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-06-02 18:34:43 +09:00
Randy Dunlap 5be7ef0024 scsi: fix scsi_proc new kernel-doc warning
Fix kernel-doc warnings in scsi_proc.c:

  Warning(drivers/scsi/scsi_proc.c:390): No description found for parameter 'dev'
  Warning(drivers/scsi/scsi_proc.c:390): No description found for parameter 'data'
  Warning(drivers/scsi/scsi_proc.c:390): Excess function parameter 's' description in 'always_match'
  Warning(drivers/scsi/scsi_proc.c:390): Excess function parameter 'p' description in 'always_match'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-28 23:12:11 -07:00
Linus Torvalds 426048313d 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: (60 commits)
  [SCSI] lpfc 8.3.24: Extend BSG infrastructure and add link diagnostics
  [SCSI] lpfc 8.3.24: Add resource extent support
  [SCSI] lpfc 8.3.24: Add request-firmware support
  [SCSI] lpfc 8.3.24: Add SR-IOV control
  [SCSI] lpfc 8.3.24: Extended hardware support and support dump images
  [SCSI] lpfc 8.3.24: Miscellaneous Fixes and Corrections
  [SCSI] libsas: Add option for SATA soft reset
  [SCSI] libsas: check dev->gone before submitting sata i/o
  [SCSI] libsas: fix/amend device gone notification in sas_deform_port()
  [SCSI] MAINTAINERS update for SCSI (new email address)
  [SCSI] Fix Ultrastor asm snippet
  [SCSI] osst: fix warning
  [SCSI] osst: wrong index used in inner loop
  [SCSI] aic94xx: world-writable sysfs update_bios file
  [SCSI] MAINTAINERS: Add drivers/target/ entry
  [SCSI] target: Convert TASK_ATTR to scsi_tcq.h definitions
  [SCSI] target: Convert REPORT_LUNs to use int_to_scsilun
  [SCSI] target: Fix task->task_execute_queue=1 clear bug + LUN_RESET OOPs
  [SCSI] target: Fix bug with task_sg chained transport_free_dev_tasks release
  [SCSI] target: Fix interrupt context bug with stats_lock and core_tmr_alloc_req
  ...
2011-05-27 19:52:57 -07:00
James Smart 7ad20aa9d3 [SCSI] lpfc 8.3.24: Extend BSG infrastructure and add link diagnostics
Extend BSG infrastructure and add link diagnostics:
- Removed unnecessary copies in handling pass-through mbox cmds.
- Add embedded SLI_CONFIG support for BSG.
- Add multibuffer support.
- Implemented the setting up and tearing down Lancer FC device for performing
  internal and external loopback diagnostic tests.
- Implemented the driver support for performing new link diagnostic tests

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:39 -05:00
James Smart 6d368e5321 [SCSI] lpfc 8.3.24: Add resource extent support
This patch adds support for hardware that returns resource ids via
extents rather than contiguous ranges.

[jejb: checkpatch.pl fixes]
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:38 -05:00
James Smart 52d5244096 [SCSI] lpfc 8.3.24: Add request-firmware support
Add request-firmware support:
- Add support for request_firmware interface for INTF2 SLI4 ports.
- Add ability to reset SLI4 INTF2 ports.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:37 -05:00
James Smart 912e3acde6 [SCSI] lpfc 8.3.24: Add SR-IOV control
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:36 -05:00
James Smart c0c1151276 [SCSI] lpfc 8.3.24: Extended hardware support and support dump images
Extended hardware support and support dump images:
- Make the size to be MAILBOX_SYSFS_MAX (4096) so that it allows the maximum
  sysfs binary access interface possible.
- Add ids and model names for new hardware
- Add capability of inducing SLI4 firmware dump obj file

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:36 -05:00
James Smart 0558056c1e [SCSI] lpfc 8.3.24: Miscellaneous Fixes and Corrections
Miscellaneous Fixes and Corrections
- Remove the memset in the lpfc_sli4_remove_rpi_hdrs call.
- Correct swapping of SGE word 2 relative to offset value
- Reorganize CQ and EQ usage to comply with SLI4 Specification.
- Expand the driver to check the rn bit. Only detect an error if the error bit
  is set and the RN bit is NOT set.
- If mailbox completion code is not success AND the mailbox status is success,
  then and only then will the driver overwrite the mailbox status.
- When driver initializing device, if the device is on a PCIe bus, set
  PCI's "needs fundamental reset" bit so that EEH uses fundamental reset
  instead of hot reset for recovery.
- Prevent driver from using new WWN when changed in firmware (until driver
  reload)
- When HBA reports maximum SGE size > 0xffffffff (infinite), override
  with 0x80000000.
- Fixed potential missed SLI4 device initialization failure conditions.
- Added 100ms delay before driver action following IF_TYPE_2 function reset.
- Reverted patch to UNREG/REG on PLOGI to mapped/unmapped node.
- Add a check for the CVL received flag in the fcf inuse routine to avoid
  unregistering the fcf if Devloss fires before Delay discover timer fires.

Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:35 -05:00
Dave Jiang 1ca1e43e55 [SCSI] libsas: Add option for SATA soft reset
This allows a libsas driver to optionally provide a soft reset handler
for libata to drive.  The isci driver allows software to control the
assertion/deassertion of SRST.

[jejb: checkpatch.pl fixes]
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:33 -05:00
Dan Williams 3673f4bf6a [SCSI] libsas: check dev->gone before submitting sata i/o
Head off doomed-to-fail i/o in sas_queuecommand before sending it down
the ata path.

Before:
sd 7:0:0:0: [sdd] Synchronizing SCSI cache
ata8: no sense translation for status: 0x00
ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
ata8.00: device reported invalid CHS sector 0
ata8: status=0x00 { }
ata8: no sense translation for status: 0x00
ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
ata8.00: device reported invalid CHS sector 0
ata8: status=0x00 { }
ata8: no sense translation for status: 0x00
ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
ata8.00: device reported invalid CHS sector 0
ata8: status=0x00 { }
sd 7:0:0:0: [sdd]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 7:0:0:0: [sdd]  Sense Key : Aborted Command [current] [descriptor]
sd 7:0:0:0: [sdd]  Add. Sense: No additional sense information
sd 7:0:0:0: [sdd] Stopping disk

After:
sd 9:0:0:0: [sdd] Synchronizing SCSI cache
sd 9:0:0:0: [sdd]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 9:0:0:0: [sdd] Stopping disk
sd 9:0:0:0: [sdd] START_STOP FAILED
sd 9:0:0:0: [sdd]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK

This is a cosmetic change as sata i/o can still leak to a gone device,
but this addresses the nominal hotplug case when releasing the target.

Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:33 -05:00
Dan Williams 90f1e10d08 [SCSI] libsas: fix/amend device gone notification in sas_deform_port()
Commit 56dd2c06 "libsas: Don't issue commands to devices that have been
hot-removed" edited Darrick's original patch to remove setting 'gone' in
the sas_deform_port() path because that prevented scsi sync cache
commands from being issued when the driver was unloaded.  However, this
allows true device gone notifications (as signaled port phy events) to
trigger sync cache commands to devices that are known to be unreachable.

Teach libsas which sas_deform_port() invocations are likely device gone
events.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-26 22:49:32 -05:00
Linus Torvalds b7c2f03628 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:
  gfs2: Drop __TIME__ usage
  isdn/diva: Drop __TIME__ usage
  atm: Drop __TIME__ usage
  dlm: Drop __TIME__ usage
  wan/pc300: Drop __TIME__ usage
  parport: Drop __TIME__ usage
  hdlcdrv: Drop __TIME__ usage
  baycom: Drop __TIME__ usage
  pmcraid: Drop __DATE__ usage
  edac: Drop __DATE__ usage
  rio: Drop __DATE__ usage
  scsi/wd33c93: Drop __TIME__ usage
  scsi/in2000: Drop __TIME__ usage
  aacraid: Drop __TIME__ usage
  media/cx231xx: Drop __TIME__ usage
  media/radio-maxiradio: Drop __TIME__ usage
  nozomi: Drop __TIME__ usage
  cyclades: Drop __TIME__ usage
2011-05-26 13:19:00 -07:00
Linus Torvalds 798ce8f1cc Merge branch 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.40/core' of git://git.kernel.dk/linux-2.6-block: (40 commits)
  cfq-iosched: free cic_index if cfqd allocation fails
  cfq-iosched: remove unused 'group_changed' in cfq_service_tree_add()
  cfq-iosched: reduce bit operations in cfq_choose_req()
  cfq-iosched: algebraic simplification in cfq_prio_to_maxrq()
  blk-cgroup: Initialize ioc->cgroup_changed at ioc creation time
  block: move bd_set_size() above rescan_partitions() in __blkdev_get()
  block: call elv_bio_merged() when merged
  cfq-iosched: Make IO merge related stats per cpu
  cfq-iosched: Fix a memory leak of per cpu stats for root group
  backing-dev: Kill set but not used var in  bdi_debug_stats_show()
  block: get rid of on-stack plugging debug checks
  blk-throttle: Make no throttling rule group processing lockless
  blk-cgroup: Make cgroup stat reset path blkg->lock free for dispatch stats
  blk-cgroup: Make 64bit per cpu stats safe on 32bit arch
  blk-throttle: Make dispatch stats per cpu
  blk-throttle: Free up a group only after one rcu grace period
  blk-throttle: Use helper function to add root throtl group to lists
  blk-throttle: Introduce a helper function to fill in device details
  blk-throttle: Dynamically allocate root group
  blk-cgroup: Allow sleeping while dynamically allocating a group
  ...
2011-05-25 09:14:07 -07:00
Roland Dreier dbee8a0aff x86: remove 32-bit versions of readq()/writeq()
The presense of a writeq() implementation on 32-bit x86 that splits the
64-bit write into two 32-bit writes turns out to break the mpt2sas driver
(and in general is risky for drivers as was discussed in
<http://lkml.kernel.org/r/adaab6c1h7c.fsf@cisco.com>).  To fix this,
revert 2c5643b1c5 ("x86: provide readq()/writeq() on 32-bit too") and
follow-on cleanups.

This unfortunately leads to pushing non-atomic definitions of readq() and
write() to various x86-only drivers that in the meantime started using the
definitions in the x86 version of <asm/io.h>.  However as discussed
exhaustively, this is actually the right thing to do, because the right
way to split a 64-bit transaction is hardware dependent and therefore
belongs in the hardware driver (eg mpt2sas needs a spinlock to make sure
no other accesses occur in between the two halves of the access).

Build tested on 32- and 64-bit x86 allmodconfig.

Link: http://lkml.kernel.org/r/x86-32-writeq-is-broken@mdm.bga.com
Acked-by: Hitoshi Mitake <h.mitake@gmail.com>
Cc: Kashyap Desai <Kashyap.Desai@lsi.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Ravi Anand <ravi.anand@qlogic.com>
Cc: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Jason Uhlenkott <juhlenko@akamai.com>
Acked-by: James Bottomley <James.Bottomley@parallels.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-05-25 08:39:44 -07:00
Linus Torvalds f50d1d9e8d Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: Make struct pcmcia_device_id const, sound drivers edition
  staging: pcmcia: Convert pcmcia_device_id declarations to const
  pcmcia: Convert pcmcia_device_id declarations to const
  pcmcia: Make declaration and uses of struct pcmcia_device_id const
  pcmcia/sa1100: put sa11x0_pcmcia_hw_init[] to .devinit.data
2011-05-24 13:28:35 -07:00
Samuel Thibault fad4dab5e4 [SCSI] Fix Ultrastor asm snippet
Commit 1292500b replaced

"=m" (*field) : "1" (*field)

with

"=m" (*field) :

with comment "The following patch fixes it by using the '+' operator on
the (*field) operand, marking it as read-write to gcc."
'+' was actually forgotten.  This really puts it.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 13:25:35 -04:00
Andrew Morton 6e2037b0fd [SCSI] osst: fix warning
drivers/scsi/osst.c: In function '__os_scsi_tape_open':
drivers/scsi/osst.c:4705: warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 13:09:41 -04:00
Roel Kluin a061f57d66 [SCSI] osst: wrong index used in inner loop
Index i was already used in the outer loop.  Fixes a potentially-infinite
loop.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Willem Riede <osst@riede.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 13:08:57 -04:00
Vasiliy Kulikov 8e91096597 [SCSI] aic94xx: world-writable sysfs update_bios file
Don't allow everybody to load firmware.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 13:08:39 -04:00
David Jeffery 3eef6257de [SCSI] Reduce error recovery time by reducing use of TURs
In error recovery, most scsi error recovery stages will send a TUR command
for every bad command when a driver's error handler reports success.  When
several bad commands to the same device, this results in a device
being probed multiple times.

This becomes very problematic if the device or connection is in a state
where the device still doesn't respond to commands even after a recovery
function returns success.  The error handler must wait for the test
commands to time out.  The time waiting for the redundant commands can
drastically lengthen error recovery.

This patch alters the scsi mid-layer's error routines to send test commands
once per device instead of once per bad command.  This can drastically
lower error recovery time.

[jejb: fixed up whitespace and formatting]
Signed-of-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:51:53 -04:00
Luben Tuikov 0bcaa11154 [SCSI] Retrieve the Caching mode page (version 2)
Some kernel transport drivers unconditionally disable
retrieval of the Caching mode page. One such for example is
the BBB/CBI transport over USB. Such a restraint is too
harsh as some devices do support the Caching mode
page. Unconditionally enabling the retrieval of this mode
page over those transports at their transport code level may
result in some devices failing and becoming unusable.

This patch implements a method of retrieving the Caching
mode page without unconditionally enabling it in the
transports which unconditionally disable it. The idea is to
ask for all supported pages, page code 0x3F, and then search
for the Caching mode page in the mode parameter data
returned. The sd driver already asks for all the mode pages
supported by the attached device by setting the page code to
0x3F in order to find out if the media is write protected by
reading the WP bit in the Device Specific Parameter
field. It then attempts to retrieve only the Caching mode
page by setting the page code to 8 and actually attempting
to retrieve it if and only if the transport allows it.

The method implemented here is that if the transport doesn't
allow retrieval of the Caching mode page and the device is
not RBC, then we ask for all pages supported by setting the
page code to 0x3F (similarly to how the WP bit is retrieved
above), and then we search for the Caching mode page in the
mode parameter data returned.

With this patch, devices over SATA, report this (no change):

Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: Attached scsi generic sg0 type 0
Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: [sda] Write Protect is off
Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
Oct 22 18:45:58 localhost kernel: sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

Smart devices report their Caching mode page. This is a
change where we'd previously see the kernel making
assumption about the device's cache being write-through:

Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: Attached scsi generic sg2 type 0
Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: [sdb] 610472646 4096-byte logical blocks: (2.50 TB/2.27 TiB)
Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: [sdb] Write Protect is off
Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: [sdb] Mode Sense: 47 00 10 08
Oct 22 18:45:58 localhost kernel: sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA

And "dumb" devices over BBB, are correctly shown not to
support reporting the Caching mode page:

Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] 15663104 512-byte logical blocks: (8.01 GB/7.46 GiB)
Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] Write Protect is off
Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] Mode Sense: 23 00 00 00
Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] No Caching mode page present
Oct 22 18:49:06 localhost kernel: sd 7:0:0:0: [sdc] Assuming drive cache: write through

Version 2 adds this:

Some devices don't support page code 0x3F, and others require a
fixed transfer length of 192 bytes. This single commit includes a
patch by Alan Stern which fixes this.

Reported-and-tested-by: Richard Senior <richard@r-senior.demon.co.uk>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:43:52 -04:00
Eddie Wai 9ae58e144d [SCSI] bnx2i: Optimized the iSCSI offload performance
Modified the event coalescing code for iSCSI offload to combat both
corner cases and optimize performance as follows:

1. Added mechanism to loop back a second time to process any leftover
CQEs that was generated by the hardware during the time the driver is
busy processing previous CQEs in the bh.  This not only helps the
performance but also fixes the corner case when no more CQEs are being
generated in the pipeline; so those leftover CQEs will get a a chance
to be processed.

2. Added ARM_CQE_FP to distinguish between fast path arming versus
slow path arming.  This change will guarantee that the CQEs will
always get a chance to be re-armed during fast path completions.

3. Removed the inline event coalescing division for perf optimization.
Also fixed a division-by-zero error when the event_coal_div module
param was set to 0.

4. Changed the default SQ WQEs size from 256 to 128 to match chip
default.

5. Changed the cmd_per_lun from 32 to 24.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:41:10 -04:00
Eddie Wai d5307a078b [SCSI] bnx2i: Updated the connection shutdown/cleanup timeout
Modified the 10s wait time for inflight offload connections to
advance to the next state to 2s based on test result.
Modified the 20s shutdown timeout to 30s based on test result.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:40:57 -04:00
Eddie Wai 7287c63e98 [SCSI] bnx2i: Fixed packet error created when the sq_size is set to 16
The number of chip's internal command cell, which is use to generate
SCSI cmd packets to the target, was not initialized correctly by
the driver when the sq_size is changed from the default 128.
This, in turn, will create a problem where the chip's transmit pipe
will erroneously reuse an old command cell that is no longer valid.
The fix is to correctly initialize the chip's command cell upon setup.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:40:45 -04:00
Vikas Chaudhary 6b278656f2 [SCSI] qla4xxx: Update driver version to 5.02.00-k7
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:40:34 -04:00
Harish Zunjarrao 7ad633c06b [SCSI] qla4xxx: Added vendor specific sysfs attributes
Added fw_version, serial_num, iscsi version and boot loader version
sysfs attributes.

Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:40:23 -04:00
Vikas Chaudhary 8f0722cae6 [SCSI] qla4xxx: Remove host_lock in queuecommand function
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:40:12 -04:00
Lalit Chandivade 1b46807e0b [SCSI] qla4xxx: Remove AF_DPC_SCHEDULED flag from ha.
Since queue_work does not requeue, there is no need to check
if a work is in progress using the AF_DPC_SCHEDULED flag.
queue_work would return if work is pending without adding the
work, do_dpc would again get invoked from qla4xxx_timer if
there is still DPC flags set.

Signed-off-by: Lalit Chandivade <lalit.chandivade@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:40:02 -04:00
Vikas Chaudhary 977f46a4bb [SCSI] qla4xxx: Don't check FW alive if ISP82XX reset is in progress
Corrected logic to don't check for F/W is alive if reset is already
in progress for ISP82XX

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:39:52 -04:00
Vikas Chaudhary 0160ef1269 [SCSI] qla4xxx: Don't process mbx interrupt unconditionally
Do not process interrupt unconditionally during mailbox processing  which can
lead to spurious interrupt. Mailbox completion are now polled if interrupt are
disabled or wait for interrupt to come in if its enabled

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:39:42 -04:00
Prasanna Mumbai 6d78bd56be [SCSI] qla4xxx: Complete the cmd if sense_len is zero
Complete the cmd if sense length is zero. For cases where sense
data spans across multiple iocb's by FW, we need to hold on to the
I/O (ha->status_srb != NULL) till we have processed them all and
copied the sense data from internal buffer to scsi_cmd sense buffer.

Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:39:29 -04:00
Vikas Chaudhary 68d92ebf59 [SCSI] qla4xxx: Dump HW/FW reg to figure out what caused FW to be hung for ISP82XX
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:39:20 -04:00
Vikas Chaudhary cb74428ee3 [SCSI] qla4xxx: Updated the reset sequence for ISP82xx
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:38:57 -04:00
Prasanna Mumbai 185f107ef9 [SCSI] qla4xxx: update function qla4xxx_isr_decode_mailbox()
- Added MBOX_ASTS_DUPLICATE_IP AEN handling.
- Update MBOX_AEN_REG_COUNT to 8 so that driver will save status
  of all mbox registers in aen_q

Signed-off-by: Prasanna Mumbai <prasanna.mumbai@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:38:46 -04:00
Martin K. Petersen c498bf1a1b [SCSI] scsi_trace: Decode UNMAP bit in WRITE SAME(10)
As of SBC3r26 WRITE SAME(10) supports the UNMAP bit.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:38:36 -04:00
Martin K. Petersen 756aca7edd [SCSI] mpt2sas: Fix missing reference tag seed with Type 2 devices
Ensure that the initial reference tag is passed on to the HBA firmware
for DIF Type 2 devices.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Kashyap Desai <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:38:25 -04:00
Martin K. Petersen 2a8cfad06e [SCSI] sd: Unmap discard alignment needs to be converted to bytes
The block layer discard alignment is reported in bytes, not in units of
the logical block size.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:38:15 -04:00
Jing Huang 45d7f0cc58 [SCSI] bfa: kdump fix
Root cause: When kernel crashes, bfa IOC state machine and FW doesn't get
a notification and hence are not cleanly shutdown. So registers holding
driver/IOC state information are not reset back to valid disabled/parking
values. This causes subsequent driver initialization to hang during kdump
kernel boot.

Fix description: during the initialization of first PCI function, reset
corresponding register when unclean shutown is detect by reading chip
registers. This will make sure that ioc/fw gets clean re-initialization.

Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:38:02 -04:00
Wayne Boyer a5442ba4a4 [SCSI] ipr: fix possible false positive detection of stuck interrupt
If the driver is getting flooded with interrupts, there's a possibility
that the interrupt service routine could falsely detect a stuck interrupt
condition and reset the adapter.

This patch changes the logic such that the routine will loop back into
the command processing code one more time after detecting the stuck
interrupt signature.  If there are no commands to process after that pass,
and the interrupt is still not cleared, then the driver will print the
"Error clearing HRRQ" message and reset the adapter.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:37:50 -04:00
Robert Love d85e607b34 [SCSI] libfcoe: Remove unnecessary module state checks
libfcoe's interface consists of create, destroy, enable,
disable and create_vn2vn. These are currently module
paramaters added durring the module initialization. A
concern arose that the module parameters were being added
with write permissions before the module had completed
initialization. The following code was added to each
sysfs store file.

* Make sure the module has been initialized, and is not about to be
* removed.  Module parameter sysfs files are writable before the
* module_init function is called and after module_exit.
*/
if (THIS_MODULE->state != MODULE_STATE_LIVE)
    goto out_nodev;

This check was called out as unhelpful as the module can
go dead at any time and therefore its state isn't a reliable
thing to look at as a sign of stability and initialization
completion. Also, that functional interfaces like these
should be added after module initialization.

This patch removes the unnecessary checks and hopes to
disprove the concern about initialization ordering.

Recent fcoe transport rework changes now require fcoe
transports to register with libfcoe before any operation
can take place. libfcoe may access some static variables
but nothing that could cause a problem. Once a fcoe transport
is registered, libfcoe is usable and any interface calls will
be functional.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:37:35 -04:00
Yi Zou 8467b96c03 [SCSI] libfc: do not immediately retry the cmd when seq_send fails in fc_fcp_send_data
Currently, when seq_send() fails in fc_fcp_send_data(),
fc_fcp_retry_cmd() would complete this failed I/O directly and let
scsi-ml retry. However, target side is not notified which may hang the
target. Instead, we should just bail out from from fc_fcp_send_data
and let scsi-ml times it out and aborts this I/O instead.

Signed-off-by: Yi Zou <yi.zou@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 <jbottomley@parallels.com>
2011-05-24 12:37:25 -04:00
Vasu Dev 0a219edb26 [SCSI] libfc: fix race in SRR response
In this case fsp was freed before error handler was invoked,
this is fixed by having SRR fsp reference freed by exch
destructor so that fsp will be always held until it exch
is freed.

Also don't reset fsp->recov_seq since this is needed by
SRR error handler to do exch done.

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 <jbottomley@parallels.com>
2011-05-24 12:37:15 -04:00
Vasu Dev 8d23f4ba38 [SCSI] libfc: don't call resp handler after FC_EX_TIMEOUT
In cases exch is already timed out then exch layer could
end up calling resp handler again for its response frame
received after timeout, though in this case fc_exch_timeout
handler would have already called resp with FC_EX_TIMEOUT.

This would cause REC response handler to release its
fsp pkt hold twice instead once and possibly similar issues
with other ELS exchanges in this race.

To avoid this race have resp updated under exch lock
in rx path, the resp would get set to NULL in case
of FC_EX_TIMEOUT under the same lock to prevent resp
callback after FC_EX_TIMEOUT.

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 <jbottomley@parallels.com>
2011-05-24 12:37:03 -04:00
Yi Zou 6a716a8535 [SCSI] libfc: release DDP context if frame_send() fails
In case frame_send() fails, make sure to let the underlying HW release the DDP
context that has already been set up before calling frame_send().

Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:36:51 -04:00
Hillf Danton 83383dd11a [SCSI] libfc: fix mm leak in handling incoming request for target discovery
When handling incoming request, if the operation code carried by the
received frame is not RSCN, the frame should be freed as in the RSCN
case, or there is 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 <jbottomley@parallels.com>
2011-05-24 12:36:41 -04:00
Neerav Parikh bdf252183e [SCSI] fcoe: Prevent creation of an NPIV port with duplicate WWPN
This patch adds a validation step before allowing creation of a new NPIV port.
It checks whether the WWPN passed for the new NPIV port to be created is unique
for the given physical port.

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 <jbottomley@parallels.com>
2011-05-24 12:36:29 -04:00
Bhanu Prakash Gollapudi c051ad2e57 [SCSI] libfcoe: Incorrect CVL handling for NPIV ports
Host doesnt handle CVL to NPIV instantiated ports correctly.
- As per FC-BB-5 Rev 2 CVLs with no VN_Port descriptors shall be treated as
  implicit logout of ALL vn_ports.
- CVL for NPIV ports should be handled before physical port even if descriptor
  for physical port appears before NPIV ports

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:36:17 -04:00
adam radford 4f788dce0b [SCSI] megaraid_sas: Version and Changelog update
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:36:06 -04:00
adam radford 3cc6851f9a [SCSI] megaraid_sas: Add 1078 OCR support
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:35:56 -04:00
adam radford 495c560970 [SCSI] megaraid_sas: Convert 6,10,12 byte CDB's for FastPath IO
The following patch for megaraid_sas converts 6,10,12 byte CDB's to 16
byte CDB for large LBA's for FastPath IO.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:35:46 -04:00
adam radford 541f90b7c6 [SCSI] megaraid_sas: Fix bug where AENs could be lost in probe() and resume()
Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:35:34 -04:00
adam radford 46fd256e05 [SCSI] megaraid_sas: Disable interrupts/free_irq() in megasas_shutdown()
The following patch for megaraid_sas disables interrupts and
free_irq() in megasas_shutdown().

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:35:09 -04:00
adam radford 7e70e73365 [SCSI] megaraid_sas: Check MFI_REG_STATE.fault.resetAdapter
The following patch for megaraid_sas fixes the function
megasas_reset_fusion() and makes the reset code check
MFI_REG_STATE.fault.resetAdapter.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:34:59 -04:00
adam radford 70d031f36f [SCSI] megaraid_sas: Remove un-used function
The following patch for megaraid_sas removes un-used function
megasas_return_cmd_for_smid().

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:34:47 -04:00
adam radford 3f1abce4ab [SCSI] megaraid_sas: Remove MSI-X black list, use MFI_REG_STATE instead
This patch for megaraid_sas removes the MSI-X black list and uses
MFI_REG_STATE.ready.msiEnable instead.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:34:12 -04:00
Xiangliang Yu bb650a1bef [SCSI] libsas: fix SATA NCQ error
Current version of libsas can not handle SATA NCQ error.
This patch handle SATA NCQ error as AHCI do.

Signed-off-by: Xiangliang Yu <yuxiangl@marvell.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:34:01 -04:00
Kashyap, Desai 5fd5cc83a8 [SCSI] mpt2sas: Driver version upgrade 08.100.00.02
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:33:35 -04:00
Kashyap, Desai 3ace8e052b [SCSI] mpt2sas: move even handling of MPT2SAS_TURN_ON_FAULT_LED into process context
Driver was a sending a SEP request during interrupt context which
required to go to sleep.

The fix is to rearrange the code so a fake event
MPT2SAS_TURN_ON_FAULT_LED is fired from interrupt context, then later
during the kernel worker threads processing, the SEP request is issued
to firmware.

Cc: stable@kernel.org
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
2011-05-24 12:33:01 -04:00
Linus Torvalds 57d19e80f4 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: (39 commits)
  b43: fix comment typo reqest -> request
  Haavard Skinnemoen has left Atmel
  cris: typo in mach-fs Makefile
  Kconfig: fix copy/paste-ism for dell-wmi-aio driver
  doc: timers-howto: fix a typo ("unsgined")
  perf: Only include annotate.h once in tools/perf/util/ui/browsers/annotate.c
  md, raid5: Fix spelling error in comment ('Ofcourse' --> 'Of course').
  treewide: fix a few typos in comments
  regulator: change debug statement be consistent with the style of the rest
  Revert "arm: mach-u300/gpio: Fix mem_region resource size miscalculations"
  audit: acquire creds selectively to reduce atomic op overhead
  rtlwifi: don't touch with treewide double semicolon removal
  treewide: cleanup continuations and remove logging message whitespace
  ath9k_hw: don't touch with treewide double semicolon removal
  include/linux/leds-regulator.h: fix syntax in example code
  tty: fix typo in descripton of tty_termios_encode_baud_rate
  xtensa: remove obsolete BKL kernel option from defconfig
  m68k: fix comment typo 'occcured'
  arch:Kconfig.locks Remove unused config option.
  treewide: remove extra semicolons
  ...
2011-05-23 09:12:26 -07:00
Linus Torvalds 06f4e926d2 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: (1446 commits)
  macvlan: fix panic if lowerdev in a bond
  tg3: Add braces around 5906 workaround.
  tg3: Fix NETIF_F_LOOPBACK error
  macvlan: remove one synchronize_rcu() call
  networking: NET_CLS_ROUTE4 depends on INET
  irda: Fix error propagation in ircomm_lmp_connect_response()
  irda: Kill set but unused variable 'bytes' in irlan_check_command_param()
  irda: Kill set but unused variable 'clen' in ircomm_connect_indication()
  rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()
  be2net: Kill set but unused variable 'req' in lancer_fw_download()
  irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()
  atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.
  rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
  rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()
  rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()
  rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()
  pkt_sched: Kill set but unused variable 'protocol' in tc_classify()
  isdn: capi: Use pr_debug() instead of ifdefs.
  tg3: Update version to 3.119
  tg3: Apply rx_discards fix to 5719/5720
  ...

Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c
as per Davem.
2011-05-20 13:43:21 -07:00
Linus Torvalds ad9471752e 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: (110 commits)
  [SCSI] qla2xxx: Refactor call to qla2xxx_read_sfp for thermal temperature.
  [SCSI] qla2xxx: Unify the read/write sfp mailbox command routines.
  [SCSI] qla2xxx: Clear complete initialization control block.
  [SCSI] qla2xxx: Allow an override of the registered maximum LUN.
  [SCSI] qla2xxx: Add host number in reset and quiescent message logs.
  [SCSI] qla2xxx: Correctly read sfp single byte mailbox register.
  [SCSI] qla2xxx: Add qla82xx_rom_unlock() function.
  [SCSI] qla2xxx: Log if qla82xx firmware fails to load from flash.
  [SCSI] qla2xxx: Use passed in host to initialize local scsi_qla_host in queuecommand function
  [SCSI] qla2xxx: Correct buffer start in edc sysfs debug print.
  [SCSI] qla2xxx: Update firmware version after flash update for ISP82xx.
  [SCSI] qla2xxx: Fix hang during driver unload when vport is active.
  [SCSI] qla2xxx: Properly set the dsd_list_len for dsd_chaining in cmd type 6.
  [SCSI] qla2xxx: Fix virtual port failing to login after chip reset.
  [SCSI] qla2xxx: Fix vport delete hang when logins are outstanding.
  [SCSI] hpsa: Change memset using sizeof(ptr) to sizeof(*ptr)
  [SCSI] ipr: Rate limit DMA mapping errors
  [SCSI] hpsa: add P2000 to list of shared SAS devices
  [SCSI] hpsa: do not attempt PCI power management reset method if we know it won't work.
  [SCSI] hpsa: remove superfluous sleeps around reset code
  ...
2011-05-20 13:29:52 -07:00
Jens Axboe 698567f3fa Merge commit 'v2.6.39' into for-2.6.40/core
Since for-2.6.40/core was forked off the 2.6.39 devel tree, we've
had churn in the core area that makes it difficult to handle
patches for eg cfq or blk-throttle. Instead of requiring that they
be based in older versions with bugs that have been fixed later
in the rc cycle, merge in 2.6.39 final.

Also fixes up conflicts in the below files.

Conflicts:
	drivers/block/paride/pcd.c
	drivers/cdrom/viocd.c
	drivers/ide/ide-cd.c

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-05-20 20:33:15 +02:00
Linus Torvalds fce519588a Merge branch 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6:
  drivercore: revert addition of of_match to struct device
  of: fix race when matching drivers
2011-05-18 13:25:57 -07:00
Grant Likely b1608d69cb drivercore: revert addition of of_match to struct device
Commit b826291c, "drivercore/dt: add a match table pointer to struct
device" added an of_match pointer to struct device to cache the
of_match_table entry discovered at driver match time.  This was unsafe
because matching is not an atomic operation with probing a driver.  If
two or more drivers are attempted to be matched to a driver at the
same time, then the cached matching entry pointer could get
overwritten.

This patch reverts the of_match cache pointer and reworks all users to
call of_match_device() directly instead.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-18 12:32:23 -06:00
Linus Torvalds a2b9c1f620 Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  block: don't delay blk_run_queue_async
  scsi: remove performance regression due to async queue run
  blk-throttle: Use task_subsys_state() to determine a task's blkio_cgroup
  block: rescan partitions on invalidated devices on -ENOMEDIA too
  cdrom: always check_disk_change() on open
  block: unexport DISK_EVENT_MEDIA_CHANGE for legacy/fringe drivers
2011-05-18 06:49:02 -07:00
Jens Axboe 9937a5e2f3 scsi: remove performance regression due to async queue run
Commit c21e6beb removed our queue request_fn re-enter
protection, and defaulted to always running the queues from
kblockd to be safe. This was a known potential slow down,
but should be safe.

Unfortunately this is causing big performance regressions for
some, so we need to improve this logic. Looking into the details
of the re-enter, the real issue is on requeue of requests.

Requeue of requests upon seeing a BUSY condition from the device
ends up re-running the queue, causing traces like this:

scsi_request_fn()
        scsi_dispatch_cmd()
                scsi_queue_insert()
                        __scsi_queue_insert()
                                scsi_run_queue()
					scsi_request_fn()
						...

potentially causing the issue we want to avoid. So special
case the requeue re-run of the queue, but improve it to offload
the entire run of local queue and starved queue from a single
workqueue callback. This is a lot better than potentially
kicking off a workqueue run for each device seen.

This also fixes the issue of the local device going into recursion,
since the above mentioned commit never moved that queue run out
of line.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-05-17 11:04:44 +02:00
Joe Carnuccio 6ad11eaa8a [SCSI] qla2xxx: Refactor call to qla2xxx_read_sfp for thermal temperature.
Eliminate duplicate code by refactoring the calls to qla2xxx_read_sfp()
in qla2x00_get_thermal_temp(). This keeps the parameter values separate
from the mailbox register mechanics. This also allows qla2xxx_read_sfp()
to be the sole "spec" for READ SFP semantics.

Signed-off_by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:39:25 +04:00
Joe Carnuccio 6766df9e8a [SCSI] qla2xxx: Unify the read/write sfp mailbox command routines.
Make the read/write sfp mailbox command routines uniform, and remove redundancy.
Also protect against attempting to do a single byte dma in these routines.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:36:23 +04:00
Andrew Vasquez 773120e4df [SCSI] qla2xxx: Clear complete initialization control block.
Use proper init_cb_size member which takes into account
MID/non-MID init-cb structure sizes.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:35:57 +04:00
Andrew Vasquez 82515920b6 [SCSI] qla2xxx: Allow an override of the registered maximum LUN.
The 'max_lun' value registered for each scsi_host is currently
capped at 0xffff.  The new module parameter can allow for
2nd-level flat-space addressing method-infrastructure to be
supported.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:34:56 +04:00
Saurav Kashyap 24014d0464 [SCSI] qla2xxx: Add host number in reset and quiescent message logs.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:34:37 +04:00
Joe Carnuccio 1bff6cc8fb [SCSI] qla2xxx: Correctly read sfp single byte mailbox register.
When reading a single byte using the READ SFP mailbox command, the
single byte of data is returned in MB[1] and not MB[8].

The reason that MB[8] was being used is that the spec was unclear
as it evolved over time; and we have not needed to read a single
byte until recently.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2011-05-17 11:34:20 +04:00