Kiyoshi Ueda [Thu, 10 Dec 2009 23:52:26 +0000 (23:52 +0000)]
dm: swap target postsuspend call and setting suspended flag
This patch moves DMF_SUSPENDED flag set before postsuspend.
No one should care about the ordering, because the flag set and
the postsuspend are protected by a single lock, md->suspend_lock,
and all strict flag-checkers take the lock.
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Cc: Mike Anderson <andmike@linux.vnet.ibm.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Jun'ichi Nomura [Thu, 10 Dec 2009 23:52:25 +0000 (23:52 +0000)]
dm: trace request based remapping
This patch adds a remapping trace to request-based dm.
BIO-based dm already has the equivalent tracepoint.
For example, under this dm stack (linear LV on multipath):
# dmsetup ls --tree -o ascii
vg-lv0 (253:1)
`-mpath0 (253:0)
|- (8:160)
|- (66:80)
|- (65:176)
`- (65:160)
Trace of 'dd of=/dev/vg/lv0 bs=128k count=1 oflag=direct' looks like this:
Mike Snitzer [Thu, 10 Dec 2009 23:52:24 +0000 (23:52 +0000)]
dm snapshot: allow live exception store handover between tables
Permit in-use snapshot exception data to be 'handed over' from one
snapshot instance to another. This is a pre-requisite for patches
that allow the changes made in a snapshot device to be merged back into
its origin device and also allows device resizing.
The basic call sequence is:
dmsetup load new_snapshot (referencing the existing in-use cow device)
- the ctr code detects that the cow is already in use and allows the
two snapshot target instances to be linked together
dmsetup suspend original_snapshot
dmsetup resume new_snapshot
- the new_snapshot becomes live, and if anything now tries to access
the original one it will receive -EIO
dmsetup remove original_snapshot
(There can only be two snapshot targets referencing the same cow device
simultaneously.)
Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
When replacing a mapped device's table during a 'resume', delay the
destruction of the old table until the new one is successfully in place.
This will make it easier for a later patch to transfer internal state
information from the old table to the new one (something we do not currently
support) while giving us more options for reversion if a later part
of the operation fails.
Devices are always in the suspended state during dm_swap_table().
This patch reinforces the requirement that all I/O must have been
flushed from the table targets while in this state (including any in
workqueues). In the case of 'noflush' suspending, unprocessed
I/O should have been 'pushed back' to the dm core prior to this point,
for resubmission after the new table is in place.
Mike Snitzer [Thu, 10 Dec 2009 23:52:22 +0000 (23:52 +0000)]
dm ioctl: retrieve status from inactive table
Add the flag DM_QUERY_INACTIVE_TABLE_FLAG to the ioctls to return
infomation about the loaded-but-not-yet-active table instead of the live
table. Prior to this patch it was impossible to obtain this information
until the device had been 'resumed'.
Userspace dmsetup and libdevmapper support the flag as of version 1.02.40.
e.g. dmsetup info --inactive vg1-lv1
Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mike Anderson [Thu, 10 Dec 2009 23:52:21 +0000 (23:52 +0000)]
dm mpath: prevent io from work queue while suspended
Reject messages that can generate I/O while the device itself
is suspended.
Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com> Acked-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mike Anderson [Thu, 10 Dec 2009 23:52:21 +0000 (23:52 +0000)]
dm mpath: add mutex to synchronize adding and flushing work
Add a mutex to allow possible creators of new work to synchronize with
flushing work queues.
Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com> Acked-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Kiyoshi Ueda [Thu, 10 Dec 2009 23:52:19 +0000 (23:52 +0000)]
dm mpath: flush workqueues before suspend completes
This patch stops the remaining dm-mpath activity during the suspend
sequence by flushing workqueues in postsuspend function.
The current dm-mpath target may not be quiet even after suspend completes
because some workqueues (e.g. device_handler's work, event handling)
are not flushed during the suspend sequence, even though suspended
devices/targets are supposed to be quiet in this state.
Kiyoshi Ueda [Thu, 10 Dec 2009 23:52:18 +0000 (23:52 +0000)]
dm: add request based barrier support
This patch adds barrier support for request-based dm.
CORE DESIGN
The design is basically same as bio-based dm, which emulates barrier
by mapping empty barrier bios before/after a barrier I/O.
But request-based dm has been using struct request_queue for I/O
queueing, so the block-layer's barrier mechanism can be used.
o Summary of the block-layer's behavior (which is depended by dm-core)
Request-based dm uses QUEUE_ORDERED_DRAIN_FLUSH ordered mode for
I/O barrier. It means that when an I/O requiring barrier is found
in the request_queue, the block-layer makes pre-flush request and
post-flush request just before and just after the I/O respectively.
After the ordered sequence starts, the block-layer waits for all
in-flight I/Os to complete, then gives drivers the pre-flush request,
the barrier I/O and the post-flush request one by one.
It means that the request_queue is stopped automatically by
the block-layer until drivers complete each sequence.
o dm-core
For the barrier I/O, treats it as a normal I/O, so no additional
code is needed.
For the pre/post-flush request, flushes caches by the followings:
1. Make the number of empty barrier requests required by target's
num_flush_requests, and map them (dm_rq_barrier()).
2. Waits for the mapped barriers to complete (dm_rq_barrier()).
If error has occurred, save the error value to md->barrier_error
(dm_end_request()).
(*) Basically, the first reported error is taken.
But -EOPNOTSUPP supersedes any error and DM_ENDIO_REQUEUE
follows.
3. Requeue the pre/post-flush request if the error value is
DM_ENDIO_REQUEUE. Otherwise, completes with the error value
(dm_rq_barrier_work()).
The pre/post-flush work above is done in the kernel thread (kdmflush)
context, since memory allocation which might sleep is needed in
dm_rq_barrier() but sleep is not allowed in dm_request_fn(), which is
an irq-disabled context.
Also, clones of the pre/post-flush request share an original, so
such clones can't be completed using the softirq context.
Instead, complete them in the context of underlying device drivers.
It should be safe since there is no I/O dispatching during
the completion of such clones.
For suspend, the workqueue of kdmflush needs to be flushed after
the request_queue has been stopped. Otherwise, the next flush work
can be kicked even after the suspend completes.
TARGET INTERFACE
No new interface is added.
Just use the existing num_flush_requests in struct target_type
as same as bio-based dm.
Kiyoshi Ueda [Thu, 10 Dec 2009 23:52:17 +0000 (23:52 +0000)]
dm: refactor request based completion functions
This patch factors out the clone completion code, dm_done(),
from dm_softirq_done() in preparation for a subsequent patch.
No functional change.
dm_done() will be used in barrier completion, which can't use and
doesn't need softirq. The softirq_done callback needs to get a clone
from an original request but it can't in the case of barrier, where
an original request is shared by multiple clones. On the other hand,
the completion of barrier clones doesn't involve re-submitting requests,
which was the primary reason of the need for softirq.
Kiyoshi Ueda [Thu, 10 Dec 2009 23:52:16 +0000 (23:52 +0000)]
dm: use md pending for in flight IO counting
This patch changes the counter for the number of in_flight I/Os
to md->pending from q->in_flight in preparation for a later patch.
No functional change.
Request-based dm used q->in_flight to count the number of in-flight
clones assuming the counter is always incremented for an in-flight
original request and original:clone is 1:1 relationship.
However, it this no longer true for barrier requests.
So use md->pending to count the number of in-flight clones.
Kiyoshi Ueda [Thu, 10 Dec 2009 23:52:16 +0000 (23:52 +0000)]
dm: simplify request based suspend
The semantics of bio-based dm were changed recently in the case of
suspend with "--nolockfs" but without "--noflush".
Before 2.6.30, I/Os submitted before the suspend invocation were always
flushed. From 2.6.30 onwards, I/Os submitted before the suspend
invocation might not be flushed. (For details, see
http://marc.info/?t=123994433400003&r=1&w=2)
This patch brings the behaviour of request-based dm into line with
bio-based dm, simplifying the code and preparing for a subsequent patch
that will wait for all in_flight I/Os to complete without stopping
request_queue and use dm_wait_for_completion() for it.
This change in semantics simplifies the suspend code as follows:
o Suspend is implemented as stopping request_queue
in request-based dm, and all I/Os are queued in the request_queue
even after suspend is invoked.
o In the old semantics, we had to track whether I/Os were
queued before or after the suspend invocation, so a special
barrier-like request called 'suspend marker' was introduced.
o With the new semantics, we don't need to flush any I/O
so we can remove the marker and the code related to the marker
handling and I/O flushing.
After removing this codes, the suspend sequence is now:
1. Flush all I/Os by lock_fs() if needed.
2. Stop dispatching any I/O by stopping the request_queue.
3. Wait for all in-flight I/Os to be completed or requeued.
Kiyoshi Ueda [Thu, 10 Dec 2009 23:52:15 +0000 (23:52 +0000)]
dm: pass gfp_mask to alloc_rq_tio
This patch adds the gfp_mask argument to alloc_rq_tio().
No functional change.
This patch is a preparation for a later patch in this series which needs to
allocate tio (for barrier I/O) with different allocation flag (GFP_NOIO) from
the one in the normal I/O code path.
Mikulas Patocka [Thu, 10 Dec 2009 23:52:13 +0000 (23:52 +0000)]
dm kcopyd: accept zero size jobs
dm-kcopyd: accept zero-size jobs
This patch changes dm-kcopyd so that it accepts zero-size jobs and completes
them immediatelly via its completion thread.
It is needed for multisnapshots snapshot resizing. When we are writing to
a chunk beyond origin end, no copying is done. To simplify the code, we submit
an empty request to kcopyd and let kcopyd complete it. If we didn't submit
a request to kcopyd and called the completion routine immediatelly, it would
violate the principle that completion is called only from one thread and
it would need additional locking.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mike Snitzer [Thu, 10 Dec 2009 23:52:12 +0000 (23:52 +0000)]
dm snapshot: track suspended state in target
Keep track of whether or not the device is suspended within the snapshot
target module, the same as we do in dm-raid1.
We will use this later to enforce the correct sequence of ioctls to
transfer the in-core exceptions from a snapshot target instance in
one table to a replacement one capable of merging them back
into the origin.
Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mike Snitzer [Thu, 10 Dec 2009 23:52:12 +0000 (23:52 +0000)]
dm snapshot: move cow ref from exception store to snap core
Store the reference to the snapshot cow device in the core snapshot
code instead of each exception store. It can be accessed through the
new function dm_snap_cow(). Exception stores should each now maintain a
reference to their parent snapshot struct.
This is cleaner and makes part of the forthcoming snapshot merge code simpler.
Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Reviewed-by: Jonathan Brassow <jbrassow@redhat.com> Cc: Mikulas Patocka <mpatocka@redhat.com>
Mike Snitzer [Thu, 10 Dec 2009 23:52:11 +0000 (23:52 +0000)]
dm snapshot: add allocated metadata to snapshot status
Add number of sectors used by metadata to the end of the snapshot's status
line.
Renamed dm_exception_store_type's 'fraction_full' to 'usage'. Renamed
arguments to be clearer about what is being returned. Also added
'metadata_sectors'.
Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Consolidate the insert_*exception functions. 'insert_completed_exception'
already contains all the logic to handle 'insert_exception' (via
check for a hash_shift of 0), so remove redundant function.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mikulas Patocka [Thu, 10 Dec 2009 23:52:08 +0000 (23:52 +0000)]
dm snapshot: abstract minimum_chunk_size fn
The origin needs to find minimum chunksize of all snapshots. This logic is
moved to a separate function because it will be used at another place in
the snapshot merge patches.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Reviewed-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Roel Kluin [Thu, 10 Dec 2009 23:52:07 +0000 (23:52 +0000)]
dm ioctl: prefer strlcpy over strncpy
strlcpy() will always null terminate the string.
The code should already guarantee this as the last bytes are already
NULs and the string lengths were restricted before being stored in
hc. Removing the '-1' becomes necessary so strlcpy() doesn't
lose the last character of a maximum-length string.
- agk
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mikulas Patocka [Thu, 10 Dec 2009 23:52:06 +0000 (23:52 +0000)]
dm raid1: hold all write bios when leg fails
Hold all write bios when leg fails and errors are handled
When using a userspace daemon such as dmeventd to handle errors, we must
delay completing bios until it has done its job.
This patch prevents the following race:
- primary leg fails
- write "1" fail, the write is held, secondary leg is set default
- write "2" goes straight to the secondary leg
Mikulas Patocka [Thu, 10 Dec 2009 23:52:05 +0000 (23:52 +0000)]
dm raid1: hold write bios when errors are handled
Hold all write bios when errors are handled.
Previously the failures list was used only when handling errors with
a userspace daemon such as dmeventd. Now, it is always used for all bios.
The regions where some writes failed must be marked as nosync. This can only
be done in process context (i.e. in raid1 workqueue), not in the
write_callback function.
Previously the write would succeed if writing to at least one leg
succeeded. This is wrong because data from the failed leg may be
replicated to the correct leg. Now, if using a userspace daemon, the
write with some failures will be held until the daemon has done its job
and reconfigured the array. If not using a daemon, the write still
succeeds if at least one leg succeeds. This is bad, but it is consistent
with current behavior.
Mikulas Patocka [Thu, 10 Dec 2009 23:52:03 +0000 (23:52 +0000)]
dm raid1: add framework to hold bios during suspend
Add framework to delay bios until a suspend and then resubmit them with
either DM_ENDIO_REQUEUE (if the suspend was noflush) or complete them
with -EIO. I/O barrier support will use this.
Mikulas Patocka [Thu, 10 Dec 2009 23:52:01 +0000 (23:52 +0000)]
dm log: use flush callback fn
Call the flush callback from the log.
If flush failed, we have no alternative but to mark the whole log as dirty.
Also we set the variable flush_failed to prevent any bits ever being marked as
clean again.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mikulas Patocka [Thu, 10 Dec 2009 23:52:01 +0000 (23:52 +0000)]
dm log: add flush callback fn
Introduce a callback pointer from the log to dm-raid1 layer.
Before some region is set as "in-sync", we need to flush hardware cache on
all the disks. But the log module doesn't have access to the mirror_set
structure. So it will use this callback.
So far the callback is unused, it will be used in further patches.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mikulas Patocka [Thu, 10 Dec 2009 23:52:00 +0000 (23:52 +0000)]
dm log: introduce flush_failed variable
Introduce "flush failed" variable. When a flush before clearing a bit
in the log fails, we don't know anything about which which regions are
in-sync and which not.
So we need to set all regions as not-in-sync and set the variable
"flush_failed" to prevent setting the in-sync bit in the future.
A target reload is the only way to get out of this situation.
The variable will be set in following patches.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mikulas Patocka [Thu, 10 Dec 2009 23:51:59 +0000 (23:51 +0000)]
dm raid1: split touched state into two
Split the variable "touched" into two, "touched_dirtied" and
"touched_cleaned", set when some region was dirtied or cleaned.
This will be used to optimize flushes.
After a transition from "dirty" to "clean" state we don't have flush hardware
cache on the log device. After a transition from "clean" to "dirty" the cache
must be flushed.
Before a transition from "clean" to "dirty" state we don't have to flush all
the raid legs. Before a transition from "dirty" to "clean" we must flush all
the legs to make sure that they are really in sync.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mikulas Patocka [Thu, 10 Dec 2009 23:51:58 +0000 (23:51 +0000)]
dm io: remove extra bi_io_vec region hack
Remove the hack where we allocate an extra bi_io_vec to store additional
private data. This hack prevents us from supporting barriers in
dm-raid1 without first making another little block layer change.
Instead of doing that, this patch eliminates the bi_io_vec abuse by
storing the region number directly in the low bits of bi_private.
We need to store two things for each bio, the pointer to the main io
structure and, if parallel writes were requested, an index indicating
which of these writes this bio belongs to. There can be at most
BITS_PER_LONG regions - 32 or 64.
The index (region number) was stored in the last (hidden) bio vector and
the pointer to struct io was stored in bi_private.
This patch now aligns "struct io" on BITS_PER_LONG bytes and stores the
region number in the low BITS_PER_LONG bits of bi_private.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mikulas Patocka [Thu, 10 Dec 2009 23:51:57 +0000 (23:51 +0000)]
dm io: use slab for struct io
Allocate "struct io" from a slab.
This patch changes dm-io, so that "struct io" is allocated from a slab cache.
It used to be allocated with kmalloc. Allocating from a slab will be needed
for the next patch, because it requires a special alignment of "struct io"
and kmalloc cannot meet this alignment.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Milan Broz [Thu, 10 Dec 2009 23:51:57 +0000 (23:51 +0000)]
dm crypt: make wipe message also wipe essiv key
The "wipe key" message is used to wipe the volume key from memory
temporarily, for example when suspending to RAM.
But the initialisation vector in ESSIV mode is calculated from the
hashed volume key, so the wipe message should wipe this IV key too and
reinitialise it when the volume key is reinstated.
This patch adds an IV wipe method called from a wipe message callback.
ESSIV is then reinitialised using the init function added by the
last patch.
Cc: stable@kernel.org Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Milan Broz [Thu, 10 Dec 2009 23:51:55 +0000 (23:51 +0000)]
dm crypt: move private iv fields to structs
Define private structures for IV so it's easy to add further attributes
in a following patch which fixes the way key material is wiped from
memory. Also move ESSIV destructor and remove unnecessary 'status'
operation.
There are no functional changes in this patch.
Cc: stable@kernel.org Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mikulas Patocka [Thu, 10 Dec 2009 23:51:54 +0000 (23:51 +0000)]
dm snapshot: cope with chunk size larger than origin
Under some special conditions the snapshot hash_size is calculated as zero.
This patch instead sets a minimum value of 64, the same as for the
pending exception table.
rounddown_pow_of_two(0) is an undefined operation (it expands to shift
by -1). init_exception_table with an argument of 0 would fail with -ENOMEM.
The way to trigger the problem is to create a snapshot with a chunk size
that is larger than the origin device.
Mikulas Patocka [Thu, 10 Dec 2009 23:51:53 +0000 (23:51 +0000)]
dm snapshot: only take lock for statustype info not table
Take snapshot lock only for STATUSTYPE_INFO, not STATUSTYPE_TABLE.
Commit 4c6fff445d7aa753957856278d4d93bcad6e2c14
(dm-snapshot-lock-snapshot-while-supplying-status.patch)
introduced this use of the lock, but userspace applications using
libdevmapper have been found to request STATUSTYPE_TABLE while the device
is suspended and the lock is already held, leading to deadlock. Since
the lock is not necessary in this case, don't try to take it.
Mikulas Patocka [Thu, 10 Dec 2009 23:51:52 +0000 (23:51 +0000)]
dm: avoid _hash_lock deadlock
Fix a reported deadlock if there are still unprocessed multipath events
on a device that is being removed.
_hash_lock is held during dev_remove while trying to send the
outstanding events. Sending the events requests the _hash_lock
again in dm_copy_name_and_uuid.
This patch introduces a separate lock around regions that modify the
link to the hash table (dm_set_mdptr) or the name or uuid so that
dm_copy_name_and_uuid no longer needs _hash_lock.
Additionally, dm_copy_name_and_uuid can only be called if md exists
so we can drop the dm_get() and dm_put() which can lead to a BUG()
while md is being freed.
Linus Torvalds [Thu, 10 Dec 2009 03:57:06 +0000 (19:57 -0800)]
Merge branch 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'acpica' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPICA: Update version to 20091112.
ACPICA: Add additional module-level code support
ACPICA: Deploy new create integer interface where appropriate
ACPICA: New internal utility function to create Integer objects
ACPICA: Add repair for predefined methods that must return sorted lists
ACPICA: Fix possible fault if return Package objects contain NULL elements
ACPICA: Add post-order callback to acpi_walk_namespace
ACPICA: Change package length error message to an info message
ACPICA: Reduce severity of predefined repair messages, Warning to Info
ACPICA: Update version to 20091013
ACPICA: Fix possible memory leak for Scope ASL operator
ACPICA: Remove possibility of executing _REG methods twice
ACPICA: Add repair for bad _MAT buffers
ACPICA: Add repair for bad _BIF/_BIX packages
Linus Torvalds [Thu, 10 Dec 2009 03:53:11 +0000 (19:53 -0800)]
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: (41 commits)
hwmon: (adt7475) Add VID support for the ADT7476
hwmon: (adt7475) Add an entry in MAINTAINERS
hwmon: (adt7475) Add support for the ADT7476
hwmon: (adt7475) Voltage attenuators can be bypassed
hwmon: (adt7475) Print device information on probe
hwmon: (adt7475) Handle alternative pin functions
hwmon: (adt7475) Move sysfs files removal to a separate function
hwmon: (adt7475) Add support for the ADT7490
hwmon: (adt7475) Improve device detection
hwmon: (adt7475) Add missing static marker
hwmon: (adt7475) Rework voltage inputs handling
hwmon: (adt7475) Implement pwm_use_point2_pwm_at_crit
hwmon: (adt7475) New documentation
hwmon: (adt7475) Add support for the ADT7473
hwmon: (f71882fg) Add support for the f71889fg (version 2)
hwmon: (f71882fg) Fix sysfs file removal
hwmon: (f71882fg) Cleanup sysfs attr creation 2/2
hwmon: (f71882fg) Cleanup sysfs attr creation 1/2
hwmon: (thmc50) Stop using I2C_CLIENT_MODULE_PARM
hwmon: Add Freescale MC13783 ADC driver
...
Linus Torvalds [Thu, 10 Dec 2009 03:52:01 +0000 (19:52 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (51 commits)
Input: appletouch - give up maintainership
Input: dm355evm_kbd - switch to using sparse keymap library
Input: wistron_btns - switch to using sparse keymap library
Input: add generic support for sparse keymaps
Input: fix memory leak in force feedback core
Input: wistron - remove identification strings from DMI table
Input: psmouse - remove identification strings from DMI tables
Input: atkbd - remove identification strings from DMI table
Input: i8042 - remove identification strings from DMI tables
DMI: allow omitting ident strings in DMI tables
Input: psmouse - do not carry DMI data around
Input: matrix-keypad - switch to using dev_pm_ops
Input: keyboard - fix lack of locking when traversing handler->h_list
Input: gpio_keys - scan gpio state at probe and resume time
Input: keyboard - add locking around event handling
Input: usbtouchscreen - add support for ET&T TC5UH touchscreen controller
Input: xpad - add two new Xbox 360 devices
Input: polled device - do not start polling if interval is zero
Input: polled device - schedule first poll immediately
Input: add S3C24XX touchscreen driver
...
Linus Torvalds [Thu, 10 Dec 2009 03:46:12 +0000 (19:46 -0800)]
Merge branch 'next-i2c' of git://git.fluff.org/bjdooks/linux
* 'next-i2c' of git://git.fluff.org/bjdooks/linux: (25 commits)
i2c-pnx: Map I2C adapter number to platform ID number
i2c-omap: OMAP3: PM: (re)init for every transfer to support off-mode
i2c-designware: i2c_dw_handle_tx_abort: Use dev_dbg() for NOACK cases
i2c-designware: Cosmetic cleanups
i2c-designware: Tx abort cleanups
i2c-designware: Skip RX_FULL and TX_EMPTY bits on tx abort errors
i2c-designware: i2c_dw_xfer_msg: Fix error handling procedures
i2c-designware: Disable TX_EMPTY when all i2c_msg msgs has been processed
i2c-designware: Process all i2c_msg messages in the interrupt handler
i2c-designware: i2c_dw_read: Remove redundant target address checker
i2c-designware: i2c_dw_func: Set I2C_FUNC_SMBUS_foo bits
i2c-designware: Initialize byte count variables just prior to being used
i2c-designware: i2c_dw_xfer_msg: Introduce a local "buf" pointer
i2c-designware: Divide i2c_dw_xfer_msg into two functions
i2c-designware: Enable RX_FULL interrupt
i2c-designware: Set Tx/Rx FIFO threshold levels
i2c-designware: Process i2c_msg messages in the interrupt handler
i2c-designware: i2c_dw_xfer_msg: Fix i2c_msg search bug
i2c-designware: Improved _HCNT/_LCNT calculation
i2c-designware: Remove an useless local variable "num"
...
Linus Torvalds [Thu, 10 Dec 2009 03:45:58 +0000 (19:45 -0800)]
Merge branch 's3c24xx-updates' of git://git.fluff.org/bjdooks/linux
* 's3c24xx-updates' of git://git.fluff.org/bjdooks/linux:
ARM: S3C24XX: DMA: Use valid index when accessing array
ARM: S3C: move s3c_pwm_remove to .devexit.text
ARM: S3C24XX: Export s3c24xx_set_fiq for modules.
ARM: S3C: move s3c_adc_remove to .devexit.text
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6:
sl82c105: remove no longer needed debugging code
sis5513: remove stale TODO
pdc202xx_old: remove no longer needed debugging code
cy82c693: remove no longer needed debugging code
cmd64x: remove no longer needed debugging code
alim15x3: remove obsolete and dangerous wdc_udma parameter
ide: Increase WAIT_DRQ to accomodate some CF cards and SSD drives.
cs5535: add pci id for AMD based CS5535 controllers
slc90e66: fix UDMA handling
drivers/ide/tx4938ide.c: use resource_size()
drivers/ide/ide_platform.c: use resource_size()
drivers/ide/au1xxx-ide.c: use resource_size()
hpt366: remove dead old timing tables
ide: update Kconfig text to mark as deprecated
ide-tape: remove the BKL
hpt366: kill unused #define's
Linus Torvalds [Thu, 10 Dec 2009 03:43:19 +0000 (19:43 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: add multi-input quirk for NextWindow Touchscreen.
HID: add support for Acan FG-8100 barcode reader
HID: make Media key on Logitech DiNovo Mini work
HID: support Logitech/3DConnexion SpaceTraveler and SpaceNavigator
HID: remove BKL from hiddev_ioctl_usage()
HID: fixup quirk for NCR devices
HID: pidff - fix unnecessary loop iterations on reset
HID: add NOGET quirk for another device from CH Products
HID: remove useless DRIVER_VERSION macro
HID: fix MODULE_AUTHOR usage in HID modules
HID: blacklist Acer Ferrari 4005 optical mouse
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (222 commits)
[SCSI] zfcp: Remove flag ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP
[SCSI] zfcp: Activate fc4s attributes for zfcp in FC transport class
[SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED
[SCSI] zfcp: Update FSF error reporting
[SCSI] zfcp: Improve ELS ADISC handling
[SCSI] zfcp: Simplify handling of ct and els requests
[SCSI] zfcp: Remove ZFCP_DID_MASK
[SCSI] zfcp: Move WKA port to zfcp FC code
[SCSI] zfcp: Use common code definitions for FC CT structs
[SCSI] zfcp: Use common code definitions for FC ELS structs
[SCSI] zfcp: Update FCP protocol related code
[SCSI] zfcp: Dont fail SCSI commands when transitioning to blocked fc_rport
[SCSI] zfcp: Assign scheduled work to driver queue
[SCSI] zfcp: Remove STATUS_COMMON_REMOVE flag as it is not required anymore
[SCSI] zfcp: Implement module unloading
[SCSI] zfcp: Merge trace code for fsf requests in one function
[SCSI] zfcp: Access ports and units with container_of in sysfs code
[SCSI] zfcp: Remove suspend callback
[SCSI] zfcp: Remove global config_mutex
[SCSI] zfcp: Replace local reference counting with common kref
...
Linus Torvalds [Thu, 10 Dec 2009 03:09:42 +0000 (19:09 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
m68knommu: export clk_* symbols in clk.c
m68knommu: Split the .init section into INIT_TEXT_SECTION and INIT_DATA_SECTION.
m68knommu: Move __init_end out of the .init section.
m68knommu: Move __init_begin out of the .init section.
m68knommu: Use more macros inside the .init section.
m68knommu: Use INIT_TASK_DATA and CACHELINE_ALIGNED_DATA.
m68knommu: Make THREAD_SIZE available to assembly files.
m68knommu: Don't hardcode the value of PAGE_SIZE in the linker script.
m68knommu: rename BSS define in linker script
m68knommu: add a task_pt_regs() macro
m68knommu: define arch_has_single_step() and friends
m68knommu: add uboot commandline argument passing support
m68knommu: Coldfire GPIO corrections
m68knommu: move mcf_remove to .devexit.text
Fixed up (?) conflict in arch/m68k/include/asm/ptrace.h
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (137 commits)
sh: include empty zero page in romImage
sh: Make associative cache writes fatal on all SH-4A parts.
sh: Drop associative writes for SH-4 cache flushes.
sh: Partial revert of copy/clear_user_highpage() optimizations.
sh: Add default uImage rule for se7724, ap325rxa, and migor.
sh: allow runtime pm without suspend/resume callbacks
sh: mach-ecovec24: Remove un-defined settings for VPU
sh: mach-ecovec24: LCDC drive ability become high
sh: fix sh7724 VEU3F resource size
serial: sh-sci: Fix too early port disabling.
sh: pfc: pr_info() -> pr_debug() cleanups.
sh: pfc: Convert from ctrl_xxx() to __raw_xxx() I/O routines.
sh: Improve kfr2r09 serial port setup code
sh: Break out SuperH PFC code
sh: Move KEYSC header file
sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
sh: Add CPG save/restore code for sh7724 R-standby
sh: Add SDHI power control support to Ecovec
mfd: Add power control platform data to SDHI driver
sh: mach-ecovec24: modify address map
...
Linus Torvalds [Thu, 10 Dec 2009 03:02:46 +0000 (19:02 -0800)]
Merge branch 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci
* 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci: (69 commits)
davinci: Initial support for Neuros OSD2 platform.
davinci: remove unused variable in arch/arm/mach-davinci/board-sffsdr.c
davinci: fix section mismatch warning in arch/arm/mach-davinci/board-dm646x-evm.c
DaVinci: DM365: Enable DaVinci RTC support for DM365 EVM
DA8xx/OMAP-L1xx: Add high speed SD/MMC capabilities
davinci: DA8XX/OMAP-L1XX: enable cpuidle and regulator in defconfig
davinci: DA850/OMAP-L138: avoid using separate initcall for initializing regulator
davinci: DA850/OMAP-L138 EVM: register for cpuidle support
davinci: DA8XX/OMAP-L1XX: add support for cpuidle driver register
davinci: add CPU idle driver
davinci: DA8XX/OMAP-L1XX: fix compiler warning
davinci: DA850/OMAP-L138: eliminate static function declaration
davinci: DA850/OMAP-L138 EVM: simplify configuration of emac in MII/RMII mode
davinci: DA850/OMAP-L138 EVM: get rid of DA850_UI_EXP config option
davinci: DA850/OMAP-L138 EVM: implement autodetect of RMII PHY
davinci: DA830/OMAP-L137 EVM: do not configure NAND on UI card when MMC/SD is selected
davinci: DA830/OMAP-L137 EVM: use runtime detection for UI card
davinci: DA830/OMAP-L137 EVM: remove ifdefs inside da830_evm_init()
davinci: DA830/OMAP-L137 EVM: fix warning with default config
davinci: Add NAND support for DA830/OMAP-L137 EVM platform
...
the description in Documentation/filesystems/proc.txt of the
procs_running entry in /proc/stat is confusing (according to that
description, it looks as if procs_running could only be a number
between 0 and the number of CPUs).
Changed it to a more accurate description in the patch attached.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The bkl has been removed from nvram_llseek() and smp_lock.h was removed
because another patch in the same tree zapped the remaining usage of bkl
in the same file. But this patch must have been excluded later, then we
still need the smp_lock.h headers for the bkl use in nvram_open().
This fixes the following build error:
drivers/char/nvram.c: In function ‘nvram_open’:
drivers/char/nvram.c:332: erreur: implicit declaration of function ‘lock_kernel’
drivers/char/nvram.c:339: erreur: implicit declaration of function ‘unlock_kernel’
make[2]: *** [drivers/char/nvram.o] Erreur 1
make[1]: *** [drivers/char] Erreur 2
make: *** [drivers] Erreur 2
Jean Delvare [Wed, 9 Dec 2009 19:36:08 +0000 (20:36 +0100)]
hwmon: (adt7475) Add VID support for the ADT7476
The ADT7476 has 5 dedicated pins for VID input, and the +12V input can
optionally be used as a 6th VID pin. Add support for VID input.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:08 +0000 (20:36 +0100)]
hwmon: (adt7475) Add an entry in MAINTAINERS
As I've just done a lot of changes to the adt7475 driver, I volunteer
to maintain it for the year to come.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:08 +0000 (20:36 +0100)]
hwmon: (adt7475) Add support for the ADT7476
Add support for the Analog Devices ADT7476 chip. This chip is largely
compatible with the ADT7473 and ADT7475, with additional features.
In particular, it has 5 voltage inputs instead of 2, and VID input
pins.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:07 +0000 (20:36 +0100)]
hwmon: (adt7475) Voltage attenuators can be bypassed
It is possible to bypass the voltage attenuators on the +2.5V, Vccp,
+5V and +12V voltage monitoring inputs. This is useful to connect
other voltage channels than the ones the monitoring chip was
originally designed for. When this feature is enabled, we must not
include the scaling factors in our computations.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:07 +0000 (20:36 +0100)]
hwmon: (adt7475) Print device information on probe
Print the device name and revision at probe time, as well as a list of
all optional features which are available.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:06 +0000 (20:36 +0100)]
hwmon: (adt7475) Handle alternative pin functions
The TACH4 pin can be used for other functions, so fan4 may not always
be available. Likewise, the PWM2 pin can be used for ALERT output, in
which case pwm2 is not available
For the ADT7490, the +2.5 Vin pin may also be used for other
functions, in which case in0 is not available.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:06 +0000 (20:36 +0100)]
hwmon: (adt7475) Move sysfs files removal to a separate function
Move sysfs files removal to a separate function. The code is common to
the device probing error path and the standard device removal path. As
it will grow with future driver development, this avoids code
duplication.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:05 +0000 (20:36 +0100)]
hwmon: (adt7475) Add support for the ADT7490
Add support for the Analog Devices ADT7490 chip. This chip is largely
compatible with the ADT7473 and ADT7475, with additional features.
In particular, it has 6 voltage inputs instead of 2.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:04 +0000 (20:36 +0100)]
hwmon: (adt7475) Improve device detection
Check the value of register 0x3f as part of the device detection, to
make it more robust.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:03 +0000 (20:36 +0100)]
hwmon: (adt7475) Add missing static marker
adt7475_attr_group is used internally only and can thus be marked
static.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:03 +0000 (20:36 +0100)]
hwmon: (adt7475) Rework voltage inputs handling
Rework the handling of voltage inputs to make it possible and easy to
support more inputs. This will be needed for the upcoming ADT7490
support.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Implement the non-standard pwm_use_point2_pwm_at_crit sysfs attribute
as the adt7473 driver did.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:02 +0000 (20:36 +0100)]
hwmon: (adt7475) New documentation
New documentation for the adt7475 driver, based on the adt7473 driver
documentation. It is IMHO much more useful that the previous
documentation which was essentially redundant with sysfs-interface.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Jean Delvare [Wed, 9 Dec 2009 19:36:02 +0000 (20:36 +0100)]
hwmon: (adt7475) Add support for the ADT7473
Add support for the ADT7473 to the adt7475 driver, and mark the
adt7473 driver for removal. The ADT7473 and ADT7475 chips are almost
the same chip and essentially compatible, so there's no point in
having separate drivers for them.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jordan Crouse <jordan@cosmicpenguin.net> Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Hans de Goede [Wed, 9 Dec 2009 19:36:01 +0000 (20:36 +0100)]
hwmon: (f71882fg) Add support for the f71889fg (version 2)
This adds support for the Fintek f71889fg to the f71882fg driver,
many thanks to Gerd v. Egidy for providing (remote) access to a
machine which such an ic.
Note that this bit of the patch:
- val = SENSORS_LIMIT(val, 0, 255);
+
+ if (data->type == f71889fg)
+ val = SENSORS_LIMIT(val, -128, 127);
+ else
+ val = SENSORS_LIMIT(val, 0, 127);
Changes behaviour for already supported models, the new behaviour is correct
as the already supported models have bit 7 of the involved registers fixed at
0, so the previous behaviour which allowed setting temp zone limits > 127
was not correct.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>