dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

117050 Commits

Author SHA1 Message Date
Dan Williams e4a867bb4a isci: kill remote_device complete_task_handler
This is unused infrastructure.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams 84b9b029bc isci: unify remote_device start_task_handlers
Implement all states in scic_sds_remote_device_start_task() and delete
the state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams c027a20bf3 isci: kill remote_device continue_io_handler
This is unused infrastructure.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams 10a09e64be isci: unify remote_device complete_io_handlers
Implement all states in scic_sds_remote_device_complete_io() and delete
the state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams 1860655706 isci: unify remote_device start_io_handlers
Implement all states in scic_sds_remote_device_start_io() and delete the
state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams 8151518265 isci: unify remote_device reset_complete_handlers
Implement all states in scic_remote_device_reset_complete() and delete the
state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams 4fd0d2e9bf isci: unify remote_device reset_handlers
Implement all states in scic_remote_device_reset() and delete the state
handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams b8d82f6cdd isci: unify remote_device destruct_handlers
Implement all states in scic_remote_device_destruct() and delete the state
handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams 1a6de2562b isci: kill remote_device fail_handler
This is just unused infrastructure.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams ec5756699b isci: unify remote_device stop_handlers
Implement all states in scic_remote_device_stop() and delete the state
handlers.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams eb229671b1 isci: unify remote_device start_handlers
Implement all states in scic_remote_device_start() and delete the state
handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:44 -07:00
Dan Williams f619fffb40 isci: fix remote_device start_io regressions
While reducing indentation commits 7ab92c9e "isci: make a
remote_node_context a proper member of a remote_device", 0879e6a6 "isci:
merge remote_device substates into a single state machine" broke
handling of situations where i/o's successfully started at the port
level need to terminated when the remote_node declines to start the i/o.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:39 -07:00
Dan Williams 8f304c36ee isci: kill scic_remote_device_get_connection_rate
A function call to dereference a pointer is a tad much.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:39 -07:00
Dan Williams ab2e8f7d07 isci: merge remote_device substates into a single state machine
A substate is just a state, so uplevel the smp and stp device substates.
Three tricks at work here:

1/ scic_sds_remote_device_ready_state_enter: needs to know the the device type
   so it can immediately transition to a stp or smp ready substate.

2/ scic_sds_remote_device_ready_state_exit: needs to know the device type. In
   the ssp case the device is no longer ready, in the stp, and smp case we have
   simply exited to a ready "substate".

3/ scic_sds_remote_device_resume_complete_handler: The one location
   where we directly check the current state against
   SCI_BASE_REMOTE_DEVICE_STATE_READY needed to comprehend the possible ready
   substates.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:39 -07:00
Maciej Patelczyk be2f41c611 isci: Removed sci_object.h from project.
The sci_object.h file was removed. No sci_base_object
is now in the code.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:39 -07:00
Maciej Patelczyk 890cae9b8a isci: Removed sci_base_object from scic_sds_request.
The 'struct sci_base_object' was removed from the struct
scic_sds_request and was replaced by a pointer to
struct isci_request.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Maciej Patelczyk af23e85737 isci: Removed sci_base_object from scic_sds_remote_node_context.
The 'struct sci_base_object' was removed from the struct
scic_sds_remote_node_context.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Maciej Patelczyk 5d937e966d isci: Removed sci_base_object from scic_sds_remote_device.
The 'struct sci_base_object' was removed from the struct
scic_sds_remote_device.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[cleaned up sci_dev_to_idev]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Maciej Patelczyk 115bd1f9e8 isci: Removed sci_base_object from scic_sds_port.
The 'struct sci_base_object' was removed from the struct
scic_sds_port and was replaced by a pointer to
struct isci_port.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Maciej Patelczyk e1e72a00dd isci: Removed sci_base_object from scic_sds_phy.
The 'struct sci_base_object' was removed from the struct
scic_sds_phy and was replaced by a pointer to
struct isci_phy.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Maciej Patelczyk d3757c3aeb isci: Removed sci_base_object from scic_sds_controller.
The 'struct sci_base_object' was removed from the struct
scic_sds_controller and was replaced by a pointer to
struct isci_host.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Maciej Patelczyk 9a0fff7bf0 isci: Removed struct sci_base_object from state machine.
Changed any occurrence of struct sci_base_object into void.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Maciej Patelczyk e76d80579c isci: Implement SCU AFE recipe 10.
Updated SCU AFE initialization values accordingly to the recipe 10.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dave Jiang d2d61433a8 isci: Remove excessive log noise with expander hot-unplug
We are logging excessive output when hot unplug from expander. Moving
that to debug.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams d37ee7e89a isci: allow fallback to option-rom if efi variable retrieval fails
If the scu efi driver is disabled but the option-rom is enabled (during an efi
boot) allow the code to fallback to scanning legacy option-rom space for the
parameters.

Reported-by: Yinghai Lu <yinghai.lu@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dave Jiang 3d6e428c0c isci: removing non-working ATAPI code
Removing not used / bit-rotten ATAPI code. This needs to go back
and debugged at a later date.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[reflow against devel, delete dead sati headers]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams 1f4fa1f958 isci: remove scic_sds_remote_device_get_port_index
Longer to type than the open-coded equivalent.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams a3d568f0df isci: remove usage of sci_sas_address in scic_sds_remote_device
The sas address can be retrieved from the domain device and then
converted to the always little-endian format in the remote node context.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams 00d680ef84 isci: kill smp_discover_response
An lldd need never look at the contents of an smp_discover_response frame.
Kill the remaining locations where isci is looking at it:

1/ covering for expanders that do not set the stp_attached bit (already
   handled by sas_ex_discover_end_dev)
2/ an overkill method to notifiy the rest of the driver about remote_device
   sas addresses

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams a1a113b0a1 isci: kill smp_discover_response_protocols in favor of domain_device.dev_type
This is step 1 of removing the contortions to:
1/ unparse expander phy data into a smp discover frame
2/ open-code-parse the smp discover fram into a domain_device.dev_type equivalent

libsas has already spent cycles determining the dev_type, so now that
scic_sds_remote_device is unified with isci_remote_device we can
directly reference dev_type.

This might also change multi-level expander detection as we previously only
looked at dev_type == EDGE_DEV and we did not consider the FANOUT_DEV case.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams b87ee3075b isci: cleanup remote device construction and comments
The construction routines scic_remote_device_[de]a_construct both reference
the need to call scic_remote_device_construct first.  Delete that comment and
just have them call it explicitly, also:
* move the comments from header to source
* delete dead references to scic_[de]a_remote_device_add_phy

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams 88f3b62ac1 isci: move remote_device handling out of the core
Now that the core/lldd remote_device data structures are nominally unified
merge the corresponding sources into the top-level directory.  Also move the
remote_node_context infrastructure which has no analog at the lldd level.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams 57f20f4ed6 isci: unify remote_device data structures
Make it explicit that isci_remote_device and scic_sds_remote_device are
one in the same object.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:38 -07:00
Dan Williams 9614395ea2 isci: remove rnc->device back pointer
Now that they are one in the same object remove the back pointer reference
in favor of container_of.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Dan Williams 7ab92c9ed2 isci: make a remote_node_context a proper member of a remote_device
A rnc object has the same lifetime as its associated remote_device.  It might
get re-initialized, but a remote device always has an rnc member.  Preparation
for unifying scic_sds_remote_device and isci_remote_device

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Dan Williams 31e824ed0d isci: rely on irq core for intx multiplexing, and silence screaming intx
Remove the extra logic to poll each controller for interrupts, that's
the core's job for shared interrupts.

While testing noticed that a number of interrupts fire while waiting for
the completion tasklet to run, so added an irq-ack.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Dave Jiang e2023b8735 isci: replace this_* and the_* variables with more meaningful names
Removed any instances of the_* and this_* to variable names that are more
meaningful and tell us what they actually are.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Dan Williams 2d70de5a0f isci: validate oem parameters early, and fallback
If the platform specifies invalid parameters warn the user and fallback to
internal defaults rather than fail the driver load altogether.

Reported-by: Yinghai Lu <yinghai.lu@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Dan Williams f22be5d838 isci: fix oem parameter header definition
The element_length is 2 bytes.

Reported-by: Yinghai Lu <yinghai.lu@oracle.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Bartosz Barcinski 6cb4d6b382 isci: audit usage of BUG_ON macro in isci driver
Removes unnecessary usage of BUG_ON macro, excluding core directory.
In some cases macro is unnecesary, check is done in caller function.
In other cases macro is replaced by if construction with
appropriate warning.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[changed some survivable bug conditions to WARN_ONCE]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Bartosz Barcinski 467e855a03 isci: sparse warnings cleanup
Clean warnings and errors reported by sparse tool.

request.c:430:50: warning: mixing different enum types
remote_device.c:534:39: warning: symbol 'flags' shadows an earlier one
task.c:495:44: warning: mixing different enum types
scic_sds_controller.c:2155:24: warning: mixing different enum types
scic_sds_controller.c:2272:36: warning: mixing different enum types
scic_sds_controller.c:2911:38: warning: incorrect type in initializer (different address spaces)
scic_sds_controller.c:2913:25: warning: incorrect type in argument 2 (different address spaces)
scic_sds_request.c:875:34: warning: cast removes address space of expression
scic_sds_request.c:876:123: warning: incorrect type in argument 2 (different address spaces)
scic_sds_port.c:585:51: warning: incorrect type in assignment (different address spaces)
scic_sds_port.c:712:9: warning: incorrect type in argument 2 (different address spaces)
scic_sds_port.c:1770:25: warning: incorrect type in argument 2 (different address spaces)

Signed-off-by: Bartosz Barcinski <Bartosz.Barcinski@intel.com>
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[fixed up some false positives and misconversions]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Dan Williams 26bace349e isci: replace sci_sas_link_rate with sas_linkrate
Drop duplicated enum definition.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Maciej Trela d857d9a0ad isci: remove base_phy abstraction
Merge struct sci_base_phy into scic_sds_phy.  Until now sci_base_phy was
referenced using scic_sds_phy->parent field.

'sci_base_phy' state machine handlers were also merged into scic_sds_phy
state handlers.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Maciej Trela <Maciej.Trela@intel.com>
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Maciej Trela 41e2b90584 isci: remove base_port abstraction
Merge struct sci_base_port into scic_sds_port.  Until now sci_base_port
was referenced indirectly with scic_sds_port->parent field.

'sci_base_port' state machine handlers were also incorporated into
scic_sds_port handlers.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Maciej Trela <Maciej.Trela@intel.com>
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Maciej Trela 0ea99d52cb isci: remove base_remote_device abstraction
Merge struct sci_base_remote_device into scic_sds_remote_device.  As for
now sci_base_remote_device was accessed indirectly using
scic_sds_remote_device->parent field.  Both machine state handlers are
also merged together.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Maciej Trela <Maciej.Trela@intel.com>
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Christoph Hellwig c629582d0d isci: remove scic_controller state handlers
Remove the state handler indirections for the scic_controller, and replace
them with procedural calls that check for the correct state first.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Christoph Hellwig bc5c96748a isci: simplify dma coherent allocation
Remove the insane infrastructure for preallocating coheren DMA regions,
and just allocate the memory where needed.  This also gets rid of the
aligment adjustments given that Documentation/DMA-API-HOWTO.txt sais:

  "The cpu return address and the DMA bus master address are both
   guaranteed to be aligned to the smallest PAGE_SIZE order which
   is greater than or equal to the requested size.  This invariant
   exists (for example) to guarantee that if you allocate a chunk
   which is smaller than or equal to 64 kilobytes, the extent of the
   buffer you receive will not cross a 64K boundary."

Signed-off-by: Christoph Hellwig <hch@lst.de>
[djbw: moved allocation from start to init, re-add memset]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Christoph Hellwig 524b5f723b isci: simplify request state handlers
Instead of filling up tables with default handlers call the default
handler in the only caller.

IMHO the whole state handlers concept is not very suitable for the
isci request.  For example there is a single real instance of the
start handler, and we'd be much better off just having a check for
the right state in the only caller, than all this mess.  It's
quite similar for the abort handler as well.

Even the actual state machine has a lot of states that are rather
pointless.  The initial and constructed states are not needed at all
as the request is not reachable for calls before it's fully set up and
started.  And the abort state should be replaced with an abort actions
and a state transition to the completed state.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Christoph Hellwig 7814167678 isci: kill dead data structurs in scic_io_request.h
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Christoph Hellwig 38aa74eb70 isci: remove base_request abstraction
Merge struct sci_base_request into scic_sds_request, and also factor the two
types of state machine handlers into one function.  While we're at it also
remove lots of duplicate incorrect kerneldoc comments for the state machine
handlers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Christoph Hellwig ca841f0e86 isci: remove base_controller abstraction
Merge struct sci_base_controller into scic_sds_controller, and also factor
the two types of state machine handlers into one function.  While we're at
it also remove lots of duplicate incorrect kerneldoc comments for the state
machine handlers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:37 -07:00
Christoph Hellwig bc99aa4710 isci: remove mmio wrappers
Remove a couple of layers around read/writel to make the driver readable.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dan Williams 4393aa4e6b isci: fix fragile/conditional isci_host lookups
A domain_device can always reference back to ->lldd_ha unlike local lldd
structures.  Fix up cases where the driver uses local objects to look up the
isci_host.  This also changes the calling conventions of some routines to
expect a valid isci_host parameter rather than re-lookup the pointer on entry.

Incidentally cleans up some macros that are longer to type than the open-coded
equivalent:
  isci_host_from_sas_ha
  isci_dev_from_domain_dev

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dan Williams 037afc7812 isci: cleanup isci_remote_device[_not]_ready interface
Require a valid isci_host in support of the general cleanup to not
re-lookup the host via potentially fragile methods when more robust
methods are available.  Also cleans up some more casting that should be
using container_of() to up-cast a base structure in a more type-safe
manner.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Jeff Skirvin ed8a72d108 isci: Qualify when the host lock is managed for STP/SATA callbacks.
In the case of internal discovery related STP/SATA I/O started
through sas_execute_task the host lock is not taken by libsas before
calling lldd_execute_task, so the lock should not be managed before
calling back to libsas through task->task_done or sas_task_abort.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Jeff Skirvin 26e953bc6e isci: Fix use of SATA soft reset state machine.
The driver SATA LUN reset function incorrectly sent an SRST deassert
FIS, which is unnecessary because the core initiates the entire SATA
soft reset state machine from the assert request.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Jeff Skirvin ce4f75def3 isci: Free host lock for SATA/STP abort escalation at submission time.
In the case of I/O requests that fail at submit time because of a
pending reset condition, the host lock for SATA/STP devices must be
managed for any SCSI-initiated I/O before sas_task_abort is called.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Jeff Skirvin f219f010a3 isci: Properly handle requests in the "aborting" state.
When a TMF times-out, the request is set back to "aborting".
Requests in the "aborting" state must be terminated when
LUN and device resets occur.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dave Jiang de728b7d72 isci: Remove "screaming" data types
Converting the all CAPS data types to lower case.

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dan Williams 2828dc0b55 isci: remove unused "remote_device_started"
These routines are just stubs, re-add them when / if they are needed.  Also
cleanup remote_device_stopped.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dan Williams 35173d579a isci: namespacecheck cleanups
* mark needlessly global routines static
* delete unused functions
* move kernel-doc blocks from header files to source
* reorder some functions to delete declarations
* more default handler cleanups phy

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dan Williams 068b2c0363 isci: kill some long macros
Delete some macros that are longer to type than the open coded operation
that they perform.

scic_sds_phy_get_base_state_machine
scic_sds_phy_get_starting_substate_machine
scic_sds_port_get_base_state_machine
scic_sds_port_get_ready_substate_machine
scic_sds_remote_device_get_base_state_machine
scic_sds_remote_device_get_ready_substate_machine
scic_sds_remote_node_context_set_remote_node_index
scic_sds_controller_get_base_state_machine

Also performs some collateral cleanups like killing casts that assume
structure member ordering, and consolidating a lot of duplicated default
handler code (the primary callers of the *_get_base_state_machine macros) via
a helper.

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dan Williams f942f32ea0 isci: reorder init to cleanup unneeded declarations
Just move isci_pci_driver below the function definitions and delete the
declarations.  A couple other whitespace fixups, and unused symbol
deletions.

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dave Jiang 09d7da135b isci: Remove event_* calls as they are just wrappers
Removed isci_event_* calls and call those functions directly.

Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dan Williams 52ae18ac80 isci: fix a build warning
Use min_t to address:
drivers/scsi/isci/probe_roms.c: In function ‘isci_get_efi_var’:
drivers/scsi/isci/probe_roms.c:241: warning: comparison of distinct pointer types lacks a cast

Reported-by: David Milburn <dmilburn@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:00:36 -07:00
Dan Williams 4eefd2518a isci: fix apc mode definition
The original apc mode definition is the correct one, the fix from commit
4711ba10 "isci: fix oem parameter initialization and mode detection" was based
on a typo from a specification update.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:58:14 -07:00
Dave Jiang b5f18a201e isci: exposing user parameters via module params
Exposing the user config parameters through the kernel module parameters.
The kernel module params will have the default values set and we will no
longer pulling the default values for user params from the core.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:58:14 -07:00
Dan Williams 4711ba10b1 isci: fix oem parameter initialization and mode detection
1/ Since commit 858d4aa7 "isci: Move firmware loading to per PCI device" we have
   been silently falling back to built-in defaults for the parameter settings by
   skipping the call to scic_oem_parameters_set().

2/ The afe parameters from the firmware were not being honored

3/ The latest oem parameter definition flips the mode_type values which are
   now 0: for APC 1: for MPC.  For APC we need to make sure all the phys
   default to the same address otherwise strict_wide_ports will cause duplicate
   domains.

4/ Fix up the driver announcement to indicate the source of the
   parameters.

5/ Fix up the sas addresses to be unique per controller (in the fallback case)

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:31 -07:00
Dave Jiang 2e8320f751 isci: Fixup for OEM parameter EFI variable retrieval
Updating the EFI variable OEM parameter retrieval after examining the EFI
variable exported via sysfs.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:31 -07:00
Dan Williams 3b67c1f376 isci: fixup with testing from isci OROM in BIOS
Added fixups for the OROM parsing code after testing with BIOS OROM

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:31 -07:00
Dave Jiang 02839a8b51 isci: copy the oem parameters instead of assign
Since the data structure for oem from orom/efi/firmware is the same as what
the core uses, we can just do a direct copy instead of assignment.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Dave Jiang ca507b98e6 isci: update efi variable name and guid
These are the finalized values that the driver can expect to see in
production.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Henryk Dembkowski 07373a5caa isci: add support for 2 more oem parmeters
1/ add OEM paramater support for mode_type (MPC vs APC)
2/ add OEM parameter support for max_number_concurrent_device_spin_up
3/ cleanup scic_sds_controller_start_next_phy

todo: hook up the amp control afe parameters into the afe init code

Signed-off-by: Henryk Dembkowski <henryk.dembkowski@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
[cleaned up scic_sds_controller_start_next_phy]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Dave Jiang 8db37aabac isci: Adding EFI variable skeletal support
Adding EFI variable retrieving for OEM parameters. Still need GUID and
variable name.

Also updated the data struct for oem parameters and hex file for firmware

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[fix CONFIG_EFI=n compile error]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Dan Williams d044af17aa isci: Add support for probing OROM for OEM params
We need to scan the OROM for signature and grab the OEM parameters. We
also need to do the same for EFI. If all fails then we resort to user
binary blob, and if that fails then we go to the defaults.

Share the format with the create_fw utility so that all possible sources
of the parameters are in-sync.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Dan Williams 9affa289e2 isci: reset hardware at init
Don't assume the hardware is in a known state at init.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Dan Williams ce0b89f356 isci: task.h compile and checkpatch fixes
A usage of "FALSE" leaked in as well as some checkpatch escapes.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin c4b9e24c4b isci: don't hold scic_lock over calls to sas_task_abort()
In the case where submitted I/Os fail with the status code
SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED, the execute function now waits
until scic_lock is cleared before calling the helper function
"isci_request_signal_device_reset" which sets the flag for the pending
reset condition on the I/O.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Dan Williams 1077a57410 isci: fix incorrect assumptions about task->dev and task->dev->port being NULL
A domain_device has the same lifetime as its related scsi_target.  The
scsi_target is reference counted based on outstanding commands,
therefore it is safe to assume that if we have a valid sas_task that the
->dev pointer is also valid.

The asd_sas_port of a domain_device has the same lifetime as the driver
so it can also never be NULL as long as the sas_task is valid and the
driver is loaded.

This also cleans up isci_task_complete_for_upper_layer(), renames it to
isci_task_refuse() and notices that the isci_completion_selection
parameter was set to isci_perform_normal_io_completion by all callers.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Dan Williams 34cad85d18 isci: add "isci_id" attribute
Allow each controller to be identified via sysfs.

# cat /sys/class/scsi_host/host13/isci_id
1

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin 6e2802a7fc isci: All pending requests are terminated before stopping the device.
Make sure all pending I/O including any in the libsas error handler
process is cleaned-up.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin aa14510295 isci: Always set response/status for requests going into the error path.
In the case of I/O requests being failed because of a required device
reset condition, set the response and status to indicate an I/O failure.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Dan Williams 50e7f9b5a9 isci: Errors in the submit path for SATA devices manage the ap lock.
Since libsas takes the domain device sata_dev.ap->lock before submitting
a task, error completions in the submit path for SATA devices must
unlock/relock when completing the sas_task back to libsas.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin 70957a94d7 isci: Fixed BUG_ON in isci_abort_task_process_cb callback.
The request may be in the "aborted" or the "completed" state when
performing a task management operation on it.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin c3f42feb0c isci: Fix TMF build for SAS/SATA LUN reset cases.
In the case where a SAS or SATA LUN reset TMF is built a NULL pointer
dereference occurred because of the (unused) callback data pointer.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin 4dc043c410 isci: Termination handling cleanup, added termination timeouts.
Added a request "dead" state for use when a termination wait times-out.

isci_terminate_pending_requests now detaches the device's pending list
and terminates each entry on the detached list.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin cbb65c665b isci: Code review change for completion pointer cleanup.
Since the request structure contains a pointer to the completion to be
used if the request is being aborted or terminated, there is no reason
to pass the completion as a pointer to isci_terminate_request_core().

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@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:30 -07:00
Jeff Skirvin f0846c6891 isci: Cleaning up task execute path.
Made sure the device ready check accounts for all states.
Moved the aborted task check into the loop of pulling task requests
off of the submitted list.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
[remove host and device starting state checks]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin 1fad9e934a isci: save the i/o tag outside the scic request structure.
The pointer to the core representation of a request is marked NULL at
completion, but we need to save the i/o tag for task management.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
[revise changelog]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:30 -07:00
Jeff Skirvin ec6c9638b0 isci: Any reset indicated on an I/O completion escalates it to the error path.
If there is a pending device reset, the I/O is used to accomplish the reset by setting the
RESET bit in the task status, and then putting the task into the error handler
path using sas abort task.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@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:29 -07:00
Jeff Skirvin a5fde22536 isci: fix completion / abort path.
Corrected use of the request state_lock in the completion callback.

In the case where an abort (or reset) thread is trying to terminate an
I/O request, it sets the request state to "aborting" (or "terminating")
if the state is still "starting".  One of the bugs was to never set the
state to "completed".  Another was to not correctly recognize the
situation where the I/O had completed but the sas_task was still pending
callback to task_done - this was typically a problem in the LUN and
device reset cases.

It is now possible that we leave isci_task_abort_task() with
request->io_request_completion pointing to localy allocated
aborted_io_completion struct. It may result in a system crash.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Maciej Trela <Maciej.Trela@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:29 -07:00
Jeff Skirvin 11b00c194c isci: Changes in isci_host_completion_routine
Changes to move management of the reqs_in_process entry for the request here.
Made changes to note when the task is already in the abort path and
cannot be completed through callbacks.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@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:29 -07:00
Jeff Skirvin 18d3d72a42 isci: isci_request_cleanup_completed_loiterer checks task before task_done
In the condition where outstanding I/Os are being cleaned from the device
requests in process list, the cleanup function needs to check that the
request is actually a sas-task and not a task management function.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams 5409bc3a20 isci: cleanup debug leftovers in isci.h
Reported-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams 1a38045ba8 isci: replace remote_device_lock with scic_lock
The remote_device_lock is currently used to protect a controller global
resource (RNCs), but the remote_device_lock is per-port.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams d9c37390c4 isci: preallocate remote devices
Until we synchronize against device removal this limits the damage of
use after free bugs to the driver's own objects.  Unless we implement
reference counting we need to ensure at least a subset of a remote
device is valid at all times.  We follow the lead of other libsas
drivers that also preallocate devices.

This also enforces maximum remote device accounting at the lldd layer,
but the core may still run out of RNC's before we hit this limit.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams 6ad31fec30 isci: replace isci_remote_device completion with event queue
Replace the device completion infrastructure with the controller wide
event queue.  There was a potential for the stop and ready notifications
to corrupt each other, now that cannot happen.

The stop pending flag cannot be used until devices are statically
allocated.  We temporarily need to maintain a completion to handle
waiting for an object that has disappeared, but we can at least stop
scribbling on freed memory.

A future change will also get rid of the "stopping" state as it should
not be exposed to the rest of the driver.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams 8acaec1593 isci: kill "host quiesce" mechanism
The midlayer is already throttling i/o in the places where host_quiesce
was trying to prevent further i/o to the device.  It's also problematic
in that it holds a lock over GFP_KERNEL allocations.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams 3a97eec6d7 isci: remove sci_device_handle
It belies the fact that isci_remote_device and scic_sds_remote_device
are one in same object with the same lifetime rules.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams b329aff107 isci: kill isci_host list in favor of an array
isci_host_by_id() should have been a clue that an array would have been
a simpler approach.

Reported-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams 52bed8eab5 isci: enable isci for dmar builds
Now that phys_to_virt() and virt_to_phys() have been removed we are no
longer violating the dma mapping (or kmap apis).

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dan Williams fe9a643157 isci: pad stp and smp request sizes
Ross says:
 "The memory allocation for these requests doesn’t take into account the
  additional memory needed when the code in
  scic_sds_s[mst]p_request_assign_buffers() shifts the struct
  scu_task_context so that it is cache line aligned:

  In an example from my machine, total buffer that I’ve given to SCIC goes
  from 0x410024566f84 to 0x410024567308.  From this same example, this
  call shifts my task_context_buffer from 0x410024567208 to
  0x410024567240.

  This means that the task_context_buffer that used to range from
  0x410024567208 to 0x410024567308 instead now goes from 0x410024567240 to
  0x410024567340.

  When the memset() call at the end of scic_task_request_construct()
  clears out this task_context_buffer, it does so from 0x410024567240 to
  0x410024567340, effectively killing whatever buffer follows this
  allocation in memory."

djbw:
Use the kernel's PTR_ALIGN instead of
scic_sds_request_align_task_context_buffer() and SMP_CACHE_BYTES instead of
the local CACHE_LINE_SIZE definition.

TODO: These allocations really want to be better defined in a union rather
than opaque buffers carved up by macros.

Reported-by: Ross Zwisler <ross.zwisler@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:29 -07:00
Dan Williams 27ce51df9a isci: fix hang after target reset
When aborting a task context we need to be sure that the hardware has acted on
this request (retrieved the task context) before invalidating the remote node
context.  In the case of the "dummy" task context and remote node we do not
have the full state machine that goes through the complete tc abort and rnc
invalidate states.  Instead we ensure the hardware has seen and acted on

Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dave Jiang d7628d0522 isci: Cleanup warning messages for phy resets
Moving some of the chattiness of warning messages to debug so only the Linux
system messages are shown.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Dave Jiang 4d07f7f367 isci: Adding support for phy enable and disable
Adding support for PHY_FUNC_LINK_RESET and PHY_FUNC_DISABLE. This allow the
sysfs knob enable (both 0 and 1) and link_reset to work properly.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Pawel Marek c658b109d3 isci: controller stop/start fixes
Core reworks to support stopping and re-starting the controller, lays the
groundwork for phy disable / re-enable and fixes other bugs around port/phy
setup/teardown.

Signed-off-by: Pawel Marek <pawel.marek@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Piotr Sawicki 3ff0121a70 isci: handle cases where a d2h fis is used report an ncq error
Observed that some devices return a d2h fis, treat like an sdb error fis.

Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:29 -07:00
Tomasz Chudy a8d4b9fe91 isci: workaround port task scheduler starvation issue
There is a condition whereby TCs (task contexts) can jump to the head of
the round robin queue causing indefinite starvation of pending tasks.
Posting a TC to a suspended RNC (remote node context) causes the
hardware to select that task first, but since the RNC is suspended the
scheduler proceeds to the next task in the expected round robin fashion,
restoring TC arbitration fairness.

Signed-off-by: Tomasz Chudy <tomasz.chudy@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Dan Williams 7c40a80358 isci: rework timer api
Prepare the timer api for the arrival of dynamic creation and
destruction events from the core.  It pretended to do this previously
but the core to date only used it in a static init-time only fashion.
This is an interim fix until a cleaner event queue can be developed.

1/ make all locking external to the api (add WARN_ONCE to verify)
2/ add a timer_destroy interface (to be used by the core)
3/ use del_timer_sync() prior to deallocating timer data
4/ delete the "timer_list" indirection, we only have timers allocated
   for the isci_host
5/ fix detection of timer list allocation errors

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Dan Williams 150fc6fc72 isci: fix sas address reporting
Undo the open coded and incorrect translation of the oem parameter sas
address to its libsas expected format.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Dave Jiang 7392d27580 isci: Removing deprecated functions
Removed all callbacks in the deprecated.c. Core will call the appropriate
functions directly.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Dave Jiang a1914059f1 isci: Change event notify calls from scic_cb_* to isci_event_*
Renaming the callbacks to apparopriate event notify calls for the LLDD.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Dave Jiang 6389a77596 isci: have the driver use native SG calls and DMA-API
Remove abstraction for SG building and get rid of callbacks for getting
DMA memory mapping.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Dave Jiang 103a00c200 isci: Make the driver copy data directly from and to sg for PIO
We can copy the data directly to and from sg for SATA PIO read operations.
There is no reason to involve the hardware SGL. In the process we also need
to kmap the sg because we don't know where that can come from.

We also do to not call phys_to_virt(). The driver already has the information.
We can just calculcate the appropriate offets.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Dave Jiang f7885c8490 isci: Removed special macros that does 64bit address math
These macros are not necessary. We can do 64bit math directly.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Piotr Sawicki b3824292cb isci: fix for asserts during aborts/resets to SAS/SATA in APC mode
Sending aborts/resets to SAS/SATA targets in APC mode eventually causes
an assert in scic_sds_apc_agent_link_up().  We need to handle the hard reset
case for apc mode ports.

Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 03:55:28 -07:00
Tomasz Chudy 52b957c80c isci: Add Support for new TC completion codes
Update the SCI Core to comprehend the changes in the TC completion
codes from A0 to B0.  Specifically, there isnew R_ER code
differences for command and data FISes.

Changes are as follows:

1) 0x16 now additionally indicates an R_ERR received for a COMMAND
FIS being sent to a SATA target.  0x16 for SSP still indicates a
NAK received for a COMMAND frame.  Fix is to retry TC to be compliant
with SATA spec or ensure proper error handling of return value
(not spec compliant I don't believe).
2) 0x1B was previously called DONE_BREAK_RCVD for STP and
DONE_LL_ABORT_ERR for SSP.  Now it is universally called
DONE_LL_ABORT_ERR.  This is purely a superficial change.
3) 0x32 is no longer a reserved code.  Now it indicates
DONE_CMD_SDMA_ERR for STP/SSP.  There was a fatal error on the
SDMA for a command IU (includes Raw frames).  Consider retry,
but at a minimum gracefully fail the request.
4) 0x33 is no longer a reserved code.  Now it indicates
DONE_CMD_LL_ABORT_ERR for SSP.  There was a break receivd
during transmission of a command IU.  Consider retry, but
at a minimum gracefully fail the request.

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:28 -07:00
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
Linus Torvalds 9508d80530 Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
  hwmon: (pmbus) Auto-detect temp2 and temp3 registers/attributes
  hwmon: (pmbus) Improve fan detection
  hwmon: (adm1275) Free allocated memory if probe function fails
  hwmon: (pmbus) Drop check for PMBus revision register in probe function
2011-07-02 16:39:50 -07:00
Linus Torvalds 6e139047e2 Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  Revert "drm/nvc0: recognise 0xdX chipsets as NV_C0"
  drm/radeon/kms: fix typo in cayman reg offset
  drm/radeon/kms: use correct reg on fusion when reading back mem config
2011-07-02 09:08:56 -07:00
Linus Torvalds c66a86d0cd Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6
* 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6:
  drm/i915: apply HWSTAM writes to Ivy Bridge as well
  drm/i915: move IRQ function table init to i915_irq.c
  drm/i915/overlay: Fix unpinning along init error paths
  drm/i915: Don't call describe_obj on NULL pointers
  drm/i915: Hold struct_mutex during i915_save_state/i915_restore_state
2011-07-01 16:38:59 -07:00
Guenter Roeck 0e502ec889 hwmon: (pmbus) Auto-detect temp2 and temp3 registers/attributes
Additional temperature attribute support is easy to detect, so do it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Cc: stable.kernel.org # 2.6.39
2011-07-01 15:56:07 -07:00
Guenter Roeck 81ae68142a hwmon: (pmbus) Improve fan detection
Some PMBus devices return no error when reading fan speed registers, but don't
really support fans. Strengthen fan detection by also checking if fan
configuration registers exist.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Cc: stable.kernel.org # 2.6.39
2011-07-01 15:56:06 -07:00
Guenter Roeck 3b33ca4122 hwmon: (adm1275) Free allocated memory if probe function fails
Probe function did not free allocated memory if it failed. Fix it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2011-07-01 15:56:06 -07:00
Guenter Roeck 7f2c0662e5 hwmon: (pmbus) Drop check for PMBus revision register in probe function
Some PMBus devices do not support the PMBus revision register, so don't check
if it exists.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Cc: stable.kernel.org # 2.6.39
2011-07-01 15:56:05 -07:00
Alan Stern e534c5b831 USB: fix regression occurring during device removal
This patch (as1476) fixes a regression introduced by
fccf4e8620 (USB: Free bandwidth when
usb_disable_device is called).  usb_disconnect() grabs the
bandwidth_mutex before calling usb_disable_device(), which calls down
indirectly to usb_set_interface(), which tries to acquire the
bandwidth_mutex.

The fix causes usb_set_interface() to return early when it is called
for an interface that has already been unregistered, which is what
happens in usb_disable_device().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:20:39 -07:00
Anatolij Gustschin 3140d5b266 USB: fsl_udc_core: fix build breakage when building for ARM arch
Commit 09ba0def (USB: fsl_udc_core: prepare for SoCs with
BE registers and descriptors) introduced build breakage
on ARM arch. Fix it by setting accessors using a static
inline function which is a nop when compiling the driver
for ARM arch.

Commit 2ea6698 (USB: fsl_udc_core: support device mode of
MPC5121E DR USB Controller) caused another breakage on ARM
by using flush_dcache_range(). Don't use it, convert to the
DMA API usage instead. USB2.0CV Halt Endpoint Test succeeds
on PPC. Tested both on ARM i.MX31 and mpc5121 PPC, also with
CONFIG_DMA_API_DEBUG enabled.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01 14:20:39 -07:00
Ben Skeggs 6002525170 Revert "drm/nvc0: recognise 0xdX chipsets as NV_C0"
Oh boy.  That was a bad gamble.  PDISP has changed.

This reverts commit cdf81a235f.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-07-02 07:10:20 +10:00
Alex Deucher 2498c41e1b drm/radeon/kms: fix typo in cayman reg offset
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-07-02 07:09:19 +10:00
Alex Deucher 8208441be2 drm/radeon/kms: use correct reg on fusion when reading back mem config
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-07-02 07:09:08 +10:00
Jesse Barnes 2b1ecb7337 drm/i915: apply HWSTAM writes to Ivy Bridge as well
In an attempt to fix 38862 and 38863.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-07-01 13:28:53 -07:00
Jarod Wilson 98c32bcded [media] rc: call input_sync after scancode reports
Due to commit cdda911c34, evdev only
becomes readable when the buffer contains an EV_SYN/SYN_REPORT event. If
we get a repeat or a scancode we don't have a mapping for, we never call
input_sync, and thus those events don't get reported in a timely
fashion.

For example, take an mceusb transceiver with a default rc6 keymap. Press
buttons on an rc5 remote while monitoring with ir-keytable, and you'll
see nothing. Now press a button on the rc6 remote matching the keymap.
You'll suddenly get the rc5 key scancodes, the rc6 scancode and the rc6
key spit out all at the same time.

Pressing and holding a button on a remote we do have a keymap for also
works rather unreliably right now, due to repeat events also happening
without a call to input_sync (we bail from ir_do_keydown before getting
to the point where it calls input_sync).

Easy fix though, just add two strategically placed input_sync calls
right after our input_event calls for EV_MSC, and all is well again.
Technically, we probably should have been doing this all along, its just
that it never caused any functional difference until the referenced
change went into the input layer.

input_sync once per IR signal. There was another hidden bug in the code
where we were calling input_report_key using last_keycode instead of our
just discovered keycode, which manifested with the reordering of calling
input_report_key and setting last_keycode.

Reported-by: Stephan Raue <sraue@openelec.tv>
CC: Stephan Raue <sraue@openelec.tv>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
CC: Jeff Brown <jeffbrown@android.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:34:45 -03:00
Jarod Wilson 372b424924 [media] imon: allow either proto on unknown 0xffdc
While 0xffdc devices have their IR protocol hard-coded into the firmware
of the device, we have no known way of telling what it is if we don't
have the device's config byte already in the driver. Unknown devices
default to the imon native protocol, but might actually be rc6, so we
should set the driver up such that the user can load the rc6 keytable
from userspace and still have a working device ahead of its config byte
being added to the driver.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:34:01 -03:00
Jarod Wilson 842071c9ea [media] imon: auto-config ffdc 7e device
Another device with the 0xffdc device id, this one with 0x7e in the
config byte. Its an iMON VFD + RC6 IR, in a CoolerMaster 260 case.

Reported-by: Filip Streibl <filip@streibl.cz>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:33:38 -03:00
Jarod Wilson 9800b5b619 [media] saa7134: fix raw IR timeout value
The comment says "wait 15ms", but the code says jiffies_to_msecs(15)
instead of msecs_to_jiffies(15). Fix that. Tested, works fine with both
rc5 and rc6 decode, in-kernel and via lirc userspace, with an HVR-1150.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:33:20 -03:00
Jarod Wilson 3f5c4c7332 [media] rc: fix ghost keypresses with certain hw
With hardware that has to use ir_raw_event_store_edge to collect IR
sample durations, we were not doing an event reset unless
IR_MAX_DURATION had passed. That's around 4 seconds. So if someone
presses up, then down, with less than 4 seconds in between, they'd get
the initial up, then up and down upon pressing down.

To fix this, I've lowered the "send a reset event" logic's threshold to
the input device's REP_DELAY (defaults to 500ms), and with an
saa7134-based GPIO-driven IR receiver in a Hauppauge HVR-1150, I get
*much* better behavior out of the remote now. Special thanks to Devin
for providing the hardware to investigate this issue.

CC: stable@kernel.org
CC: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:33:01 -03:00
Jarod Wilson c4b0afee3c [media] [staging] lirc_serial: allocate irq at init time
There's really no good reason not to just grab the desired IRQ at driver
init time, instead of every time the lirc device node is accessed. This
also improves the speed and reliability with which a serial transmitter
can operate, as back-to-back transmission attempts (i.e., channel change
to a multi-digit channel) don't have to spend time acquiring and then
releasing the IRQ for every digit, sometimes multiple times, if lircd
has been told to use the min_repeat parameter.

CC: devel@driverdev.osuosl.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:32:45 -03:00
Jarod Wilson 6a8c97ac92 [media] lirc_zilog: fix spinning rx thread
We were calling schedule_timeout with the rx thread's task state still
at TASK_RUNNING, which it shouldn't be. Make sure we call
set_current_state(TASK_INTERRUPTIBLE) *before* schedule_timeout, and
we're all good here. I believe this problem was mistakenly introduced in
commit 5bd6b0464b, and I'm not sure how I
missed it before, as I swear I tested the patchset that was included in,
but alas, stuff happens...

Acked-by: Andy Walls <awalls@md.metrocast.net>
CC: stable@kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:32:27 -03:00
Jarod Wilson 1ba9268c2b [media] keymaps: fix table for pinnacle pctv hd devices
Both consumers of RC_MAP_PINNACLE_PCTV_HD send along full RC-5
scancodes, so this update makes this keymap actually *have* full
scancodes, heisted from rc-dib0700-rc5.c. This should fix out of the box
remote functionality for the Pinnacle PCTV HD 800i (cx88 pci card) and
PCTV HD Pro 801e (em28xx usb stick).

CC: stable@kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:31:54 -03:00
Jarod Wilson 35d136c8da [media] ite-cir: 8709 needs to use pnp resource 2
Thanks to the intrepid testing and debugging of Matthijs van Drunen, it
was uncovered that at least some variants of the ITE8709 need to use pnp
resource 2, rather than 0, for things to function properly. Resource 0
has a length of only 1, and if you try to bypass the pnp_port_len check
and use it anyway (with either a length of 1 or 2), the system in
question's trackpad ceased to function.

The circa lirc 0.8.7 lirc_ite8709 driver used resource 2, but the value
was (amusingly) changed to 0 by way of a patch from ITE themselves, so I
don't know if there may be variants where 0 actually *is* correct, but
at least in this case and in the original lirc_ite8709 driver author's
case, it sure looks like 2 is the right value.

This fix should probably be applied to all stable kernels with the
ite-cir driver, lest we nuke more people's trackpads.

Tested-by: Matthijs van Drunen
CC: Juan Jesús García de Soria <skandalfo@gmail.com>
CC: stable@kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 16:31:38 -03:00
Andre Bartke 258c05637d [media] V4L: mx1-camera: fix uninitialized variable
mx1_camera_add_device() can return an uninitialized value of ret.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
[g.liakhovetski@gmx.de: modified the fix to remove "ret" completely]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 15:51:34 -03:00
Vaibhav Hiremath 383e4f6987 [media] omap_vout: Added check in reqbuf & mmap for buf_size allocation
The usecase where, user allocates small size of buffer
through bootargs (video1_bufsize/video2_bufsize) and later from application
tries to set the format which requires larger buffer size, driver doesn't
check for insufficient buffer size and allows application to map extra buffer.
This leads to kernel crash, when user application tries to access memory
beyond the allocation size.

Added check in both mmap and reqbuf call back function,
and return error if the size of the buffer allocated by user through
bootargs is less than the S_FMT size.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 15:47:53 -03:00
Vaibhav Hiremath 8f3a307b9a [media] OMAP_VOUT: Change hardcoded device node number to -1
With addition of media-controller framework, now we have various
device nodes (/dev/videoX) getting created, so hardcoding
minor number in video_register_device() is not recommended.

So let V4L2 framework choose free minor number for the device.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 15:46:46 -03:00
Vladimir Pantelic e8bb10b82f [media] OMAP_VOUTLIB: Fix wrong resizer calculation
The omap_vout_new_crop() function has possible bug, uses uninitialized
variable "crop.width/height" which is actually output of the function.
Instead we should be using "try_crop.width/height" to calculate the
resizer value.

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-01 15:46:24 -03:00
Sjoerd Simons aa122d424b [media] uvcvideo: Disable the queue when failing to start
When failing to start the camera we should disable the queue again, to
rollback into the same initial state. Otherwise re-trying will always
hit -EBUSY

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 23:19:16 -03:00
Sjoerd Simons 8ca2c80b17 [media] uvcvideo: Remove buffers from the queues when freeing
When freeing memory for the video buffers also remove them from the
irq & main queues.

This fixes an oops when doing the following:

open ("/dev/video", ..)
VIDIOC_REQBUFS
VIDIOC_QBUF
VIDIOC_REQBUFS
close ()

As the second VIDIOC_REQBUFS will cause the list entries of the buffers
to be cleared while they still hang around on the main and irc queues

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 23:18:52 -03:00
Laurent Pinchart a96aa5342d [media] uvcvideo: Ignore entities for terminals with no supported format
If a streaming interface has no supported format, the driver won't
create a video device for the associated terminal. Fix an oops by
ignoring that terminal when creating links between entities.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 23:18:13 -03:00
Laurent Pinchart c064b8eac8 [media] v4l: Don't access media entity after is has been destroyed
Entities associated with video device nodes are unregistered in
video_unregister_device(). This destroys the entity even though it can
still be accessed through open video device nodes.

Move the media_device_unregister_entity() call from
video_unregister_device() to v4l2_device_release() to ensure that the
entity isn't unregistered until the last reference to the video device
is released.

Also remove the media_entity_get()/put() calls from v4l2-dev.c. Those
functions were designed for subdevs, to avoid a parent module from being
removed while still accessible through board code. They're not currently
needed for video device nodes, and will oops when a hotpluggable device
is disconnected during streaming, as media_entity_put() called in
v4l2_device_release() tries to access entity->parent->dev->driver which
is set to NULL when the device is disconnected.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 23:12:36 -03:00
Ohad Ben-Cohen ca4186f06f [media] media: omap3isp: fix a potential NULL deref
Fix a potential NULL pointer dereference by skipping registration of
external entities in case none are provided.

This is useful at least when testing mere memory-to-memory scenarios.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 23:01:05 -03:00
Marek Szyprowski 66072d4fa7 [media] media: vb2: fix allocation failure check
__vb2_queue_alloc function returns the number of successfully allocated
buffers. There is no point in checking if the returned value is negative.
If this function returns 0, videobuf2 should just return -ENOMEM to
userspace, because no driver can work without memory buffers.

Reported-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 22:33:47 -03:00
Marek Szyprowski afdea8bac5 [media] media: vb2: reset queued_count value during queue reinitialization
queued_count variable was left untouched during the queue reinitialization
in __vb2_queue_cancel, what might lead to mismatch between the real number
of queued buffers and queued_count variable.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 22:32:58 -03:00
Marek Szyprowski bf7b73efb7 [media] Revert "[media] v4l2: vb2: one more fix for REQBUFS()"
This reverts commit 31901a078a.

Queue should be reinitialized on each REQBUFS() call even if the memory
access method and buffer count have not been changed. The user might have
changed the format and if we go the short path introduced in that commit,
the memory buffer will not be reallocated to fit with new format.

The previous patch was just over-engineered optimization, which just
introduced a bug to videobuf2.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 22:32:28 -03:00
Marek Szyprowski a52a82fc3a [media] media: vb2: add __GFP_NOWARN to dma-sg allocator
Add __GFP_NOWARN parameter to videobuf2 dma-sg allocator to prevent
kernel warning and stack dump if there is not enough memory available.
Videobuf2 and drivers should correctly handle no memory case, so there
is no need for stack dump and extensive log.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-06-30 22:31:53 -03:00
Alex Deucher daf54f1f36 drm/radeon/kms: Fix chremap setup on RV770 CE
CE variant requires a different chremap setup.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=35472

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-07-01 07:29:46 +10:00
Linus Torvalds 0e90ed0e8b Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits)
  usbnet: Remove over-broad module alias from zaurus.
  MAINTAINERS: drop Michael from bfin_mac driver
  net/can: activate bit-timing calculation and netlink based drivers by default
  rionet: fix NULL pointer dereference in rionet_remove
  net+crypto: Use vmalloc for zlib inflate buffers.
  netfilter: Fix ip_route_me_harder triggering ip_rt_bug
  ipv4: Fix IPsec slowpath fragmentation problem
  ipv4: Fix packet size calculation in __ip_append_data
  cxgb3: skb_record_rx_queue now records the queue index relative to the net_device.
  bridge: Only flood unregistered groups to routers
  qlge: Add maintainer.
  MAINTAINERS: mark socketcan-core lists as subscribers-only
  MAINTAINERS: Remove Sven Eckelmann from BATMAN ADVANCED
  r8169: fix wrong register use.
  net/usb/kalmia: signedness bug in kalmia_bind()
  net/usb: kalmia: Various fixes for better support of non-x86 architectures.
  rtl8192cu: Fix missing firmware load
  udp/recvmsg: Clear MSG_TRUNC flag when starting over for a new packet
  ipv6/udp: Use the correct variable to determine non-blocking condition
  netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on
  ...
2011-06-30 10:44:52 -07:00
Linus Torvalds 3b775e2246 Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  watchdog: update author email for at32ap700x_wdt
  watchdog: gef_wdt: fix MODULE_ALIAS
  watchdog: Intel SCU Watchdog: Fix build and remove duplicate code
  watchdog: mtx1-wdt: fix section mismatch
  watchdog: mtx1-wdt: fix GPIO toggling
  watchdog: mtx1-wdt: request gpio before using it
  watchdog: Handle multiple wm831x watchdogs being registered
2011-06-30 10:43:57 -07:00
Jesse Barnes f71d4af4cd drm/i915: move IRQ function table init to i915_irq.c
This lets us make the various IRQ functions static and helps avoid
problems like the one fixed in "drm/i915: Use chipset-specific irq
installers" where one of the exported functions was called rather than
the chipset specific version.

This also fixes a UMS-mode bug -- the correct irq functions for IRL
and later chips were only getting loaded in the KMS path.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-06-29 20:37:22 -07:00
Chris Wilson 79d2427338 drm/i915/overlay: Fix unpinning along init error paths
As pointed out by Dan Carpenter, it was seemingly possible to hit an error
whilst mapping the buffer for the regs (except the only likely error
returns should not happen during init) and so leak a pin count on the
bo. To handle this we would need to reacquire the struct mutex, so for
simplicity rearrange for the lock to be held for the entire function.
For extra pedagogy, test that we only call init once.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-06-29 19:09:13 -07:00
Linus Torvalds ca56a95eed Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon/kms: increase rom size for atrm method
2011-06-29 18:18:48 -07:00
Linus Torvalds 0e47427bc5 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: caam - fix operator precedence in shared descriptor allocation
2011-06-29 18:10:54 -07:00
Alex Deucher b271a988eb drm/radeon/kms: increase rom size for atrm method
The vbios rom is >64k on a lot of modern asics.  Increase
the fetch size for atrm to make sure we don't miss part
of a larger rom.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-06-30 10:12:17 +10:00
Kim Phillips a18b989a5c crypto: caam - fix operator precedence in shared descriptor allocation
setkey allocates 16 bytes (CAAM_CMD_SZ *
DESC_AEAD_SHARED_TEXT_LEN) shy of what is needed to
store the shared descriptor, resulting in memory
corruption.  Fix this.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2011-06-30 07:43:27 +08:00
Ben Widawsky dc501fbc43 drm/i915: Don't call describe_obj on NULL pointers
Reported-by: Pavel Roskin <proski@gnu.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38777
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-06-29 13:05:52 -07:00
Keith Packard d70bed1947 drm/i915: Hold struct_mutex during i915_save_state/i915_restore_state
Lots of register access in these functions, some of which requires the
struct mutex.

These functions now hold the struct mutex across the calls to
i915_save_display and i915_restore_display, and so the internal mutex
calls in those functions have been removed. To ensure that no-one else
was calling them (and hence violating the new required locking
invarient), those functions have been made static.

gen6_enable_rps locks the struct mutex, and so i915_restore_state
unlocks the mutex around calls to that function.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-06-29 11:20:45 -07:00
Linus Torvalds c773547183 Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c/pca954x: Initialize the mux to disconnected state
  i2c-taos-evm: Fix log messages
2011-06-29 11:07:02 -07:00
Linus Torvalds 78a3cc38f7 Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  arch/powerpc: use printk_ratelimited instead of printk_ratelimit
  powerpc/rtas-rtc: remove sideeffects of printk_ratelimit
  powerpc/pseries: remove duplicate SCSI_BNX2_ISCSI in pseries_defconfig
  powerpc/e500: fix breakage with fsl_rio_mcheck_exception
  powerpc/p1022ds: fix audio-related properties in the device tree
  powerpc/85xx: fix NAND_CMD_READID read bytes number
2011-06-29 11:03:27 -07:00
Linus Torvalds 4974317055 ahci: change 'masking port_map' printk to KERN_WARNING level
It's not so much an error as a warning about normal Marvell crazines.
So don't use KERN_ERR that ends up spamming the console even in quiet
mode, it's not _that_ critical.

Explained by Jeff:

 "Long explanation, it's a mess:

  Marvell took standard AHCI, and bastardized it to include a weird mode
  whereby PATA devices appear inside the AHCI DMA and interrupt
  infrastructure you're familiar with.

  So, PATA devices appear via pata_marvell driver, using basic legacy
  IDE programming interface.  But SATA devices, which might also be
  attached to this chip, either work in under-performing mode or
  simply don't work at all (e.g.  newer 6 Gbps devices or port
  multiplier attachments, NCQ, ...)

  On the other hand, 'ahci' driver loads and works with the chip's
  attached SATA devices quite beautifully, but is completely unable to
  drive any attached PATA devices, due to the Marvell-specific
  PATA-under-AHCI interface.

  The "masking port_map 0x7 -> 0x3" message is the ahci driver "hiding"
  the PATA port(s) from itself, making sure it will only drive the SATA
  ports it knows how to drive."

Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-29 10:10:07 -07:00
Stephen M. Cameron db111e18ec [SCSI] hpsa: fix potential overrun while memcpy'ing sense data
This memcpy:

   memcpy(cmd->sense_buffer, ei->SenseInfo,
	   ei->SenseLen > SCSI_SENSE_BUFFERSIZE ?
		   SCSI_SENSE_BUFFERSIZE :
		   ei->SenseLen);

The ei->SenseLen field is filled in by the Smart Array.  For requests to
logical drives, it will not exceed 32 bytes, so should be ok, but for physical
requests it depends on the target device, not the Smart Array.  It's conceivable
that this could exceed the 32 byte size of ei->SenseInfo.  In that case, the memcpy
would read past the end of ei->SenseInfo, copying data from the next command,
as if it were sense data, or, if it happened to be the very last command in the
block of allocated commands, could fall off the end of the allocated area and
crash.  I'm not aware of anyone ever encountering this behavior, but it could
conceivably happen.  This bug was found by Coverity.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29 12:09:56 -05:00
Stephen M. Cameron c2dd32e026 [SCSI] hpsa: fix dma unmap error in hpsa_passthru_ioctl
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29 12:09:53 -05:00
Brian King 38553564dc [SCSI] ibmvfc: Fix Virtual I/O failover hang
If a Virtual I/O server fails in a dual virtual I/O server multipath
configuration, ensure we delete all remote ports so that path failover
can occur. For a single path configuration, the remote ports will
go into devloss state.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-06-29 12:08:39 -05:00
Dave Jones 16adf5d079 usbnet: Remove over-broad module alias from zaurus.
This module and a bunch of dependancies are getting loaded on several
of laptops I have (probably picking up the mobile broadband device),
that have nothing to do with zaurus. Matching by class without
any vendor/device pair isn't the right thing to do here, as it
will prevent any other driver from correctly binding to it.
(Or in the absense of a driver, will just waste time & memory by
 unnecessarily loading modules)

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-29 06:09:17 -07:00
Marc Kleine-Budde a30d5155a4 net/can: activate bit-timing calculation and netlink based drivers by default
The two options "CAN bit-timing calculation" and
"Platform CAN drivers with Netlink support" have a "default Y". In order to
activate them by default, change to "default y".

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-29 05:58:42 -07:00
Yinglin Luan 55caa9241e rionet: fix NULL pointer dereference in rionet_remove
Function rionet_remove initializes local variable 'ndev' to NULL
and do nothing changes before the call to unregister_netdev(ndev),
this could cause a NULL pointer dereference.

Reported-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Yinglin Luan <synmyth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-29 05:57:35 -07:00
David S. Miller 7ab24bfdf9 net+crypto: Use vmalloc for zlib inflate buffers.
They are 64K and result in order-4 allocations, even with SLUB.

Therefore, just like we always have for the deflate buffers, use
vmalloc.

Reported-by: Martin Jackson <mjackson220.list@gmail.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-29 05:48:41 -07:00