Laxman Dewangan [Sun, 20 May 2012 16:18:50 +0000 (21:48 +0530)]
regulator: tps65910: use of_node of matched regulator being register
After getting matched regulators by using of_regulator_match(),
initialize the config.of_node of regulator being register with
of_regulator_match.of_node of that regulator.
This is require for supporting regulator consumers in dt.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Laxman Dewangan [Sun, 20 May 2012 16:18:49 +0000 (21:48 +0530)]
regulator: tps65910: dt: support when "regulators" node found
The device tree binding for the tps65910 is described as:
tps65911 {
reg = <0x2d>
:::::::::
regulators {
compatible = "ti,tps65911";
ldo1_reg: ldo1 {
/** regulator entry */
};
Laxman Dewangan [Sun, 20 May 2012 16:18:47 +0000 (21:48 +0530)]
regulator: tps62360: dt: initialize of_node param for regulator register.
Initialize config.of_node for regulator before registering.
This is needed for DT based regulator support.
Regulator stores this of_node value in rdev->dev.of_node
and used for lookup when client ask for regulator_get().
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Graeme Gregory [Fri, 18 May 2012 15:53:57 +0000 (16:53 +0100)]
regulator: regulator driver for Palmas series chips
Palmas has both Switched Mode (SMPS) and Linear (LDO) regulators in it.
This regulator driver allows software control of these regulators.
The regulators available on Palmas series chips vary depending on the muxing.
This is handled automatically in the driver by reading the mux info from OTP.
Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Lee Jones [Fri, 18 May 2012 08:39:04 +0000 (09:39 +0100)]
regulator: db8500-prcmu: Separate regulator registration from probe
This will provide us with a convenient way to register regulators when
booting with Device Tree both enabled & disabled and will save us a
great deal of code duplication in time.
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Thu, 17 May 2012 05:06:18 +0000 (13:06 +0800)]
regulator: ab3100: Use regulator_map_voltage_iterate()
regulator_map_voltage_iterate() is for drivers implementing set_voltage_sel()
and list_voltage() to use it as their map_voltage() operation.
In this case, regulator_map_voltage_iterate() happen to be doing the same thing
as ab3100_get_best_voltage_index() function. So we can use it to replace
ab3100_get_best_voltage_index() function.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Tue, 15 May 2012 07:17:58 +0000 (15:17 +0800)]
regulator: tps65217: Convert to set_voltage_sel and map_voltage
Convert tps65217_pmic_ops to use set_voltage_sel and map_voltage.
After this convertion, we can also use tps65217_pmic_set_voltage_sel()
for set_voltage_sel callback of tps65217_pmic_ldo1_ops.
Thus this patch also removes tps65217_pmic_ldo1_set_voltage_sel() function.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Lee Jones [Thu, 17 May 2012 13:45:16 +0000 (14:45 +0100)]
regulator: Enable the ab8500 for Device Tree
Here we setup the ab8500 regulator driver for DT. We first do
this in the normal way, by providing a match structure during
initialisation, but then we provide information so that
whilst probing we can use existing data structures to do DT
look-ups.
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Lee Jones [Thu, 17 May 2012 13:45:14 +0000 (14:45 +0100)]
regulator: ab8500: Split up probe() into manageable pieces
ab8500's probe() function is becoming quite large, so in the lead
up to Device Tree enablement which will fork the thread of execution
this patch splits it into 3 main areas; basic error checking will
remain in probe(), but regulator register initialisation and regulator
registration have been moved to their own functions which will
be called in sequence by probe() and the DT equivalent.
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Thu, 17 May 2012 00:55:45 +0000 (08:55 +0800)]
regulator: max8925: Remove check_range function and max_uV from struct rc5t583_regulator_info
This driver has been converted to use regulator_map_voltage_linear and
set_voltage_sel now. regulator_map_voltage_linear will check the the voltage
falls within specified range. The check_range() function and max_uV field are
not used now, remove them.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Thu, 17 May 2012 01:02:42 +0000 (09:02 +0800)]
regulator: max8649: Remove unused check_range() function
This driver has been converted to use regulator_map_voltage_linear and
set_voltage_sel now. regulator_map_voltage_linear will check the the voltage
falls within specified range. The check_range() function is not used, remove it.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Thu, 17 May 2012 00:50:45 +0000 (08:50 +0800)]
regulator: rc5t583: Remove max_uV from struct rc5t583_regulator_info
This driver has been converted to set_voltage_sel and regulator_map_voltage_linear.
regulator_map_voltage_linear will check the voltage falls within specified range.
The max_uV field is not used now, remove it.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Wed, 16 May 2012 04:50:47 +0000 (12:50 +0800)]
regulator: max8952: Use devm_kzalloc
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Laxman Dewangan [Mon, 14 May 2012 12:16:51 +0000 (17:46 +0530)]
regulator: tps62360: support force PWM mode via regulator mode
Change the mechanism of enabling the force PWM mode through
regulator set mode. This can be dynamically configured now.
In the REGULATOR_MODE_FAST the force PWM is enabled and in
REGULATOR_MODE_NORMAL the force PWM is disabled.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Mon, 14 May 2012 02:55:50 +0000 (10:55 +0800)]
regulator: rc5t583: Convert to regulator_set_voltage_sel_regmap and regulator_map_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Mon, 14 May 2012 02:54:46 +0000 (10:54 +0800)]
regulator: rc5t583: Convert to regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Mon, 14 May 2012 15:58:08 +0000 (23:58 +0800)]
regulator: tps62360: Fix build error due to missing semicolon
Fix below build error:
CC [M] drivers/regulator/tps62360-regulator.o
drivers/regulator/tps62360-regulator.c:351:1: error: expected ',' or ';' before 'extern'
make[2]: *** [drivers/regulator/tps62360-regulator.o] Error 1
make[1]: *** [drivers/regulator] Error 2
make: *** [drivers] Error 2
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Mon, 14 May 2012 03:27:25 +0000 (11:27 +0800)]
regulator: tps62360: Convert to set_voltage_sel and regulator_map_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Mon, 14 May 2012 03:25:42 +0000 (11:25 +0800)]
regulator: tps62360: Convert to regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Laxman Dewangan [Fri, 11 May 2012 06:38:43 +0000 (12:08 +0530)]
regulator: tps62360: add dt support
Add dt support for the pmu device tps62360 and
Add binding documentation with example.
With this patch driver will support both device-tree and
non-device tree registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Laxman Dewangan [Fri, 11 May 2012 06:38:42 +0000 (12:08 +0530)]
regulator: tps62360: make init_data of platform data to pointer.
Convert platform data member regulator_init_data to pointer type.
This will avoid the copy of entire regualator init data into
platform data member when adding dt support and it can be achieve
by simple assignment:
pdata->init_data = of_get_regulator_init_data(dev, dev->of_node);
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Wed, 9 May 2012 20:38:33 +0000 (21:38 +0100)]
regulator: core: Allow drivers to set simple linear voltage maps as data
A lot of regulator hardware maps selectors on to voltages with a simple
linear mapping function
selector = base + (selector * step size)
Provide off the shelf list_voltage() and map_voltage() operations which
use new min_uV and uV_step members in the regulator_desc to implement
this function.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Wed, 9 May 2012 20:16:06 +0000 (21:16 +0100)]
regulator: core: Allow regulators to provide a voltage to selector mapping
In order to allow more drivers to factor things out into data allow
drivers to provide a mapping function to convert voltages into selectors.
This allows any driver to use set_voltage_sel(). The existing mapping
based on iterating over list_voltage() is provided as an operation which
can be assigned to the new map_voltage() function though for ease of
transition it is treated as the default.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Tue, 8 May 2012 17:09:12 +0000 (18:09 +0100)]
regulator: core: Warn on missing struct device
The core really wants a struct device to be supplied for regulators and
there's no reason this should be impossible so provide one so complain
if we didn't get one.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Wed, 9 May 2012 23:41:02 +0000 (00:41 +0100)]
regulator: wm831x: Register all normal regulators
Register all normal regulators rather than skipping unconfigured ones now
that the core can handle regulators without init data. Skip the boost and
isink regulators since they are normally controlled by other drivers.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
NeilBrown [Tue, 8 May 2012 19:44:00 +0000 (05:44 +1000)]
regulator: twl-regulator: make TWL4030_ALLOW_UNSUPPORTED more configurable.
The regulators in the twl4030 can provide some voltage settings
that are not offically supported.
These settings are disabled by default, but can be enabled with
CONFIG_TWL4030_ALLOW_UNSUPPORTED=y
However
- that config variable is not mentioned in any Kconfig so cannot
be used, and
- a global setting is clumsy - a per regulator setting would be
better.
So define a new 'feature' flag that a board file can set to enable
these unsupported volatages for boards which need them.
This flag cannot (yet) be set using device-tree.
Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
NeilBrown [Tue, 8 May 2012 19:43:59 +0000 (05:43 +1000)]
mfd: twl: define all feature flags in one place.
twl-regulator has a collection of feature flags, some defined
in twl-core.c and one defined in i2c/twl.h.
This is confusing for anyone adding a new feature flag.
So collect them together and place them in twl.h immediately
after the structure in which they are initially set.
Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Wed, 9 May 2012 01:22:47 +0000 (09:22 +0800)]
regulator: tps65910: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Laxman Dewangan [Tue, 8 May 2012 11:35:58 +0000 (17:05 +0530)]
regulator: tps62360: fix stylistic issue and optimize code
Fix multiple stylistic issue like:
- The print message should be not break into multiple line.
- line gap after variable declaration and statement.
- checkpatch error.
- some typo.
Some enhancement on error message printing to print error value
also along with proper text.
Avoid voltage_base conversion to microvolts every time.
Put init functions in init section.
Using efficient function inplace of calling multiple function
to reduce the code size.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Laxman Dewangan [Mon, 7 May 2012 12:38:26 +0000 (18:08 +0530)]
regulator: tps62360: Provide settling time for voltage change
Settling time is require when there is voltage output change.
Implement set_voltage_time_sel() callback which returns delay time
for voltage change to settle down to new value.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Linus Torvalds [Sun, 6 May 2012 19:19:38 +0000 (12:19 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes form Peter Anvin
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
intel_mid_powerbtn: mark irq as IRQF_NO_SUSPEND
arch/x86/platform/geode/net5501.c: change active_low to 0 for LED driver
x86, relocs: Remove an unused variable
asm-generic: Use __BITS_PER_LONG in statfs.h
x86/amd: Re-enable CPU topology extensions in case BIOS has disabled it
Linus Torvalds [Sun, 6 May 2012 17:20:07 +0000 (10:20 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs fixes from Chris Mason:
"The big ones here are a memory leak we introduced in rc1, and a
scheduling while atomic if the transid on disk doesn't match the
transid we expected. This happens for corrupt blocks, or out of date
disks.
It also fixes up the ioctl definition for our ioctl to resolve logical
inode numbers. The __u32 was a merging error and doesn't match what
we ship in the progs."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: avoid sleeping in verify_parent_transid while atomic
Btrfs: fix crash in scrub repair code when device is missing
btrfs: Fix mismatching struct members in ioctl.h
Btrfs: fix page leak when allocing extent buffers
Btrfs: Add properly locking around add_root_to_dirty_list
Al Viro [Sun, 6 May 2012 16:20:00 +0000 (17:20 +0100)]
x86: fix broken TASK_SIZE for ia32_aout
Setting TIF_IA32 in load_aout_binary() used to be enough; these days
TASK_SIZE is controlled by TIF_ADDR32 and that one doesn't get set
there. Switch to use of set_personality_ia32()...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Chris Mason [Sun, 6 May 2012 11:23:47 +0000 (07:23 -0400)]
Btrfs: avoid sleeping in verify_parent_transid while atomic
verify_parent_transid needs to lock the extent range to make
sure no IO is underway, and so it can safely clear the
uptodate bits if our checks fail.
But, a few callers are using it with spinlocks held. Most
of the time, the generation numbers are going to match, and
we don't want to switch to a blocking lock just for the error
case. This adds an atomic flag to verify_parent_transid,
and changes it to return EAGAIN if it needs to block to
properly verifiy things.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Linus Torvalds [Sat, 5 May 2012 23:34:38 +0000 (16:34 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha
Pull alpha fixes from Matt Turner:
"My alpha tree is back up (after taking quite some time to get my GPG
key signed). It contains just some simple fixes."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha:
alpha: silence 'const' warning in sys_marvel.c
alpha: include module.h to fix modpost on Tsunami
alpha: properly define get/set_rtc_time on Marvel/SMP
alpha: VGA_HOSE depends on VGA_CONSOLE
Jiri Slaby [Sat, 5 May 2012 20:49:10 +0000 (22:49 +0200)]
TTY: pdc_cons, fix regression in close
The test in pdc_console_tty_close '!tty->count' was always wrong
because tty->count is decremented after tty->ops->close is called and
thus can never be zero. Hence the 'then' branch was never executed and
the timer never deleted.
This did not matter until commit 5dd5bc40f3b6 ("TTY: pdc_cons, use
tty_port"). There we needed to set TTY in tty_port to NULL, but this
never happened due to the bug above.
So change the test to really trigger at the last close by changing the
condition to 'tty->count == 1'.
Well, the driver should not touch tty->count at all. It should use
tty_port->count and count open count there itself.
Linus Torvalds [Sat, 5 May 2012 17:07:06 +0000 (10:07 -0700)]
Merge tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound sound fixes from Takashi Iwai:
"As good as nothing exciting here; just a few trivial fixes for various
ASoC stuff."
* tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ASoC: omap-pcm: Free dma buffers in case of error.
ASoC: s3c2412-i2s: Fix dai registration
ASoC: wm8350: Don't use locally allocated codec struct
ASoC: tlv312aic23: unbreak resume
ASoC: bf5xx-ssm2602: Set DAI format
ASoC: core: check of_property_count_strings failure
ASoC: dt: sgtl5000.txt: Add description for 'reg' field
ASoC: wm_hubs: Make sure we don't disable differential line outputs
Sasha Levin [Sat, 5 May 2012 15:06:35 +0000 (17:06 +0200)]
init: don't try mounting device as nfs root unless type fully matches
Currently, we'll try mounting any device who's major device number is
UNNAMED_MAJOR as NFS root. This would happen for non-NFS devices as
well (such as 9p devices) but it wouldn't cause any issues since
mounting the device as NFS would fail quickly and the code proceeded to
doing the proper mount:
[ 101.522716] VFS: Unable to mount root fs via NFS, trying floppy.
[ 101.534499] VFS: Mounted root (9p filesystem) on device 0:18.
Commit 6829a048102a ("NFS: Retry mounting NFSROOT") introduced retries
when mounting NFS root, which means that now we don't immediately fail
and instead it takes an additional 90+ seconds until we stop retrying,
which has revealed the issue this patch fixes.
This meant that it would take an additional 90 seconds to boot when
we're not using a device type which gets detected in order before NFS.
This patch modifies the NFS type check to require device type to be
'Root_NFS' instead of requiring the device to have an UNNAMED_MAJOR
major. This makes boot process cleaner since we now won't go through
the NFS mounting code at all when the device isn't an NFS root
("/dev/nfs").
Lin Ming [Mon, 23 Apr 2012 01:03:49 +0000 (09:03 +0800)]
ACPI: Fix D3hot v D3cold confusion
Before this patch, ACPI_STATE_D3 incorrectly referenced D3hot
in some places, but D3cold in other places.
After this patch, ACPI_STATE_D3 always means ACPI_STATE_D3_COLD;
and all references to D3hot use ACPI_STATE_D3_HOT.
ACPI's _PR3 method is used to enter both D3hot and D3cold states.
What distinguishes D3hot from D3cold is the presence _PR3
(Power Resources for D3hot) If these resources are all ON,
then the state is D3hot. If _PR3 is not present,
or all _PR0 resources for the devices are OFF,
then the state is D3cold.
This patch applies after Linux-3.4-rc1.
A future syntax cleanup may remove ACPI_STATE_D3
to emphasize that it always means ACPI_STATE_D3_COLD.
Signed-off-by: Lin Ming <ming.m.lin@intel.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Aaron Lu <aaron.lu@amd.com> Signed-off-by: Len Brown <len.brown@intel.com>
Commit ec81aecb2966 ("hfs: fix a potential buffer overflow") fixed a few
potential buffer overflows in the hfs filesystem. But as Timo Warns
pointed out, these changes also need to be made on the hfsplus
filesystem as well.
Reported-by: Timo Warns <warns@pre-sense.de> Acked-by: WANG Cong <amwang@redhat.com> Cc: Alexey Khoroshilov <khoroshilov@ispras.ru> Cc: Miklos Szeredi <mszeredi@suse.cz> Cc: Sage Weil <sage@newdream.net> Cc: Eugene Teo <eteo@redhat.com> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Dave Anderson <anderson@redhat.com> Cc: stable <stable@vger.kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Fri, 4 May 2012 22:34:21 +0000 (15:34 -0700)]
Merge git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French.
* git://git.samba.org/sfrench/cifs-2.6:
fs/cifs: fix parsing of dfs referrals
cifs: make sure we ignore the credentials= and cred= options
[CIFS] Update cifs version to 1.78
cifs - check S_AUTOMOUNT in revalidate
cifs: add missing initialization of server->req_lock
cifs: don't cap ra_pages at the same level as default_backing_dev_info
CIFS: Fix indentation in cifs_show_options
Dave Jones [Fri, 4 May 2012 16:04:17 +0000 (12:04 -0400)]
CPU frequency drivers MAINTAINERS update
Remove myself as cpufreq maintainer.
x86 driver changes can go through the regular x86/ACPI trees.
ARM driver changes through the ARM trees.
cpufreq core changes are rare these days, and can just go to lkml/direct.
Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Fri, 4 May 2012 22:13:54 +0000 (15:13 -0700)]
seqlock: add 'raw_seqcount_begin()' function
The normal read_seqcount_begin() function will wait for any current
writers to exit their critical region by looping until the sequence
count is even.
That "wait for sequence count to stabilize" is the right thing to do if
the read-locker will just retry the whole operation on contention: no
point in doing a potentially expensive reader sequence if we know at the
beginning that we'll just end up re-doing it all.
HOWEVER. Some users don't actually retry the operation, but instead
will abort and do the operation with proper locking. So the sequence
count case may be the optimistic quick case, but in the presense of
writers you may want to do full locking in order to guarantee forward
progress. The prime example of this would be the RCU name lookup.
And in that case, you may well be better off without the "retry early",
and are in a rush to instead get to the failure handling. Thus this
"raw" interface that just returns the sequence number without testing it
- it just forces the low bit to zero so that read_seqcount_retry() will
always fail such a "active concurrent writer" scenario.
Linus Torvalds [Fri, 4 May 2012 21:46:02 +0000 (14:46 -0700)]
Fix __read_seqcount_begin() to use ACCESS_ONCE for sequence value read
We really need to use a ACCESS_ONCE() on the sequence value read in
__read_seqcount_begin(), because otherwise the compiler might end up
reloading the value in between the test and the return of it. As a
result, it might end up returning an odd value (which means that a write
is in progress).
If the reader is then fast enough that that odd value is still the
current one when the read_seqcount_retry() is done, we might end up with
a "successful" read sequence, even despite the concurrent write being
active.
In practice this probably never really happens - there just isn't
anything else going on around the read of the sequence count, and the
common case is that we end up having a read barrier immediately
afterwards.
So the code sequence in which gcc might decide to reaload from memory is
small, and there's no reason to believe it would ever actually do the
reload. But if the compiler ever were to decide to do so, it would be
incredibly annoying to debug. Let's just make sure.
Yong Wang [Fri, 4 May 2012 21:02:44 +0000 (14:02 -0700)]
intel_mid_powerbtn: mark irq as IRQF_NO_SUSPEND
So that the power button still wakes up the platform.
Signed-off-by: Pierre Tardy <pierre.tardy@intel.com> Link: http://lkml.kernel.org/r/20120504210244.F2EA5A018B@akpm.mtv.corp.google.com Tested-by: Kangkai Yin <kangkai.yin@intel.com> Tested-by: Yong Wang <yong.y.wang@intel.com> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/platform/geode/net5501.c: change active_low to 0 for LED driver
It seems that there was an error with the active_low = 1 for the
LED, since it should be set to 0 (meaning that active is high,
since 0 is false, hence the confusion.
The wiki article about it confuses it, since it contradicts itself,
regarding what turns on the LED.
I have tested 3.4-rc2 on my net5501 with this patch, and it makes the LED
behave correctly, where "none" turns it off, and "default-on" turns it on,
when echoed onto the trigger "file" in /sys/class/leds.
Signed-off-by: Bjarke Istrup Pedersen <gurligebis@gentoo.org> Link: http://lkml.kernel.org/r/20120504210146.62186A018B@akpm.mtv.corp.google.com Cc: Philip Prindeville <philipp@redfish-solutions.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Stefan Behrens [Fri, 4 May 2012 19:16:07 +0000 (15:16 -0400)]
Btrfs: fix crash in scrub repair code when device is missing
Fix that when scrub tries to repair an I/O or checksum error and one of
the devices containing the mirror is missing, it crashes in bio_add_page
because the bdev is a NULL pointer for missing devices.
Reported-by: Marco L. Crociani <marco.crociani@gmail.com> Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Alexander Block [Fri, 4 May 2012 19:16:06 +0000 (15:16 -0400)]
btrfs: Fix mismatching struct members in ioctl.h
Fix the size members of btrfs_ioctl_ino_path_args and
btrfs_ioctl_logical_ino_args. The user space btrfs-progs utilities used
__u64 and the kernel headers used __u32 before.
Signed-off-by: Alexander Block <ablock84@googlemail.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Josef Bacik [Fri, 4 May 2012 19:16:06 +0000 (15:16 -0400)]
Btrfs: fix page leak when allocing extent buffers
If we happen to alloc a extent buffer and then alloc a page and notice that
page is already attached to an extent buffer, we will only unlock it and
free our existing eb. Any pages currently attached to that eb will be
properly freed, but we don't do the page_cache_release() on the page where
we noticed the other extent buffer which can cause us to leak pages and I
hope cause the weird issues we've been seeing in this area. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Linus Torvalds [Fri, 4 May 2012 14:57:13 +0000 (07:57 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"Some minor fixes from Intel and a radeon fix.
I have the nouveau fix for the i2c regression queued for next week,
its mostly a revert and seems to work on the system it was originally
introduced for thanks to some i2c core changes."
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
drm/radeon: clarify and extend wb setup on APUs and NI+ asics
drm/i915: enable dip before writing data on gen4
fixing dmi match for hp t5745 and hp st5747 thin client
drm/i915: Only enable IPS polling for gen5
drm/i915: Do not read non-existent DPLL registers on PCH hardware