deliverable/linux.git
10 years agoBtrfs: move btrfs_{set,clear}_and_info() to ctree.h
Wang Shilong [Wed, 23 Apr 2014 11:33:33 +0000 (19:33 +0800)] 
Btrfs: move btrfs_{set,clear}_and_info() to ctree.h

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
10 years agobtrfs: replace error code from btrfs_drop_extents
David Sterba [Tue, 15 Apr 2014 16:50:17 +0000 (18:50 +0200)] 
btrfs: replace error code from btrfs_drop_extents

There's a case which clone does not handle and used to BUG_ON instead,
(testcase xfstests/btrfs/035), now returns EINVAL. This error code is
confusing to the ioctl caller, as it normally signifies errorneous
arguments.

Change it to ENOPNOTSUPP which allows a fall back to copy instead of
clone. This does not affect the common reflink operation.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
10 years agobtrfs: Change the hole range to a more accurate value.
Qu Wenruo [Tue, 15 Apr 2014 02:41:00 +0000 (10:41 +0800)] 
btrfs: Change the hole range to a more accurate value.

Commit 3ac0d7b96a268a98bd474cab8bce3a9f125aaccf fixed the btrfs expanding
write problem but the hole punched is sometimes too large for some
iovec, which has unmapped data ranges.
This patch will change to hole range to a more accurate value using the
counts checked by the write check routines.

Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
10 years agoserial_core: fix uart PORT_UNKNOWN handling
Thomas Pfaff [Wed, 23 Apr 2014 10:33:22 +0000 (12:33 +0200)] 
serial_core: fix uart PORT_UNKNOWN handling

While porting a RS485 driver from 2.6.29 to 3.14, i noticed that the serial tty
driver could break it by using uart ports that it does not own :

1. uart_change_pm ist called during uart_open and calls the uart pm function
   without checking for PORT_UNKNOWN.
   The fix is to move uart_change_pm from uart_open to uart_port_startup.
2. The return code from the uart request_port call in uart_set_info is not
   handled properly, leading to the situation that the serial driver also
   thinks it owns the uart ports.
   This can triggered by doing following actions :

   setserial /dev/ttyS0 uart none    # release the uart ports
   modprobe lirc-serial              # or any other device that uses the uart
   setserial /dev/ttyS0 uart 16550   # gives no error and the uart tty driver
                                     # can use the ports as well

Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoserial: samsung: Change barrier() to cpu_relax() in console output
Doug Anderson [Mon, 21 Apr 2014 16:40:36 +0000 (09:40 -0700)] 
serial: samsung: Change barrier() to cpu_relax() in console output

The two functions to write out to the console (one used in normal
console mode and one in polling console mode) were slightly different.
One used a barrier() in its loop and the other a cpu_relax().  The
barrier() really doesn't do anything since we're using rd_regl() to
read the port anyway.  Switch it to cpu_relax() to make things
consistent.

No known bugs / issues are fixed by this change--it just makes things
more consistent.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoserial: samsung: don't check config for every character
Doug Anderson [Mon, 21 Apr 2014 16:40:35 +0000 (09:40 -0700)] 
serial: samsung: don't check config for every character

The s3c24xx_serial_console_putchar() is _only_ ever used by
s3c24xx_serial_console_write() and is called in a loop (indirectly
through uart_console_write()).  There's no reason to call
s3c24xx_port_configured() for every iteration through the loop.  Move
it outside the loop.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoserial: samsung: Use the passed in "port", fixing kgdb w/ no console
Doug Anderson [Mon, 21 Apr 2014 16:40:34 +0000 (09:40 -0700)] 
serial: samsung: Use the passed in "port", fixing kgdb w/ no console

The two functions in the samsung serial driver used for writing
characters out to the port were inconsistent about whether they used
the passed in "port" or the global "cons_uart".  There was no reason
to use the global and the use of the global in
s3c24xx_serial_put_poll_char() caused a crash in the case where you
used the serial port for kgdboc but not for console.

Fix it so we used the passed in variable.

Note that this doesn't fix all problems with the samsung serial
driver.  Specifically:
* s3c24xx_serial_console_putchar() is still 99% identical to
  s3c24xx_serial_put_poll_char() (the function signature is different,
  but that's about it).  A future patch will make them slightly less
  identical and judging by other serial drivers we may need yet more
  differences eventually.
* The samsung serial driver still doesn't allow you to have more than
  one console port since it still uses the global cons_uart in
  s3c24xx_serial_console_write().

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoserial: 8250: Fix thread unsafe __dma_tx_complete function
Loic Poulain [Thu, 24 Apr 2014 09:34:48 +0000 (11:34 +0200)] 
serial: 8250: Fix thread unsafe __dma_tx_complete function

__dma_tx_complete is not protected against concurrent
call of serial8250_tx_dma. it can lead to circular tail
index corruption or parallel call of serial_tx_dma on the
same data portion.

This patch fixes this issue by holding the port lock.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years ago8250_core: Fix unwanted TX chars write
Loic Poulain [Thu, 24 Apr 2014 09:38:56 +0000 (11:38 +0200)] 
8250_core: Fix unwanted TX chars write

On transmit-hold-register empty, serial8250_tx_chars
should be called only if we don't use DMA.
DMA has its own tx cycle.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agotty: Fix race condition between __tty_buffer_request_room and flush_to_ldisc
Manfred Schlaegl [Tue, 8 Apr 2014 12:42:04 +0000 (14:42 +0200)] 
tty: Fix race condition between __tty_buffer_request_room and flush_to_ldisc

The race was introduced while development of linux-3.11 by
e8437d7ecbc50198705331449367d401ebb3181f and
e9975fdec0138f1b2a85b9624e41660abd9865d4.
Originally it was found and reproduced on linux-3.12.15 and
linux-3.12.15-rt25, by sending 500 byte blocks with 115kbaud to the
target uart in a loop with 100 milliseconds delay.

In short:
 1. The consumer flush_to_ldisc is on to remove the head tty_buffer.
 2. The producer adds a number of bytes, so that a new tty_buffer must
be allocated and added by __tty_buffer_request_room.
 3. The consumer removes the head tty_buffer element, without handling
newly committed data.

Detailed example:
 * Initial buffer:
   * Head, Tail -> 0: used=250; commit=250; read=240; next=NULL
 * Consumer: ''flush_to_ldisc''
   * consumed 10 Byte
   * buffer:
     * Head, Tail -> 0: used=250; commit=250; read=250; next=NULL
{{{
count = head->commit - head->read; // count = 0
if (!count) { // enter
// INTERRUPTED BY PRODUCER ->
if (head->next == NULL)
break;
buf->head = head->next;
tty_buffer_free(port, head);
continue;
}
}}}
 * Producer: tty_insert_flip_... 10 bytes + tty_flip_buffer_push
   * buffer:
     * Head, Tail -> 0: used=250; commit=250; read=250; next=NULL
   * added 6 bytes: head-element filled to maximum.
     * buffer:
       * Head, Tail -> 0: used=256; commit=250; read=250; next=NULL
   * added 4 bytes: __tty_buffer_request_room is called
     * buffer:
       * Head -> 0: used=256; commit=256; read=250; next=1
       * Tail -> 1: used=4; commit=0; read=250 next=NULL
   * push (tty_flip_buffer_push)
     * buffer:
       * Head -> 0: used=256; commit=256; read=250; next=1
       * Tail -> 1: used=4; commit=4; read=250 next=NULL
 * Consumer
{{{
count = head->commit - head->read;
if (!count) {
// INTERRUPTED BY PRODUCER <-
if (head->next == NULL) // -> no break
break;
buf->head = head->next;
tty_buffer_free(port, head);
// ERROR: tty_buffer head freed -> 6 bytes lost
continue;
}
}}}

This patch reintroduces a spin_lock to protect this case. Perhaps later
a lock-less solution could be found.

Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at>
Cc: stable <stable@vger.kernel.org> # 3.11
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge tag 'vexpress/fixes-for-3.15' of git://git.linaro.org/people/pawel.moll/linux...
Arnd Bergmann [Thu, 24 Apr 2014 21:46:58 +0000 (23:46 +0200)] 
Merge tag 'vexpress/fixes-for-3.15' of git://git.linaro.org/people/pawel.moll/linux into fixes

ARM Versatile Express fixes for 3.15

This series contains straight-forward fixes for different
Versatile Express infrastructure drivers:

- NULL pointer dereference on the error path in the clk driver
- out of boundary array access in the dcscb driver
- broken restart/power off implementation
- mis-interpreted voltage unit in the spc driver

* tag 'vexpress/fixes-for-3.15' of git://git.linaro.org/people/pawel.moll/linux:
  ARM: vexpress/TC2: Convert OPP voltage to uV before storing
  power/reset: vexpress: Fix restart/power off operation
  arm/mach-vexpress: array accessed out of bounds
  clk: vexpress: NULL dereference on error path

Includes an update to 3.15-rc2

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agophy: core: make NULL a valid phy reference if !CONFIG_GENERIC_PHY
Grygorii Strashko [Sat, 19 Apr 2014 03:21:44 +0000 (08:51 +0530)] 
phy: core: make NULL a valid phy reference if !CONFIG_GENERIC_PHY

This fixes a regression on Keystone 2 platforms caused by patch
57303488cd37da58263e842de134dc65f7c626d5
"usb: dwc3: adapt dwc3 core to use Generic PHY Framework" which adds
optional support of generic phy in DWC3 core.

On Keystone 2 platforms the USB is not working now because
CONFIG_GENERIC_PHY isn't set and, as result, Generic PHY APIs stubs
return -ENOSYS always. The log shows:
 dwc3 2690000.dwc3: failed to initialize core
 dwc3: probe of 2690000.dwc3 failed with error -38

Hence, fix it by making NULL a valid phy reference in Generic PHY
APIs stubs in the same way as it was done by the patch
04c2facad8fee66c981a51852806d8923336f362 "drivers: phy: Make NULL
a valid phy reference".

Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agophy: fix kernel oops in phy_lookup()
Sergei Shtylyov [Sat, 19 Apr 2014 03:21:43 +0000 (08:51 +0530)] 
phy: fix kernel oops in phy_lookup()

The kernel oopses in phy_lookup() due to 'phy->init_data' being NULL if we
register PHYs from a device tree probing driver and then call phy_get() on a
device that has no representation in the device tree (e.g. a PCI device).
Checking the pointer before dereferening it and skipping an interation if
it's NULL prevents this kernel oops.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agophy: restore OMAP_CONTROL_PHY dependencies
Jean Delvare [Sat, 19 Apr 2014 03:21:42 +0000 (08:51 +0530)] 
phy: restore OMAP_CONTROL_PHY dependencies

When OMAP_CONTROL_USB was renamed to OMAP_CONTROL_PHY (commit
14da699b), its dependencies were lost in the process. Nothing in the
commit message indicates that this removal was intentional, so I think
it was by accident and the dependencies should be restored.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Roger Quadros <rogerq@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agophy: exynos: fix building as a module
Arnd Bergmann [Sat, 19 Apr 2014 03:21:41 +0000 (08:51 +0530)] 
phy: exynos: fix building as a module

The top-level phy-samsung-usb2 driver may be configured as a
loadable module, which currently causes link errors because
of the dependency on the exynos{5250,4x12,4210}_usb2_phy_config
symbol. Solving this could be achieved by exporting these
symbols, but as the SoC-specific parts of the driver are not
currently built as modules, it seems better to just link
everything into one module and avoid the need for the export.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoUSB: serial: fix sysfs-attribute removal deadlock
Johan Hovold [Wed, 23 Apr 2014 09:32:19 +0000 (11:32 +0200)] 
USB: serial: fix sysfs-attribute removal deadlock

Fix driver new_id sysfs-attribute removal deadlock by making sure to
not hold any locks that the attribute operations grab when removing the
attribute.

Specifically, usb_serial_deregister holds the table mutex when
deregistering the driver, which includes removing the new_id attribute.
This can lead to a deadlock as writing to new_id increments the
attribute's active count before trying to grab the same mutex in
usb_serial_probe.

The deadlock can easily be triggered by inserting a sleep in
usb_serial_deregister and writing the id of an unbound device to new_id
during module unload.

As the table mutex (in this case) is used to prevent subdriver unload
during probe, it should be sufficient to only hold the lock while
manipulating the usb-serial driver list during deregister. A racing
probe will then either fail to find a matching subdriver or fail to get
the corresponding module reference.

Since v3.15-rc1 this also triggers the following lockdep warning:

======================================================
[ INFO: possible circular locking dependency detected ]
3.15.0-rc2 #123 Tainted: G        W
-------------------------------------------------------
modprobe/190 is trying to acquire lock:
 (s_active#4){++++.+}, at: [<c0167aa0>] kernfs_remove_by_name_ns+0x4c/0x94

but task is already holding lock:
 (table_lock){+.+.+.}, at: [<bf004d84>] usb_serial_deregister+0x3c/0x78 [usbserial]

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #1 (table_lock){+.+.+.}:
       [<c0075f84>] __lock_acquire+0x1694/0x1ce4
       [<c0076de8>] lock_acquire+0xb4/0x154
       [<c03af3cc>] _raw_spin_lock+0x4c/0x5c
       [<c02bbc24>] usb_store_new_id+0x14c/0x1ac
       [<bf007eb4>] new_id_store+0x68/0x70 [usbserial]
       [<c025f568>] drv_attr_store+0x30/0x3c
       [<c01690e0>] sysfs_kf_write+0x5c/0x60
       [<c01682c0>] kernfs_fop_write+0xd4/0x194
       [<c010881c>] vfs_write+0xbc/0x198
       [<c0108e4c>] SyS_write+0x4c/0xa0
       [<c000f880>] ret_fast_syscall+0x0/0x48

-> #0 (s_active#4){++++.+}:
       [<c03a7a28>] print_circular_bug+0x68/0x2f8
       [<c0076218>] __lock_acquire+0x1928/0x1ce4
       [<c0076de8>] lock_acquire+0xb4/0x154
       [<c0166b70>] __kernfs_remove+0x254/0x310
       [<c0167aa0>] kernfs_remove_by_name_ns+0x4c/0x94
       [<c0169fb8>] remove_files.isra.1+0x48/0x84
       [<c016a2fc>] sysfs_remove_group+0x58/0xac
       [<c016a414>] sysfs_remove_groups+0x34/0x44
       [<c02623b8>] driver_remove_groups+0x1c/0x20
       [<c0260e9c>] bus_remove_driver+0x3c/0xe4
       [<c026235c>] driver_unregister+0x38/0x58
       [<bf007fb4>] usb_serial_bus_deregister+0x84/0x88 [usbserial]
       [<bf004db4>] usb_serial_deregister+0x6c/0x78 [usbserial]
       [<bf005330>] usb_serial_deregister_drivers+0x2c/0x4c [usbserial]
       [<bf016618>] usb_serial_module_exit+0x14/0x1c [sierra]
       [<c009d6cc>] SyS_delete_module+0x184/0x210
       [<c000f880>] ret_fast_syscall+0x0/0x48

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(table_lock);
                               lock(s_active#4);
                               lock(table_lock);
  lock(s_active#4);

 *** DEADLOCK ***

1 lock held by modprobe/190:
 #0:  (table_lock){+.+.+.}, at: [<bf004d84>] usb_serial_deregister+0x3c/0x78 [usbserial]

stack backtrace:
CPU: 0 PID: 190 Comm: modprobe Tainted: G        W     3.15.0-rc2 #123
[<c0015e10>] (unwind_backtrace) from [<c0013728>] (show_stack+0x20/0x24)
[<c0013728>] (show_stack) from [<c03a9a54>] (dump_stack+0x24/0x28)
[<c03a9a54>] (dump_stack) from [<c03a7cac>] (print_circular_bug+0x2ec/0x2f8)
[<c03a7cac>] (print_circular_bug) from [<c0076218>] (__lock_acquire+0x1928/0x1ce4)
[<c0076218>] (__lock_acquire) from [<c0076de8>] (lock_acquire+0xb4/0x154)
[<c0076de8>] (lock_acquire) from [<c0166b70>] (__kernfs_remove+0x254/0x310)
[<c0166b70>] (__kernfs_remove) from [<c0167aa0>] (kernfs_remove_by_name_ns+0x4c/0x94)
[<c0167aa0>] (kernfs_remove_by_name_ns) from [<c0169fb8>] (remove_files.isra.1+0x48/0x84)
[<c0169fb8>] (remove_files.isra.1) from [<c016a2fc>] (sysfs_remove_group+0x58/0xac)
[<c016a2fc>] (sysfs_remove_group) from [<c016a414>] (sysfs_remove_groups+0x34/0x44)
[<c016a414>] (sysfs_remove_groups) from [<c02623b8>] (driver_remove_groups+0x1c/0x20)
[<c02623b8>] (driver_remove_groups) from [<c0260e9c>] (bus_remove_driver+0x3c/0xe4)
[<c0260e9c>] (bus_remove_driver) from [<c026235c>] (driver_unregister+0x38/0x58)
[<c026235c>] (driver_unregister) from [<bf007fb4>] (usb_serial_bus_deregister+0x84/0x88 [usbserial])
[<bf007fb4>] (usb_serial_bus_deregister [usbserial]) from [<bf004db4>] (usb_serial_deregister+0x6c/0x78 [usbserial])
[<bf004db4>] (usb_serial_deregister [usbserial]) from [<bf005330>] (usb_serial_deregister_drivers+0x2c/0x4c [usbserial])
[<bf005330>] (usb_serial_deregister_drivers [usbserial]) from [<bf016618>] (usb_serial_module_exit+0x14/0x1c [sierra])
[<bf016618>] (usb_serial_module_exit [sierra]) from [<c009d6cc>] (SyS_delete_module+0x184/0x210)
[<c009d6cc>] (SyS_delete_module) from [<c000f880>] (ret_fast_syscall+0x0/0x48)

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousb: wusbcore: fix panic in wusbhc_chid_set
Thomas Pugliese [Wed, 23 Apr 2014 19:28:10 +0000 (14:28 -0500)] 
usb: wusbcore: fix panic in wusbhc_chid_set

If no valid CHID value has previously been set on an HWA, writing a
value of all zeros will cause a kernel panic in uwb_radio_stop because
wusbhc->uwb_rc has not been set.  This patch skips the call to
uwb_radio_stop if wusbhc->uwb_rc has not been initialized.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousb: wusbcore: convert nested lock to use spin_lock instead of spin_lock_irq
Thomas Pugliese [Wed, 23 Apr 2014 19:32:27 +0000 (14:32 -0500)] 
usb: wusbcore: convert nested lock to use spin_lock instead of spin_lock_irq

Nesting a spin_lock_irq/unlock_irq inside a lock that has already
disabled interrupts will enable interrupts before we are ready when
spin_unlock_irq is called.  This patch converts the inner lock to use
spin_lock and spin_unlock instead.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agouwb: don't call spin_unlock_irq in a USB completion handler
Thomas Pugliese [Wed, 23 Apr 2014 19:42:47 +0000 (14:42 -0500)] 
uwb: don't call spin_unlock_irq in a USB completion handler

This patch converts the use of spin_lock_irq/spin_unlock_irq to
spin_lock_irqsave/spin_unlock_irqrestore in uwb_rc_set_drp_cmd_done
which is called from a USB completion handler.  There are also
whitespace cleanups to make checkpatch.pl happy.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agousb: chipidea: coordinate usb phy initialization for different phy type
Peter Chen [Thu, 24 Apr 2014 00:15:27 +0000 (08:15 +0800)] 
usb: chipidea: coordinate usb phy initialization for different phy type

For internal PHY (like UTMI), the phy clock may from internal pll,
it is on/off on the fly, the access PORTSC.PTS will hang without
phy clock. So, the usb_phy_init which will open phy clock needs to
be called before hw_phymode_configure.
See: http://marc.info/?l=linux-arm-kernel&m=139350618732108&w=2

For external PHY (like ulpi), it needs to configure portsc.pts before
visit viewport, or the viewport can't be visited. so phy_phymode_configure
needs to be called before usb_phy_init.
See: cd0b42c2a6d2a74244f0053f8960f5dad5842278

It may not the best solution, but it can work for all situations.

Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Chris Ruehl <chris.ruehl@gtsys.com.hk>
Cc: shc_work@mail.ru
Cc: denis@eukrea.com
Cc: festevam@gmail.com
Cc: stable <stable@vger.kernel.org> # 3.14
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge tag 'fixes-for-v3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Thu, 24 Apr 2014 19:33:10 +0000 (12:33 -0700)] 
Merge tag 'fixes-for-v3.15-rc3' of git://git./linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v3.15-rc3

Quite a few fixes this time since I lost v3.15-rc2
window.

Most fixes are MUSB which learned to remove its debugfs directories
properly, got a fix for PHY handling and now knows that it should
make sure its clocks aren't gated before trying to access registers.

ffs got a race fix between ffs_epfile_io() and ffs_func_eps_disable().

dwc3 got a fix for system suspend/resume and now only iterates over
valid endpoints when trying to resize TX fifos.

usb_get_phy() now will properly return an error if try_module_get() fails.

We also have a revert for a NAPI conversion on the ethernet gadget which
was causing a kernel BUG.

Signed-of-by: Felipe Balbi <balbi@ti.com>
10 years agoMerge tag 'regulator-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Thu, 24 Apr 2014 19:01:58 +0000 (12:01 -0700)] 
Merge tag 'regulator-v3.15-rc2' of git://git./linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "A couple of things here:

   - Fixes for pbias that didn't make it in during the merge window due
     to the driver coming in via MMC.  The conversion to use helpers is
     a fix as it implements list_voltage() which the main user (MMC)
     relies on for correct functioning.
   - Change the !REGULATOR stub for optional regulators to return an
     error rather than a dummy; this is more in keeping with the
     intended use of optional regulators and fixes some issues seen MMC
     where it got confused by a dummy being provided"

* tag 'regulator-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: core: Return error in get optional stub
  regulator: pbias: Convert to use regmap helper functions
  regulator: pbias: Fix is_enabled callback implementation

10 years agoMerge tag 'spi-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Linus Torvalds [Thu, 24 Apr 2014 19:01:05 +0000 (12:01 -0700)] 
Merge tag 'spi-v3.15-rc2' of git://git./linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A few driver specific fixes here:

   - SH HSPI was dealing with its clocks incorrectly which meant it
     didn't work on some SoCs, fixing this also requires a small fix to
     one of the SoC clock trees to avoid breaking existing users.
   - The SiRF driver appears to have had several quality problems, it's
     fairly new and not widely used so this isn't too worrying.
   - A brute force fix for excessive locking in the Atmel driver, it
     needs further investigation but this deals with the immediate
     issue.
   - A build fix for the Blackfin driver"

* tag 'spi-v3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: atmel: Fix scheduling while atomic bug
  spi: sh-hspi: Do not specifically request shyway_clk clock
  ARM: shmobile: r8a7778: Use clks as MSTP007 parent
  spi: sirf: make GPIO chipselect function work well
  spi: sirf: set SPI controller in RISC IO chipselect mode
  spi: sirf: correct TXFIFO empty interrupt status bit
  spi: bfin5xx: fix build error

10 years agoACPI / notify: Do not block unknown type notifications in root handler
Rafael J. Wysocki [Thu, 24 Apr 2014 17:27:49 +0000 (19:27 +0200)] 
ACPI / notify: Do not block unknown type notifications in root handler

Commit 1a699476e258 "ACPI / hotplug / PCI: Hotplug notifications from
acpi_bus_notify()" changed the root notify handler, acpi_bus_notify(),
to block unknown type norifications, but it overlooked the fact that
they might be propagated to drivers via the ->notify() callback.

Fix the problem by allowing drivers to receive unknown type
notifications via ->notify() as before.

Fixes: 1a699476e258 (ACPI / hotplug / PCI: Hotplug notifications from acpi_bus_notify())
Reported-and-tested-by: Mantas MikulÄ—nas <grawity@gmail.com>
Reported-and-tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoMerge branch 'fixes_for_v3.15' of git://git.linaro.org/people/mszyprowski/linux-dma...
Linus Torvalds [Thu, 24 Apr 2014 16:58:57 +0000 (09:58 -0700)] 
Merge branch 'fixes_for_v3.15' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping

Pull dma-mapping fix from Marek Szyprowski:
 "A small fix for dma-mapping subsystem for ARM"

* 'fixes_for_v3.15' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping:
  arm: dma-mapping: Fix mapping size value

10 years agoMerge branch 'for-3.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
Linus Torvalds [Thu, 24 Apr 2014 16:57:02 +0000 (09:57 -0700)] 
Merge branch 'for-3.15-fixes' of git://git./linux/kernel/git/tj/libata

Pull libata fixes from Tejun Heo:
 "Dan updated tag allocation to accomodate devices which choke when tags
  jump back and forth.  Quite a few ahci MSI related fixes.  A couple
  config dependency fixes and other misc fixes"

* 'for-3.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
  libata/ahci: accommodate tag ordered controllers
  ahci: Do not receive interrupts sent by dummy ports
  ahci: Use pci_enable_msi_exact() instead of pci_enable_msi_range()
  ahci: Ensure "MSI Revert to Single Message" mode is not enforced
  ahci: do not request irq for dummy port
  pata_samsung_cf: fix ata_host_activate() failure handling
  pata_arasan_cf: fix ata_host_activate() failure handling
  ata: fix i.MX AHCI driver dependencies
  pata_at91: fix ata_host_activate() failure handling
  libata: Update queued trim blacklist for M5x0 drives
  libata: make AHCI_XGENE depend on PHY_XGENE

10 years agoARM: vexpress/TC2: Convert OPP voltage to uV before storing
Punit Agrawal [Wed, 19 Mar 2014 12:43:25 +0000 (12:43 +0000)] 
ARM: vexpress/TC2: Convert OPP voltage to uV before storing

The SPC stores voltage in mV while the code assumes it was returning
uV. Convert the returned voltage to uV before storing. Also fix the
comment depicting voltage to uV.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
10 years agopower/reset: vexpress: Fix restart/power off operation
Pawel Moll [Thu, 24 Apr 2014 16:19:30 +0000 (17:19 +0100)] 
power/reset: vexpress: Fix restart/power off operation

The restart/power off implementation in the vexpress driver
used to obtain the config function when necessary. This was
wrong in two respects:

1. It required memory allocation with disabled interrupts
(it worked, but lockdep - when enabled - reported warnings).

2. Used jiffies-based timeout, while jiffies are not running
at this stage of system shutdown (therefore a config
transaction error - if happened - would have never be reported).

Fixed by pre-allocating the config function per device
and using mdelay for timeout.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
10 years agodt: tegra: remove non-existent clock IDs
Stephen Warren [Tue, 1 Apr 2014 20:13:17 +0000 (14:13 -0600)] 
dt: tegra: remove non-existent clock IDs

The Tegra124 clock DT binding currently provides 3 clocks that don't
actually exist; 2 for NAND and one for UART5/UARTE. Delete these. While
this is technically an incompatible DT ABI change, nothing could have
used these clock IDs for anything practical, since the HW doesn't exist.

Cc: <stable@vger.kernel.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoclk: tegra: remove non-existent clocks
Stephen Warren [Tue, 1 Apr 2014 20:13:16 +0000 (14:13 -0600)] 
clk: tegra: remove non-existent clocks

The Tegra124 clock driver currently provides 3 clocks that don't actually
exist; 2 for NAND and one for UART5/UARTE. Delete these.

Cc: <stable@vger.kernel.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoARM: tegra: remove UART5/UARTE from tegra124.dtsi
Stephen Warren [Tue, 1 Apr 2014 20:13:15 +0000 (14:13 -0600)] 
ARM: tegra: remove UART5/UARTE from tegra124.dtsi

Tegra124 only has 4 UARTs. Parts of the documentation hint at a fifth
UART, but this appears to be left-over from earlier SoC documentation.
Remove the non-existent DT node for UART5.

Cc: <stable@vger.kernel.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'omap-for-v3.15/fixes-v2-signed' of git://git.kernel.org/pub/scm/linux...
Arnd Bergmann [Thu, 24 Apr 2014 13:35:58 +0000 (15:35 +0200)] 
Merge tag 'omap-for-v3.15/fixes-v2-signed' of git://git./linux/kernel/git/tmlind/linux-omap into fixes

Fixes for omaps, mostly to fix some GPMC, DSS and USB issues for
device tree based booting. And turns out BeagleBoard xM A/B
needs it's own minimal dts in addition to the related u-boot
changes. Also few minor documentation and typo fixes are merged
to get them out of the way.

* tag 'omap-for-v3.15/fixes-v2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Fix GPMC remap for devices using an offset
  ARM: OMAP2+: Fix oops for GPMC free
  ARM: dts: Add support for the BeagleBoard xM A/B
  ARM: dts: Grammar /that will/it will/
  ARM: dts: Grammar /is uses/ is used/
  ARM: OMAP2+: Fix config name for USB3 PHY
  ARM: dts: am335x: update USB DT references
  ARM: dts: OMAP2+: remove uses of obsolete gpmc,device-nand
  ARM: AM335X: EVM: fix pinmux documentation in devicetree
  ARM: OMAP2+: N900: remove omapdss init for DT boot
  ARM: dts: dra7xx-clocks: Correct mcasp2_ahclkx_mux bit-shift
  ARM: dts: omap5: Add clocks to USB3 PHY node
  ARM: OMAP2+: hwmod: fix missing braces in _init()
  ARM: AM43xx: fix dpll init in bypass mode
  ARM: OMAP3: hwmod data: Correct clock domains for USB modules
  ARM: OMAP3: PM: remove access to PRM_VOLTCTRL register

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'ux500-defconfig-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Thu, 24 Apr 2014 13:35:14 +0000 (15:35 +0200)] 
Merge tag 'ux500-defconfig-for-arm-soc' of git://git./linux/kernel/git/linusw/linux-stericsson into fixes

This is a patch set for some ST-Ericsson devices:
- Updates the Ux500 (U8500) defconfig
- Selects PARTITION_ADVANCED for Ux500 and U300
- Configure in IIO sensor drivers for the Ux500
- Configure in the CW1200 WLAN chip for the Ux500

* tag 'ux500-defconfig-for-arm-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson:
  ARM: ux500: configure for CW1200 WLAN chip
  ARM: ux500: configure in sensors
  ARM: u300: u300_defconfig: Enable PARTITION_ADVANCED
  ARM: ux500: u8500_defconfig: Enable PARTITION_ADVANCED
  ARM: ux500: update defconfig

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'renesas-fixes-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel...
Arnd Bergmann [Thu, 24 Apr 2014 13:34:34 +0000 (15:34 +0200)] 
Merge tag 'renesas-fixes-for-v3.15' of git://git./linux/kernel/git/horms/renesas into fixes

Renesas ARM Based SoC Fixes Updates for v3.15

r8a7791 (R-Car M2) based koelsch board
* Correct renesas,gpios to renesas,groups in sd[012] pfc

8a7790 (R-Car H2) based lager board
* Correct SND_SOC_DAIFMT_CBx_CFx flags

r8a7740 (R-Mobile A1) SoC
* Drop address cells from GIC node

r8a7740 (R-Mobile A1) based Armadillo800 EVA board
* Correct SND_SOC_DAIFMT_CBx_CFx flags

sh73a0 (SH-Mobile AG5) SoC
* Drop address cells from GIC node

* tag 'renesas-fixes-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: koelsch: correct renesas,gpios to renesas,groups in sd[012] pfc
  ARM: shmobile: r8a7740: drop address cells from GIC node
  ARM: shmobile: sh73a0: drop address cells from GIC node
  ARM: shmobile: armadillo800eva: fixup SND_SOC_DAIFMT_CBx_CFx flags
  ARM: shmobile: lager: fixup SND_SOC_DAIFMT_CBx_CFx flags

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'renesas-dt5-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Thu, 24 Apr 2014 13:34:00 +0000 (15:34 +0200)] 
Merge tag 'renesas-dt5-for-v3.15' of git://git./linux/kernel/git/horms/renesas into fixes

Fifth Round of Renesas ARM Based SoC DT Updates for v3.15

Correct renesas,groups in SDHI nodes of for r8a7790 (R-Car H2) based
Lager board.

* tag 'renesas-dt5-for-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  ARM: shmobile: lager: correct renesas,gpios to renesas,groups in sd[02] pfc

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'v3.15-rockchip-fixes1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Arnd Bergmann [Thu, 24 Apr 2014 13:33:31 +0000 (15:33 +0200)] 
Merge tag 'v3.15-rockchip-fixes1' of git://git./linux/kernel/git/mmind/linux-rockchip into fixes

Fixing uart-rx pull settings and a copy'n'paste error in a smp message

* tag 'v3.15-rockchip-fixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  ARM: rockchip: fix copy'n'paste error in smp error messages
  ARM: rockchip: rk3188: enable pull-ups on UART RX pins

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'imx-fixes-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo...
Arnd Bergmann [Thu, 24 Apr 2014 13:30:53 +0000 (15:30 +0200)] 
Merge tag 'imx-fixes-3.15' of git://git./linux/kernel/git/shawnguo/linux into fixes

The i.MX fixes for 3.15:
 - A couple of dts changes for the fallout of imx-drm binding update
 - Parent DI clocks to video PLL for better HDMI support
 - PCIe interrupt mapping and GIC node fixes
 - A series of edmqmx6 board fixes
 - Other small and random fixes on imx5 and imx6 dts

* tag 'imx-fixes-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  ARM: i.MX6: ipu_di_sel clocks can set parent rates
  ARM: imx6q: clk: Parent DI clocks to video PLL via di_pre_sel
  ARM: dts: imx: add required #clock-cells for fixed-clock
  ARM: dts: vybrid: drop address and size cells from GIC node
  ARM: dts: imx6sl-evk: Add an entry for MX6SL_PAD_ECSPI1_SS0__GPIO4_IO11
  ARM: dts: imx53: fix apparent copy/paste error
  ARM: dts: imx6q-gw5xxx: remove dead 'crtcs' property
  ARM: dts: imx53-tx53: add IPU DI ports and endpoints
  ARM: dts: imx6: edmqmx6: add second STMPE
  ARM: dts: imx6: edmqmx6: USB H1 only supports host mode
  ARM: dts: imx6: edmqmx6: Do not use the OTG switch as VBUS regulator
  ARM: dts: imx6: edmqmx6: Fix usbotg id pin
  ARM: dt: microsom: don't set bit 7 for ethernet mux settings
  ARM: imx6q-clk: parent lvds_gate from lvds_sel
  ARM: dts: imx: drop invalid size and address cells properties
  ARM: dts: mx5: fix wrong stmpe-ts bindings
  ARM: dts: imx53-m53evk: Fix memory region description
  ARM: dts: imx53-qsb-common: Fix memory region description
  ARM: dts: imx6: add PCIe interrupt mapping properties

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoMerge tag 'mvebu-dt-fixes-non-crit-3.15' of git://git.infradead.org/linux-mvebu into...
Arnd Bergmann [Thu, 24 Apr 2014 13:30:16 +0000 (15:30 +0200)] 
Merge tag 'mvebu-dt-fixes-non-crit-3.15' of git://git.infradead.org/linux-mvebu into fixes

mvebu DT fixes-non-critical (for v3.15-rc1)

 - kirkwood
    - add some missing vendor prefixes to keep checkpatch happy

 - mvebu
    - add clock ref to mdio node on 370/XP/38x

* tag 'mvebu-dt-fixes-non-crit-3.15' of git://git.infradead.org/linux-mvebu:
  ARM: mvebu: ensure the mdio node has a clock reference on Armada 38x
  ARM: mvebu: ensure the mdio node has a clock reference on Armada 370/XP
  ARM: Kirkwood: DT: Add missing vendor prefix
  ARM: Kirkwood: Fix Atmel vendor prefix

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoARM: tegra: remove TEGRA_EMC_SCALING_ENABLE
Paul Bolle [Mon, 7 Apr 2014 16:52:23 +0000 (10:52 -0600)] 
ARM: tegra: remove TEGRA_EMC_SCALING_ENABLE

Commit a7cbe92cef27 ("ARM: tegra: remove tegra EMC scaling driver")
removed the only user of TEGRA_EMC_SCALING_ENABLE. Remove its Kconfig
entry too.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoARM: Tidy up DTB Makefile entries
Domenico Andreoli [Mon, 14 Apr 2014 09:55:01 +0000 (11:55 +0200)] 
ARM: Tidy up DTB Makefile entries

Few things were out of order:

- removed ARCH_BCM2835 duplicate
- shuffled ARCH_BCM_5301X, ARCH_U8500 and ARCH_U300 around so to keep the
  list sorted

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Olof Johansson <olof@lixom.net>
Signed-by: Domenico Andreoli <domenico.andreoli@linux.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoARM: fix missing CLKSRC_OF on multi-platform
Rob Herring [Wed, 16 Apr 2014 13:42:13 +0000 (08:42 -0500)] 
ARM: fix missing CLKSRC_OF on multi-platform

In commit ddb902cc34593e (ARM: centralize common multi-platform kconfig
options), CLKSRC_OF was removed from some platforms, but not added to
ARCH_MULTIPLATFORM. Fix this.

Reported-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoARM: spear: add __init to spear_clocksource_init()
Alex Elder [Wed, 9 Apr 2014 14:01:12 +0000 (09:01 -0500)] 
ARM: spear: add __init to spear_clocksource_init()

I get a build warning because spear_clocksource_init() calls
clocksource_mmio_init(), but it doesn't have an __init annotation.
Fix that.

Signed-off-by: Alex Elder <elder@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agoARM: pxa: hx4700.h: include "irqs.h" for PXA_NR_BUILTIN_GPIO
Andrea Adami [Tue, 8 Apr 2014 12:53:44 +0000 (14:53 +0200)] 
ARM: pxa: hx4700.h: include "irqs.h" for PXA_NR_BUILTIN_GPIO

hx4700 needs the same fix as in
9705e74671f0e4f994d86b00cecf441917c64a66
"ARM: pxa: fix various compilation problems"

Fix build errors. Initial one is:
/linux/arch/arm/mach-pxa/include/mach/hx4700.h:18:32: error:
 'PXA_NR_BUILTIN_GPIO' undeclared here (not in a function)
|  #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO

Cc: stable@vger.kernel.org # v3.13+
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
10 years agohwmon: (ltc2945) Don't crash the kernel unnecessarily
Guenter Roeck [Mon, 21 Apr 2014 17:38:08 +0000 (10:38 -0700)] 
hwmon: (ltc2945) Don't crash the kernel unnecessarily

An implementation error should not crash the kernel if it is avoidable.
Replace BUG() with WARN_ONCE().

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
10 years agohwmon: (vexpress) Avoid creating non-existing attributes
Pawel Moll [Wed, 23 Apr 2014 17:27:05 +0000 (18:27 +0100)] 
hwmon: (vexpress) Avoid creating non-existing attributes

The 'label' attribute was always created but returned -ENOENT
if there is no label and such behaviour is undefined from
libsensors' point of view.

Fixed by providing is_visible method in the attributes group,
so the attribute is not created at all when unnecessary.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
10 years agohwmon: (vexpress) Use legal hwmon device names
Pawel Moll [Wed, 23 Apr 2014 17:27:04 +0000 (18:27 +0100)] 
hwmon: (vexpress) Use legal hwmon device names

The driver used to directly us a DT 'compatible' property for
the 'name' attribute of the hwmon devices. Unfortunately it
contains '-' which is illegal in this context. It messes up
libsensors and thus every application using it.

Fixed by providing equivalent (and simpler) name strings.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
10 years agoarm/mach-vexpress: array accessed out of bounds
Heinrich Schuchardt [Mon, 14 Apr 2014 07:42:01 +0000 (08:42 +0100)] 
arm/mach-vexpress: array accessed out of bounds

dcscb_allcpus_mask is an array of size 2.

The index variable cluster has to be checked against this limit
before accessing the array.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
10 years agoclk: vexpress: NULL dereference on error path
Dan Carpenter [Thu, 7 Nov 2013 08:08:44 +0000 (08:08 +0000)] 
clk: vexpress: NULL dereference on error path

If the allocation fails then we dereference the NULL in the error path.
Just return directly.

Fixes: ed27ff1db869 ('clk: Versatile Express clock generators ("osc") driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
10 years agoextcon: arizona: Use devm_extcon_dev_register()
Sangjung Woo [Mon, 21 Apr 2014 10:10:15 +0000 (19:10 +0900)] 
extcon: arizona: Use devm_extcon_dev_register()

Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: palmas: Use devm_extcon_dev_register()
Sangjung Woo [Mon, 21 Apr 2014 10:10:14 +0000 (19:10 +0900)] 
extcon: palmas: Use devm_extcon_dev_register()

Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: max8997: Use devm_extcon_dev_register()
Sangjung Woo [Mon, 21 Apr 2014 10:10:13 +0000 (19:10 +0900)] 
extcon: max8997: Use devm_extcon_dev_register()

Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: max77693: Use devm_extcon_dev_register()
Sangjung Woo [Mon, 21 Apr 2014 10:10:12 +0000 (19:10 +0900)] 
extcon: max77693: Use devm_extcon_dev_register()

Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: max14577: Use devm_extcon_dev_register()
Sangjung Woo [Mon, 21 Apr 2014 10:10:11 +0000 (19:10 +0900)] 
extcon: max14577: Use devm_extcon_dev_register()

Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: gpio: Use devm_extcon_dev_register()
Sangjung Woo [Mon, 21 Apr 2014 10:10:10 +0000 (19:10 +0900)] 
extcon: gpio: Use devm_extcon_dev_register()

Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: adc-jack: Use devm_extcon_dev_register()
Sangjung Woo [Mon, 21 Apr 2014 10:10:09 +0000 (19:10 +0900)] 
extcon: adc-jack: Use devm_extcon_dev_register()

Use the resource-managed extcon device register function (i.e.
devm_extcon_dev_register()) instead of extcon_dev_register(). If extcon device
is attached with this function, that extcon device is automatically unregistered
on driver detach. That reduces tiresome managing code.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: Add resource-managed extcon register function
Sangjung Woo [Mon, 21 Apr 2014 10:10:08 +0000 (19:10 +0900)] 
extcon: Add resource-managed extcon register function

Add resource-managed extcon device register function for convenience.
For example, if a extcon device is attached with new
devm_extcon_dev_register(), that extcon device is automatically
unregistered on driver detach.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
[Fix bug about devm_extcon_dev_match/release() and code clean by Chanwoo Choi]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: max14577: Properly handle regmap_irq_get_virq error
Krzysztof Kozlowski [Fri, 18 Apr 2014 14:47:30 +0000 (16:47 +0200)] 
extcon: max14577: Properly handle regmap_irq_get_virq error

The regmap_irq_get_virq may return 0 or -EINVAL on error. Fail the probe
in both situations.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: max14577: Fix probe failure on successful work queue
Krzysztof Kozlowski [Wed, 9 Apr 2014 09:56:09 +0000 (11:56 +0200)] 
extcon: max14577: Fix probe failure on successful work queue

In probe the driver queued delayed work for cable detection and
returned the result of queue_delayed_work() call. However the return
value of queue_delayed_work() does not indicate an error and in normal
condition it returns true which means successful work queue.
This effectively resulted in probe failure:
[    2.088204] max14577-muic: probe of max77836-muic failed with error 1

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <stable@vger.kernel.org>
Fixes: 962e56bfcf0b ("extcon: max14577: Add extcon-max14577 driver...")
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoMerge tag 'ib-mfd-extcon-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee...
Chanwoo Choi [Thu, 24 Apr 2014 08:21:58 +0000 (17:21 +0900)] 
Merge tag 'ib-mfd-extcon-3.16' of git://git./linux/kernel/git/lee/mfd into HEAD

Immutable branch between MFD and Extcon due for v3.16 merge-window.

10 years agoextcon: max8997: Use power efficient workqueue for delayed cable detection
Krzysztof Kozlowski [Wed, 9 Apr 2014 13:20:15 +0000 (15:20 +0200)] 
extcon: max8997: Use power efficient workqueue for delayed cable detection

Schedule delayed cable detection work on power efficient workqueue
so the scheduler won't wake up idle core for that work.
This extends the idle time for CPU cores and conserves power.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: max77693: Use power efficient workqueue for delayed cable detection
Krzysztof Kozlowski [Wed, 9 Apr 2014 13:20:13 +0000 (15:20 +0200)] 
extcon: max77693: Use power efficient workqueue for delayed cable detection

Schedule delayed cable detection work on power efficient workqueue
so the scheduler won't wake up idle core for that work.
This extends the idle time for CPU cores and conserves power.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: max8997: Fix NULL pointer exception on missing pdata
Krzysztof Kozlowski [Wed, 9 Apr 2014 13:20:14 +0000 (15:20 +0200)] 
extcon: max8997: Fix NULL pointer exception on missing pdata

Fix NULL pointer exception when platform data is not supplied. The
driver dereferenced pdata pointer where it could be NULL.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <stable@vger.kernel.org>
Fixes: 810d601f07c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoextcon: max77693: Fix two NULL pointer exceptions on missing pdata
Krzysztof Kozlowski [Wed, 9 Apr 2014 13:20:12 +0000 (15:20 +0200)] 
extcon: max77693: Fix two NULL pointer exceptions on missing pdata

Fix NULL pointer exceptions when platform data is not supplied.

Trace of one exception:
Unable to handle kernel NULL pointer dereference at virtual address 00000008
pgd = c0004000
[00000008] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 2 PID: 1 Comm: swapper/0 Not tainted 3.14.0-12045-gead5dd4687a6-dirty #1628
task: eea80000 ti: eea88000 task.ti: eea88000
PC is at max77693_muic_probe+0x27c/0x528
LR is at regmap_write+0x50/0x60
pc : [<c041d1c8>]    lr : [<c02eba60>]    psr: 20000113
sp : eea89e38  ip : 00000000  fp : c098a834
r10: ee1a5a10  r9 : 00000005  r8 : c098a83c
r7 : 0000000a  r6 : c098a774  r5 : 00000005  r4 : eeb006d0
r3 : c0697bd8  r2 : 00000000  r1 : 00000001  r0 : 00000000
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 4000404a  DAC: 00000015
Process swapper/0 (pid: 1, stack limit = 0xeea88240)
Stack: (0xeea89e38 to 0xeea8a000)
9e20:                                                       c08499fc eeb006d0
9e40: 00000000 00000000 c0915f98 00000001 00000000 ee1a5a10 c098a730 c09a88b8
9e60: 00000000 c098a730 c0915f98 00000000 00000000 c02d6aa0 c02d6a88 ee1a5a10
9e80: c0a712c8 c02d54e4 00001204 c0628b00 ee1a5a10 c098a730 ee1a5a44 00000000
9ea0: eea88000 c02d57b4 00000000 c098a730 c02d5728 c02d3a24 ee813e5c eeb9d534
9ec0: c098a730 ee22f700 c097c720 c02d4b14 c08174ec c098a730 00000006 c098a730
9ee0: 00000006 c092fd30 c09b8500 c02d5df8 00000000 c093cbb8 00000006 c0008928
9f00: 000000c3 ef7fc785 00000000 ef7fc794 00000000 c08af968 00000072 eea89f30
9f20: ef7fc85e c065f198 000000c3 c003e87c 00000003 00000000 c092fd3c 00000000
9f40: c08af618 c0826d58 00000006 00000006 c0956f58 c093cbb8 00000006 c092fd30
9f60: c09b8500 000000c3 c092fd3c c08e8510 00000000 c08e8bb0 00000006 00000006
9f80: c08e8510 c0c0c0c0 00000000 c0628fac 00000000 00000000 00000000 00000000
9fa0: 00000000 c0628fb4 00000000 c000f038 00000000 00000000 00000000 00000000
9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 c0c0c0c0 c0c0c0c0
[<c041d1c8>] (max77693_muic_probe) from [<c02d6aa0>] (platform_drv_probe+0x18/0x48)
[<c02d6aa0>] (platform_drv_probe) from [<c02d54e4>] (driver_probe_device+0x140/0x384)
[<c02d54e4>] (driver_probe_device) from [<c02d57b4>] (__driver_attach+0x8c/0x90)
[<c02d57b4>] (__driver_attach) from [<c02d3a24>] (bus_for_each_dev+0x54/0x88)
[<c02d3a24>] (bus_for_each_dev) from [<c02d4b14>] (bus_add_driver+0xe8/0x204)
[<c02d4b14>] (bus_add_driver) from [<c02d5df8>] (driver_register+0x78/0xf4)
[<c02d5df8>] (driver_register) from [<c0008928>] (do_one_initcall+0xc4/0x174)
[<c0008928>] (do_one_initcall) from [<c08e8bb0>] (kernel_init_freeable+0xfc/0x1c8)
[<c08e8bb0>] (kernel_init_freeable) from [<c0628fb4>] (kernel_init+0x8/0xec)
[<c0628fb4>] (kernel_init) from [<c000f038>] (ret_from_fork+0x14/0x3c)
Code: caffffe7 e59d200c e3550001 b3a05001 (e5923008)
---[ end trace 85db969ce011bde7 ]---

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <stable@vger.kernel.org>
Fixes: 190d7cfc8632
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 years agoPNP: Work around BIOS defects in Intel MCH area reporting
Bjorn Helgaas [Wed, 23 Apr 2014 16:21:06 +0000 (10:21 -0600)] 
PNP: Work around BIOS defects in Intel MCH area reporting

Work around BIOSes that don't report the entire Intel MCH area.

MCHBAR is not an architected PCI BAR, so MCH space is usually reported as a
PNP0C02 resource.  The MCH space was once 16KB, but is 32KB in newer parts.
Some BIOSes still report a PNP0C02 resource that is only 16KB, which means
the rest of the MCH space is consumed but unreported.

This can cause resource map sanity check warnings or (theoretically) a
device conflict if we assigned the unreported space to another device.

The Intel perf event uncore driver tripped over this when it claimed the
MCH region:

  resource map sanity check conflict: 0xfed10000 0xfed15fff 0xfed10000 0xfed13fff pnp 00:01
  Info: mapping multiple BARs. Your kernel is fine.

To prevent this, if we find a PNP0C02 resource that covers part of the MCH
space, extend it to cover the entire space.

References: http://lkml.kernel.org/r/20140224162400.GE16457@pd.tnic
Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Borislav Petkov <bp@suse.de>
Acked-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
10 years agoMerge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Linus Torvalds [Wed, 23 Apr 2014 23:48:56 +0000 (16:48 -0700)] 
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm

Pull ARM fixes from Russell King:
 "Various fixes and post-merge window updates.  Included here are:
   - ensure Kconfig things which should be sorted remain sorted
   - fix three big-endian bugs which crept in during the last merge
     window
   - add the renameat2 syscall
   - fix big.LITTLE switcher initialisation checks
   - fix kdump vmcore for LPAE kernels"

* 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
  ARM: add renameat2 syscall
  ARM: keep arch/arm/Kconfig and arch/arm/mm/Kconfig select entries sorted
  ARM: 8033/1: fix big endian __pv_phys_pfn_offset size related issue
  ARM: 8032/1: bL_switcher: fix validation check before its activation
  ARM: 8030/1: ARM : kdump : add arch_crash_save_vmcoreinfo
  ARM: 8027/1: fix do_div() bug in big-endian systems
  ARM: 8026/1: Fix emulation of multiply accumulate instructions
  ARM: 8024/1: Keep DEBUG_UART_{PHYS,VIRT} entries sorted

10 years agostaging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data
H Hartley Sweeten [Fri, 28 Mar 2014 16:20:58 +0000 (09:20 -0700)] 
staging: comedi: usbdux: bug fix for accessing 'ao_chanlist' in private data

In usbdux_ao_cmd(), the channels for the command are transfered from the
cmd->chanlist and stored in the private data 'ao_chanlist'. The channel
numbers are bit-shifted when stored so that they become the "command"
that is transfered to the device. The channel to command conversion
results in the 'ao_chanlist' having these values for the channels:

  channel 0 -> ao_chanlist = 0x00
  channel 1 -> ao_chanlist = 0x40
  channel 2 -> ao_chanlist = 0x80
  channel 3 -> ao_chanlist = 0xc0

The problem is, the usbduxsub_ao_isoc_irq() function uses the 'chan' value
from 'ao_chanlist' to access the 'ao_readback' array in the private data.
So instead of accessing the array as 0, 1, 2, 3, it accesses it as 0x00,
0x40, 0x80, 0xc0.

Fix this by storing the raw channel number in 'ao_chanlist' and doing the
bit-shift when creating the command.

Fixes: a998a3db530bff80 "staging: comedi: usbdux: cleanup the private data 'outBuffer'"
Cc: stable <stable@vger.kernel.org> # 3.12
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Acked-by: Bernd Porr <mail@berndporr.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agolocks: rename FL_FILE_PVT and IS_FILE_PVT to use "*_OFDLCK" instead
Jeff Layton [Tue, 22 Apr 2014 12:24:32 +0000 (08:24 -0400)] 
locks: rename FL_FILE_PVT and IS_FILE_PVT to use "*_OFDLCK" instead

File-private locks have been re-christened as "open file description"
locks.  Finish the symbol name cleanup in the internal implementation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
10 years agoARM: OMAP2+: Fix GPMC remap for devices using an offset
Tony Lindgren [Tue, 22 Apr 2014 02:26:13 +0000 (19:26 -0700)] 
ARM: OMAP2+: Fix GPMC remap for devices using an offset

At least the smc91x driver expects the device to be at 0x300
offset from bus base address. This does not work currently
for GPMC when booted in device tree mode as it attempts to
remap the the allocated GPMC partition to the address
configured by the device tree plus the device offset.

Note that this works just fine when booted with legacy mode.

Let's fix the issue by just ignoring any device specific
offset while remapping. And let's make sure the remap
address confirms to the GPMC 16MB minimum granularity
as listed in the TRM for GPMC_CONFIG7 BASEADDRESS bits.

Otherwise we can get something like this:

omap-gpmc 6e000000.gpmc: cannot remap GPMC CS 1 to 0x01000300

Cc: Pekon Gupta <pekon@ti.com>
Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
10 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Wed, 23 Apr 2014 14:48:03 +0000 (07:48 -0700)] 
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:
 "The main change is that we now publish "firmware ID" for the serio
  devices to help userspace figure out the kind of touchpads it is
  dealing with: i8042 will export PS/2 port's PNP IDs as firmware IDs.

  You will also get more quirks for Synaptics touchpads in various
  Lenovo laptops, a change to elantech driver to recognize even more
  models, and fixups to wacom and couple other drivers"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: elantech - add support for newer elantech touchpads
  Input: soc_button_array - fix a crash during rmmod
  Input: synaptics - add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1
  Input: synaptics - report INPUT_PROP_TOPBUTTONPAD property
  Input: Add INPUT_PROP_TOPBUTTONPAD device property
  Input: i8042 - add firmware_id support
  Input: serio - add firmware_id sysfs attribute
  Input: wacom - handle 1024 pressure levels in wacom_tpc_pen
  Input: wacom - references to 'wacom->data' should use 'unsigned char*'
  Input: wacom - override 'pressure_max' with value from HID_USAGE_PRESSURE
  Input: wacom - use full 32-bit HID Usage value in switch statement
  Input: wacom - missed the last bit of expresskey for DTU-1031
  Input: ads7846 - fix device usage within attribute show
  Input: da9055_onkey - remove use of regmap_irq_get_virq()

10 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Wed, 23 Apr 2014 14:46:12 +0000 (07:46 -0700)] 
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull radeon drm fixes from Dave Airlie:
 "This is just radeon fixes, primarily the two pll fix and the aux fix,
  it also disables dpm on rv770 gpus, fixes driver reloading, and fixes
  two issues with runtime PM on some GPUS"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon: don't allow runpm=1 on systems with out ATPX
  drm/radeon: fix ATPX detection on non-VGA GPUs
  drm/radeon/pm: don't walk the crtc list before it has been initialized (v2)
  drm/radeon: properly unregister hwmon interface (v2)
  drm/radeon: fix count in cik_sdma_ring_test()
  drm/radeon/aux: fix hpd assignment for aux bus
  drm/radeon: improve PLL limit handling in post div calculation
  drm/radeon: use fixed PPL ref divider if needed
  drm/radeon: disable dpm on rv770 by default

10 years agoregulator: max14577: Add support for MAX77836 regulators
Krzysztof Kozlowski [Mon, 14 Apr 2014 09:17:20 +0000 (11:17 +0200)] 
regulator: max14577: Add support for MAX77836 regulators

Add support for MAX77836 chipset and its additional two LDO regulators.
These LDO regulators are controlled by the PMIC block with additional
regmap (different I2C slave address).

The MAX77836 charger and safeout regulators are almost identical to
MAX14577. The registers layout is the same, except values for charger's
current. The patch adds simple mapping between device type and supported
current by the charger regulator.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoextcon: max14577: Add support for MAX77836
Krzysztof Kozlowski [Mon, 14 Apr 2014 09:17:19 +0000 (11:17 +0200)] 
extcon: max14577: Add support for MAX77836

Add support for MAX77836 chipset to the max14577 extcon driver. The
MAX77836 MUIC has additional interrupts (VIDRM, ADC1K) so IRQ handling
is split up into two functions: max14577_parse_irq() and
max77836_parse_irq().

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: max77836: Add MAX77836 support to max14577 driver
Krzysztof Kozlowski [Mon, 14 Apr 2014 09:17:18 +0000 (11:17 +0200)] 
mfd: max77836: Add MAX77836 support to max14577 driver

Add Maxim 77836 support to max14577 driver. The chipsets have same MUIC
component so the extcon, charger and regulators are almost the same. The
MAX77836 however has also PMIC and Fuel Gauge.

The MAX77836 uses three I2C slave addresses and has additional interrupts
(related to PMIC and Fuel Gauge). It has also Interrupt Source register,
just like MAX77686 and MAX77693.

The MAX77836 PMIC's TOPSYS and INTSRC interrupts are reported in the
PMIC block. The PMIC block has different I2C slave address and uses own
regmap so another regmap_irq_chip is needed.

Since we have two regmap_irq_chip, use shared interrupts on MAX77836.

This patch adds additional defines and functions to the max14577 MFD core
driver so the driver will handle both chipsets. Also this patch replaces
"0x1 << N" with BIT(N) in defines for register masks.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: max14577: Add MAX14577 prefix to IRQ defines
Krzysztof Kozlowski [Mon, 14 Apr 2014 09:17:17 +0000 (11:17 +0200)] 
mfd: max14577: Add MAX14577 prefix to IRQ defines

This patch prepares for adding support for MAX77836 device to existing
max14577 driver by adding MAX14577 prefix to defines of interrupts.

This is only a rename-like patch, new code is not added.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoextcon: max14577: Choose muic_irqs according to device type
Krzysztof Kozlowski [Mon, 14 Apr 2014 09:17:16 +0000 (11:17 +0200)] 
extcon: max14577: Choose muic_irqs according to device type

This patch continues the preparation for adding support for max77836
device to existing max14577 driver.

During probe choose muic_irqs according to device type. Currently there
are only "max14577_muic_irqs" but later patch will add max77836
interrupts.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoextcon: max14577: Add max14577 prefix to muic_irqs
Krzysztof Kozlowski [Mon, 14 Apr 2014 09:17:15 +0000 (11:17 +0200)] 
extcon: max14577: Add max14577 prefix to muic_irqs

Add max14577 prefix to muic_irqs array. This prepares for max77836
support in this extcon driver.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: max14577: Add detection of device type
Krzysztof Kozlowski [Mon, 14 Apr 2014 09:17:14 +0000 (11:17 +0200)] 
mfd: max14577: Add detection of device type

This patch continues the preparation for adding support for MAX77836
device to existing max14577 driver.

Add enum for types of devices supported by this driver. The device type
will be detected by matching of_device_id, or i2c_device_id as a
fallback.

The patch also moves to separate function the code related to displaying
DeviceID register values.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: max14577: Add muic prefix to regmap config
Krzysztof Kozlowski [Mon, 14 Apr 2014 09:17:13 +0000 (11:17 +0200)] 
mfd: max14577: Add muic prefix to regmap config

Add muic prefix to regmap config to differentiate between another regmap
config for MAX77836 PMIC node. Additionally remove unused
symbols: MAX14577_REG_INVALID and max14577_irq_source.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoextcon: max14577: Change extcon name instead of static name according to device type
Chanwoo Choi [Mon, 14 Apr 2014 09:17:12 +0000 (11:17 +0200)] 
extcon: max14577: Change extcon name instead of static name according to device type

This patch use device name to make sysfs path according to device type:

max14577-muic
- /sys/class/extcon/max14577-muic/
max77836-muic
- /sys/class/extcon/max77836-muic/

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoarm: dma-mapping: Fix mapping size value
Ritesh Harjani [Mon, 21 Apr 2014 06:47:27 +0000 (12:17 +0530)] 
arm: dma-mapping: Fix mapping size value

68efd7d2fb("arm: dma-mapping: remove order parameter from
arm_iommu_create_mapping()") is causing kernel panic
because it wrongly sets the value of mapping->size:

Unable to handle kernel NULL pointer dereference at virtual
address 000000a0
pgd = e7a84000
[000000a0] *pgd=00000000
...
PC is at bitmap_clear+0x48/0xd0
LR is at __iommu_remove_mapping+0x130/0x164

Fix it by correcting mapping->size value.

Signed-off-by: Ritesh Harjani <ritesh.harjani@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
10 years agoMerge remote-tracking branches 'spi/fix/atmel', 'spi/fix/bfin5xx', 'spi/fix/hspi...
Mark Brown [Wed, 23 Apr 2014 12:50:18 +0000 (13:50 +0100)] 
Merge remote-tracking branches 'spi/fix/atmel', 'spi/fix/bfin5xx', 'spi/fix/hspi' and 'spi/fix/sirf' into spi-linus

10 years agoMerge remote-tracking branch 'regulator/fix/pbias' into regulator-linus
Mark Brown [Wed, 23 Apr 2014 12:50:12 +0000 (13:50 +0100)] 
Merge remote-tracking branch 'regulator/fix/pbias' into regulator-linus

10 years agoMerge remote-tracking branch 'regulator/fix/core' into regulator-linus
Mark Brown [Wed, 23 Apr 2014 12:50:11 +0000 (13:50 +0100)] 
Merge remote-tracking branch 'regulator/fix/core' into regulator-linus

10 years agoARM: add renameat2 syscall
Miklos Szeredi [Fri, 11 Apr 2014 10:25:39 +0000 (12:25 +0200)] 
ARM: add renameat2 syscall

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
[dropped arch/arm/include/asm/unistd.h changes --rmk]
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
10 years agoarm64: add renameat2 compat syscall
Miklos Szeredi [Fri, 11 Apr 2014 10:25:41 +0000 (11:25 +0100)] 
arm64: add renameat2 compat syscall

Wire up the renameat2 syscall for compat (AArch32) applications.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agoARM: keep arch/arm/Kconfig and arch/arm/mm/Kconfig select entries sorted
Russell King [Tue, 22 Apr 2014 21:26:27 +0000 (22:26 +0100)] 
ARM: keep arch/arm/Kconfig and arch/arm/mm/Kconfig select entries sorted

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
10 years agoInput: elantech - add support for newer elantech touchpads
Jordan Rife [Wed, 23 Apr 2014 00:44:51 +0000 (17:44 -0700)] 
Input: elantech - add support for newer elantech touchpads

Newer elantech touchpads are not recognized by the current driver, since it
fails to detect their firmware version number. This prevents more advanced
touchpad features from being usable such as two-finger scrolling. This
patch allows newer touchpads to be detected and be fully functional. Tested
on Sony Vaio SVF13N17PXB.

Signed-off-by: Jordan Rife <jrife0@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 years agoInput: soc_button_array - fix a crash during rmmod
Lejun Zhu [Wed, 23 Apr 2014 05:47:13 +0000 (22:47 -0700)] 
Input: soc_button_array - fix a crash during rmmod

When the system has zero or one button available, trying to rmmod
soc_button_array will cause crash. Fix this by properly handling -ENODEV
in probe().

Signed-off-by: Lejun Zhu <lejun.zhu@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 years agoMerge tag 'iio-fixes-for-3.15a' of git://git.kernel.org/pub/scm/linux/kernel/git...
Greg Kroah-Hartman [Wed, 23 Apr 2014 04:29:20 +0000 (21:29 -0700)] 
Merge tag 'iio-fixes-for-3.15a' of git://git./linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

First found of IIO fixes for the 3.15 cycle.

* Fix the platform data support for the at91 adc driver.
* A couple of related follow up patches get the support working again
  for at91sam9260 and at91sam9g45 as the earlier patch results in a device
  name change.
* A default timer value in the at91 adc driver was bonkers.  Make it sane.
* Fix incorrect reporting of the integration time for the cm32181 light sensor
* Fix a missing break in the ad2s1200 driver which would have give a false
  error return.
* Make sure buffer scan mask queries from userspace return 0/1 rather than
  a fairly random value depending on their implementation of test_bit
* Fix leak of the i2c client and a null pointer dereference in the cm36651
  driver.
* Fix a build warning on avr32 for the mxs-lradc (not exactly a critical
  combination - but the issue was real).

10 years agoMerge branch 'drm-fixes-3.15' of git://people.freedesktop.org/~deathsimple/linux...
Dave Airlie [Tue, 22 Apr 2014 21:39:12 +0000 (07:39 +1000)] 
Merge branch 'drm-fixes-3.15' of git://people.freedesktop.org/~deathsimple/linux into drm-next

1. Further PLL parameter fixes.
2. Fixes for HPD on DP
3. Could of different PM fixes
4. Disabling DPM on RV770

* 'drm-fixes-3.15' of git://people.freedesktop.org/~deathsimple/linux:
  drm/radeon: don't allow runpm=1 on systems with out ATPX
  drm/radeon: fix ATPX detection on non-VGA GPUs
  drm/radeon/pm: don't walk the crtc list before it has been initialized (v2)
  drm/radeon: properly unregister hwmon interface (v2)
  drm/radeon: fix count in cik_sdma_ring_test()
  drm/radeon/aux: fix hpd assignment for aux bus
  drm/radeon: improve PLL limit handling in post div calculation
  drm/radeon: use fixed PPL ref divider if needed
  drm/radeon: disable dpm on rv770 by default

10 years agoARM: 8033/1: fix big endian __pv_phys_pfn_offset size related issue
Victor Kamensky [Tue, 22 Apr 2014 01:25:36 +0000 (02:25 +0100)] 
ARM: 8033/1: fix big endian __pv_phys_pfn_offset size related issue

Fix e26a9e00afc482b971afcaef1db8c9034d4d6d7c 'ARM: Better
virt_to_page() handling' replaced __pv_phys_offset with
__pv_phys_pfn_offset. Also note that size of __pv_phys_offset
was quad but size of __pv_phys_pfn_offset is word. Instruction
that used to update __pv_phys_offset which address is in r6
had to update low word of __pv_phys_offset so it used #LOW_OFFSET
macro for store offset. Now when size of __pv_phys_pfn_offset is
word, no difference between little endian and big endian should
exist - i.e no offset should be used when __pv_phys_pfn_offset
is stored.

Note that for little endian image proposed change is noop,
since in little endian case #LOW_OFFSET is defined 0 anyway.

Reported-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
10 years agoARM: 8032/1: bL_switcher: fix validation check before its activation
Nicolas Pitre [Mon, 21 Apr 2014 23:25:35 +0000 (00:25 +0100)] 
ARM: 8032/1: bL_switcher: fix validation check before its activation

The switcher should not depend on MAX_CLUSTER to determine ifit should
be activated or not. In a multiplatform kernel binary it is possible to
have dual-cluster and quad-cluster platforms configured in. In that case
MAX_CLUSTER which is a build time limit should be 4 and that shouldn't
prevent the switcher from working if the kernel is booted on a b.L
dual-cluster system.

In bL_switcher_halve_cpus() we already have a runtime validation check
to make sure we're dealing with only two clusters, so booting on a quad
cluster system will be caught and switcher activation aborted.

However, the b.L switcher must ensure the MCPM layer is initialized on
the booted hardware before doing anything.  The mcpm_is_available()
function is added to that effect.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Abhilash Kesavan <kesavan.abhilash@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
10 years agoARM: 8030/1: ARM : kdump : add arch_crash_save_vmcoreinfo
Liu Hua [Fri, 18 Apr 2014 06:45:36 +0000 (07:45 +0100)] 
ARM: 8030/1: ARM : kdump : add arch_crash_save_vmcoreinfo

For vmcore generated by LPAE enabled kernel, user space
utility such as crash needs additional infomation to
parse.

So this patch add arch_crash_save_vmcoreinfo as what PAE enabled
i386 linux does.

Cc: <stable@vger.kernel.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
10 years agoARM: 8027/1: fix do_div() bug in big-endian systems
Xiangyu Lu [Tue, 15 Apr 2014 08:38:17 +0000 (09:38 +0100)] 
ARM: 8027/1: fix do_div() bug in big-endian systems

In big-endian systems, "%1" get the most significant part of the value, cause the instruction to get the wrong result.

When viewing ftrace record in big-endian ARM systems, we found that
the timestamp errors:

swapper-0   [001] 1325.970000:   0:120:R ==> [001]    16:120:R events/1
events/1-16 [001] 1325.970000:   16:120:S ==> [001]    0:120:R swapper
swapper-0   [000] 1325.1000000:  0:120:R   + [000]    15:120:R events/0
swapper-0   [000] 1325.1000000:  0:120:R ==> [000]    15:120:R events/0
swapper-0   [000] 1326.030000:   0:120:R   + [000]  1150:120:R sshd
swapper-0   [000] 1326.030000:   0:120:R ==> [000]  1150:120:R sshd

When viewed ftrace records, it will call the do_div(n, base) function, which achieved arch/arm/include/asm/div64.h in. When n = 10000000, base = 1000000, in do_div(n, base) will execute "umull %Q0, %R0, %1, %Q2".

Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Cc: <stable@vger.kernel.org> # 2.6.20+
Signed-off-by: Alex Wu <wuquanming@huawei.com>
Signed-off-by: Xiangyu Lu <luxiangyu@huawei.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
10 years agomm: make fixup_user_fault() check the vma access rights too
Linus Torvalds [Tue, 22 Apr 2014 20:49:40 +0000 (13:49 -0700)] 
mm: make fixup_user_fault() check the vma access rights too

fixup_user_fault() is used by the futex code when the direct user access
fails, and the futex code wants it to either map in the page in a usable
form or return an error.  It relied on handle_mm_fault() to map the
page, and correctly checked the error return from that, but while that
does map the page, it doesn't actually guarantee that the page will be
mapped with sufficient permissions to be then accessed.

So do the appropriate tests of the vma access rights by hand.

[ Side note: arguably handle_mm_fault() could just do that itself, but
  we have traditionally done it in the caller, because some callers -
  notably get_user_pages() - have been able to access pages even when
  they are mapped with PROT_NONE.  Maybe we should re-visit that design
  decision, but in the meantime this is the minimal patch. ]

Found by Dave Jones running his trinity tool.

Reported-by: Dave Jones <davej@redhat.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoARM64: Remove duplicated Kconfig entry for "kernel/power/Kconfig"
Hanjun Guo [Thu, 3 Apr 2014 11:16:49 +0000 (12:16 +0100)] 
ARM64: Remove duplicated Kconfig entry for "kernel/power/Kconfig"

There is a duplicated Kconfig entry for "kernel/power/Kconfig"
in menu "Power management options" and "CPU Power Management",
remove the one from menu "CPU Power Management" suggested by
Viresh.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agoarm64: __NR_compat_syscalls fix
Miklos Szeredi [Fri, 11 Apr 2014 10:25:40 +0000 (11:25 +0100)] 
arm64: __NR_compat_syscalls fix

This fixes commit 6290b53de025 (arm64: compat: Wire up new AArch32 syscalls)
which did not update __NR_compat_syscalls accordingly.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: <stable@vger.kernel.org> # 3.14+
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
10 years agoMerge tag 'gpio-v3.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Tue, 22 Apr 2014 16:28:02 +0000 (09:28 -0700)] 
Merge tag 'gpio-v3.15-2' of git://git./linux/kernel/git/linusw/linux-gpio

Pull gpio fixes from Linus Walleij:
 "A small batch of GPIO fixes for the v3.15 series.  I expect more to
  come in but I'm a bit behind on mail, might as well get these to you
  right now:

   - Change a crucial semantic ordering in the GPIO irqchip helpers

   - Fix two nasty regressions in the ACPI gpiolib extensions"

* tag 'gpio-v3.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio / ACPI: Prevent potential wrap of GPIO value on OpRegion read
  gpio / ACPI: Don't crash on NULL chip->dev
  gpio: set data first, then chip and handler

10 years agoMerge branch 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Tue, 22 Apr 2014 16:09:06 +0000 (09:09 -0700)] 
Merge branch 'x86-vdso-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 vdso fix from Peter Anvin:
 "This is a single build fix for building with gold as opposed to GNU
  ld.  It got queued up separately and was expected to be pushed during
  the merge window, but it got left behind"

* 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, vdso: Make the vdso linker script compatible with Gold

10 years agodrm/radeon: don't allow runpm=1 on systems with out ATPX
Alex Deucher [Tue, 15 Apr 2014 16:44:35 +0000 (12:44 -0400)] 
drm/radeon: don't allow runpm=1 on systems with out ATPX

vgaswitcheroo and the ATPX ACPI methods are required to
power down the dGPU.

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=73901

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
This page took 0.078512 seconds and 5 git commands to generate.