ARM: DRA7/AM43XX: fix header definition for omap44xx_restart

[ upstream commit 7abb1a530e87fce0d73f85ac7802648bb542cf26 ]

omap44xx_restart is defined as a static void inline when DRA7/AM437X is
defined alone, which implies that the restart function is no longer
functional even though it is built in. So, fix the definition of the
same.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
mm: dmapool: add/remove sysfs file outside of the pool lock lock

[ Upstream commit 01c2965f0723a25209d5cf4cac630ed0f6d0edf4 ]

cat /sys/.../pools followed by removal the device leads to:

|======================================================
|[ INFO: possible circular locking dependency detected ]
|3.17.0-rc4+ #1498 Not tainted
|-------------------------------------------------------
|rmmod/2505 is trying to acquire lock:
| (s_active#28){++++.+}, at: [<c017f754>] kernfs_remove_by_name_ns+0x3c/0x88
|
|but task is already holding lock:
| (pools_lock){+.+.+.}, at: [<c011494c>] dma_pool_destroy+0x18/0x17c
|
|which lock already depends on the new lock.
|the existing dependency chain (in reverse order) is:
|
|-> #1 (pools_lock){+.+.+.}:
|   [<c0114ae8>] show_pools+0x30/0xf8
|   [<c0313210>] dev_attr_show+0x1c/0x48
|   [<c0180e84>] sysfs_kf_seq_show+0x88/0x10c
|   [<c017f960>] kernfs_seq_show+0x24/0x28
|   [<c013efc4>] seq_read+0x1b8/0x480
|   [<c011e820>] vfs_read+0x8c/0x148
|   [<c011ea10>] SyS_read+0x40/0x8c
|   [<c000e960>] ret_fast_syscall+0x0/0x48
|
|-> #0 (s_active#28){++++.+}:
|   [<c017e9ac>] __kernfs_remove+0x258/0x2ec
|   [<c017f754>] kernfs_remove_by_name_ns+0x3c/0x88
|   [<c0114a7c>] dma_pool_destroy+0x148/0x17c
|   [<c03ad288>] hcd_buffer_destroy+0x20/0x34
|   [<c03a4780>] usb_remove_hcd+0x110/0x1a4

The problem is the lock order of pools_lock and kernfs_mutex in
dma_pool_destroy() vs show_pools() call path.

This patch breaks out the creation of the sysfs file outside of the
pools_lock mutex.  The newly added pools_reg_lock ensures that there is no
race of create vs destroy code path in terms whether or not the sysfs file
has to be deleted (and was it deleted before we try to create a new one)
and what to do if device_create_file() failed.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ARM: dts: am335x-evmsk: enable second USB controller

The first port is hard wired to a USB-HUB and should be operated in
device mode (or OTG). The second port (which is enabled by this patch)
is wired to a host port. However the ID-pin isn't so we have to force
host mode here.
There is no match thing upstream commit for this because upstream has
already both ports enabled with USB1 forced in host mode.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[nsekhar@ti.com: made it explicit that USB1 is forced in host
                 mode even in upstream]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: musb: dsps: fix the base address for accessing the mode register

[ Upstream commit 8035691365b80428c58908215d4408559afe7cb3 ]

commit 943c13971c08 "usb: musb: dsps: implement ->set_mode()"
should have made it possible to use the driver with boards that have
the USBID pin unconnected. This doesn't actually work, since the
driver uses the wrong base address to access the mode register.
Furthermore it uses different base addresses in different places to
access the same register (phy_utmi).

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arm: mach-omap2: omap_hwmod_33xx_43xx_ipblock_data: Move am33xx_l4_hs_hwmod to ipblock_data

This patch moves am33xx_l4_hs_hwmod from 33xx_data to ipblock_data. This
is required because it can be reused in 43xx to add hwmod support to
tscadc as it uses the same l4_hs hwmod in am437x. This is helps in setting
appropriate clock domain names for tscadc on am33xx and am43xx.

Signed-off-by: Vignesh R <vigneshr@ti.com>
arm: mach-omap2: omap_hwmod_43xx_data: add hwmod support for tscadc on am437x-evm

This patch adds hwmod support for tscadc to work on am437x-evm. The am335x
hwmod structures of tscadc has been moved to ipblock_data so that it can
be reused in am437x just like v3.12. Thus tscadc dt entries can now be
added to am437x board specific dt files. Patch has not be tested on epos-evm.

Signed-off-by: Vignesh R <vigneshr@ti.com>
ARM: DRA7: hwmod data: Add missing UART hwmod data

We had constrainted hwmod entries to entries in dts which were present
only for default mapped interrupts, the ones such as UARTs > 6 which
needed IRQ crossbar configured were never added to hwmod database.

Add them now that IRQ crossbar is functional

Reported-by: Franklin Cooper Jr. <fcooper@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Ambresh K <ambresh@ti.com>
Merge branch 'platform-ti-linux-3.14.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-3.14.y

TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-3.14.y

* 'platform-ti-linux-3.14.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  ARM: DRA7: hwmod data: Add missing UART hwmod data
  arm: mach-omap2: omap_hwmod_43xx_data: add hwmod support for tscadc on am437x-evm
  arm: mach-omap2: omap_hwmod_33xx_43xx_ipblock_data: Move am33xx_l4_hs_hwmod to ipblock_data
  ARM: DRA7/AM43XX: fix header definition for omap44xx_restart

Signed-off-by: Dan Murphy <DMurphy@ti.com>
ARM: dts: dra7xx-clocks: Fix McASP8 shift values

Fix the shift values for McASP8 clocks: 'mcasp8_ahclk_mux'
and 'mcasp8_aux_gfclk_mux'.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Merge branch 'platform-ti-linux-3.14.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-3.14.y

TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-3.14.y

* 'platform-ti-linux-3.14.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  ARM: dts: dra7xx-clocks: Fix McASP8 shift values

Signed-off-by: Dan Murphy <DMurphy@ti.com>
Merge branch 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-3.14.y

TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-3.14.y

* 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  usb: musb: dsps: fix the base address for accessing the mode register
  ARM: dts: am335x-evmsk: enable second USB controller
  mm: dmapool: add/remove sysfs file outside of the pool lock lock

Signed-off-by: Dan Murphy <DMurphy@ti.com>
ARM: dts: am437x: add tscadc DT entries for am437x-evm

This patch adds tscadc DT entries for am437x-gp-evm and am437x-epos-evm.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Merge branch 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-3.14.y

TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-3.14.y

* 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  ARM: dts: am437x: add tscadc DT entries for am437x-evm

Signed-off-by: Dan Murphy <DMurphy@ti.com>