Daniel Drake [Mon, 5 Mar 2012 23:01:00 +0000 (15:01 -0800)]
x86/olpc/xo15/sci: Enable lid close wakeup control
Like most systems, OLPC's ACPI LID switch wakes up the system
when the lid is opened, but not when it is closed.
Under OLPC's opportunistic suspend model, the lid may be closed
while the system was oportunistically suspended with the screen
running. In this event, we want to wake up to turn the screen
off.
Enable control of normal ACPI wakeups through lid close events
through a new sysfs attribute "lid_wake_on_closed". When set,
and when LID wakeups are enabled through ACPI, the system will
wake up on both open and close lid events.
Signed-off-by: Daniel Drake <dsd@laptop.org> Cc: Andres Salomon <dilinger@queued.net> Cc: Matthew Garrett <mjg@redhat.com>
[ Fixed sscanf checking] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-bgt8hxu2wwe0x5p8edhogtf7@git.kernel.org
[ Did very minor readability tweaks ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
x86/kprobes: Fix a bug which can modify kernel code permanently
Fix a bug in kprobes which can modify kernel code
permanently at run-time. In the result, kernel can
crash when it executes the modified code.
This bug can happen when we put two probes enough near
and the first probe is optimized. When the second probe
is set up, it copies a byte which is already modified
by the first probe, and executes it when the probe is hit.
Even worse, the first probe and the second probe are removed
respectively, the second probe writes back the copied
(modified) instruction.
To fix this bug, kprobes always recovers the original
code and copies the first byte from recovered instruction.
x86/kprobes: Fix instruction recovery on optimized path
Current probed-instruction recovery expects that only breakpoint
instruction modifies instruction. However, since kprobes jump
optimization can replace original instructions with a jump,
that expectation is not enough. And it may cause instruction
decoding failure on the function where an optimized probe
already exists.
This bug can reproduce easily as below:
1) find a target function address (any kprobe-able function is OK)
$ grep __secure_computing /proc/kallsyms ffffffff810c19d0 T __secure_computing
2) decode the function
$ objdump -d vmlinux --start-address=0xffffffff810c19d0 --stop-address=0xffffffff810c19eb
3) put a kprobe-event at an optimize-able place, where no
call/jump places within the 5 bytes.
$ su -
# cd /sys/kernel/debug/tracing
# echo p __secure_computing+0x9 > kprobe_events
4) enable it and check it is optimized.
# echo 1 > events/kprobes/p___secure_computing_9/enable
# cat ../kprobes/list ffffffff810c19d9 k __secure_computing+0x9 [OPTIMIZED]
5) put another kprobe on an instruction after previous probe in
the same function.
# echo p __secure_computing+0x12 >> kprobe_events
bash: echo: write error: Invalid argument
# dmesg | tail -n 1
[ 1666.500016] Probing address(0xffffffff810c19e2) is not an instruction boundary.
6) however, if the kprobes optimization is disabled, it works.
# echo 0 > /proc/sys/debug/kprobes-optimization
# cat ../kprobes/list ffffffff810c19d9 k __secure_computing+0x9
# echo p __secure_computing+0x12 >> kprobe_events
(no error)
This is because kprobes doesn't recover the instruction
which is overwritten with a relative jump by another kprobe
when finding instruction boundary.
It only recovers the breakpoint instruction.
This patch fixes kprobes to recover such instructions.
With this fix:
# echo p __secure_computing+0x9 > kprobe_events
# echo 1 > events/kprobes/p___secure_computing_9/enable
# cat ../kprobes/list ffffffff810c1aa9 k __secure_computing+0x9 [OPTIMIZED]
# echo p __secure_computing+0x12 >> kprobe_events
# cat ../kprobes/list ffffffff810c1aa9 k __secure_computing+0x9 [OPTIMIZED] ffffffff810c1ab2 k __secure_computing+0x12 [DISABLED]
Changes in v4:
- Fix a bug to ensure optimized probe is really optimized
by jump.
- Remove kprobe_optready() dependency.
- Cleanup code for preparing optprobe separation.
Changes in v3:
- Fix a build error when CONFIG_OPTPROBE=n. (Thanks, Ingo!)
To fix the error, split optprobe instruction recovering
path from kprobes path.
- Cleanup comments/styles.
Changes in v2:
- Fix a bug to recover original instruction address in
RIP-relative instruction fixup.
- Moved on tip/master.
WANG Cong [Mon, 5 Mar 2012 23:05:13 +0000 (15:05 -0800)]
x86/mm: Fix the size calculation of mapping tables
For machines that enable PSE, the first 2/4M memory region still uses
4K pages, so needs more PTEs in this case, but
find_early_table_space() doesn't count this.
This patch fixes it.
The bug was found via code review, no misbehavior of the kernel
was observed.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Tejun Heo <tj@kernel.org> Cc: <ianfang.cn@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-kq6a00qe33h7c7ais2xsywnh@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
x86/geode/net5501: Add platform driver for Soekris Engineering net5501
Add platform driver for the Soekris Engineering net5501 single-board
computer. Probes well-known locations in ROM for BIOS signature
to confirm correct platform. Registers 1 LED and 1 GPIO-based
button (typically used for soft reset).
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Andres Salomon <dilinger@queued.net> Cc: Matthew Garrett <mjg@redhat.com>
[ Removed Kconfig and Makefile detritus from drivers/leds/] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-jv5uf34996juqh5syes8mn4h@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
x86/geode/alix2: Supplement driver to include GPIO button support
GPIO 24 is used in reference designs as a soft-reset button, and
the alix2 is no exception. Add it as a gpio-button.
Use symbolic values to describe BIOS addresses.
Record the model number.
Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com> Acked-by: Ed Wildgoose <kernel@wildgooses.com> Acked-by: Andres Salomon <dilinger@queued.net> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-sjp6k1rjksitx1pej0c0qxd1@git.kernel.org
[ tidied up the code a bit ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Michael Demeter [Mon, 5 Mar 2012 23:01:04 +0000 (15:01 -0800)]
x86/mid/powerbtn: Use MSIC read/write instead of ipc_scu
In the 2.6.36 kernel we did not have the MSIC driver. Changed
all ipc_scu_reads/writes to use the MSIC driver and defines.
Added a fix from the 2.6.36 kernel where the SCU FW could send a
power button interrupt to the IA32 FW and the kernel was not
running yet. This resulted in the interrupt not getting cleared
and the power button was ignored. this fix just clears the
interrupt on start-up.
Signed-off-by: Michael Demeter <michael.demeter@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
[ Revert style-only changes. Remove unused variable. Fix comment style. ] Signed-off-by: Alan Cox <alan@linux.intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-4runmso4t49p4waz5gcvy0ux@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Mika Westerberg [Mon, 5 Mar 2012 23:01:04 +0000 (15:01 -0800)]
x86/mid/thermal: Turn off thermistor
Instead of complaining that the voltage is on, we can just ask
the MSIC to turn the voltage off. This should save some power.
Voltage for thermistors is turned on when ADC conversion is
initiated.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Acked-by: Durgadoss R <durgadoss.r@intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-85zdo06yve1o27jpwc74gzng@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Mika Westerberg [Mon, 5 Mar 2012 23:01:03 +0000 (15:01 -0800)]
x86/mid/thermal: Add msic_thermal alias
This device is called "msic_thermal" instead of "msic_sensor" on
actual boards so rename it.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
[ Updated to rename rather than add an entry as er discussion with Mika & Durgadoss R] Signed-off-by: Alan Cox <alan@linux.intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-gyrbptvkozsbp2yk3ssu084o@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Mika Westerberg [Mon, 5 Mar 2012 23:01:03 +0000 (15:01 -0800)]
x86/mid/thermal: Convert to use Intel MSIC API
Intel MSIC MFD driver provides common register access interface
to the devices in the MSIC die so we use that instead of SCU
IPC.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Acked-by: Durgadoss R <durgadoss.r@intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-6so0ep0lj0zann68ad5983xh@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Alan Cox [Mon, 5 Mar 2012 23:01:02 +0000 (15:01 -0800)]
x86/mid/scu_ipc: Remove Moorestown support
All the production devices use the PC compatible version of this
device so don't use the SCU interfaces or the SCU firmware
interfaces.
Delete lots of code and conditional paths
Signed-off-by: Alan Cox <alan@linux.intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-4bg4fn9na37b350ohhgiy18n@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Alan Cox [Mon, 5 Mar 2012 23:01:02 +0000 (15:01 -0800)]
x86/mid: Kill off Moorestown
All production devices operate in the Oaktrail configuration
with legacy PC elements present and an ACPI BIOS. Continue
stripping out the Moorestown elements from the tree leaving
Medfield.
Signed-off-by: Alan Cox <alan@linux.intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-z0dxy88f949rvxo5vvd08ybs@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Mike Travis [Mon, 5 Mar 2012 23:05:16 +0000 (15:05 -0800)]
x86/iommu/intel: Increase the number of iommus supported to MAX_IO_APICS
The number of IOMMUs supported should be the same as the number
of IO APICS. This limit comes into play when the IOMMUs are
identity mapped, thus the number of possible IOMMUs in the
"static identity" (si) domain should be this same number.
Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Jack Steiner <steiner@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Chris Wright <chrisw@sous-sol.org> Cc: Daniel Rahn <drahn@suse.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Joerg Roedel <joerg.roedel@amd.com>
[ Fixed printk format string, cleaned up the code ] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-ixcmp0hfp0a3b2lfv3uo0p0x@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Mike Travis [Mon, 5 Mar 2012 23:05:16 +0000 (15:05 -0800)]
x86/iommu/intel: Fix identity mapping for sandy bridge
With SandyBridge, Intel has changed these Socket PCI devices to
have a class type of "System Peripheral" & "Performance
counter", rather than "HostBridge".
So instead of using a "special" case to detect which devices will
not be doing DMA, use the fact that a device that is not associated
with an IOMMU, will not need an identity map.
Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Mike Habeck <habeck@sgi.com> Cc: Jack Steiner <steiner@sgi.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Chris Wright <chrisw@sous-sol.org> Cc: Daniel Rahn <drahn@suse.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Link: http://lkml.kernel.org/n/tip-018fywmjs3lmzfyzjlktg8dx@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
H.J. Lu [Mon, 5 Mar 2012 23:32:11 +0000 (15:32 -0800)]
x32: Add ptrace for x32
X32 ptrace is a hybrid of 64bit ptrace and compat ptrace with 32bit
address and longs. It use 64bit ptrace to access the full 64bit
registers. PTRACE_PEEKUSR and PTRACE_POKEUSR are only allowed to access
segment and debug registers. PTRACE_PEEKUSR returns the lower 32bits
and PTRACE_POKEUSR zero-extends 32bit value to 64bit. It works since
the upper 32bits of segment and debug registers of x32 process are always
zero. GDB only uses PTRACE_PEEKUSR and PTRACE_POKEUSR to access
segment and debug registers.
[ hpa: changed TIF_X32 test to use !is_ia32_task() instead, and moved
the system call number to the now-unused 521 slot. ]
H. Peter Anvin [Mon, 5 Mar 2012 21:40:24 +0000 (13:40 -0800)]
x32: Switch to a 64-bit clock_t
clock_t is used mainly to give the number of jiffies a certain process
has burned. It is entirely feasible for a long-running process to
consume more than 2^32 jiffies especially in a multiprocess system.
As such, switch to a 64-bit clock_t for x32, just as we already
switched to a 64-bit time_t.
clock_t is only used in a handful of places, and as such it is really
not a very significant change. The one that has the biggest impact is
in struct siginfo, but since the *size* of struct siginfo doesn't
change (it is padded to the hilt) it is fairly easy to make this a
localized change.
This also gets rid of sys_x32_times, however since this is a pretty
late change don't compactify the system call numbers; we can reuse
system call slot 521 next time we need an x32 system call.
Linus Torvalds [Mon, 5 Mar 2012 16:51:10 +0000 (08:51 -0800)]
Merge tag 'mmc-fixes-for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
MMC fixes from Chris Ball for 3.3:
- atmel-mci: oops fix against regression introduced in 3.2
- core: power saving regression fix against 3.3-rc1
- core: suspend/resume fix for UHS-I cards
- esdhc-imx: MMC card regression fix against 3.0
- mmci: oops fix for ARM systems with large (64k) pages
- MAINTAINERS update for atmel-mci.
* tag 'mmc-fixes-for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
mmc: core: Fixup suspend/resume issues for UHS-I cards
mmc: mmci: reduce max_blk_count to avoid overflowing max_req_size
mmc: sdhci-esdhc-imx: fix for mmc cards on i.MX5
mmc: core: fix regression: set default clock gating delay to 0
MAINTAINERS: hand over atmel-mci (sd/mmc interface)
mmc: atmel-mci: don't use dma features when using DMA with no chan available
Linus Torvalds [Mon, 5 Mar 2012 16:48:24 +0000 (08:48 -0800)]
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull from Jiri Kosina:
"Please pull to receive updates for HID layer. Nikolai's patch is
rather important and should still go in for 3.3, as it's a regression
fix for commit b4b583d."
* 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: hid-input: allow array fields out of range
HID: usbhid: Add NOGET quirk for the AIREN Slim+ keyboard
Namhyung Kim [Thu, 23 Feb 2012 08:46:24 +0000 (17:46 +0900)]
perf annotate: Add missing newline on error message
If perf.data couldn't find vmlinux image for the given build-id,
it would print error message. However it lacked a newline at the
end, so the output looked like below:
Namhyung Kim [Thu, 23 Feb 2012 08:46:22 +0000 (17:46 +0900)]
perf annotate: Restore title when came back to original symbol
On tui annotation, the title was set to name of the target symbol if
user selects the target. However it remained after returning to original
symbol from the target. Fix it.
Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1329986784-4916-4-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Namhyung Kim [Thu, 23 Feb 2012 07:08:14 +0000 (16:08 +0900)]
perf tools: Add descriptions of missing Makefile arguments
There are some variable arguments can be specified on make invocation,
but some of them are missing descriptions so that user cannot be
informed easily. Fix it.
Namhyung Kim [Thu, 23 Feb 2012 03:13:36 +0000 (12:13 +0900)]
perf evlist: Restore original errno after open failed
If perf_evsel__open() failed, the errno was set and returned properly.
However since the perf_evlist__open() called close() on fd's for all of
evsel x cpu x thread after the failure, the errno was overridden by
other code (EBADF). So the caller of the function ended up seeing
different error message and getting confused.
Fit it by restoring original return value. Because one of caller of the
function is in the python extension, and it uses system errno
internally, it'd be better restoring the original value rather than
using the return value of the function directly, IMHO (i.e. I'm not a
python expert :)
Allow array field values out of range as per HID 1.11 specification,
section 6.2.25:
Rather than returning a single bit for each button in the group, an
array returns an index in each field that corresponds to the pressed
button (like keyboard scan codes). An out-of range value in and array
field is considered no controls asserted.
Apparently, "and" above is a typo and should be "an".
This fixes at least Waltop tablet pen clicks - otherwise BTN_TOUCH is never
released.
The relevant part of Waltop tablet report descriptors is this:
Alex Shi [Sat, 3 Mar 2012 11:27:27 +0000 (19:27 +0800)]
x86/numa: Improve internode cache alignment
Currently cache alignment among nodes in the kernel is still 128
bytes on x86 NUMA machines - we got that X86_INTERNODE_CACHE_SHIFT
default from old P4 processors.
But now most modern x86 CPUs use the same size: 64 bytes from L1 to
last level L3. so let's remove the incorrect setting, and directly
use the L1 cache size to do SMP cache line alignment.
This patch saves some memory space on kernel data, and it also
improves the cache locality of kernel data.
The System.map is quite different with/without this change:
Linus Torvalds [Mon, 5 Mar 2012 01:10:06 +0000 (17:10 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
MFD fixes from Samuel Ortiz:
"This is the pull request for the MFD fixes for 3.3. We have a few
NULL pointer dereferences fixes, an ACPI conflict check fix, and a
couple of wm8994 fixes."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
mfd: Correct readability of WM8994 DC servo 4E register
mfd: Initialize tps65912 irq platform data properly
mfd: Fix ACPI conflict check
mfd: Fix ab8500 error path bug
mfd: Test for jack detection when deciding if wm8994 should suspend
mfd: Initialize tps65910 irq platform data properly
mfd: Fix possible s5m null pointer dereference
mfd: wm8350 variable dereferenced before check
Linus Torvalds [Sun, 4 Mar 2012 23:51:42 +0000 (15:51 -0800)]
vfs: move dentry_cmp from <linux/dcache.h> to fs/dcache.c
It's only used inside fs/dcache.c, and we're going to play games with it
for the word-at-a-time patches. This time we really don't even want to
export it, because it really is an internal function to fs/dcache.c, and
has been since it was introduced.
Having it in that extremely hot header file (it's included in pretty
much everything, thanks to <linux/fs.h>) is a disaster for testing
different versions, and is utterly pointless.
We really should have some kind of header file diet thing, where we
figure out which parts of header files are really better off private and
only result in more expensive compiles.
Ulf Hansson [Thu, 1 Mar 2012 12:18:05 +0000 (13:18 +0100)]
mmc: core: Fixup suspend/resume issues for UHS-I cards
Even if cards supports 1.8V I/O voltage those should anyway be
initialized at 3.3V I/O according to (e)MMC, SD and SDIO specs.
Some eMMC and embedded SDIO devices are able to be initialized
at 1.8V as well, but it is better to be safe.
Do note that initialization in this context means that the card
has been completely powered off, otherwise the card will remain
at the last I/O voltage level that were negotitiated.
Due to the above being taken care of the suspend/resume issues
for UHS-I SD-cards has been fixed.
Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com> Acked-by: Philip Rakity <prakity@marvell.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Chris Ball <cjb@laptop.org>
This is because of a 64k request with a max_req_size of 64k-1 bytes.
The following patch fixes the problem by limiting the max_blk_count
such that max_blk_count * max_blk_size == max_req_size. I couldn't
pursuade the compiler to emit a shift instead of a div without encoding
the shift explicitly.
Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Sascha Hauer [Fri, 17 Feb 2012 10:51:49 +0000 (11:51 +0100)]
mmc: sdhci-esdhc-imx: fix for mmc cards on i.MX5
On i.MX53 we have to write a special SDHCI_CMD_ABORTCMD to the
SDHCI_TRANSFER_MODE register during a MMC_STOP_TRANSMISSION
command. This works for SD cards. However, with MMC cards
the MMC_SET_BLOCK_COUNT command is used instead, but this
needs the same handling. Fix MMC cards by testing for the
MMC_SET_BLOCK_COUNT command aswell. Tested on a custom i.MX53
board with a Transcend MMC+ card and eMMC.
The kernel started used MMC_SET_BLOCK_COUNT in 3.0, so this
is a regression for these boards introduced in 3.0; it should
go to 3.0/3.1/3.2-stable.
mmc: core: fix regression: set default clock gating delay to 0
A recent commit "mmc: core: Use delayed work in clock gating framework"
(597dd9d79cfbbb1) introduced a default 200ms delay before clock gating
actually takes place. This means that every time an MMC interface
becomes idle it first stays on for 200ms before gating its clock. This
leads to increased power consumption and is therefore a clear regression.
This patch restores the original behaviour by setting the default delay
to 0. Users prioritising throughput over power efficiency can still
modify the delay via sysfs.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
Linus Torvalds [Sun, 4 Mar 2012 00:33:51 +0000 (16:33 -0800)]
Merge tag 'parisc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6
PARISC fixes from James Bottomley:
"This is a set of build fixes to get the cross compiled architecture
testbeds building again"
* tag 'parisc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6:
[PARISC] don't unconditionally override CROSS_COMPILE for 64 bit.
[PARISC] include <linux/prefetch.h> in drivers/parisc/iommu-helpers.h
[PARISC] fix compile break caused by iomap: make IOPORT/PCI mapping functions conditional
perf tools: Handle kernels that don't support attr.exclude_{guest,host}
Just fall back to resetting those fields, if set, warning the user that
that feature is not available.
If guest samples appear they will just be discarded because no struct
machine will be found and thus the event will be accounted as not
handled and dropped, see 0c09571.
Reported-by: Namhyung Kim <namhyung@gmail.com> Tested-by: Joerg Roedel <joerg.roedel@amd.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Joerg Roedel <joerg.roedel@amd.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-vuwxig36mzprl5n7nzvnxxsh@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Joerg Roedel [Fri, 10 Feb 2012 17:05:05 +0000 (18:05 +0100)]
perf tools: Change perf_guest default back to false
Setting perf_guest to true by default makes no sense because the perf
subcommands can not setup guest symbol information and thus not process
and guest samples. The only exception is perf-kvm which changes the
perf_guest value on its own. So change the default for perf_guest back
to false.
Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jason Wang <jasowang@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1328893505-4115-3-git-send-email-joerg.roedel@amd.com Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Linus Torvalds [Fri, 2 Mar 2012 23:21:48 +0000 (15:21 -0800)]
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
hhwmon fixes for 3.3-rc6 from Guenter Roeck:
These patches are necessary for correct operation and management of
F75387.
* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (f75375s) Catch some attempts to write to r/o registers
hwmon: (f75375s) Properly map the F75387 automatic modes to pwm_enable
hwmon: (f75375s) Make pwm*_mode writable for the F75387
hwmon: (f75375s) Fix writes to the pwm* attribute for the F75387
Linus Torvalds [Fri, 2 Mar 2012 23:21:15 +0000 (15:21 -0800)]
Merge tag 'fbdev-fixes-for-3.3-2' of git://github.com/schandinat/linux-2.6
fbdev fixes for 3.3 from Florian Tobias Schandinat
It includes:
- two fixes for OMAP HDMI
- one fix to make new OMAP functions behave as they are supposed to
- one Kconfig dependency fix
- two fixes for viafb for modesetting on VX900 hardware
* tag 'fbdev-fixes-for-3.3-2' of git://github.com/schandinat/linux-2.6:
OMAPDSS: APPLY: make ovl_enable/disable synchronous
OMAPDSS: panel-dvi: Add Kconfig dependency on I2C
viafb: fix IGA1 modesetting on VX900
viafb: select HW scaling on VX900 for IGA2
OMAPDSS: HDMI: hot plug detect fix
OMAPDSS: HACK: Ensure DSS clock domain gets out of idle when HDMI is enabled
Linus Torvalds [Fri, 2 Mar 2012 23:20:41 +0000 (15:20 -0800)]
Merge tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
sound fixes for 3.3-rc6 from Takashi Iwai
This contains again regression fixes for various HD-audio and ASoC
regarding SSI and dapm shutdown path. In addition, a minor azt3328
fix and the correction of the new jack-notification strings in HD-audio.
* tag 'sound-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Kill hyphenated names
ALSA: hda - Add a fake mute feature
ALSA: hda - Always set HP pin in unsol handler for STAC/IDT codecs
ALSA: azt3328 - Fix NULL ptr dereference on cards without OPL3
ALSA: hda/realtek - Fix resume of multiple input sources
ASoC: i.MX SSI: Fix DSP_A format.
ASoC: dapm: Check for bias level when powering down
Linus Torvalds [Fri, 2 Mar 2012 22:49:24 +0000 (14:49 -0800)]
vfs: split up name hashing in link_path_walk() into helper function
The code in link_path_walk() that finds out the length and the hash of
the next path component is some of the hottest code in the kernel. And
I have a version of it that does things at the full width of the CPU
wordsize at a time, but that means that we *really* want to split it up
into a separate helper function.
So this re-organizes the code a bit and splits the hashing part into a
helper function called "hash_name()". It returns the length of the
pathname component, while at the same time computing and writing the
hash to the appropriate location.
The code generation is slightly changed by this patch, but generally for
the better - and the added abstraction actually makes the code easier to
read too. And the new interface is well suited for replacing just the
"hash_name()" function with alternative implementations.
Linus Torvalds [Fri, 2 Mar 2012 22:47:15 +0000 (14:47 -0800)]
vfs: clarify and clean up dentry_cmp()
It did some odd things for unclear reasons. As this is one of the
functions that gets changed when doing word-at-a-time compares, this is
yet another of the "don't change any semantics, but clean things up so
that subsequent patches don't get obscured by the cleanups".
Linus Torvalds [Fri, 2 Mar 2012 22:32:59 +0000 (14:32 -0800)]
vfs: uninline full_name_hash()
.. and also use it in lookup_one_len() rather than open-coding it.
There aren't any performance-critical users, so inlining it is silly.
But it wouldn't matter if it wasn't for the fact that the word-at-a-time
dentry name patches want to conditionally replace the function, and
uninlining it sets the stage for that.
So again, this is a preparatory patch that doesn't change any semantics,
and only prepares for a much cleaner and testable word-at-a-time dentry
name accessor patch.
Linus Torvalds [Fri, 2 Mar 2012 22:23:30 +0000 (14:23 -0800)]
vfs: trivial __d_lookup_rcu() cleanups
These don't change any semantics, but they clean up the code a bit and
mark some arguments appropriately 'const'.
They came up as I was doing the word-at-a-time dcache name accessor
code, and cleaning this up now allows me to send out a smaller relevant
interesting patch for the experimental stuff.
mmc: atmel-mci: don't use dma features when using DMA with no chan available
Some callbacks are set too early -- i.e. we can have dma capabilities but
we can't get a dma channel. So wait to get the dma channel before setting
callbacks and change logs consequently.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
[Should be applied to 3.2-stable.] Cc: <stable@vger.kernel.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Nikolaus Schulz [Tue, 28 Feb 2012 21:15:54 +0000 (16:15 -0500)]
hwmon: (f75375s) Catch some attempts to write to r/o registers
It makes no sense to attempt to manually configure the fan in auto mode,
or set the duty cycle directly in closed loop mode. The corresponding
registers are then read-only. If the user tries it nonetheless, error out
with EINVAL instead of silently doing nothing.
Nikolaus Schulz [Tue, 28 Feb 2012 21:15:53 +0000 (16:15 -0500)]
hwmon: (f75375s) Properly map the F75387 automatic modes to pwm_enable
The F75387 supports automatic fan control using either PWM duty cycle or
RPM speed values. Make the driver detect the latter mode, and expose the
different modes in sysfs as per pwm_enable, so that the user can switch
between them.
The interpretation of the pwm_enable attribute for the F75387 is adjusted
to be a superset of those values used for similar Fintek chips which do
not support automatic duty mode, with 2 mapping to automatic speed mode,
and moving automatic duty mode to the new value 4.
Toggling the duty mode via pwm_enable is currently denied for the F75387,
as the chip then simply reinterprets the fan configuration register values
according to the new mode, switching between RPM and PWM units, which
makes this a dangerous operation.
This patch introduces a new pwm mode into the driver. This is necessary
because the new mode (automatic pwm mode, 4) may already be enabled by the
BIOS, and the driver should not break existing functionality. This was seen
on at least one board.
Linus Torvalds [Fri, 2 Mar 2012 19:38:43 +0000 (11:38 -0800)]
Merge branches 'core-urgent-for-linus', 'perf-urgent-for-linus' and 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pulling latest branches from Ingo:
* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
memblock: Fix size aligning of memblock_alloc_base_nid()
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf probe: Ensure offset provided is not greater than function length without DWARF info too
perf tools: Ensure comm string is properly terminated
perf probe: Ensure offset provided is not greater than function length
perf evlist: Return first evsel for non-sample event on old kernel
perf/hwbp: Fix a possible memory leak
* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
CPU hotplug, cpusets, suspend: Don't touch cpusets during suspend/resume
H. Peter Anvin [Fri, 2 Mar 2012 18:43:49 +0000 (10:43 -0800)]
regset: Return -EFAULT, not -EIO, on host-side memory fault
There is only one error code to return for a bad user-space buffer
pointer passed to a system call in the same address space as the
system call is executed, and that is EFAULT. Furthermore, the
low-level access routines, which catch most of the faults, return
EFAULT already.
Signed-off-by: H. Peter Anvin <hpa@zytor.com> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Roland McGrath <roland@hack.frob.com> Cc: <stable@vger.kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
H. Peter Anvin [Fri, 2 Mar 2012 18:43:48 +0000 (10:43 -0800)]
regset: Prevent null pointer reference on readonly regsets
The regset common infrastructure assumed that regsets would always
have .get and .set methods, but not necessarily .active methods.
Unfortunately people have since written regsets without .set methods.
Rather than putting in stub functions everywhere, handle regsets with
null .get or .set methods explicitly.
Signed-off-by: H. Peter Anvin <hpa@zytor.com> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Roland McGrath <roland@hack.frob.com> Cc: <stable@vger.kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joerg Roedel [Wed, 29 Feb 2012 13:57:32 +0000 (14:57 +0100)]
perf/x86/kvm: Fix Host-Only/Guest-Only counting with SVM disabled
It turned out that a performance counter on AMD does not
count at all when the GO or HO bit is set in the control
register and SVM is disabled in EFER.
This patch works around this issue by masking out the HO bit
in the performance counter control register when SVM is not
enabled.
The GO bit is not touched because it is only set when the
user wants to count in guest-mode only. So when SVM is
disabled the counter should not run at all and the
not-counting is the intended behaviour.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Avi Kivity <avi@redhat.com> Cc: Stephane Eranian <eranian@google.com> Cc: David Ahern <dsahern@gmail.com> Cc: Gleb Natapov <gleb@redhat.com> Cc: Robert Richter <robert.richter@amd.com> Cc: stable@vger.kernel.org # v3.2 Link: http://lkml.kernel.org/r/1330523852-19566-1-git-send-email-joerg.roedel@amd.com Signed-off-by: Ingo Molnar <mingo@elte.hu>