]> git.neil.brown.name Git - gta04.git/log
gta04.git
9 years agoMerge branches 'dts', 'config', 'hdq', 'dss', 'pwm-old', 'input', 'hacks', 'wifi... 3.18-gta04 mainline
NeilBrown [Sat, 20 Dec 2014 01:12:53 +0000 (12:12 +1100)]
Merge branches 'dts', 'config', 'hdq', 'dss', 'pwm-old', 'input', 'hacks', 'wifi', 'extcon', 'itg', 'tty-slave', 'audio', 'twl4030' and 'charger' into mainline

9 years agoMMC sdio-irq: always poll, in case interrupts aren't reliable.
NeilBrown [Fri, 24 Oct 2014 09:40:38 +0000 (20:40 +1100)]
MMC sdio-irq: always poll, in case interrupts aren't reliable.

The Libertas chip in my GTA04 does deliver sdio interrupts,
and significantly improves throughput .. except that it doesn't
seem to be reliable.
If I poll as well, it works nicely.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoMMC sdio_irq: don't poll for interrupts when powered off.
NeilBrown [Fri, 24 Oct 2014 01:31:53 +0000 (12:31 +1100)]
MMC sdio_irq: don't poll for interrupts when powered off.

The sdio irq poll thread can continue polling while
the device is powered-off (e.g. during suspend/resume).
If it tries to talk to a card that isn't there, bad things
happen.
So simply avoid the poll unless MMC_POWER_ON.

Without this, sdio_irq_thread hangs in mmc_wait_for_req
from process_sdio_pending_irqs during resume, and
nothing else can claim the host.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agolibertas/sdio: simplify suspend/resume.
NeilBrown [Fri, 24 Oct 2014 01:03:59 +0000 (12:03 +1100)]
libertas/sdio: simplify suspend/resume.

The current suspend/resume code is wrong.
Returning -ENOSYS does not cause the device to be powered
off, it causes the suspend to fail.

If the card is currently active (interface is 'up'), we do
need to power-off the card, and then power-on again at resume.

This doesn't handle WoW, and is currently just a hack.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agolibertas/sdio: make power management dependant on MMC_CAP_POWER_OFF_CARD
NeilBrown [Fri, 24 Oct 2014 00:59:35 +0000 (11:59 +1100)]
libertas/sdio: make power management dependant on MMC_CAP_POWER_OFF_CARD

If this flag isn't set, then one runtime_pm reference will have
been taken, so dropping the ref in if_sdio_finish_power_on()
causes the count to go negative.

So make all runtime_pm conditional on the flag.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agommc: core: allow a reset gpio to be configured.
NeilBrown [Fri, 24 Oct 2014 00:54:00 +0000 (11:54 +1100)]
mmc: core: allow a reset gpio to be configured.

If the regulator supplying an SDIO device is shared
with another device, the turning the regulator 'on' and 'off'
will not actually cycle power and so will not reset
the device.

This is particularly a problem for some wi2si wireless modules which
have a BT module on chip and can share power lines.
Without the power-cycle, subsequent reset commands fail.

So allow a 'reset' gpio to be specified.  If provided, the
line is asserted during power-up.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agommc: omap_hsmmc: use mmc_of_parse to parse common mmc configuration.
NeilBrown [Fri, 24 Oct 2014 00:21:42 +0000 (11:21 +1100)]
mmc: omap_hsmmc: use mmc_of_parse to parse common mmc configuration.

This ensures that all standard options are available to hsmmc,
In particular, I need cap-power-off-card.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04: update defconfig for recent changes etc
NeilBrown [Sat, 20 Dec 2014 00:57:46 +0000 (11:57 +1100)]
GTA04: update defconfig for recent changes etc

- tty slave configs have changed
- add cpufreq_dt
- add ECC for NAND

Signed-off-by: NeilBrown <neil@brown.name>
9 years agoOMAP: don't init voltages until after cpufreq initialised.
NeilBrown [Sat, 20 Dec 2014 00:44:44 +0000 (11:44 +1100)]
OMAP: don't init voltages until after cpufreq initialised.

We need to init cpufreq for the opp tables to be loaded, else
init_voltages will fails.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agommc: omap_hsmmc: use slot-gpio library for gpio support.
NeilBrown [Fri, 19 Dec 2014 23:01:44 +0000 (10:01 +1100)]
mmc: omap_hsmmc: use slot-gpio library for gpio support.

Using the common code removes some code duplication, and
makes it easier to switch to using mmc_of_parse() which
will remove more duplication.

This uses the new mmc_gpio_request_cd_isr to provide a non-standard
interrupt service routine for card-detect interrupts.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: assume a 'charger' can supply maximum current.
NeilBrown [Mon, 8 Dec 2014 05:53:28 +0000 (16:53 +1100)]
twl4030_charger: assume a 'charger' can supply maximum current.

If it cannot, we will stop pulling more current when voltage drops.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: Increase current carefully while watching voltage.
NeilBrown [Fri, 12 Dec 2014 00:55:03 +0000 (11:55 +1100)]
twl4030_charger: Increase current carefully while watching voltage.

The USB Battery Charging spec (BC1.2) suggests a dedicated
charging port can deliver from 0.5 to 5.0A at between 4.75 and 5.25
volts.

To choose the "correct" current voltage setting requires a trial
and error approach: try to draw current and see if the voltage drops
too low.

Even with a configure Standard Downstream Port, it may not be possible
to reliably pull 500mA - depending on cable quality and source
quality I have reports of charging failure due to the voltage dropping
too low.

To address both these concern, this patch introduce incremental
current setting.
The current pull from VBUS is increased in steps of 20mA every 100ms
until the target is reached or until the measure voltage drops below
4.75V.  If the voltage does go too long, the target current is reduced
by 20mA and kept there.

This applies to currents selected automatically, or to values
set via sysfs.  So setting a large value will cause the maximum
available to be used - up to the limit of 1.7mA imposed by the
hardware.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agomisc: add a driver to power on/off UART attached devices.
NeilBrown [Fri, 19 Dec 2014 05:46:38 +0000 (16:46 +1100)]
misc: add a driver to power on/off UART attached devices.

If a platform has a particular device permanently attached to a UART,
there may be out-of-band signaling necessary to power the device
on and off.

This drive controls that signalling for a number of different devices.
It can
 - enable/disable a regulator
 - toggle a GPIO
 - register an 'rfkill' which can for the device to be off.

When the rfkill is absent of unblocked, the device will be on when the
associated tty device is open, and closed otherwise.

Signed-off-by: NeilBrown <neil@brown.name>
9 years agoTTY: add support for "tty slave" devices.
NeilBrown [Sun, 26 Oct 2014 06:10:30 +0000 (17:10 +1100)]
TTY: add support for "tty slave" devices.

A "tty slave" is a device connected via UART.
It may need a driver to, for example, power the device on
when the tty is opened, and power it off when the tty
is released.

A "tty slave" is a platform device which is declared as a
child of the uart in device-tree:

&uart1 {
bluetooth {
compatible = "wi2wi,w2cbw003";
vdd-supply = <&vaux4>;
};
};

The driver can attach to the tty by calling
   tty_set_slave(dev->parent, dev, &slave_ops);

where slave_ops' is a set of interface that
the tty layer must call when appropriate.
Currently only 'open' and 'release' are defined.
They are called at first open and last close.
They cannot fail.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoomap3: gta04: dtr: only power DSS when necessary.
NeilBrown [Sun, 7 Dec 2014 22:39:38 +0000 (09:39 +1100)]
omap3: gta04: dtr: only power DSS when necessary.

Signed-off-by: NeilBrown <neil@brown.name>
9 years agogta04a4: add voicefmt info to codec
NeilBrown [Sun, 7 Dec 2014 22:39:38 +0000 (09:39 +1100)]
gta04a4: add voicefmt info to codec

This allow routing voice from gsm modem.

Signed-off-by: NeilBrown <neilb@suse.de>
Conflicts:
arch/arm/boot/dts/goldelico-gta04a4.dts
arch/arm/boot/dts/omap3-gta04.dts

9 years agogta04: enable power-off using twl4030.
NeilBrown [Sun, 7 Dec 2014 22:39:38 +0000 (09:39 +1100)]
gta04: enable power-off using twl4030.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04: add dts config for GPS.
NeilBrown [Sun, 7 Dec 2014 22:39:38 +0000 (09:39 +1100)]
GTA04: add dts config for GPS.

GPS is a slave of UART2, needs a regulator to power the
antenna, and reconfigures the RX line as a GPIO when idle.

Signed-off-by: NeilBrown <neil@brown.name>
9 years agoGTA04: add bluetooth slave-tty device to DTS
NeilBrown [Sun, 7 Dec 2014 22:39:37 +0000 (09:39 +1100)]
GTA04: add bluetooth slave-tty device to DTS

This needs vaux4 to be turned on when the tty is opened.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoAdd defconfig for gta04. config
NeilBrown [Mon, 8 Dec 2014 05:56:41 +0000 (16:56 +1100)]
Add defconfig for gta04.

 make gta04_defconfig

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: add ac/mode to match usb/mode
NeilBrown [Sun, 7 Dec 2014 23:11:42 +0000 (10:11 +1100)]
twl4030_charger: add ac/mode to match usb/mode

This allows AC charging to be turned off, must like usb charging.

"continuous" (aka "linear") mode maps to the CVENAC (constant voltage)
feature of the twl4030.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: add software controlled linear charging mode.
NeilBrown [Sun, 7 Dec 2014 23:11:41 +0000 (10:11 +1100)]
twl4030_charger: add software controlled linear charging mode.

Add a 'continuous' option for usb charging which enabled
the "linear" charging mode of the twl4030.

Linear charging does a good job with not so reliable power sources, since
several voltage controlling is then often too intelligent.
It was used with a bike hub dynamo since a year or so. In that case there
are automatically charging stops when the cyclist needs a break.

Orignal-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: enable manual enable/disable of usb charging.
NeilBrown [Sun, 7 Dec 2014 23:11:41 +0000 (10:11 +1100)]
twl4030_charger: enable manual enable/disable of usb charging.

'off' or 'auto' to

 /sys/class/power/twl4030_usb/mode

will now enable or disable charging from USB port.  Normally this is
enabled on 'plug' and disabled on 'unplug'.
Unplug will still disable charging.  'plug' will only enable it if
'auto' if selected.

Signed-off-by: NeilBrown <neilb@suse.de>
Conflicts:
drivers/power/twl4030_charger.c

9 years agotwl4030_charger: only draw USB current as negotiated with host.
NeilBrown [Sun, 7 Dec 2014 23:11:41 +0000 (10:11 +1100)]
twl4030_charger: only draw USB current as negotiated with host.

If the phy has been told what current it can draw, it tells us
and now we use that number.

Note that 'vbus_draw' is in mA, while usb_cur is in uA.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: allow max_current to be managed via sysfs.
NeilBrown [Sun, 7 Dec 2014 23:11:41 +0000 (10:11 +1100)]
twl4030_charger: allow max_current to be managed via sysfs.

'max_current' sysfs attributes are created which allow the
max to be set.
Whenever a current source changes, the default is restored.
This will be followed by a uevent, so user-space can decide to
update again.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: distinguish between USB current an 'AC' current
NeilBrown [Sun, 7 Dec 2014 23:11:40 +0000 (10:11 +1100)]
twl4030_charger: distinguish between USB current an 'AC' current

The twl4030 charger has two current sources, 'USB' and 'AC' (which is
really DC of course...).

If 'AC' is providing current, we should set the current limit
differently to when it isn't (and so USB is used).
So split 'cur' into 'usb_cur' and 'ac_cur' and use accordingly.

Now we must review the current setting on any interrupt or USB
event which might indicate that the charger-source has changed.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: allow fine control of charger current.
NeilBrown [Sun, 7 Dec 2014 23:11:40 +0000 (10:11 +1100)]
twl4030_charger: allow fine control of charger current.

The twl4030 allows control of the incoming current.
Part of this control is a 'CGAIN' setting which doubles
the range for half the precision.  This control affects
several different current setting, so all need to be updated
at once when CGAIN is changed.

With this patch, all of these current setting are managed
by the driver, but most are left at their default settings.

The current drawn is set to 500mA if the allow_usb module parameter is
set, and to 100mA otherwise.
More fine control will appear in later patches.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: split uA calculation into a function.
NeilBrown [Sun, 7 Dec 2014 23:11:40 +0000 (10:11 +1100)]
twl4030_charger: split uA calculation into a function.

We will need this calculation in other places, so
create functions to map between register value and uA value.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agousb: phy: twl4030: test ID resistance to see if charger is present.
NeilBrown [Sun, 7 Dec 2014 23:11:40 +0000 (10:11 +1100)]
usb: phy: twl4030: test ID resistance to see if charger is present.

If an 'A' plug is inserted, ID should be pulled to ground.
If a 'B' plug, then ID should be floating.

If an Accessory Charger Adapter is inserted, then ID will
be neither grounds nor floating.  In this case tell the
USB subsystem that it is an A plug, and the battery
charging subsystem that it is a charger.

Fortunately, this will treat the Openmoko charger (and
other similar chargers) as a charger.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agousb: phy: twl4030: add support for reading restore on ID pin.
NeilBrown [Sun, 7 Dec 2014 23:11:39 +0000 (10:11 +1100)]
usb: phy: twl4030: add support for reading restore on ID pin.

The twl4030 phy can measure, with low precision, the
resistance-to-ground of the ID pin.

Add a function to read the value, and export the result
via sysfs.

If the read fails, which it does sometimes, try again in 50msec.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: trust phy to determine when USB power is available.
NeilBrown [Sun, 7 Dec 2014 23:11:39 +0000 (10:11 +1100)]
twl4030_charger: trust phy to determine when USB power is available.

The usb phy driver already determine when VBUS is available,
so repeating the test in the charger driver is pointless duplication.

On probe, process the last event from the phy, and from then on,
do whatever the phy tells us without double-checking.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agousb: phy: twl4030: allow charger to see usb current draw limits.
NeilBrown [Sun, 7 Dec 2014 23:11:39 +0000 (10:11 +1100)]
usb: phy: twl4030: allow charger to see usb current draw limits.

The charger needs to know when a USB gadget has been enumerated
and what the agreed maximum current was so that it can adjust
charging accordingly.

So define a "set_power()" function to record the permitted
draw, and pass a pointer to that when sending USB_EVENT_ENUMERATED
notification.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: use runtime_pm to keep usb phy active while charging.
NeilBrown [Sun, 7 Dec 2014 23:11:39 +0000 (10:11 +1100)]
twl4030_charger: use runtime_pm to keep usb phy active while charging.

The twl4030 usb phy needs to be active while we are using
the USB VBUS as a current source for charging.
In particular, the usb3v1 regulator must be enabled and the
PHY_PWR_PHYPWD bit must be set to keep the phy powered.

commit ab37813f4093a5f59cb8e083cde277289dc72ed3
    twl4030_charger: Allow charger to control the regulator that feeds it

Gave the charger control over the regulator, but didn't resolve
the PHY_PWR_PHYPWD issue.

Now that both of these are controlled by runtime_pm in
phy-twl4030-usb, we can simply take a runtime_pm reference to the USB
phy whenever the charger wants to use it as a current source.

So this patch reverts the above commit, and add the necessary
runtime_pm calls.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agousb: phy: twl4030: make runtime pm more reliable.
NeilBrown [Sun, 7 Dec 2014 23:11:38 +0000 (10:11 +1100)]
usb: phy: twl4030: make runtime pm more reliable.

A construct like:

        if (pm_runtime_suspended(twl->dev))
               pm_runtime_get_sync(twl->dev);

is against the spirit of the runtime_pm interface as it
makes the internal refcounting useless.

In this case it is also racy, particularly as 'put_autosuspend'
is use to drop a reference.
When that happens a timer is started and the device is
runtime-suspended after the timeout.
If the above code runs in this window, the device will not be
found to be suspended so no pm_runtime reference is taken.
When the timer expires the device will be suspended, which is
against the intention of the code.

So be more direct is taking and dropping references.
If twl->linkstat is VBUS_VALID or ID_GROUND, then hold a
pm_runtime reference, otherwise don't.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: use devres for power_supply_register and kzalloc.
NeilBrown [Sun, 7 Dec 2014 23:11:38 +0000 (10:11 +1100)]
twl4030_charger: use devres for power_supply_register and kzalloc.

Final allocations/registrations are now managed by devres.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agopower_supply core: support use of devres to register/unregister a power supply.
NeilBrown [Sun, 7 Dec 2014 23:11:38 +0000 (10:11 +1100)]
power_supply core: support use of devres to register/unregister a power supply.

Using devm_power_supply_register allows the unregister to happen
automatically on error or final put.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: find associated phy by more reliable means.
NeilBrown [Sun, 7 Dec 2014 23:11:37 +0000 (10:11 +1100)]
twl4030_charger: find associated phy by more reliable means.

twl4030_charger currently finds the associated phy
using usb_get_phy() which will return the first USB2 phy.
If your platform has multiple such phys (as mine does),
this is not reliable (and reliably fails on the GTA04).

Change to use devm_usb_get_phy_by_node(), having found the
node by looking for an appropriately named sibling in
device-tree.

This makes usb-charging dependent on correct device-tree
configuration.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030_charger: use devm_request_threaded_irq
NeilBrown [Sun, 7 Dec 2014 23:11:37 +0000 (10:11 +1100)]
twl4030_charger: use devm_request_threaded_irq

This simplifies the error paths.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agousb: phy: Add interface to get phy give of device_node.
NeilBrown [Sun, 7 Dec 2014 23:11:36 +0000 (10:11 +1100)]
usb: phy: Add interface to get phy give of device_node.

Split the "get phy from device_node" functionality out of
"get phy by phandle" so it can be used directly.

This is useful when a battery-charger is intimately associated with a
particular phy but handled by a separate driver.  The charger
can find the device_node based on sibling relationships
without the need for a redundant declaration in the devicetree
description.

As a peripheral that gets a phy will often want to register a
notifier block, and de-register it later, that functionality
is included so the de-registration is automatic.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoDisable wakeup on charger and AC attach. twl4030
NeilBrown [Sun, 7 Dec 2014 23:11:01 +0000 (10:11 +1100)]
Disable wakeup on charger and AC attach.

This ensures that the device doesn't turn on again once it has
been turned off.

Not sure this is really the right way to do it though.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agomfd: twl4030-power: Support compatible = "ti,twl4030-power" again.
NeilBrown [Sun, 7 Dec 2014 23:11:00 +0000 (10:11 +1100)]
mfd: twl4030-power: Support compatible = "ti,twl4030-power" again.

commit e7cd1d1eb16fcdf53001b926187a82f1f3e1a7e6
    mfd: twl4030-power: Add generic reset configuration

claims:
    Let's add device tree support and configure things for warm reset
    as the default when compatible = "ti,twl4030-power".
and
  Documentation/devicetree/bindings/mfd/twl4030-power.txt
claims that "ti,twl4030-power" is still a valid "compatible" setting.

However the current driver fails to probe with that 'compatible'
setting.
Restore the old default.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoASoC: twl4030: enable routing audio to 'voice' interface. audio
NeilBrown [Sun, 7 Dec 2014 23:10:18 +0000 (10:10 +1100)]
ASoC: twl4030: enable routing audio to 'voice' interface.

When 'voice' is some external connection, we power up
the downlink when the downline amplifier is not muted,
and power up the uplink when a new switch "Voice Uplink" is
turned on.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoASoC: twl4030: allow voice port to be connected externally.
NeilBrown [Sun, 7 Dec 2014 23:10:18 +0000 (10:10 +1100)]
ASoC: twl4030: allow voice port to be connected externally.

If voice port on twl4030 is not connected to a McBSP (or similar)
then we cannot configure the format the way we normally do for a DAI.

In this case, allow the platform data/devicetree to specify a format
which is put into effect when the 'voice' mode is selected.

If there is a voice connection, then we keep the twl side tri-stated
when not being driven.  This allows for the device to also be
connected to a McBSP if desired.

This is needed if the 'voice' port directly connects to a mobile-phone
module.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoASoC: twl4030: don't report EBUSY if no change requested.
NeilBrown [Sun, 7 Dec 2014 23:10:17 +0000 (10:10 +1100)]
ASoC: twl4030: don't report EBUSY if no change requested.

"mode" must not be changed when active.
However if a request is received to set the mode to what it currently
is, that is also rejected when active, which causes confusing
error messages.

So check first and if no change is actually requested, don't report
an error.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoiio: gyro: itg3200: add suspend/resume support. itg
NeilBrown [Sun, 7 Dec 2014 23:08:52 +0000 (10:08 +1100)]
iio: gyro: itg3200: add suspend/resume support.

Unless we put the device to sleep when not it use, it wastes
6mA.

If the device is asleep on probe, the 'id' register
sometimes mis-reads - so reset first.  If the device responds
at all a command sent to the address, it is almost certainly
the correct device already.

Acked-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: NeilBrown <neil@brown.name>
9 years agoextcon-gpio: add devicetree support. extcon
NeilBrown [Sun, 7 Dec 2014 23:08:39 +0000 (10:08 +1100)]
extcon-gpio: add devicetree support.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agommc: core: Allow host driver to provide isr for card-detect interrupts.
NeilBrown [Thu, 6 Nov 2014 23:15:09 +0000 (10:15 +1100)]
mmc: core: Allow host driver to provide isr for card-detect interrupts.

One of the reasons omap_hsmmc doesn't use the slot-gpio library
is that it has some non-standard functionality in the card-detect
interrupt service routine.

To make it possible for omap_hsmmc (and maybe others) to be converted
to use slot-gpio, add 'mmc_gpio_request_cd_isr' which provide an
alternate isr to be register by the slot-gpio code.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agommc: omap_hsmmc: remove prepare/complete system suspend support.
NeilBrown [Thu, 6 Nov 2014 23:40:36 +0000 (10:40 +1100)]
mmc: omap_hsmmc: remove prepare/complete system suspend support.

The only function of these 'prepare' and 'complete' is to
disable the 'card detect' irq during suspend.

The commit which added this,
commit a48ce884d5819d5df2cf1139ab3c43f8e9e419b3
    mmc: omap_hsmmc: Introduce omap_hsmmc_prepare/complete

justified it by the need to avoid the registration of new devices
during suspend.
However mmc_pm_notify will set ->rescan_disable in the 'prepare'
stage and clear it in the 'complete' stage, so no card detection
will actually happen.
Also the interrupt will be disabled before final suspend as part
of common suspend processing.

So this disabling of the interrupt is unnecessary, and interferes
with a transition to using common code for card-detect management.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Venkatraman S <svenkatr@ti.com>
Cc: Chris Ball <cjb@laptop.org>
Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoMerge branch 'next' of git://git.linaro.org/people/ulf.hansson/mmc into wifi
NeilBrown [Sun, 7 Dec 2014 22:46:29 +0000 (09:46 +1100)]
Merge branch 'next' of git://git.linaro.org/people/ulf.hansson/mmc into wifi

9 years agoARM: OMAP: serial: remove last vestige of DTR_gpio support. hacks
NeilBrown [Sun, 7 Dec 2014 22:42:01 +0000 (09:42 +1100)]
ARM: OMAP: serial: remove last vestige of DTR_gpio support.

These fields were added by:
commit 9574f36fb801035f6ab0fbb1b53ce2c12c17d100
    OMAP/serial: Add support for driving a GPIO as DTR.

but not removed by

commit 985bfd54c826c0ba873ca0adfd5589263e0c6ee2
    tty: serial: omap: remove some dead code

which reverted most of that commit.
Time to revert the rest.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoHSO: only disable net on suspend if enabled.
NeilBrown [Sun, 7 Dec 2014 22:42:01 +0000 (09:42 +1100)]
HSO: only disable net on suspend if enabled.

9 years agonet/wireless: get rid if a warning.
NeilBrown [Sun, 7 Dec 2014 22:42:00 +0000 (09:42 +1100)]
net/wireless: get rid if a warning.

This warning always triggers on shutdown of libertas.
It seems benign.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoTWL4030 IRQ thing.
NeilBrown [Sun, 7 Dec 2014 22:42:00 +0000 (09:42 +1100)]
TWL4030 IRQ thing.

I don't know if this is really needed, but IRQF_EARLY_RESUME
here causes a warning:
WARN(1, "Primary handler called for nested irq %d\n", irq);

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agogpio-keys: ensure we don't miss key-presses during resume. input
NeilBrown [Sun, 7 Dec 2014 22:41:42 +0000 (09:41 +1100)]
gpio-keys: ensure we don't miss key-presses during resume.

If the latency of resume means we don't poll the key status until
after it has been released, we can lose the keypress which woke the
device.

So on each interrupt, record that a press is pending, and in that
case, report both the up and down event.  One might be swallowed by
the input layer if there was no change, but the result will be that
every interrupt will produce at least one event.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agotwl4030 power button: don't lose presses.
NeilBrown [Sun, 7 Dec 2014 22:41:41 +0000 (09:41 +1100)]
twl4030 power button: don't lose presses.

If we press and release the power button before the press interrupt is
handled (can happen on resume) we lose the press event so the release
event is ignored and we don't know what happened to cause the wakeup.

So make sure that each interrupt handled does generate an event -
possibly two.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agopwm-bl: always enable pwm at power-on. pwm-old
NeilBrown [Sun, 7 Dec 2014 22:41:28 +0000 (09:41 +1100)]
pwm-bl: always enable pwm at power-on.

Some pwms (omap-pwm) need to disable the pwm before setting
configuration.
They rely on pwm_enable() being called after pwm_config.
Prior to:

  commit 97c38437115aa0c3fb2d50c488814b503ba529e0
  Author: Thierry Reding <treding@nvidia.com>
  Date:   Wed Oct 2 18:01:02 2013 +0200

      pwm-backlight: Track enable state

This would always happen.  Now it doesn't.
Using the ->enabled state to protect calls to pwm_enable/disable
is pointless as pwm already has it's own 'enabled' state.

So when pwm_backlight_power_on is called, always call pwn_enable().
This ensures that if pwm_config() needed to disable the pwm, it will
be re-enabled.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agopwm: omap: Add PWM support using dual-mode timers
NeilBrown [Sun, 7 Dec 2014 22:41:28 +0000 (09:41 +1100)]
pwm: omap: Add PWM support using dual-mode timers

This patch is based on an earlier patch by Grant Erickson
which provided PWM devices using the 'legacy' interface.

This driver instead uses the new framework interface.

Platform data must be provided to identify which dmtimer to use.

Lots of cleanup and inprovements thanks to Thierry Reding
and Jon Hunter.

Cc: Grant Erickson <marathon96@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoOMAP: DSS: DPI: disable vt-switch on suspend/resume. dss
NeilBrown [Sun, 7 Dec 2014 22:41:08 +0000 (09:41 +1100)]
OMAP: DSS: DPI: disable vt-switch on suspend/resume.

these devices do not need to return to non-graphic console
for suspend, so disable that option.

Signed-off-by: NeilBrown <neil@brown.name>
9 years agoOMAPDSS: restore "name" sysfs entry.
NeilBrown [Sun, 7 Dec 2014 22:41:08 +0000 (09:41 +1100)]
OMAPDSS: restore "name" sysfs entry.

commit 303e4697e762dc92a40405f4e4b8aac02cd0d70b
Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
Date:   Tue Sep 24 17:00:14 2013 +0300

    OMAPDSS: rename display-sysfs 'name' entry

Broke the X server on my device as it couldn't find the display
any more...

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agobq27x00_battery: register as non-wakeup power supply. hdq
NeilBrown [Sun, 7 Dec 2014 22:40:55 +0000 (09:40 +1100)]
bq27x00_battery: register as non-wakeup power supply.

power_supply status changes for the bq27x00 are only
noticed via polling, not via interrupts.  So they are no
the store of event which should reliably wake the system
from suspend.
So it is appropriate to register as a no_ws power source,
just like the ACPI battery.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agow1: support auto-load of w1_bq27000 module.
NeilBrown [Sun, 7 Dec 2014 22:40:54 +0000 (09:40 +1100)]
w1: support auto-load of w1_bq27000 module.

1/ change request_module call to zero-pad single digit
   family numbers.  This appears to be the intention of
   the code, but not what it actually does.

   This means that the alias created for W1_FAMILY_SMEM_01
   might actually be useful.

2/ Define a family name for the BQ27000 battery charge monitor.
   Unfortunately this is the same number as W1_FAMILY_SMEM_01
   so if both a compiled on a system, one module might need to
   be blacklisted.

3/ Add a MODULE_ALIAS for the bq27000.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agow1: omap-hdq: support device probing with device-tree.
NeilBrown [Sun, 7 Dec 2014 22:40:54 +0000 (09:40 +1100)]
w1: omap-hdq: support device probing with device-tree.

This driver has no 'compatible' string and so is not found when
using device-tree.

Add one with value to match
hdqw1w: 1w@480b2000 {
device in omap3.dtsi.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04 - Fix a GPIO line.
NeilBrown [Sun, 7 Dec 2014 22:39:37 +0000 (09:39 +1100)]
GTA04 - Fix a GPIO line.

GPIO_115 is in &gpio4, not &gpio3.

Also normalize some 'GPIO' comments.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04-DTS add gyroscope
NeilBrown [Sun, 7 Dec 2014 22:39:37 +0000 (09:39 +1100)]
GTA04-DTS add gyroscope

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04 - add extcon to detect antenna status
NeilBrown [Sun, 7 Dec 2014 22:39:37 +0000 (09:39 +1100)]
GTA04 - add extcon to detect antenna status

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04-DTS - add twl4030 vibra support.
NeilBrown [Sun, 7 Dec 2014 22:39:36 +0000 (09:39 +1100)]
GTA04-DTS - add twl4030 vibra support.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04 - add support for sdio interrupts.
NeilBrown [Sun, 7 Dec 2014 22:39:36 +0000 (09:39 +1100)]
GTA04 - add support for sdio interrupts.

We need to arrange for the DAT1 line to become GPIO
when the mmc host is asleep, so interrupts can wake
the device.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agogta04: enable power-off for wifi card.
NeilBrown [Sun, 7 Dec 2014 22:39:36 +0000 (09:39 +1100)]
gta04: enable power-off for wifi card.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agogta04.dts: add reset line for wifi in mmc1
NeilBrown [Sun, 7 Dec 2014 22:39:36 +0000 (09:39 +1100)]
gta04.dts: add reset line for wifi in mmc1

This ensures it gets reset properly.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agogta04: fix 'audio' support in dts file.
NeilBrown [Sun, 7 Dec 2014 22:39:35 +0000 (09:39 +1100)]
gta04: fix 'audio' support in dts file.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04 - Fix backup-batter charging in devicetree file.
NeilBrown [Sun, 7 Dec 2014 22:39:35 +0000 (09:39 +1100)]
GTA04 - Fix backup-batter charging in devicetree file.

The attribute names have changed.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04 dts: add gpio-keys for 'incoming' signal from Option module.
NeilBrown [Sun, 7 Dec 2014 22:39:35 +0000 (09:39 +1100)]
GTA04 dts: add gpio-keys for 'incoming' signal from Option module.

So we can wake up when a phone call or SMS arrives.

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoGTA04 - add backlight to dts
NeilBrown [Sun, 7 Dec 2014 22:39:35 +0000 (09:39 +1100)]
GTA04 - add backlight to dts

Signed-off-by: NeilBrown <neilb@suse.de>
9 years agoLinux 3.18
Linus Torvalds [Sun, 7 Dec 2014 22:21:05 +0000 (14:21 -0800)]
Linux 3.18

9 years agoMerge branch 'for-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Linus Torvalds [Sun, 7 Dec 2014 20:00:14 +0000 (12:00 -0800)]
Merge branch 'for-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata

Pull libata fixes from Tejun Heo:
 "Three libata fixes for v3.18.  Nothing too interesting.  PCI ID ID and
  quirk additions to ahci and an error handling path fix in sata_fsl"

* 'for-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
  ahci: disable MSI on SAMSUNG 0xa800 SSD
  sata_fsl: fix error handling of irq_of_parse_and_map
  AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller

9 years agoMerge git://www.linux-watchdog.org/linux-watchdog
Linus Torvalds [Sat, 6 Dec 2014 19:27:25 +0000 (11:27 -0800)]
Merge git://www.linux-watchdog.org/linux-watchdog

Pull watchdog fix from Wim Van Sebroeck:
 "Fix the watchdog mask bit offset for Exynos7"

* git://www.linux-watchdog.org/linux-watchdog:
  watchdog: s3c2410_wdt: Fix the mask bit offset for Exynos7

9 years agoMerge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Sat, 6 Dec 2014 19:26:01 +0000 (11:26 -0800)]
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "Here are two more driver bugfixes for I2C which would be good to have"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: cadence: Set the hardware time-out register to maximum value
  i2c: davinci: generate STP always when NACK is received

9 years agowatchdog: s3c2410_wdt: Fix the mask bit offset for Exynos7
Abhilash Kesavan [Fri, 17 Oct 2014 16:12:53 +0000 (21:42 +0530)]
watchdog: s3c2410_wdt: Fix the mask bit offset for Exynos7

The watchdog mask bit offset listed for Exynos7 is incorrect.
Fix this.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Acked-by: Naveen Krishna Chatradhi <naveenkrishna.ch@gmail.com
Reviewd-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
9 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 5 Dec 2014 18:47:19 +0000 (10:47 -0800)]
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
 "Two final fixlets for 3.18:
   - Prevent microcode reload wreckage on 32bit
   - Unbreak cross compilation"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, microcode: Limit the microcode reloading to 64-bit for now
  x86: Use $(OBJDUMP) instead of plain objdump

9 years agoMerge tag 'sound-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Fri, 5 Dec 2014 18:39:49 +0000 (10:39 -0800)]
Merge tag 'sound-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixlet from Takashi Iwai:
 "Just one commit for adding a copule of HD-audio quirk entries"

* tag 'sound-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek - Add headset Mic support for new Dell machine

9 years agommc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter
Ulf Hansson [Fri, 5 Dec 2014 10:31:22 +0000 (11:31 +0100)]
mmc: core: Let mmc_send_tuning() to take struct mmc_host* as parameter

To be able to use mmc_send_tuning() prior the struct mmc_card has been
allocated, let's convert it to take the struct mmc_host* as parameter
instead.

Suggested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Dong Aisheng <b29396@freescale.com>
9 years agommc: queue: Improve error handling during allocation of bounce buffers
Bhuvanesh Surachari [Mon, 1 Dec 2014 07:23:02 +0000 (02:23 -0500)]
mmc: queue: Improve error handling during allocation of bounce buffers

Allocation of previous bounce buffer in mmc_init_queue when the current
bounce buffer allocation fails was leading to a crash later in
__blk_segment_map_sg. Error handling is improved by allocating previous
bounce buffer only if the current bounce buffer allocation succeeds.

Signed-off-by: Bhuvanesh Surachari <bhuvanesh_surachari@mentor.com>
Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Fri, 5 Dec 2014 06:39:37 +0000 (22:39 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm intel fixes from Dave Airlie:
 "Two intel stable fixes, that should be it from me for this round"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/i915: Unlock panel even when LVDS is disabled
  drm/i915: More cautious with pch fifo underruns

9 years agoMerge tag 'pm+acpi-3.18-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Fri, 5 Dec 2014 01:48:13 +0000 (17:48 -0800)]
Merge tag 'pm+acpi-3.18-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI backlight fix from Rafael Wysocki:
 "This is a simple fix for an ACPI backlight regression introduced by a
  recent commit that overlooked a corner case which should have been
  taken into account"

* tag 'pm+acpi-3.18-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / video: update condition to check if device is in _DOD list

9 years agoMerge tag 'drm-intel-fixes-2014-12-04' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Fri, 5 Dec 2014 01:12:29 +0000 (11:12 +1000)]
Merge tag 'drm-intel-fixes-2014-12-04' of git://anongit.freedesktop.org/drm-intel into drm-fixes

Silence some pch fifo underrun reports and panel locking backtraces,
both cc: stable.

* tag 'drm-intel-fixes-2014-12-04' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Unlock panel even when LVDS is disabled
  drm/i915: More cautious with pch fifo underruns

9 years agoMerge tag 'media/v3.18-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Fri, 5 Dec 2014 00:06:02 +0000 (16:06 -0800)]
Merge tag 'media/v3.18-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
 "A core fix and some driver fixes:
   - regression fix in Remote Controller core affecting RC6 protocol
     handling
   - fix video buffer handling in cx23885
   - race fix in solo6x10
   - fix image selection in smiapp
   - fix reported payload size on s2255drv
   - two updates for MAINTAINERS file"

* tag 'media/v3.18-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] rc-core: fix toggle handling in the rc6 decoder
  MAINTAINERS: Update mchehab's addresses
  [media] cx23885: use sg = sg_next(sg) instead of sg++
  [media] s2255drv: fix payload size for JPG, MJPEG
  [media] Update MAINTAINERS for solo6x10
  [media] solo6x10: fix a race in IRQ handler
  [media] smiapp: Only some selection targets are settable

9 years agouapi: fix to export linux/vm_sockets.h
Masahiro Yamada [Thu, 4 Dec 2014 22:42:25 +0000 (14:42 -0800)]
uapi: fix to export linux/vm_sockets.h

A typo "header=y" was introduced by commit 7071cf7fc435 ("uapi: add
missing network related headers to kbuild").

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoi2c: cadence: Set the hardware time-out register to maximum value
Vishnu Motghare [Wed, 3 Dec 2014 12:35:25 +0000 (18:05 +0530)]
i2c: cadence: Set the hardware time-out register to maximum value

Cadence I2C controller has bug wherein it generates invalid read transactions
after timeout in master receiver mode. This driver does not use the HW
timeout and this interrupt is disabled but the feature itself cannot be
disabled. Hence, this patch writes the maximum value (0xFF) to this register.
This is one of the workarounds to this bug and it will not avoid the issue
completely but reduces the chances of error.

Signed-off-by: Vishnu Motghare <vishnum@xilinx.com>
Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
9 years agoi2c: davinci: generate STP always when NACK is received
Grygorii Strashko [Mon, 1 Dec 2014 15:34:04 +0000 (17:34 +0200)]
i2c: davinci: generate STP always when NACK is received

According to I2C specification the NACK should be handled as follows:
"When SDA remains HIGH during this ninth clock pulse, this is defined as the Not
Acknowledge signal. The master can then generate either a STOP condition to
abort the transfer, or a repeated START condition to start a new transfer."
[I2C spec Rev. 6, 3.1.6: http://www.nxp.com/documents/user_manual/UM10204.pdf]

Currently the Davinci i2c driver interrupts the transfer on receipt of a
NACK but fails to send a STOP in some situations and so makes the bus
stuck until next I2C IP reset (idle/enable).

For example, the issue will happen during SMBus read transfer which
consists from two i2c messages write command/address and read data:

S Slave Address Wr A Command Code A Sr Slave Address Rd A D1..Dn A P
<--- write -----------------------> <--- read --------------------->

The I2C client device will send NACK if it can't recognize "Command Code"
and it's expected from I2C master to generate STP in this case.
But now, Davinci i2C driver will just exit with -EREMOTEIO and STP will
not be generated.

Hence, fix it by generating Stop condition (STP) always when NACK is received.

This patch fixes Davinci I2C in the same way it was done for OMAP I2C
commit cda2109a26eb ("i2c: omap: query STP always when NACK is received").

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reported-by: Hein Tibosch <hein_tibosch@yahoo.es>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
9 years agoahci: disable MSI on SAMSUNG 0xa800 SSD
Tejun Heo [Thu, 4 Dec 2014 18:13:28 +0000 (13:13 -0500)]
ahci: disable MSI on SAMSUNG 0xa800 SSD

Just like 0x1600 which got blacklisted by 66a7cbc303f4 ("ahci: disable
MSI instead of NCQ on Samsung pci-e SSDs on macbooks"), 0xa800 chokes
on NCQ commands if MSI is enabled.  Disable MSI.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Dominik Mierzejewski <dominik@greysector.net>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=89171
Cc: stable@vger.kernel.org
9 years agocontext_tracking: Restore previous state in schedule_user
Andy Lutomirski [Wed, 3 Dec 2014 23:37:08 +0000 (15:37 -0800)]
context_tracking: Restore previous state in schedule_user

It appears that some SCHEDULE_USER (asm for schedule_user) callers
in arch/x86/kernel/entry_64.S are called from RCU kernel context,
and schedule_user will return in RCU user context.  This causes RCU
warnings and possible failures.

This is intended to be a minimal fix suitable for 3.18.

Reported-and-tested-by: Dave Jones <davej@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Wed, 3 Dec 2014 22:27:07 +0000 (14:27 -0800)]
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c bugfixes from Wolfram Sang:
 "A few driver bugfixes for 3.18"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: omap: fix i207 errata handling
  i2c: designware: prevent early stop on TX FIFO empty
  i2c: omap: fix NACK and Arbitration Lost irq handling

9 years agoMerge tag 'pci-v3.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
Linus Torvalds [Wed, 3 Dec 2014 22:24:10 +0000 (14:24 -0800)]
Merge tag 'pci-v3.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci

Pull PCI fix from Bjorn Helgaas:
 "This fixes a Tegra20 regression that we introduced during the v3.18
  merge window"

* tag 'pci-v3.18-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: tegra: Use physical range for I/O mapping

9 years agoMerge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 3 Dec 2014 22:08:50 +0000 (14:08 -0800)]
Merge tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux

Pull devicetree bugfix from Grant Likely:
 "One more bug fix for v3.18.  I debated whether or not to send you this
  merge request because we're at such a late rc.  The bug isn't critical
  in that there is only one system known to be affected and the patch is
  easy to backport.  The codepath is used by pretty much every DT based
  system, so there is risk a of regression (it /should/ be safe, but
  I've been bitten by stuff that should be safe before).  I've had it in
  linux-next for a week and haven't received any complaints.

  I think it probably should just be merged right away rather than
  waiting for the merge window and backporting.  It does fix a real bug
  and the code is theoretically safer after the change.  I can't think
  of any situation where it would be dangerous to reserve the DT memory
  an extra time.

  Summary from tag:

    Single bugfix for boot failure seen in the wild.  The memory reserve
    code tries to be clever about reserving the FDT, but it should just
    go ahead and reserve it unconditionally to avoid the problem of
    partial overlap described in the patch"

* tag 'devicetree-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux:
  of/fdt: memblock_reserve /memreserve/ regions in the case of partial overlap

9 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Wed, 3 Dec 2014 22:05:24 +0000 (14:05 -0800)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block core regression fix from Jens Axboe:
 "Single fix for a regression introduced in this development cycle,
  where dm on top of dif/dix is broken.  From Darrick Wong"

* 'for-linus' of git://git.kernel.dk/linux-block:
  block: fix regression where bio_integrity_process uses wrong bio_vec iterator

9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Wed, 3 Dec 2014 21:51:50 +0000 (13:51 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Radeon and Nouveau fixes:

  So nouveau had a few regression introduced, Ben and Maarten finally
  tracked down the one that was causing problems on my MacBookPro, also
  nvidia gave some info on the an engine we were using incorrectly, so
  disable our use of it, and one regresion with pci hotplug affecting
  optimus users.

  Radeon has an oops fixs, sync fix, and one workaround to avoid broken
  functionality on 32-bit x86, this needs better root causing and a
  better fix, but the bandaid is a lot safer at this point"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6
  drm/radeon: Ignore RADEON_GEM_GTT_WC on 32-bit x86
  drm/radeon: sync all BOs involved in a CS v2
  nouveau: move the hotplug ignore to correct place.
  drm/nouveau/gf116: remove copy1 engine
  drm/nouveau: prevent stale fence->channel pointers, and protect with rcu
  drm/nouveau/fifo/g84-: ack non-stall interrupt before handling it

9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Wed, 3 Dec 2014 21:35:18 +0000 (13:35 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller:

 1) Fill in ethtool link parameters for all link types in cxgb4, from
    Hariprasad Shenai.

 2) Fix probe regressions in stmmac driver, from Huacai Chen.

 3) Network namespace leaks on errirs in rtnetlink, from Nicolas
    Dichtel.

 4) Remove erroneous BUG check which can actually trigger legitimately,
    in xen-netfront.  From Seth Forshee.

 5) Validate length of IFLA_BOND_ARP_IP_TARGET netlink attributes, from
    Thomas Grag.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  cxgb4: Fill in supported link mode for SFP modules
  xen-netfront: Remove BUGs on paged skb data which crosses a page boundary
  sh_eth: Fix sleeping function called from invalid context
  stmmac: platform: Move plat_dat checking earlier
  sh_eth: Fix skb alloc size and alignment adjust rule.
  rtnetlink: release net refcnt on error in do_setlink()
  bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes

9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Wed, 3 Dec 2014 18:56:12 +0000 (10:56 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

Pull keyring/nfs fixes from James Morris:
 "From David Howells:

  The first one fixes the handling of maximum buffer size for key
  descriptions, fixing the size at 4095 + NUL char rather than whatever
  PAGE_SIZE happens to be and permits you to read back the full
  description without it getting clipped because some extra information
  got prepended.

  The second and third fix a bug in NFS idmapper handling whereby a key
  representing a mapping between an id and a name expires and causing
  EKEYEXPIRED to be seen internally in NFS (which prevents the mapping
  from happening) rather than re-looking up the mapping"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  KEYS: request_key() should reget expired keys rather than give EKEYEXPIRED
  KEYS: Simplify KEYRING_SEARCH_{NO,DO}_STATE_CHECK flags
  KEYS: Fix the size of the key description passed to/from userspace

9 years agoMerge branch 'akpm' (patches from Andrew Morton)
Linus Torvalds [Wed, 3 Dec 2014 17:36:20 +0000 (09:36 -0800)]
Merge branch 'akpm' (patches from Andrew Morton)

Merge misc fixes from Andrew Morton:
 "10 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  slab: fix nodeid bounds check for non-contiguous node IDs
  lib/genalloc.c: export devm_gen_pool_create() for modules
  mm: fix anon_vma_clone() error treatment
  mm: fix swapoff hang after page migration and fork
  fat: fix oops on corrupted vfat fs
  ipc/sem.c: fully initialize sem_array before making it visible
  drivers/input/evdev.c: don't kfree() a vmalloc address
  mm/vmpressure.c: fix race in vmpressure_work_fn()
  mm: frontswap: invalidate expired data on a dup-store failure
  mm: do not overwrite reserved pages counter at show_mem()

9 years agoslab: fix nodeid bounds check for non-contiguous node IDs
Paul Mackerras [Tue, 2 Dec 2014 23:59:48 +0000 (15:59 -0800)]
slab: fix nodeid bounds check for non-contiguous node IDs

The bounds check for nodeid in ____cache_alloc_node gives false
positives on machines where the node IDs are not contiguous, leading to
a panic at boot time.  For example, on a POWER8 machine the node IDs are
typically 0, 1, 16 and 17.  This means that num_online_nodes() returns
4, so when ____cache_alloc_node is called with nodeid = 16 the VM_BUG_ON
triggers, like this:

  kernel BUG at /home/paulus/kernel/kvm/mm/slab.c:3079!
  Call Trace:
    .____cache_alloc_node+0x5c/0x270 (unreliable)
    .kmem_cache_alloc_node_trace+0xdc/0x360
    .init_list+0x3c/0x128
    .kmem_cache_init+0x1dc/0x258
    .start_kernel+0x2a0/0x568
    start_here_common+0x20/0xa8

To fix this, we instead compare the nodeid with MAX_NUMNODES, and
additionally make sure it isn't negative (since nodeid is an int).  The
check is there mainly to protect the array dereference in the get_node()
call in the next line, and the array being dereferenced is of size
MAX_NUMNODES.  If the nodeid is in range but invalid (for example if the
node is off-line), the BUG_ON in the next line will catch that.

Fixes: 14e50c6a9bc2 ("mm: slab: Verify the nodeid passed to ____cache_alloc_node")
Signed-off-by: Paul Mackerras <paulus@samba.org>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>