Zhao Yakui [Tue, 15 Dec 2009 14:01:57 +0000 (22:01 +0800)]
ACPI: Use the return result of ACPI lid notifier chain correctly
On some laptops it will return NOTIFY_OK(non-zero) when calling the ACPI LID
notifier. Then it is used as the result of ACPI LID resume function, which
will complain the following warning message in course of suspend/resume:
>PM: Device PNP0C0D:00 failed to resume: error 1
This patch is to eliminate the above warning message.
http://bugzilla.kernel.org/show_bug.cgi?id=14782
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Alexey Dobriyan [Tue, 15 Dec 2009 23:51:12 +0000 (21:51 -0200)]
thinkpad-acpi: convert to seq_file
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
Add the basic ALSA mixer functionality. The mixer is event-driven,
and will work fine on IBM ThinkPads. I expect Lenovo ThinkPads will
cause some trouble with the event interface.
Heavily based on work by Lorne Applebaum <lorne.applebaum@gmail.com>
and ideas from Matthew Garrett <mjg@redhat.com>.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Lorne Applebaum <lorne.applebaum@gmail.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
Disable volume control by default. It can be enabled at module load
time by a module parameter (volume_control=1).
The audio control mixer that thinkpad-acpi interacts with is fully
functional without any drivers, and operated by hotkeys.
The idea behind the console audio control is that the human operator
is the only one that can interact with it. The ThinkVantage suite in
Windows does not allow any software-based overrides, and only does OSD
(on-screen-display) functions.
The Linux driver will, with the addition of the ALSA interface, try to
follow and enforce the ThinkVantage UI design:
The user is supposed to use the keyboard hotkeys to interact with the
console audio control. The kernel and the desktop environment is
supposed to cooperate to provide proper user feedback through
on-screen-display functions.
Distros are urged to not to enable volume control by default.
Enabling this must be a local admin's decision. This is the reason
why there is no Kconfig option.
Keep in mind that all ThinkPads have a normal, main mixer (AC97 or
HDA) for regular software-based audio control. We are not talking
about that mixer here.
Advanced users are, of course, free to enable volume control and do as
they please.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Lorne Applebaum <lorne.applebaum@gmail.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
Lenovo removed the extra mixer since the T61 and thereabouts.
Newer Lenovo models only have the mute gate function, and leave
the volume control to the HDA mixer.
Until a way to automatically query the firmware about its audio
control capabilities is discovered (there might not be any), use a
white/black list.
We will likely need to ask T60 (old and new model) and Z60/Z61 users
whether they have volume control to populate the black/white list.
Meanwhile, provide a volume_capabilities parameter that can be used to
override the defaults.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Lorne Applebaum <lorne.applebaum@gmail.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
I don't trust the coupled EC writes and SMI calls the current volume
control code does very much, although it is exactly what the IBM DSDTs
seem to do (they never do more than a single step though).
Change the driver to stop issuing SMIs, and just drive the EC directly
to the desired level (DSDTs seem to confirm this will work even on
very old models like the 570 and 600e/x).
We checkpoint directly to NVRAM (this can be turned off) at
suspend/shutdown/driver unload, which from what I can see in tbp,
should also work on every ThinkPad.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Lorne Applebaum <lorne.applebaum@gmail.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
thinkpad-acpi: sync input device EV_SW initial state
Before we register the input device, sync the input layer EV_SW state
through a call to input_report_switch(), to avoid issuing a gratuitous
event for the initial state of these switches.
This fixes some annoyances caused by the interaction with rfkill and
EV_SW SW_RFKILL_ALL events.
Reported-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Len Brown <len.brown@intel.com>
Corentin Chary [Mon, 7 Dec 2009 21:05:50 +0000 (22:05 +0100)]
asus-laptop: change light sens default values.
The light sensor disable brightness key and
/sys/class/backlight/ control. There was a lot of report
from users who didn't understand why they couldn't change their
brightness, including:
Now the light sensor is disabled, and if the user want to enable
it, the level should be ok.
The funny thing is that comments where ok, not code.
Cc: stable@kernel.org Cc: Thomas Renninger <trenn@suse.de> Cc: Peter Küppers <peter-mailbox@web.de> Cc: Michael Franzl <michaelfranzl@gmx.at> Cc: Ian Turner <vectro@vectro.org> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
Dan Carpenter [Fri, 11 Dec 2009 07:31:40 +0000 (15:31 +0800)]
ACPICA: Move check for valid Thread ID structure
This change moves the check for a valid Thread ID structure up a
few lines to insure that the check is made before the structure
is actually used.
Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Bob Moore [Fri, 11 Dec 2009 07:29:44 +0000 (15:29 +0800)]
ACPICA: Predefined name repair: automatically remove null package elements
This change will automatically remove embedded and trailing NULL
package elements from returned package objects that are defined
to containe a variable number of sub-packages. The driver is then
presented with a package with no null elements to deal with.
ACPICA BZ 819.
Lin Ming [Fri, 11 Dec 2009 07:28:27 +0000 (15:28 +0800)]
ACPICA: Module-level code: enable _REG execution in same scope
This change enables the execution of _REG methods that appear
in the same scope as the module-level code, in resonse to an
operation region declaration within the module-level code.
Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Bob Moore [Fri, 11 Dec 2009 07:23:22 +0000 (15:23 +0800)]
ACPICA: Remove messages if predefined repair(s) are successful
Repair mechanism was considered too wordy. Now, messages are only
unconditionally emitted if the return object cannot be repaired.
Existing messages for successful repairs were converted to
ACPI_DEBUG_PRINT messages for now. ACPICA BZ 827.
Bob Moore [Fri, 11 Dec 2009 07:16:38 +0000 (15:16 +0800)]
ACPICA: Fix mutex errors when running _REG methods
Fixes a problem where mutex errors can occur when running a _REG
method that is in the same scope as a method-defined operation
region or an operation region under a module-level IF block.
This is rare, so the problem has not been seen before.
ACPICA BZ 826.
Bob Moore [Fri, 11 Dec 2009 07:01:12 +0000 (15:01 +0800)]
ACPICA: Add more conversions to predefined name repair module
This change enhances the automatic repairs/conversions for
predefined name return values to make Integers, Strings, and
Buffers fully interchangeable. Also, a Buffer can be converted
to a Package of Integers if necessary. The nsrepair.c module was
completely restructured.
Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This change deletes the unnecessary acpi_ns_convert_entry_to_handle
interface and renames the acpi_ns_map_handle_to_node interface to
acpi_ns_validate_handle. ACPICA BZ 798.
Bob Moore [Fri, 11 Dec 2009 06:53:11 +0000 (14:53 +0800)]
ACPICA: Add repair for bad _FDE/_GTM buffers
The expected return value for both names is a Buffer of 5 DWORDS.
This repair fixes two possible problems (both seen in the field):
A package of integers is returned, or a buffer of BYTEs is returned.
Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Lin Ming [Fri, 11 Dec 2009 06:36:47 +0000 (14:36 +0800)]
ACPICA: Fix possible memory leak for module-level code execution
An object can be leaked for each block of executed module-level
code if the interpreter slack mode is enabled. The change deletes
any implicitly returned object in this case.
Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This file seems to have been missed in the renaming.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Tue, 15 Dec 2009 17:12:43 +0000 (09:12 -0800)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
xfs: event tracing support
xfs: change the xfs_iext_insert / xfs_iext_remove
xfs: cleanup bmap extent state macros
* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (80 commits)
dm snapshot: use merge origin if snapshot invalid
dm snapshot: report merge failure in status
dm snapshot: merge consecutive chunks together
dm snapshot: trigger exceptions in remaining snapshots during merge
dm snapshot: delay merging a chunk until writes to it complete
dm snapshot: queue writes to chunks being merged
dm snapshot: add merging
dm snapshot: permit only one merge at once
dm snapshot: support barriers in snapshot merge target
dm snapshot: avoid allocating exceptions in merge
dm snapshot: rework writing to origin
dm snapshot: add merge target
dm exception store: add merge specific methods
dm snapshot: create function for chunk_is_tracked wait
dm snapshot: make bio optional in __origin_write
dm mpath: reject messages when device is suspended
dm: export suspended state to targets
dm: rename dm_suspended to dm_suspended_md
dm: swap target postsuspend call and setting suspended flag
dm crypt: add plain64 iv
...
Linus Torvalds [Tue, 15 Dec 2009 17:11:28 +0000 (09:11 -0800)]
Merge branch 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.33' of git://git.kernel.dk/linux-2.6-block:
cfq: set workload as expired if it doesn't have any slice left
Fix a CFQ crash in "for-2.6.33" branch of block tree
cfq: Remove wait_request flag when idle time is being deleted
cfq-iosched: commenting non-obvious initialization
cfq-iosched: Take care of corner cases of group losing share due to deletion
cfq-iosched: Get rid of cfqq wait_busy_done flag
cfq: Optimization for close cooperating queue searching
block,xd: Delay allocation of DMA buffers until device is known
drbd: Following the hmac change to SHASH (see linux commit 8bd1209cfff)
cfq-iosched: reduce write depth only if sync was delayed
Linus Torvalds [Tue, 15 Dec 2009 17:11:05 +0000 (09:11 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: ac97_codec - increase timeout for analog sections to 5 second
ASoC: Correct code taking the size of a pointer
ALSA: hda - Add PCI IDs for Nvidia G2xx-series
ALSA: sound/isa/gus: Correct code taking the size of a pointer
ALSA: hda: Fix max PCM level to 0 dB for AD1981_HP
ALSA: hda: Use ALC260_WILL quirk for another Acer model (0x1025007f)
Linus Torvalds [Tue, 15 Dec 2009 17:02:01 +0000 (09:02 -0800)]
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (26 commits)
clockevents: Convert to raw_spinlock
clockevents: Make tick_device_lock static
debugobjects: Convert to raw_spinlocks
perf_event: Convert to raw_spinlock
hrtimers: Convert to raw_spinlocks
genirq: Convert irq_desc.lock to raw_spinlock
smp: Convert smplocks to raw_spinlocks
rtmutes: Convert rtmutex.lock to raw_spinlock
sched: Convert pi_lock to raw_spinlock
sched: Convert cpupri lock to raw_spinlock
sched: Convert rt_runtime_lock to raw_spinlock
sched: Convert rq->lock to raw_spinlock
plist: Make plist debugging raw_spinlock aware
bkl: Fixup core_lock fallout
locking: Cleanup the name space completely
locking: Further name space cleanups
alpha: Fix fallout from locking changes
locking: Implement new raw_spinlock
locking: Convert raw_rwlock functions to arch_rwlock
locking: Convert raw_rwlock to arch_rwlock
...
* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
avr32: update default configurations for ATNGW100, ATSTK1002 and ATSTK1006
avr32: add default configurations for ATNGW100 mkII and EVKLCD10X
avr32: add support for ATNGW100 mkII board
avr32: convert to asm-generic/hardirq.h
avr32: add two new at91 to cpu.h definition
avr32: clean up linker script using standard macros.
avr32: MRMT: correct setup of SPI slaves
avr32: function for independently setting up SPI slaves
avr32: re-instate MCI WP/CD pin assignments for ATNGW100
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sparc64: Fix clock event multiplier printf format.
sparc64: Use clock{source,events}_calc_mult_shift().
sparc64: Use free_bootmem_late() in mdesc_lmb_free().
sparc: Add alignment and emulation fault perf events.
sparc64: Add syscall tracepoint support.
sparc: Stop trying to be so fancy and use __builtin_{memcpy,memset}()
sparc: Use __builtin_object_size() to validate the buffer size for copy_from_user()
sparc64: Add some missing __kprobes annotations to kernel fault paths.
sparc64: Use kprobes_built_in() to avoid ifdefs in fault_64.c
sparc: Validate that kprobe address is 4-byte aligned.
sparc64: Don't specify IRQF_SHARED for LDC interrupts.
sparc64: Fix stack debugging IRQ stack regression.
sparc64: Fix overly strict range type matching for PCI devices.
Linus Torvalds [Tue, 15 Dec 2009 16:59:33 +0000 (08:59 -0800)]
Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6:
power_supply_sysfs: Handle -ENODATA in a special way
wm831x_backup: Remove unused variables
gta02: Set pcf50633 charger_reference_current_ma
pcf50633: Query charger status directly
pcf50633: Properly reenable charging when the supply conditions change
pcf50633: Get rid of charging restart software auto-triggering
pcf50633: introduces battery charging current control
pcf50633: Add ac power supply class to the charger
wm831x: Factor out WM831x backup battery charger
Samu Onkalo [Tue, 15 Dec 2009 02:01:46 +0000 (18:01 -0800)]
lis3: scale output values to mg
Report output values as 1/1000 of earth gravity.
Output values from lis3 can be read from sysfs position entry and from
input device. Input device can be accessed as event device and as
joystick device. Joystick device can be in two modes. Meaning of the
output values varies from case to case depending on the chip type and
configuration (scale). Only joystick interface in JS_CORR_BROKEN mode
returned somehow similar output values in different configurations.
Joystick device is in that state by default in case of lis3.
Position sysfs entry, input event device and raw joystick device have been
little bit broken since meaning of the output values has been varied
between 12 and 8 bit devices. Applications which relayed on those methods
failed if the chip is different than the expected one.
This patch converts output values to mean similar thing in different
configurations. Both 8 and 12 bit devices reports now same acceleration
values. If somebody implements full scale support to the driver, output
values will still mean the same. Scaling factor and input device range
must be updated in that case.
Joystick interface in JS_CORR_BROKEN mode is not touched by this patch.
All other interfaces have different scale after this change. For 12 bit
device scaling factor is 0.977 which keeps scaled and unscaled values are
quite close to each others. For 8 bit device, scaled values are 18 times
bigger than unscaled values.
Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Acked-by: Éric Piel <Eric.Piel@tremplin-utc.net> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Samu Onkalo [Tue, 15 Dec 2009 02:01:43 +0000 (18:01 -0800)]
lis3lv02d: remove calibaration functionality
Chip is calibrated by the manufacturer. There is no need to calibarate it
at driver level. If the chip is used as a joystick, calibaration can be
done using joystick device calibration mechanism.
Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Acked-by: Éric Piel <Eric.Piel@tremplin-utc.net> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Samu Onkalo [Tue, 15 Dec 2009 02:01:43 +0000 (18:01 -0800)]
lis3: selftest support
Implement selftest feature as specified by chip manufacturer. Control:
read selftest sysfs entry
Response: "OK x y z" or "FAIL x y z"
where x, y, and z are difference between selftest mode and normal mode.
Test is passed when values are within acceptance limit values.
Acceptance limits are provided via platform data. See chip spesifications
for acceptance limits. If limits are not properly set, OK / FAIL decision
is meaningless. However, userspace application can still make decision
based on the numeric x, y, z values.
Selftest is meant for HW diagnostic purposes. It is not meant to be
called during normal use of the chip. It may cause false interrupt
events. Selftest mode delays polling of the normal results but it doesn't
cause wrong values. Chip must be in static state during selftest. Any
acceration during the test causes most probably failure.
Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Acked-by: Éric Piel <Eric.Piel@tremplin-utc.net> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Samu Onkalo [Tue, 15 Dec 2009 02:01:41 +0000 (18:01 -0800)]
lis3lv02d: proper power on sequence
Lis3 accelerometer sensors have quite long power on delay (up to 125
ms). This patch adds necessary delay to power on sequence for currently
supported lis3 chips.
Éric Piel [Tue, 15 Dec 2009 02:01:40 +0000 (18:01 -0800)]
lis3: fix show rate for 8 bits chips
Originally the driver was only targeted to 12bits sensors. When support
for 8bits sensors was added, some slight difference in the registers were
overlooked. This should fix it, both for initialization, and for
displaying the rate.
Reported-by: Kalhan Trisal <kalhan.trisal@intel.com> Reported-by: Christoph Plattner <christoph.plattner@gmx.at> Tested-by: Christoph Plattner <christoph.plattner@gmx.at> Tested-by: Samu Onkalo <samu.p.onkalo@nokia.com> Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Éric Piel [Tue, 15 Dec 2009 02:01:39 +0000 (18:01 -0800)]
lis3: update documentation and comments
Most of the documentation and comments were written when the driver was
only supporting one type of chip, only via ACPI/HP. Update the info to
the much clearer understanding that we have now.
Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Daniel J Blueman [Tue, 15 Dec 2009 02:01:37 +0000 (18:01 -0800)]
hwmon: w83627ehf updates
Add control of fan minimum turn-on output levels, decoupling it from the
fan turn-off output level. Add control of rate of change of fan output
level. These in turn allow lower turn-off rotor speed and smoother
transitions for better thermal and acoustic control authority. Add
support for constant fan speed and proportional-response operations modes.
[akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: David Hubbard <david.c.hubbard@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Nicolas Ferre [Tue, 15 Dec 2009 02:01:31 +0000 (18:01 -0800)]
mmc: atmel-mci: new MCI2 module support in atmel-mci driver
This new revision of the IP adds some improvements to the MCI already
present in several Atmel SOC.
Some new registers are added and a particular way of handling DMA
interaction lead to a new sequence in function call which is backward
compatible: On MCI2, we must set the DMAEN bit to enable the DMA
handshaking interface. This must happen before the data transfer command
is sent.
A new function is able to differentiate MCI2 code and is based on
knowledge of processor id (cpu_is_xxx()).
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Nicolas Ferre [Tue, 15 Dec 2009 02:01:30 +0000 (18:01 -0800)]
atmel-mci: change use of dma slave interface
Allow the use of another DMA controller driver in atmel-mci sd/mmc driver.
This adds a generic dma_slave pointer to the mci platform structure where
we can store DMA controller information. In atmel-mci we use information
provided by this structure to initialize the driver (with new helper
functions that are architecture dependant).
This also adds at32/avr32 chip modifications to cope with this new access
method.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Ben Hutchings [Tue, 15 Dec 2009 02:01:29 +0000 (18:01 -0800)]
mmc: add module parameter to set whether cards are assumed removable
Some people run general-purpose distribution kernels on netbooks with
a card that is physically non-removable or logically non-removable
(e.g. used for /home) and cannot be cleanly unmounted during suspend.
Add a module parameter to set whether cards are assumed removable or
non-removable, with the default set by CONFIG_MMC_UNSAFE_RESUME.
In general, it is not possible to tell whether a card present in an MMC
slot after resume is the same that was there before suspend. So there are
two possible behaviours, each of which will cause data loss in some cases:
CONFIG_MMC_UNSAFE_RESUME=n (default): Cards are assumed to be removed
during suspend. Any filesystem on them must be unmounted before suspend;
otherwise, buffered writes will be lost.
CONFIG_MMC_UNSAFE_RESUME=y: Cards are assumed to remain present during
suspend. They must not be swapped during suspend; otherwise, buffered
writes will be flushed to the wrong card.
Currently the choice is made at compile time and this allows that to be
overridden at module load time.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: Wouter van Heyst <larstiq@larstiq.dyndns.org> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Ben Dooks [Tue, 15 Dec 2009 02:01:27 +0000 (18:01 -0800)]
s3cmci: convert missed s3c2410_gpio calls to gpiolib calls
Convert two missed s3c2410 specific gpio calls to gpiolib calls.
Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Simtec Linux Team <linux@simtec.co.uk> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Nicolas Pitre [Tue, 15 Dec 2009 02:01:26 +0000 (18:01 -0800)]
sdhci: add support for the SysKonnect CardBus2SDIO adapter
This is still in use especially to develop SDIO device drivers on laptop
machines which are lacking SDIO slots. This adapter supports SDIO cards
only due to lack of 136-bit response capability.
Signed-off-by: Nicolas Pitre <nico@marvell.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mmc: davinci: modify data types of EDMA related variables
Currently DaVinci EDMA driver supports multiple EDMA channel controller
instances. edma_alloc_channel() api returns a 32 bit value which has the
channel controller number in MSB and the EDMA channel number in LSB. The
variables which store the value returned by edma_alloc_channel() have to
be 32 bit wide now.
Albert Herranz [Tue, 15 Dec 2009 02:01:19 +0000 (18:01 -0800)]
sdio: rework cis tuple parsing
Rework the current CIS tuple parsing code, reusing the existing
infrastructure and providing an easy way to add new CISTPL_FUNCE parsers
by TPLFE_TYPE.
Valid known CIS tuples are now silently queued for the SDIO function
driver when not parsed/processed (-EILSEQ) by the SDIO core. Unknown CIS
tuples (-ENOENT) are queued too for the SDIO function driver without
aborting the initialization, but emit a warning in the kernel log.
CISTPL_FUNCE tuples can be "whitelisted" now by adding a matching entry to
the cis_tpl_funce_list table.
Signed-off-by: Albert Herranz <albert_herranz@yahoo.es> Acked-by: Pierre Ossman <pierre@ossman.eu> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Mike Frysinger [Tue, 15 Dec 2009 02:01:16 +0000 (18:01 -0800)]
firmware: only allow EDD on x86
Rather than have the EDD depend on !ia64 (and assuming that only ia64,
x86, x86_64 will be including this Kconfig), have EDD depend on the only
arches which can support this code. This should allow all other arches to
cleanly include the firmware Kconfig.
Also simplify the x86 string used by FIRMWARE_MEMMAP to match EDD.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Recently, We marked strstrip() as must_check. because it was frequently
misused and it should be checked. However, we found one exception.
scsi/ipr.c intentionally ignore return value of strstrip. Because it
wishes to keep the whitespace at the beginning.
Thus we need to keep with and without checked whitespace trim function.
This patch adds a new strim() and changes ipr.c to use it.
[akpm@linux-foundation.org: coding-style fixes] Suggested-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches [Tue, 15 Dec 2009 02:01:12 +0000 (18:01 -0800)]
drivers/md/md.c: use %pU to print UUIDs
Signed-off-by: Joe Perches <joe@perches.com> Cc: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches [Tue, 15 Dec 2009 02:01:10 +0000 (18:01 -0800)]
fs/xfs/xfs_log_recover.c: use %pU to print UUIDs
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Alex Elder <aelder@sgi.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
No functional change. Cache strlen() result to avoid recalculating it up
to 3 times on the worst case.
Reduces code size a little by 32 bytes:
text data bss dec hex filename
1385 0 0 1385 569 lib/parser.o-BEFORE
1353 0 0 1353 549 lib/parser.o-AFTER
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tree-wide: convert open calls to remove spaces to skip_spaces() lib function
Makes use of skip_spaces() defined in lib/string.c for removing leading
spaces from strings all over the tree.
It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
text data bss dec hex filename
64688 584 592 65864 10148 (TOTALS-BEFORE)
64641 584 592 65817 10119 (TOTALS-AFTER)
Also, while at it, if we see (*str && isspace(*str)), we can be sure to
remove the first condition (*str) as the second one (isspace(*str)) also
evaluates to 0 whenever *str == 0, making it redundant. In other words,
"a char equals zero is never a space".
Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
and found occurrences of this pattern on 3 more files:
drivers/leds/led-class.c
drivers/leds/ledtrig-timer.c
drivers/video/output.c
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Cc: Julia Lawall <julia@diku.dk> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Jeff Dike <jdike@addtoit.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Neil Brown <neilb@suse.de> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: David Howells <dhowells@redhat.com> Cc: <linux-ext4@vger.kernel.org> Cc: Samuel Ortiz <samuel@sortiz.org> Cc: Patrick McHardy <kaber@trash.net> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
string: on strstrip(), first remove leading spaces before running over str
... so that strlen() iterates over a smaller string comprising of the
remaining characters only.
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
string: factorize skip_spaces and export it to be generally available
On the following sentence:
while (*s && isspace(*s))
s++;
If *s == 0, isspace() evaluates to ((_ctype[*s] & 0x20) != 0), which
evaluates to ((0x08 & 0x20) != 0) which equals to 0 as well.
If *s == 1, we depend on isspace() result anyway. In other words,
"a char equals zero is never a space", so remove this check.
Also, *s != 0 is most common case (non-null string).
Fixed const return as noticed by Jan Engelhardt and James Bottomley.
Fixed unnecessary extra cast on strstrip() as noticed by Jan Engelhardt.
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andrew Morton [Tue, 15 Dec 2009 02:01:02 +0000 (18:01 -0800)]
drivers/scsi/sym53c8xx_2/sym_glue.c: rename skip_spaces() to sym_skip_spaces()
To avoid a collision with the newly-added kernel-wide skip_spaces().
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
vsprintf: reuse almost identical simple_strtoulX() functions
The difference between simple_strtoul() and simple_strtoull() is just
the size of the variable used to keep track of the sum of characters
converted to numbers:
unsigned long simple_strtoul() {...}
unsigned long long simple_strtoull(){...}
Both are same size on my Core 2/gcc 4.4.1.
Overflow condition is not checked on both functions, so an extremely large
string can break these functions so that they don't even notice it.
As we do not care for overflowing on these functions, always keep the sum
using the larger variable around (unsigned long long) on simple_strtoull()
and cast it to (unsigned long) on simple_strtoul(), which then becomes
just a wrapper around simple_strtoull().
Code size decreases by 304 bytes:
text data bss dec hex filename
15534 0 8 15542 3cb6 vsprintf.o (ex lib/lib.a-BEFORE)
15230 0 8 15238 3b86 vsprintf.o (ex lib/lib.a-AFTER)
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
vsprintf: factor out skip_space code in a separate function
When converting more caller sites, the inline decision will be left up to gcc.
It decreases code size:
text data bss dec hex filename
15710 0 8 15718 3d66 vsprintf.o (ex lib/lib.a-BEFORE)
15534 0 8 15542 3cb6 vsprintf.o (ex lib/lib.a-AFTER)
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
vsprintf: reduce code size by avoiding extra check
No functional change, just refactor the code so that it avoid checking
"if (hi)" two times in a sequence, taking advantage of previous check made.
It also reduces code size:
text data bss dec hex filename
15726 0 8 15734 3d76 vsprintf.o (ex lib/lib.a-BEFORE)
15710 0 8 15718 3d66 vsprintf.o (ex lib/lib.a-AFTER)
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
It decreases code size as well:
text data bss dec hex filename
15758 0 8 15766 3d96 vsprintf.o (ex lib/lib.a-BEFORE)
15726 0 8 15734 3d76 vsprintf.o (ex lib/lib.a-TOLOWER)
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This patchset reduces lib/lib.a code size by 482 bytes on my Core 2 with
gcc 4.4.1 even considering that it exports a newly defined function
skip_spaces() to drivers:
text data bss dec hex filename
64867 840 592 66299 102fb (TOTALS-lib.a-BEFORE)
64641 584 592 65817 10119 (TOTALS-lib.a-AFTER)
and implements some code tidy up.
Besides reducing lib.a size, it converts many in-tree drivers to use the
newly defined function, which makes another small reduction on kernel size
overall when those drivers are used.
This patch:
Change "<NULL>" to "(null)", unifying 3 equal strings.
glibc also uses "(null)" for the same purpose.
It decreases code size by 7 bytes:
text data bss dec hex filename
15765 0 8 15773 3d9d vsprintf.o (ex lib/lib.a-BEFORE)
15758 0 8 15766 3d96 vsprintf.o (ex lib/lib.a-AFTER)
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches [Tue, 15 Dec 2009 02:00:54 +0000 (18:00 -0800)]
MAINTAINERS: Update file patterns for WOLFSON MICROELECTRONICS PMIC DRIVERS
One of the includes pointed to a non-existent directory
Add Documentation/hwmon/wm83??
Add sound/soc/codecs/wm(8350|8400).h files
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches [Tue, 15 Dec 2009 02:00:52 +0000 (18:00 -0800)]
MAINTAINERS: rename PALM TREO section and file patterns
Signed-off-by: Joe Perches <joe@perches.com> Cc: Tomas Cech <sleep_walker@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
KOSAKI Motohiro [Tue, 15 Dec 2009 02:00:52 +0000 (18:00 -0800)]
MAINTAINERS: mark cifs mailing list as "moderated for non-subscribers"
If non-subscribers post bug report to CIFS mailing list, they will get
following messages.
Your mail to 'linux-cifs-client' with the subject
[PATCH x/x] cifs: xxxxxxxxxxxxx
Is being held until the list moderator can review it for approval.
The reason it is being held:
Post by non-member to a members-only list
Either the message will get posted to the list, or you will receive
notification of the moderator's decision. If you would like to cancel
this posting, please visit the following URL:
members-only list should be written as so in MAINTAINERS file.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Steve French <sfrench@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>