[DLM] lowcomms style

Replace some printk with log_print, and fix some simple cases of lines
over 80.  Also, return -ENOTCONN if lowcomms_start fails due to no local
IP address being available.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
[GFS2] Uncomment sprintf_symbol calling code

Now that the patch from -mm has gone upstream, we can uncomment the code
in GFS2 which uses sprintf_symbol.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Robert Peterson <rpeterso@redhat.com>
mmc: cull sg list to match mmc request size

mmc layer may introduce additional (compared to block layer) limits on
request size. Culling of the sg list to match adjusted request size
simplifies the handling of such cases in the low level driver, allowing
it to skip block count checks while processing sg entries.

(fixes for wbsd and sdhci by Pierre Ossman)

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
mmc: enforce correct sg list

Now that we've fixed our only offender when it comes to strange sg
list, add a check so that future users keep the sg list proper with
regard to transfer size.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
wbsd: remove block crc test

Block completion interrupts occur faster than we can process
them, so just ignore them competely.

Commit also fixes up some incorrect register defines.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm: hide details of interrupt processing from socket drivers

Instead of passing transformed value of adapter interrupt status to
socket drivers, implement two separate callbacks - one for card events
and another for dma events.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm: use bus methods to handle probe/remove instead of driver ones.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm: simplify bus match and uevent handlers

Remove code duplicating the kernel functionality and clean up data
structures involved in driver matching.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm: replace per-adapter kthread with freezeable workqueue

Freezeable workqueue makes sure that adapter work items (device insertions
and removals) would be handled after the system is fully resumed. Previously
this was achieved by explicit freezing of the kthread.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm_7xx1: improve card detection routine

Remove unneeded conditions and change a sleeping regime a little in the
card type detection routine.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm: move common adapter management tasks from tifm_7xx1 to tifm_core

Some details of the adapter management (create, add, remove) are really
belong to the tifm_core, as they are not hardware specific.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm: move common device management tasks from tifm_7xx1 to tifm_core

Some details of the device management (create, add, remove) are really
belong to the tifm_core, as they are not hardware specific.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm_7xx1: fix adapter resume function

Fixes to the adapter resume function to correctly handle all possible cases:
1. Card is removed during suspend
2. Card is inserted during suspend into previously empty socket
3. Card is replaced during suspend by same or different media type card.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm: add sysfs attribute for tifm devices

A sysfs attribute reflecting current media type is added.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm_sd: remove tifm_sd_terminate function

tifm_sd_terminate can only lawfully be called on device removal so it can be
merged with tifm_sd_remove.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm_sd: remove wait for power off on remove

This wait was needed because of the mmc layer failure to wait for completion
of all outstanding commands before host removal. It should be fixed now in
the mmc layer.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm_sd: separate command flags, socket flags and register bit masks

host->flags variable was hosting a collection of bits with different
semantics. For clarity, hardware bit masks are now defined as macros,
socket flags represented as bit fields and flags (now cmd_flags) only
hosts command processing modifiers.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm_sd: merge dma and pio request processing paths

To allow for switching of trasfer mode (dma/pio) on a per-request basis,
pio and dma request issue and completion function are now merged.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm_sd: replace command completion state machine with full checking

State machine used to to track mmc command state was found to be fragile
and unreliable, making many cards unusable. The safer solution is to perform
all needed checks at every card event.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
tifm_sd: fix resume handler

Resume should not explicitly check for media type. Instead, it may relay
on success of socket initialization.
Small changes are introduced to tifm_sd_initialize to make it more robust.

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>