ti-linux-kernel/ti-linux-kernel-next.git
5 years agoMerge branch 'connectivity-ti-linux-4.1.y-next' of git://git.ti.com/connectivity... ti-linux-4.1.y-next ti-linux-4.1.y-next-20160301
Dan Murphy [Tue, 1 Mar 2016 15:01:11 +0000 (09:01 -0600)]
Merge branch 'connectivity-ti-linux-4.1.y-next' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.1.y-next

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

* 'connectivity-ti-linux-4.1.y-next' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  ti_config_fragments/baseport.cfg: enable DMA on 8250 UART
  tty: serial: 8250: omap: growable ring-buffer with watchdog
  tty: serial: 8250: omap: Switch to the new dmaengine_terminate_sync

Signed-off-by: Dan Murphy <dmurphy@ti.com>
5 years agoMerge branch 'platform-ti-linux-4.1.y-next' of git://git.ti.com/~rrnayak/ti-linux...
Dan Murphy [Tue, 1 Mar 2016 15:01:09 +0000 (09:01 -0600)]
Merge branch 'platform-ti-linux-4.1.y-next' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.1.y-next

TI-Feature: platform_next
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-4.1.y-next

* 'platform-ti-linux-4.1.y-next' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  dmaengine: omap-dma: Fix completion reporting via tx_status

Signed-off-by: Dan Murphy <dmurphy@ti.com>
5 years agodmaengine: omap-dma: Fix completion reporting via tx_status
Peter Ujfalusi [Fri, 26 Feb 2016 16:06:10 +0000 (18:06 +0200)]
dmaengine: omap-dma: Fix completion reporting via tx_status

When based on the CCR_ENABLE bit the channel is stopped we should not call
omap_dma_callback(), only change the return value to DMA_COMPLETE. Client
drivers will do the right thing to clean up the channel after the transfer
has been completed.
Check the CCR_ENABLE only if the channel is running and it is not paused:
If the channel is not yet started the CCR_ENABLE bit is not set.
sDMA can not be paused. Pause (in cyclic mode only) means that we stop
the channel.

This will fix one hard to reproduce race condition when the channel is
terminated during transfer (affecting cyclic operation).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agoMerge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integrati...
Dan Murphy [Tue, 1 Mar 2016 00:58:30 +0000 (18:58 -0600)]
Merge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.1.y

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

* 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  Revert "usb: dwc3: gadget: start requests as soon as they come"

Signed-off-by: Dan Murphy <dmurphy@ti.com>
5 years agoRevert "usb: dwc3: gadget: start requests as soon as they come"
Roger Quadros [Fri, 26 Feb 2016 11:17:00 +0000 (13:17 +0200)]
Revert "usb: dwc3: gadget: start requests as soon as they come"

This reverts commit 118694c58a32c16ca0ef24304a8e9d8c21b5082b.

The reverted commit was causing 50% eunumeration failures for
mass_storage gadget with the below backtrace.

The commit was supposed to make dwc3 little faster. However,
testing with mass storage gadget on am437x-gp-evm (with backing
storage in RAM) gives no diffrence in performance with or without
the patch.

We choose to sacrifice any (minor) performance gain for
stability.

[   73.526467] ------------[ cut here ]------------
[   73.531230] WARNING: CPU: 0 PID: 2195 at drivers/usb/dwc3/ep0.c:306 dwc3_ep0_out_start+0x44/0x50 [dwc3]()
[   73.540854] Modules linked in: g_mass_storage usb_f_mass_storage libcomposite ipv6 xhci_plat_hcd xhci_hcd usbcore evdev joydev dwc3 pru_rproc udc_core ti_am335x_adc kfifo_c
[   73.582299] CPU: 0 PID: 2195 Comm: irq/266-dwc3 Not tainted 4.1.18-00998-ga6a31ce #211
[   73.590267] Hardware name: Generic AM43 (Flattened Device Tree)
[   73.596224] Backtrace:
[   73.598751] [<c0012b2c>] (dump_backtrace) from [<c0012cc8>] (show_stack+0x18/0x1c)
[   73.606366]  r6:00000000 r5:00000000 r4:20000093 r3:00000000
[   73.612152] [<c0012cb0>] (show_stack) from [<c0623200>] (dump_stack+0x94/0xb4)
[   73.619448] [<c062316c>] (dump_stack) from [<c0041f40>] (warn_slowpath_common+0x80/0xbc)
[   73.627585]  r6:00000132 r5:bf0f6854 r4:00000000 r3:ed1cc000
[   73.633361] [<c0041ec0>] (warn_slowpath_common) from [<c0041fa0>] (warn_slowpath_null+0x24/0x2c)
[   73.642194]  r8:00000000 r7:0000030c r6:00000000 r5:f22c5000 r4:ee494010
[   73.649073] [<c0041f7c>] (warn_slowpath_null) from [<bf0f6854>] (dwc3_ep0_out_start+0x44/0x50 [dwc3])
[   73.658434] [<bf0f6810>] (dwc3_ep0_out_start [dwc3]) from [<bf0f6b0c>] (dwc3_ep0_interrupt+0x1dc/0xae4 [dwc3])
[   73.668570] [<bf0f6930>] (dwc3_ep0_interrupt [dwc3]) from [<bf0f4be8>] (dwc3_thread_interrupt+0x7f4/0x9e4 [dwc3])
[   73.678890]  r10:ed17e380 r9:00000000 r8:00000000 r7:0000030c r6:ee494010 r5:00000004
[   73.686847]  r4:ed66e890
[   73.689461] [<bf0f43f4>] (dwc3_thread_interrupt [dwc3]) from [<c0081a14>] (irq_thread_fn+0x24/0x3c)
[   73.698558]  r10:00000000 r9:00000001 r8:ed4047c0 r7:ed13f780 r6:ed13f780 r5:00000000
[   73.706513]  r4:ed4047c0
[   73.709094] [<c00819f0>] (irq_thread_fn) from [<c0081be8>] (irq_thread+0x158/0x1b8)
[   73.716795]  r6:00000001 r5:00000000 r4:ed4047e0 r3:c00819f0
[   73.722575] [<c0081a90>] (irq_thread) from [<c005b138>] (kthread+0xdc/0xf8)
[   73.729578]  r10:00000000 r9:00000000 r8:00000000 r7:c0081a90 r6:ed4047c0 r5:ed4045c0
[   73.737531]  r4:00000000
[   73.740121] [<c005b05c>] (kthread) from [<c000fc28>] (ret_from_fork+0x14/0x2c)
[   73.747384]  r7:00000000 r6:00000000 r5:c005b05c r4:ed4045c0
[   73.753140] ---[ end trace 7a5e0f83644dd200 ]---

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoMerge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integrati...
LCPD Auto Merger [Fri, 26 Feb 2016 15:42:34 +0000 (09:42 -0600)]
Merge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.1.y

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

* 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  usb: gadget: gserial: Privatize close_wait
  usb: gadget: u_serial: eliminate abuse of ep->driver data

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agousb: gadget: gserial: Privatize close_wait
Peter Hurley [Thu, 25 Feb 2016 14:37:04 +0000 (20:07 +0530)]
usb: gadget: gserial: Privatize close_wait

commit b140dfe622ca23bad6755ce7cd7de2245ef2b68d upstream.

close_wait is no longer needed or provided by the tty core.
Move close_wait to struct gs_port.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agousb: gadget: u_serial: eliminate abuse of ep->driver data
Robert Baldyga [Thu, 25 Feb 2016 14:37:03 +0000 (20:07 +0530)]
usb: gadget: u_serial: eliminate abuse of ep->driver data

commit 18411c0f94716ec225a4f7e1d7735c80f5ec0dab upstream.

Since ep->driver_data is not used for endpoint claiming, neither for
enabled/disabled state storing, we can reduce number of places where
we read or modify it's value, as now it has no particular meaning for
function or framework logic.

In case of u_serial ep->driver_data stores pointer to struct gs_port,
which is referenced in many places in code. Code using ep->driver_data
to mark endpoint as enabled/disabled has been removed.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoMerge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integrati...
Dan Murphy [Thu, 25 Feb 2016 15:04:26 +0000 (09:04 -0600)]
Merge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.1.y

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

* 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  usb: dwc3: gadget: Fix superspeed enumeration on system resume
  ARM: dts: am571x-idk: Add tricolor status LED support
  ARM: dts: am572x-idk: Add tricolor status LED support

Signed-off-by: Dan Murphy <dmurphy@ti.com>
5 years agousb: dwc3: gadget: Fix superspeed enumeration on system resume
Roger Quadros [Wed, 24 Feb 2016 15:10:30 +0000 (17:10 +0200)]
usb: dwc3: gadget: Fix superspeed enumeration on system resume

The dwc3 gadget controller disconnects during system suspend
but fails to reconnect during system resume while in superspeed
mode. Disconnecting and reconnecting the cable makes it work.
The USB device controller was not being stopped during system suspend.

The USB device controller must be stopped during system suspend
as we're powering down the PHYs and we shouldn't prevent deeper
idle states. This also fixes the superspeed enumeration after
system suspend-resume.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoARM: dts: am571x-idk: Add tricolor status LED support
Nishanth Menon [Tue, 23 Feb 2016 18:19:05 +0000 (12:19 -0600)]
ARM: dts: am571x-idk: Add tricolor status LED support

AM571x-IDK rev 1.2A has tricolor RGB LEDs that can be controlled using
GPIO. expose these to userspace for usage as necessary.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoARM: dts: am572x-idk: Add tricolor status LED support
Nishanth Menon [Tue, 23 Feb 2016 18:19:04 +0000 (12:19 -0600)]
ARM: dts: am572x-idk: Add tricolor status LED support

AM572x-IDK rev 1.3A has tricolor RGB LEDs that can be controlled using
GPIO. expose these to userspace for usage as necessary.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoMerge branch 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel...
LCPD Auto Merger [Wed, 24 Feb 2016 18:08:28 +0000 (12:08 -0600)]
Merge branch 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.1.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-4.1.y

* 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  hwmon: (gpio-fan) Remove un-necessary speed_index lookup for thermal hook
  ARM: dts: am43xx: fix edma memcpy channel allocation

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agohwmon: (gpio-fan) Remove un-necessary speed_index lookup for thermal hook
Nishanth Menon [Fri, 19 Feb 2016 18:52:20 +0000 (12:52 -0600)]
hwmon: (gpio-fan) Remove un-necessary speed_index lookup for thermal hook

Thermal hook gpio_fan_get_cur_state is only interested in knowing
the current speed index that was setup in the system, this is
already available as part of fan_data->speed_index which is always
set by set_fan_speed. Using get_fan_speed_index is useful when we
have no idea about the fan speed configuration (for example during
fan_ctrl_init).

When thermal framework invokes
gpio_fan_get_cur_state=>get_fan_speed_index via gpio_fan_get_cur_state
especially in a polled configuration for thermal governor, we
basically hog the i2c interface to the extent that other functions
fail to get any traffic out :(.

Instead, just provide the last state set in the driver - since the gpio
fan driver is responsible for the fan state immaterial of override, the
fan_data->speed_index should accurately reflect the state.

Fixes: b5cf88e46bad ("(gpio-fan): Add thermal control hooks")
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoARM: dts: am43xx: fix edma memcpy channel allocation
Tero Kristo [Tue, 23 Feb 2016 17:03:06 +0000 (19:03 +0200)]
ARM: dts: am43xx: fix edma memcpy channel allocation

EDMA was allocating DMA channels 32 and 33 for memcpy usage, out of which
channel 33 is actually used by DES crypto engine. This bad allocation of
the channel causes a crash in the DES crypto engine, as the channel
gets configured for memcpy usage instead of hardware <-> memory DMA.

Fixed by allocating DMA channels 58 and 59 for memcpy usage (I2C0 RX/TX),
which are not used by anybody.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Suggested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agoMerge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integrati...
Dan Murphy [Tue, 23 Feb 2016 15:14:18 +0000 (09:14 -0600)]
Merge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.1.y

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

* 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  net: prueth: change firmware names for PRUSS Ethernet

Signed-off-by: Dan Murphy <dmurphy@ti.com>
5 years agonet: prueth: change firmware names for PRUSS Ethernet
Suman Anna [Fri, 19 Feb 2016 01:12:27 +0000 (19:12 -0600)]
net: prueth: change firmware names for PRUSS Ethernet

The PRUSS Ethernet driver would require different firmwares to
be loaded on different SoCs. Update the ti-prueth driver to use
different compatibles based on the SoC families, so that the
appropriate firmwares can be loaded on the different IDK boards.
Updates have been made to handle AM437x, AM571x and AM572x SoCs,
with AM571x and AM572x using the same firmwares.

he existing DTS node for AM57xx IDKs has been updated accordingly
as well. The firmware names are also updated to match the location
of the firmwares on the filesystem and to match their path on the
TI linux-firmware tree.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoMerge branch 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg into ti-linux...
Dan Murphy [Tue, 23 Feb 2016 00:53:55 +0000 (18:53 -0600)]
Merge branch 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg into ti-linux-4.1.y

TI-Feature: rpmsg
TI-Tree: git://git.ti.com/rpmsg/rpmsg.git
TI-Branch: rpmsg-ti-linux-4.1.y

* 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg:
  remoteproc/pru: change firmware names for PRUSS Ethernet

Signed-off-by: Dan Murphy <dmurphy@ti.com>
5 years agoMerge branch 'audio-display-ti-linux-4.1.y' of git.ti.com:~darrene/ti-linux-kernel...
LCPD Auto Merger [Mon, 22 Feb 2016 22:46:05 +0000 (16:46 -0600)]
Merge branch 'audio-display-ti-linux-4.1.y' of git.ti.com:~darrene/ti-linux-kernel/audio-display-linux-feature-tree into ti-linux-4.1.y

TI-Feature: audio-display
TI-Tree: git@git.ti.com:~darrene/ti-linux-kernel/audio-display-linux-feature-tree.git
TI-Branch: audio-display-ti-linux-4.1.y

* 'audio-display-ti-linux-4.1.y' of git.ti.com:~darrene/ti-linux-kernel/audio-display-linux-feature-tree:
  drm/omap: EBUSY status handling in omap_gem_fault()

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'rproc-linux-4.1.y' of git://git.ti.com/rpmsg/remoteproc into rpmsg...
Suman Anna [Mon, 22 Feb 2016 17:40:15 +0000 (11:40 -0600)]
Merge branch 'rproc-linux-4.1.y' of git://git.ti.com/rpmsg/remoteproc into rpmsg-ti-linux-4.1.y

Pull in the updated remoteproc feature branch that updates the firmware
names to be used for the PRUSS Ethernet usecase. This is done to match
the firmware location in the TI linux-firmware tree.

* 'rproc-linux-4.1.y' of git://git.ti.com/rpmsg/remoteproc:
  remoteproc/pru: change firmware names for PRUSS Ethernet

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/pru: change firmware names for PRUSS Ethernet
Suman Anna [Thu, 18 Feb 2016 20:17:12 +0000 (14:17 -0600)]
remoteproc/pru: change firmware names for PRUSS Ethernet

Change the firmware names to be used for the PRUSS Ethernet EMAC
functionality on AM437x and AM57xx IDK boards to reflect the
location of the firmwares on the filesystem and to match their
path on the TI linux-firmware tree.

The ti-prueth driver also needs to match these names.

Fixes: a7868b69a2e3 ("HACK: remoteproc/pru: use different firmware names for IDKs")
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agodrm/omap: EBUSY status handling in omap_gem_fault()
Rob Clark [Fri, 19 Feb 2016 13:59:29 +0000 (15:59 +0200)]
drm/omap: EBUSY status handling in omap_gem_fault()

Subsequent threads returning EBUSY from vm_insert_pfn() was not
handled correctly. As a result concurrent access from new threads
to mmapped data caused SIGBUS.

See e79e0fe380847493266fba557217e2773c61bd1b ("drm/i915: EBUSY status
handling added to i915_gem_fault()").

Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
5 years agoMerge branch 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel...
LCPD Auto Merger [Thu, 18 Feb 2016 20:58:59 +0000 (14:58 -0600)]
Merge branch 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.1.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-4.1.y

* 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  rtc: palmas: Drop IRQF_EARLY_RESUME flag
  extcon: palmas: Drop IRQF_EARLY_RESUME flag
  genirq: Don't suspend nested_thread irqs over system suspend
  regmap: irq: Enable irq retriggering for nested irqs
  ARM: OMAP2+: AM43XX: Enable fixes for Cortex-A9 erratas

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agortc: palmas: Drop IRQF_EARLY_RESUME flag
Grygorii Strashko [Thu, 18 Feb 2016 15:42:21 +0000 (09:42 -0600)]
rtc: palmas: Drop IRQF_EARLY_RESUME flag

This flag is not required for nested irqs anymore, since commit
3c646f2c6aa9 ("genirq: Don't suspend nested_thread irqs over system
suspend") was merged.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoextcon: palmas: Drop IRQF_EARLY_RESUME flag
Grygorii Strashko [Thu, 18 Feb 2016 15:42:20 +0000 (09:42 -0600)]
extcon: palmas: Drop IRQF_EARLY_RESUME flag

This flag is not required for nested irqs anymore, since commit
3c646f2c6aa9 ("genirq: Don't suspend nested_thread irqs over system
suspend") was merged.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agogenirq: Don't suspend nested_thread irqs over system suspend
NeilBrown [Thu, 18 Feb 2016 15:42:19 +0000 (09:42 -0600)]
genirq: Don't suspend nested_thread irqs over system suspend

commit 3c646f2c6aa9e918d7fc77867df7f430059f9ccc upstream.

Nested IRQs can only fire when the parent irq fires.  So when the
parent is suspended, there is no need to suspend the child irq.

Suspending nested irqs can cause a problem is they are suspended or
resumed in the wrong order.  If an interrupt fires while the parent is
active but the child is suspended, then the interrupt will not be
acknowledged properly and so an interrupt storm can result.  This is
particularly likely if the parent is resumed before the child, and the
interrupt was raised during suspend.

Ensuring correct ordering would be possible, but it is simpler to just
never suspend nested interrupts.

Signed-off-by: NeilBrown <neil@brown.name>
Cc: GTA04 owners <gta04-owner@goldelico.com>
Cc: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Link: http://lkml.kernel.org/r/20150517151934.2393e8f8@notabene.brown
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoregmap: irq: Enable irq retriggering for nested irqs
Grygorii Strashko [Thu, 18 Feb 2016 15:42:18 +0000 (09:42 -0600)]
regmap: irq: Enable irq retriggering for nested irqs

When nested interrupts are handled with regmap irq framework, we need to
mark the interrupts to be resend for pending interrupts on enable_irq.
Else the events will be lost for nested irqs.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
[nm@ti.com : commit message update]
Signed-off-by: Nishanth Menon <nm@ti.com>
5 years agoARM: OMAP2+: AM43XX: Enable fixes for Cortex-A9 erratas
Dave Gerlach [Thu, 18 Feb 2016 15:40:38 +0000 (09:40 -0600)]
ARM: OMAP2+: AM43XX: Enable fixes for Cortex-A9 erratas

This patch explicitly enables the fixes for the below erratas applicable
for AM43x Socs as was done for OMAP4.

754322: Faulty MMU translations following ASID switch

775420: A data cache maintenance operation which aborts,
        followed by an ISB, without any DSB in-between,
        might lead to deadlock

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoMerge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integrati...
LCPD Auto Merger [Tue, 16 Feb 2016 16:57:43 +0000 (10:57 -0600)]
Merge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.1.y

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

* 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  ti_config_fragments/baseport.cfg: enable DMA on 8250 UART
  tty: serial: 8250: omap: growable ring-buffer with watchdog
  tty: serial: 8250: omap: Switch to the new dmaengine_terminate_sync

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoti_config_fragments/baseport.cfg: enable DMA on 8250 UART
Sekhar Nori [Wed, 3 Feb 2016 15:28:27 +0000 (20:58 +0530)]
ti_config_fragments/baseport.cfg: enable DMA on 8250 UART

Enable DMA on 8250 UART. Boot tested on DRA74x, DRA72x,
BeagleBone black, BeagleBone, AM572x GP, AM572x IDK,
AM437x GP, AM437x SK, AM335x SK and AM335x EVMs.

Tested with suspend-to-RAM with RTC wake on BeagleBone black
and with RTC-only mode on AM437x GP EVM.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agotty: serial: 8250: omap: growable ring-buffer with watchdog
John Ogness [Wed, 3 Feb 2016 15:28:26 +0000 (20:58 +0530)]
tty: serial: 8250: omap: growable ring-buffer with watchdog

The ring buffer used for cyclic dma transfers will grow according
to the baud rate to allow at least 1 second of buffering. This way
a large (367KiB) buffer would only be created if very high baud
rates are used (3Mbit).

A hrtimer is used as a watchdog to check that the ring buffer is
being processed. If the watchdog triggers and sees there is
unprocessed data in the ring buffer, the DMA engine is paused.

If the watchdog sees that it itself experienced a latency such
that the ring buffer could have become more than half full, a
ring buffer overflow is assumed.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agotty: serial: 8250: omap: Switch to the new dmaengine_terminate_sync
Peter Ujfalusi [Fri, 12 Feb 2016 09:56:03 +0000 (11:56 +0200)]
tty: serial: 8250: omap: Switch to the new dmaengine_terminate_sync

By using the new dmaengine_terminate_sync() we can avoid dma completion
callback after the channel has been terminated.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoMerge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integrati...
LCPD Auto Merger [Tue, 16 Feb 2016 15:39:49 +0000 (09:39 -0600)]
Merge branch 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.1.y

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

* 'connectivity-ti-linux-4.1.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  ti_config_fragments/connectivity.cfg: Enable TLK10X Driver
  net: phy: dp83848: Add support for TI TLK10x Ethernet PHYs
  net: phy: dp83848: Add TI DP83848 Ethernet PHY
  Documentation: GPIO: Add TPIC2810 binding
  ti_config_fragments/connectivity.cfg: Enable PRU Ethernet driver
  net: prueth: Add TI PRUSS Ethernet driver
  ARM: dts: am57xx-idk-common: Add PRUSS Ethernet ports
  Documentation: dt: net: Add TI-PRUeth bindings

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge tag 'v4.1.18' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux...
Dan Murphy [Tue, 16 Feb 2016 14:53:38 +0000 (08:53 -0600)]
Merge tag 'v4.1.18' of git./linux/kernel/git/stable/linux-stable into ti-linux-4.1.y

Linux 4.1.18

* tag 'v4.1.18' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (229 commits)
  Linux 4.1.18
  X.509: Don't strip leading 00's from key ID when constructing key description
  radix-tree: fix oops after radix_tree_iter_retry
  mm: replace vma_lock_anon_vma with anon_vma_lock_read/write
  ocfs2/dlm: clear refmap bit of recovery lock while doing local recovery cleanup
  dump_stack: avoid potential deadlocks
  drm/i915: Take all modeset locks for DP MST hotplug
  drm/radeon: Take all modeset locks for DP MST hotplug
  drm/dp/mst: fixup handling hotplug on port removal.
  drm/dp/mst: Remove port after removing connector.
  drm/dp/mst: Calculate MST PBN with 31.32 fixed point
  drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil
  drm: fix missing reference counting decrease
  ARM: nomadik: fix up SD/MMC DT settings
  [media] saa7134-alsa: Only frees registered sound cards
  ALSA: timer: Fix leftover link at closing
  [media] tda1004x: only update the frontend properties if locked
  xhci: Fix list corruption in urb dequeue at host removal
  usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Broxton-M platforms
  usb: xhci: set SSIC port unused only if xhci_suspend succeeds
  ...

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Conflicts:
drivers/usb/host/xhci.h

5 years agoti_config_fragments/baseport.cfg: enable DMA on 8250 UART
Sekhar Nori [Wed, 3 Feb 2016 15:28:27 +0000 (20:58 +0530)]
ti_config_fragments/baseport.cfg: enable DMA on 8250 UART

Enable DMA on 8250 UART. Boot tested on DRA74x, DRA72x,
BeagleBone black, BeagleBone, AM572x GP, AM572x IDK,
AM437x GP, AM437x SK, AM335x SK and AM335x EVMs.

Tested with suspend-to-RAM with RTC wake on BeagleBone black
and with RTC-only mode on AM437x GP EVM.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agotty: serial: 8250: omap: growable ring-buffer with watchdog
John Ogness [Wed, 3 Feb 2016 15:28:26 +0000 (20:58 +0530)]
tty: serial: 8250: omap: growable ring-buffer with watchdog

The ring buffer used for cyclic dma transfers will grow according
to the baud rate to allow at least 1 second of buffering. This way
a large (367KiB) buffer would only be created if very high baud
rates are used (3Mbit).

A hrtimer is used as a watchdog to check that the ring buffer is
being processed. If the watchdog triggers and sees there is
unprocessed data in the ring buffer, the DMA engine is paused.

If the watchdog sees that it itself experienced a latency such
that the ring buffer could have become more than half full, a
ring buffer overflow is assumed.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agotty: serial: 8250: omap: Switch to the new dmaengine_terminate_sync
Peter Ujfalusi [Fri, 12 Feb 2016 09:56:03 +0000 (11:56 +0200)]
tty: serial: 8250: omap: Switch to the new dmaengine_terminate_sync

By using the new dmaengine_terminate_sync() we can avoid dma completion
callback after the channel has been terminated.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoMerge branch 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel...
LCPD Auto Merger [Tue, 16 Feb 2016 11:42:50 +0000 (05:42 -0600)]
Merge branch 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.1.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-4.1.y

* 'platform-ti-linux-4.1.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  dmaengine: omap-dma: Implement device_synchronize callback
  dmaengine: edma: Implement device_synchronize callback
  dmaengine: edma: Fetch echan->edesc while holding lock in edma_comletion_handler
  dmaengine: Add might_sleep() to dmaengine_synchronize()
  dmaengine: virt-dma: Add synchronization helper function
  dmaengine: Add transfer termination synchronization support
  thermal: omap-thermal: Add notify function to thermal_zone_device_ops
  ARM: DRA7: hwmod: Make rng hwmod non-secure only
  ARM: OMAP2+: sleep43xx: Add RTC access to avoid TLB miss during off path

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoti_config_fragments/connectivity.cfg: Enable TLK10X Driver
Andrew F. Davis [Fri, 5 Feb 2016 23:24:17 +0000 (17:24 -0600)]
ti_config_fragments/connectivity.cfg: Enable TLK10X Driver

AM437x, AM571x, and AM572x IDKs have this part.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agonet: phy: dp83848: Add support for TI TLK10x Ethernet PHYs
Andrew F. Davis [Fri, 5 Feb 2016 23:24:16 +0000 (17:24 -0600)]
net: phy: dp83848: Add support for TI TLK10x Ethernet PHYs

The TI TLK10x Ethernet PHYs are similar in the interrupt relevant
registers and so are compatible with the DP83848x devices already
supported. Add these and re-order code to support additional PHYs.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agonet: phy: dp83848: Add TI DP83848 Ethernet PHY
Andrew F. Davis [Fri, 5 Feb 2016 23:24:15 +0000 (17:24 -0600)]
net: phy: dp83848: Add TI DP83848 Ethernet PHY

commit 34e45ad9378c31ef2b59e8bd63d62f0ca8e719a3 upstream.

Add support for the TI DP83848 Ethernet PHY device.

The DP83848 is a highly reliable, feature rich, IEEE 802.3 compliant
single port 10/100 Mb/s Ethernet Physical Layer Transceiver supporting
the MII and RMII interfaces.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agodmaengine: omap-dma: Implement device_synchronize callback
Peter Ujfalusi [Fri, 12 Feb 2016 09:56:02 +0000 (11:56 +0200)]
dmaengine: omap-dma: Implement device_synchronize callback

We need the callback to support the dmaengine_terminate_sync().

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agodmaengine: edma: Implement device_synchronize callback
Peter Ujfalusi [Fri, 12 Feb 2016 09:56:01 +0000 (11:56 +0200)]
dmaengine: edma: Implement device_synchronize callback

We need the callback to support the dmaengine_terminate_sync().

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agodmaengine: edma: Fetch echan->edesc while holding lock in edma_comletion_handler
Peter Ujfalusi [Fri, 12 Feb 2016 09:56:00 +0000 (11:56 +0200)]
dmaengine: edma: Fetch echan->edesc while holding lock in edma_comletion_handler

In order to avoid possible race condition when client drivers are using
dmaengine_terminate_sync() call to disable the channel.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
5 years agodmaengine: Add might_sleep() to dmaengine_synchronize()
Lars-Peter Clausen [Fri, 12 Feb 2016 09:55:59 +0000 (11:55 +0200)]
dmaengine: Add might_sleep() to dmaengine_synchronize()

commit 4255384f48a2a86e7dccd0103a4e9e0dc9c0e9d3 upstream.

Implementations of dmaengine_synchronize() are allowed to sleep, hence the
function must not be called to from atomic context. Add might_sleep() to
dmaengine_synchronize() to make it easier to detect non-compliant callers.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agodmaengine: virt-dma: Add synchronization helper function
Lars-Peter Clausen [Fri, 12 Feb 2016 09:55:58 +0000 (11:55 +0200)]
dmaengine: virt-dma: Add synchronization helper function

commit 2ed086296e60c3ca9a63a025701f4d104f4ced85 upstream.

Add a synchronize helper function for the virt-dma library. The function
makes sure that any scheduled descriptor complete callbacks have finished
running before the function returns.

This needs to be called by drivers using virt-dma in their
device_synchronize() callback. Depending on the driver additional
operations might be necessary in addition to calling vchan_synchronize() to
ensure proper synchronization.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agodmaengine: Add transfer termination synchronization support
Lars-Peter Clausen [Fri, 12 Feb 2016 09:55:57 +0000 (11:55 +0200)]
dmaengine: Add transfer termination synchronization support

commit b36f09c3c441a6e59eab9315032e7d546571de3f upstream.

The DMAengine API has a long standing race condition that is inherent to
the API itself. Calling dmaengine_terminate_all() is supposed to stop and
abort any pending or active transfers that have previously been submitted.
Unfortunately it is possible that this operation races against a currently
running (or with some drivers also scheduled) completion callback.

Since the API allows dmaengine_terminate_all() to be called from atomic
context as well as from within a completion callback it is not possible to
synchronize to the execution of the completion callback from within
dmaengine_terminate_all() itself.

This means that a user of the DMAengine API does not know when it is safe
to free resources used in the completion callback, which can result in a
use-after-free race condition.

This patch addresses the issue by introducing an explicit synchronization
primitive to the DMAengine API called dmaengine_synchronize().

The existing dmaengine_terminate_all() is deprecated in favor of
dmaengine_terminate_sync() and dmaengine_terminate_async(). The former
aborts all pending and active transfers and synchronizes to the current
context, meaning it will wait until all running completion callbacks have
finished. This means it is only possible to call this function from
non-atomic context. The later function does not synchronize, but can still
be used in atomic context or from within a complete callback. It has to be
followed up by dmaengine_synchronize() before a client can free the
resources used in a completion callback.

In addition to this the semantics of the device_terminate_all() callback
are slightly relaxed by this patch. It is now OK for a driver to only
schedule the termination of the active transfer, but does not necessarily
have to wait until the DMA controller has completely stopped. The driver
must ensure though that the controller has stopped and no longer accesses
any memory when the device_synchronize() callback returns.

This was in part done since most drivers do not pay attention to this
anyway at the moment and to emphasize that this needs to be done when the
device_synchronize() callback is implemented. But it also helps with
implementing support for devices where stopping the controller can require
operations that may sleep.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agoDocumentation: GPIO: Add TPIC2810 binding
Andrew F. Davis [Mon, 15 Feb 2016 15:41:46 +0000 (09:41 -0600)]
Documentation: GPIO: Add TPIC2810 binding

Add binding for TPIC2810 GPO device.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoti_config_fragments/connectivity.cfg: Enable PRU Ethernet driver
Roger Quadros [Tue, 16 Feb 2016 00:44:17 +0000 (18:44 -0600)]
ti_config_fragments/connectivity.cfg: Enable PRU Ethernet driver

Add the configuration to build the PRU Ethernet driver as a
module to support the PRU Ethernet ports available on various
AMxxxx IDK boards.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agonet: prueth: Add TI PRUSS Ethernet driver
Roger Quadros [Tue, 16 Feb 2016 00:44:16 +0000 (18:44 -0600)]
net: prueth: Add TI PRUSS Ethernet driver

This driver brings dual-EMAC or Switch functionality
on TI IDK boards that support Ethernet over PRUSS.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoARM: dts: am57xx-idk-common: Add PRUSS Ethernet ports
Roger Quadros [Tue, 16 Feb 2016 00:44:15 +0000 (18:44 -0600)]
ARM: dts: am57xx-idk-common: Add PRUSS Ethernet ports

Add PRUSS Ethernet ports on ICSS2. We don't add the
ICSS1 ethernet ports as they are not connected to the
SoC by default on the AM57xx IDKs.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoDocumentation: dt: net: Add TI-PRUeth bindings
Andrew F. Davis [Tue, 16 Feb 2016 00:44:14 +0000 (18:44 -0600)]
Documentation: dt: net: Add TI-PRUeth bindings

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agothermal: omap-thermal: Add notify function to thermal_zone_device_ops
Keerthy [Thu, 11 Feb 2016 06:21:10 +0000 (11:51 +0530)]
thermal: omap-thermal: Add notify function to thermal_zone_device_ops

notify function is used to notify when some temperature thresholds
are crossed. In case we get notified for a critical trip point then
schedule an emergency shutdown function to backup orderly_poweroff
failures.

orderly_poweroff is triggered when a graceful shutdown
of system is desired. This may be used in many critical states of the
kernel such as when subsystems detects conditions such as critical
temperature conditions. However, in certain conditions in system
boot up sequences like those in the middle of driver probes being
initiated, userspace will be unable to power off the system in a clean
manner and leaves the system in a critical state. In cases like these,
the /sbin/poweroff will return success (having forked off to attempt
powering off the system. However, the system overall will fail to
completely poweroff (since other modules will be probed) and the system
is still functional with no userspace (since that would have shut itself
off).

However, there is no clean way of detecting such failure of userspace
powering off the system. In such scenarios, it is necessary for a backup
workqueue to be able to force a shutdown of the system when orderly
shutdown is not successful after a configurable time period.

fixes: LCPD-5512

Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: DRA7: hwmod: Make rng hwmod non-secure only
Daniel Allred [Fri, 12 Feb 2016 14:19:50 +0000 (08:19 -0600)]
ARM: DRA7: hwmod: Make rng hwmod non-secure only

If running on a non-secure (GP) device, the hwmod for the
hardware RNG should be initialized. It should NOT be used
on secure (HS) devices as it will be firewalled for secure
world use. The RNG is not as nice as other crypto modules (AES,
SHA) which have secure and public interfaces, with the public
interfaces opened to the public world (Linux kernel) and the
secure interfaces firewalled to be used by the secure world only.

Giving access to the RNG from the public world could pose a
security risk for the secure world (by reducing the randomness
available through manipulation of the RNG config), therefore
the firewall is set to enforce no public access on HS devices.

Signed-off-by: Daniel Allred <d-allred@ti.com>
5 years agoARM: OMAP2+: sleep43xx: Add RTC access to avoid TLB miss during off path
Dave Gerlach [Thu, 11 Feb 2016 02:49:38 +0000 (20:49 -0600)]
ARM: OMAP2+: sleep43xx: Add RTC access to avoid TLB miss during off path

On AM437x, when entering RTC+DDR mode, we run the risk of a TLB miss
after the DDR has been placed in self-refresh when attempting to read
the RTC_PMIC register to power down the SoC. If this happens a page
table walk is attempted which leads to a system hang due to the page
tables and DDR not being available. We can fix this by accessing the RTC
address space before shutting off the EMIF to ensure the virtual address
mapping is fresh in the TLB.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
5 years agoMerge branch 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg into ti-linux...
LCPD Auto Merger [Tue, 16 Feb 2016 07:35:01 +0000 (01:35 -0600)]
Merge branch 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg into ti-linux-4.1.y

TI-Feature: rpmsg
TI-Tree: git://git.ti.com/rpmsg/rpmsg.git
TI-Branch: rpmsg-ti-linux-4.1.y

* 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg:
  remoteproc/pruss: enable OCP master ports in SYSCFG
  HACK: remoteproc/pru: use different firmware names for IDKs
  HACK: remoteproc/pru: do not auto-boot PRU cores on IDKs
  TEMP: remoteproc/pru: add pru_rproc_set_ctable() function
  remoteproc/pruss: add apis to set GPI mode, MII_RT_event and XFR
  TEMP: remoteproc/pruss: add pruss_host_to_mpu_irq()
  remoteproc/pruss: add pruss_intc_sysevent_{irqenable,irqdisable,check,clear}
  remoteproc/pruss: add pruss_{request,release}_mem_region() API
  remoteproc/pruss: add pruss_rproc_boot/halt() API
  remoteproc/pruss: add APIs to get and set the PRU cores
  ARM: dts: AM33xx/AM437x/DRA7: Rename PRU nodes
  remoteproc/pruss: add pruss_get()/put() API

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'rproc-linux-4.1.y' of git://git.ti.com/rpmsg/remoteproc into rpmsg...
Suman Anna [Tue, 16 Feb 2016 05:37:20 +0000 (23:37 -0600)]
Merge branch 'rproc-linux-4.1.y' of git://git.ti.com/rpmsg/remoteproc into rpmsg-ti-linux-4.1.y

Pull in the updated remoteproc feature branch that exposes new APIs
from the PRUSS remoteproc drivers to enable the PRUSS Ethernet driver
to be able to load and boot a Ethernet-specific firmwares onto the
PRUs.

* 'rproc-linux-4.1.y' of git://git.ti.com/rpmsg/remoteproc:
  remoteproc/pruss: enable OCP master ports in SYSCFG
  HACK: remoteproc/pru: use different firmware names for IDKs
  HACK: remoteproc/pru: do not auto-boot PRU cores on IDKs
  TEMP: remoteproc/pru: add pru_rproc_set_ctable() function
  remoteproc/pruss: add apis to set GPI mode, MII_RT_event and XFR
  TEMP: remoteproc/pruss: add pruss_host_to_mpu_irq()
  remoteproc/pruss: add pruss_intc_sysevent_{irqenable,irqdisable,check,clear}
  remoteproc/pruss: add pruss_{request,release}_mem_region() API
  remoteproc/pruss: add pruss_rproc_boot/halt() API
  remoteproc/pruss: add APIs to get and set the PRU cores
  ARM: dts: AM33xx/AM437x/DRA7: Rename PRU nodes
  remoteproc/pruss: add pruss_get()/put() API

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/pruss: enable OCP master ports in SYSCFG
Suman Anna [Sun, 14 Feb 2016 00:56:14 +0000 (18:56 -0600)]
remoteproc/pruss: enable OCP master ports in SYSCFG

The PRUSS CFG module's SYSCFG register is used for managing the
PRCM clock management settings at the PRU-ICSS subsystem level.

Add two helper functions pruss_{enable/disable}_module() that
programs this SYSCFG register. The register is currently programmed
to enable the OCP master ports (disable MStandby), and for the
default Smart-Idle and Smart-Standby. The Ethernet usecase does
not have Rx working without enabling the OCP master ports.

NOTE:
1. The AM57xx TRM suggests to enable "No Standby" during the
   Idle + Standby state to an Active/Normal state, but this
   sequence is not documented in either of AM33xx and AM437x
   SoCs. Furthermore, it did not have an impact on the working
   of Ethernet Rx, so is left out.
2. This breaks the PM suspend/resume operation on AM33xx (verified)
   and possibly on AM437x SoC even when the PRU cores are in
   halted state. The STANDBY_INIT has to be re-programmed to
   initiate a standby sequence and have the PM suspend/resume
   functional when PRUs are halted.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: remove no-standby state]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoHACK: remoteproc/pru: use different firmware names for IDKs
Suman Anna [Thu, 4 Feb 2016 23:58:29 +0000 (17:58 -0600)]
HACK: remoteproc/pru: use different firmware names for IDKs

The PRUSS Ethernet usecase is currently designed to have the PRUSS
ethernet driver perform the load and boot of a PRU device (in the
expected fashion when a firmware doesn't support virtio devices),
though the ethernet driver wants to use its own firmware name. The
remoteproc core instrastructure currently does the loading as a
two-step process with the resource table processed and cached the
first step, and a CRC-based cross-check in the second step. The
ethernet driver fails to load an image properly due to either a
mismatched resource table or a complete absence of a resource table.

Add a work-around to the PRU remoteproc driver to enable the Ethernet
usecases by using matching firmware names for supported IDKs. This
is based on the assumption that the supported IDKs will be running
only Ethernet usecases for the moment. This solution was preferred
rather than making any remoteproc core changes so as to not affect
other existing remoteproc drivers.

Real fix will need restructuring work done on the remoteproc core to
facilitate client provided firmware names at run-time and not rely
on firmware names provided at respective platform driver probe time.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoHACK: remoteproc/pru: do not auto-boot PRU cores on IDKs
Andrew F. Davis [Fri, 8 Jan 2016 20:17:56 +0000 (14:17 -0600)]
HACK: remoteproc/pru: do not auto-boot PRU cores on IDKs

The PRUSS Ethernet usecase is currently designed to have the ethernet
driver perform the boot of a PRU device (in the expected fashion when
a firmware doesn't support virtio devices). The commit ad6bf515e79f
("remoteproc/pruss: manage PRUs without virtio devices manually") has
provided a temporary mechanism to manage the boot cycle of PRU cores
running firmwares without any virtio devices previously for generic
usecases.

It cannot be currently determined whether the PRUs are being used for
an Ethernet usecase or the previously supported generic usecases, so
make a decision using the assumption that Ethernet usecases are to
be supported only on IDK boards. This assumption itself is not solid
though and is not scalable, it is only made on the premises that the
supported IDKs will be running only Ethernet usecases.

Real fix will need restructuring work done on the remoteproc core and
a rework on the PRUSS remoteproc driver architecture to meet its
varying usecases.

Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: revise commit description]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoTEMP: remoteproc/pru: add pru_rproc_set_ctable() function
Roger Quadros [Mon, 21 Dec 2015 18:25:22 +0000 (23:55 +0530)]
TEMP: remoteproc/pru: add pru_rproc_set_ctable() function

Some firmware e.g. pru_ethernet expects OS to configure the
CTABLE entries. In particular C28 and C30 that point to
Shared RAM and System SRAM (OCMC) areas.

Provide a way for users to do that.

NOTE:
This probably should be restricted to the PRU firmwares, as
typically they will be re-programming these when dealing with
a certain block of memory. For one-time configuration, the
client driver and firmware can probably use a fixed address
location in shared memory.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: add the NOTE: on patch description, minor cleanups]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/pruss: add apis to set GPI mode, MII_RT_event and XFR
Roger Quadros [Mon, 21 Dec 2015 18:25:29 +0000 (23:55 +0530)]
remoteproc/pruss: add apis to set GPI mode, MII_RT_event and XFR

Certain configuration bits lie in PRUSS CFG module space which is
owned by the PRUSS remoteproc driver. Provide APIs to set GPI mode,
MII_RT event enable/disable and XFR (XIN XOUT) enable/disable to
enable the PRUSS Ethernet usecase.

NOTE:
These API can probably be eliminated in a future version by
representing the PRUSS CFG module as a SYSCON node.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
[balbi@ti.com: logic simplification in pruss_cfg_gpimode()]
Signed-off-by: Felipe Balbi <balbi@ti.com>
[s-anna@ti.com: GPCFG register definitions, code cleanup]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoTEMP: remoteproc/pruss: add pruss_host_to_mpu_irq()
Suman Anna [Mon, 11 Jan 2016 22:45:50 +0000 (16:45 -0600)]
TEMP: remoteproc/pruss: add pruss_host_to_mpu_irq()

Add a new API, pruss_host_to_mpu_irq(), that returns the MPU IRQ
number for a given PRUSS host interrupt number. This allows the
clients to deal with interrupts directly. The INTC is expected to
be configured through the resource table INTC configuration data.

NOTE:
1. This drops the default interrupt handling in the PRUSS core.
2. The clients are supposed to be requesting the interrupts using
   IRQF_SHARED, and handle the interrupts after checking for the
   interrupt trigger source to be their system events.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: fixup the function to account for AM437x, revise commit]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/pruss: add pruss_intc_sysevent_{irqenable,irqdisable,check,clear}
Andrew F. Davis [Mon, 11 Jan 2016 22:27:32 +0000 (16:27 -0600)]
remoteproc/pruss: add pruss_intc_sysevent_{irqenable,irqdisable,check,clear}

The PRUSS interrupt generation follows a cascaded model of PRUSS events to
interrupt channel mapping (many-to-one), and interrupt channel to host
interrupt mapping (many-to-one), with the primary interrupt sources being
the individual events themselves.

Client users may want to selectively enable/disable IRQ generation by such
a sysevent. Add APIs to provide the same. API has also been added to allow
the users to check and clear their interrupt sources.

NOTE:
This probably can be done better by limiting the API to registration and
unregistration of event callbacks, with the PRUSS core managing all the
interrupts, or through a irqchip/irqdomain implementation exposing standard
API. These improvements are left for later.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: rewrite commit description]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/pruss: add pruss_{request,release}_mem_region() API
Andrew F. Davis [Mon, 11 Jan 2016 22:18:38 +0000 (16:18 -0600)]
remoteproc/pruss: add pruss_{request,release}_mem_region() API

Add two new API - pruss_request_mem_region() & pruss_release_mem_region(),
to the PRUSS platform driver to allow client drivers to acquire and release
the common memory resources present within a PRU-ICSS subsystem. This
allows the client drivers to directly manipulate the respective memories,
as per their design contract with the associated firmware.

Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: rename functions, add error checking, comments]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/pruss: add pruss_rproc_boot/halt() API
Roger Quadros [Mon, 21 Dec 2015 18:25:31 +0000 (23:55 +0530)]
remoteproc/pruss: add pruss_rproc_boot/halt() API

Certain PRU applications might want to access and configure
memory regions before booting the PRU processor. Provide two
new APIs in the PRUSS driver - pruss_rproc_boot() and
pruss_rproc_halt() to perform the same.

The former takes in a rproc handle obtained using the
pruss_rproc_get() API, and also supplies a firmware name
to be loaded and booted. The latter is used for halting
the previously booted PRU remoteproc.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: add error checking, revise comments, cleanup]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/pruss: add APIs to get and set the PRU cores
Roger Quadros [Mon, 21 Dec 2015 18:25:17 +0000 (23:55 +0530)]
remoteproc/pruss: add APIs to get and set the PRU cores

Add two new get and put API, pruss_rproc_get() and pruss_rproc_put(),
to the PRUSS platform driver to allow client drivers to acquire and
release the remoteproc device associated with a PRU core. The PRU
cores are treated as resources with only one client owning it at
a time.

The pruss_rproc_get() function returns the rproc handle corresponding
to a PRU core identified by its id number. The pruss_rproc_put() is
the complimentary function to pruss_rproc_get().

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: error checking, cleanup, add commit description]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: dts: AM33xx/AM437x/DRA7: Rename PRU nodes
Andrew F. Davis [Mon, 18 Jan 2016 20:46:36 +0000 (14:46 -0600)]
ARM: dts: AM33xx/AM437x/DRA7: Rename PRU nodes

Each of the PRU child nodes has been renamed from the
generic name 'pru' to a core-specific 'pru0' or 'pru1'
name. This allows them to be identified and looked up
specifically using name.

NOTE:
The DT specification in general does not require that
different instances be named accordingly, but this is
being done at present to support the new API that will
be added to support the PRUSS Ethernet usecases. The
normal way to use a device would be to use the phandle
approach in DT.

Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: revise binding and commit description]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/pruss: add pruss_get()/put() API
Roger Quadros [Mon, 21 Dec 2015 18:25:19 +0000 (23:55 +0530)]
remoteproc/pruss: add pruss_get()/put() API

Add two new get and put API, pruss_get() and pruss_put(), to the
PRUSS platform driver to allow client drivers to request a handle
to a PRUSS device. This handle will be used by client drivers to
request various operations of the PRUSS platform driver through
additional API that will be added in the following patches.

The pruss_get() function returns the pruss handle corresponding
to a PRUSS device referenced by the PRUSS phandle in the "pruss"
property of the client device's DT node. The pruss_put() is the
complimentary function to pruss_get().

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
[s-anna@ti.com: error checking, few other minor fixes]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoMerge branch 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg into ti-linux...
LCPD Auto Merger [Mon, 15 Feb 2016 23:32:52 +0000 (17:32 -0600)]
Merge branch 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg into ti-linux-4.1.y

TI-Feature: rpmsg
TI-Tree: git://git.ti.com/rpmsg/rpmsg.git
TI-Branch: rpmsg-ti-linux-4.1.y

* 'rpmsg-ti-linux-4.1.y' of git://git.ti.com/rpmsg/rpmsg:
  ti_config_fragments: rpmsg: Enable PRUSS remoteproc support
  ARM: dts: DRA7: Add PRUSS MDIO controller nodes
  ARM: dts: AM4372: Add PRUSS MDIO controller node
  ARM: dts: AM33xx: Add PRUSS MDIO controller node
  remoteproc/pruss: add support to parse IEP & MII_RT resources
  ARM: dts: DRA7: Add PRUSS IEP and MII_RT resources
  ARM: dts: AM4372: Add PRUSS IEP and MII_RT resources
  ARM: dts: AM33xx: Add PRUSS IEP and MII_RT resources
  Documentation: dt: Update PRUSS remoteproc bindings
  remoteproc/pruss: fix up the INTC configuration per PRU core
  remoteproc/pruss: split out PRU remoteproc driver from PRUSS subsystem driver
  remoteproc/pruss: store device pointer instead of platform_device
  remoteproc/pruss: group interrupt mapping information into a new structure
  remoteproc/pruss: group memory regions information into a new structure
  remoteproc/pruss: use {upper,lower}_32_bits()
  remoteproc/pruss: purge userspace types
  remoteproc/pruss: remove dead rproc_put() in pruss probe
  remoteproc/pruss: drop pru_trigger_interrupt() function
  remoteproc/pruss: fix couple of NULL pointer dereferences

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoLinux 4.1.18 v4.1.18
Sasha Levin [Mon, 15 Feb 2016 20:46:24 +0000 (15:46 -0500)]
Linux 4.1.18

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoX.509: Don't strip leading 00's from key ID when constructing key description
David Howells [Fri, 25 Sep 2015 15:31:46 +0000 (16:31 +0100)]
X.509: Don't strip leading 00's from key ID when constructing key description

[ Upstream commit e7c87bef7de2417b219d4dbfe8d33a0098a8df54 ]

Don't strip leading zeros from the crypto key ID when using it to construct
the struct key description as the signature in kernels up to and including
4.2 matched this aspect of the key.  This means that 1 in 256 keys won't
actually match if their key ID begins with 00.

The key ID is stored in the module signature as binary and so must be
converted to text in order to invoke request_key() - but it isn't stripped
at this point.

Something like this is likely to be observed in dmesg when the key is loaded:

[    1.572423] Loaded X.509 cert 'Build time autogenerated kernel
    key: 62a7c3d2da278be024da4af8652c071f3fea33'

followed by this when we try and use it:

  [    1.646153] Request for unknown module key 'Build time autogenerated
    kernel key: 0062a7c3d2da278be024da4af8652c071f3fea33' err -11

The 'Loaded' line should show an extra '00' on the front of the hex string.

This problem should not affect 4.3-rc1 and onwards because there the key
should be matched on one of its auxiliary identities rather than the key
struct's description string.

Reported-by: Arjan van de Ven <arjan@linux.intel.com>
Reported-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoradix-tree: fix oops after radix_tree_iter_retry
Konstantin Khlebnikov [Fri, 5 Feb 2016 23:37:01 +0000 (15:37 -0800)]
radix-tree: fix oops after radix_tree_iter_retry

[ Upstream commit 732042821cfa106b3c20b9780e4c60fee9d68900 ]

Helper radix_tree_iter_retry() resets next_index to the current index.
In following radix_tree_next_slot current chunk size becomes zero.  This
isn't checked and it tries to dereference null pointer in slot.

Tagged iterator is fine because retry happens only at slot 0 where tag
bitmask in iter->tags is filled with single bit.

Fixes: 46437f9a554f ("radix-tree: fix race in gang lookup")
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Jeremiah Mahler <jmmahler@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agomm: replace vma_lock_anon_vma with anon_vma_lock_read/write
Konstantin Khlebnikov [Fri, 5 Feb 2016 23:36:50 +0000 (15:36 -0800)]
mm: replace vma_lock_anon_vma with anon_vma_lock_read/write

[ Upstream commit 12352d3cae2cebe18805a91fab34b534d7444231 ]

Sequence vma_lock_anon_vma() - vma_unlock_anon_vma() isn't safe if
anon_vma appeared between lock and unlock.  We have to check anon_vma
first or call anon_vma_prepare() to be sure that it's here.  There are
only few users of these legacy helpers.  Let's get rid of them.

This patch fixes anon_vma lock imbalance in validate_mm().  Write lock
isn't required here, read lock is enough.

And reorders expand_downwards/expand_upwards: security_mmap_addr() and
wrapping-around check don't have to be under anon vma lock.

Link: https://lkml.kernel.org/r/CACT4Y+Y908EjM2z=706dv4rV6dWtxTLK9nFg9_7DhRMLppBo2g@mail.gmail.com
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoocfs2/dlm: clear refmap bit of recovery lock while doing local recovery cleanup
xuejiufei [Fri, 5 Feb 2016 23:36:47 +0000 (15:36 -0800)]
ocfs2/dlm: clear refmap bit of recovery lock while doing local recovery cleanup

[ Upstream commit c95a51807b730e4681e2ecbdfd669ca52601959e ]

When recovery master down, dlm_do_local_recovery_cleanup() only remove
the $RECOVERY lock owned by dead node, but do not clear the refmap bit.
Which will make umount thread falling in dead loop migrating $RECOVERY
to the dead node.

Signed-off-by: xuejiufei <xuejiufei@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodump_stack: avoid potential deadlocks
Eric Dumazet [Fri, 5 Feb 2016 23:36:16 +0000 (15:36 -0800)]
dump_stack: avoid potential deadlocks

[ Upstream commit d7ce36924344ace0dbdc855b1206cacc46b36d45 ]

Some servers experienced fatal deadlocks because of a combination of
bugs, leading to multiple cpus calling dump_stack().

The checksumming bug was fixed in commit 34ae6a1aa054 ("ipv6: update
skb->csum when CE mark is propagated").

The second problem is a faulty locking in dump_stack()

CPU1 runs in process context and calls dump_stack(), grabs dump_lock.

   CPU2 receives a TCP packet under softirq, grabs socket spinlock, and
   call dump_stack() from netdev_rx_csum_fault().

   dump_stack() spins on atomic_cmpxchg(&dump_lock, -1, 2), since
   dump_lock is owned by CPU1

While dumping its stack, CPU1 is interrupted by a softirq, and happens
to process a packet for the TCP socket locked by CPU2.

CPU1 spins forever in spin_lock() : deadlock

Stack trace on CPU1 looked like :

    NMI backtrace for cpu 1
    RIP: _raw_spin_lock+0x25/0x30
    ...
    Call Trace:
      <IRQ>
      tcp_v6_rcv+0x243/0x620
      ip6_input_finish+0x11f/0x330
      ip6_input+0x38/0x40
      ip6_rcv_finish+0x3c/0x90
      ipv6_rcv+0x2a9/0x500
      process_backlog+0x461/0xaa0
      net_rx_action+0x147/0x430
      __do_softirq+0x167/0x2d0
      call_softirq+0x1c/0x30
      do_softirq+0x3f/0x80
      irq_exit+0x6e/0xc0
      smp_call_function_single_interrupt+0x35/0x40
      call_function_single_interrupt+0x6a/0x70
      <EOI>
      printk+0x4d/0x4f
      printk_address+0x31/0x33
      print_trace_address+0x33/0x3c
      print_context_stack+0x7f/0x119
      dump_trace+0x26b/0x28e
      show_trace_log_lvl+0x4f/0x5c
      show_stack_log_lvl+0x104/0x113
      show_stack+0x42/0x44
      dump_stack+0x46/0x58
      netdev_rx_csum_fault+0x38/0x3c
      __skb_checksum_complete_head+0x6e/0x80
      __skb_checksum_complete+0x11/0x20
      tcp_rcv_established+0x2bd5/0x2fd0
      tcp_v6_do_rcv+0x13c/0x620
      sk_backlog_rcv+0x15/0x30
      release_sock+0xd2/0x150
      tcp_recvmsg+0x1c1/0xfc0
      inet_recvmsg+0x7d/0x90
      sock_recvmsg+0xaf/0xe0
      ___sys_recvmsg+0x111/0x3b0
      SyS_recvmsg+0x5c/0xb0
      system_call_fastpath+0x16/0x1b

Fixes: b58d977432c8 ("dump_stack: serialize the output from dump_stack()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodrm/i915: Take all modeset locks for DP MST hotplug
Daniel Vetter [Thu, 9 Jul 2015 21:44:31 +0000 (23:44 +0200)]
drm/i915: Take all modeset locks for DP MST hotplug

[ Upstream commit 8bb4da1df54a20d68c34427356e34315ba122c0f ]

While auditing various users of the connector/encoder lists I realized
that the atomic code is a very prolific user of them. And it only ever
grabs the mode_config->connection_mutex, but not the
mode_config->mutex like all the other code walking encoder/connector
lists.

The problem is that we can't grab the mode_config.mutex late in atomic
code since that would lead to locking inversions. And we don't want to
grab it unconditionally like the legacy set_config modeset path since
that would render all the fine-grained locking moot.

Instead just grab more locks in the dp mst hotplug code. Note that
drm_connector_init (which is the one adding the connector to these
lists) already uses drm_modeset_lock_all.

The other reason for grabbing all locks is that the dpms off in the
unplug function amounts to a modeset, so better to take all required
locks for that.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodrm/radeon: Take all modeset locks for DP MST hotplug
Daniel Vetter [Thu, 9 Jul 2015 21:44:32 +0000 (23:44 +0200)]
drm/radeon: Take all modeset locks for DP MST hotplug

[ Upstream commit 2ee6bcdcfa4d8b56b20bc6308cd5f9bced5b5324 ]

Similar with the i915 take all modeset locks for mst hotplug. This is
needed to make sure radeon holds both mode_config.mutex and
mode_config.connection_mutex when updating the connector_list, which
is the new (interim) locking regime we want for that.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodrm/dp/mst: fixup handling hotplug on port removal.
Dave Airlie [Wed, 16 Sep 2015 00:37:28 +0000 (10:37 +1000)]
drm/dp/mst: fixup handling hotplug on port removal.

[ Upstream commit df4839fdc9b3c922586b945f062f38cbbda022bb ]

output ports should always have a connector, unless
in the rare case connector allocation fails in the
driver.

In this case we only need to teardown the pdt,
and free the struct, and there is no need to
send a hotplug msg.

In the case were we add the port to the destroy
list we need to send a hotplug if we destroy
any connectors, so userspace knows to reprobe
stuff.

this patch also handles port->connector allocation
failing which should be a rare event, but makes
the code consistent.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodrm/dp/mst: Remove port after removing connector.
Maarten Lankhorst [Tue, 11 Aug 2015 07:54:29 +0000 (09:54 +0200)]
drm/dp/mst: Remove port after removing connector.

[ Upstream commit 4772ff03df8094fd99d28de5fcf5df3a3e9c68bb ]

The port is removed synchronously, but the connector delayed.
This causes a use after free which can cause a kernel BUG with
slug_debug=FPZU. This is fixed by freeing the port after the
connector.

This fixes a regression introduced with
6b8eeca65b18ae77e175cc2b6571731f0ee413bf
"drm/dp/mst: close deadlock in connector destruction."

Cc: stable@vger.kernel.org
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodrm/dp/mst: Calculate MST PBN with 31.32 fixed point
Harry Wentland [Fri, 22 Jan 2016 22:07:26 +0000 (17:07 -0500)]
drm/dp/mst: Calculate MST PBN with 31.32 fixed point

[ Upstream commit a9ebb3e46c7ef6112c0da466ef0954673ad36832 ]

Our PBN value overflows the 20 bits integer part of the 20.12
fixed point. We need to use 31.32 fixed point to avoid this.

This happens with display clocks larger than 293122 (at 24 bpp),
which we see with the Sharp (and similar) 4k tiled displays.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodrm: Add drm_fixp_from_fraction and drm_fixp2int_ceil
Harry Wentland [Fri, 22 Jan 2016 22:07:25 +0000 (17:07 -0500)]
drm: Add drm_fixp_from_fraction and drm_fixp2int_ceil

[ Upstream commit 64566b5e767f9bc3161055ca1b443a51afb52aad ]

drm_fixp_from_fraction allows us to create a fixed point directly
from a fraction, rather than creating fixed point values and dividing
later. This avoids overflow of our 64 bit value for large numbers.

drm_fixp2int_ceil allows us to return the ceiling of our fixed point
value.

[airlied: squash Jordan's fix]
32-bit-build-fix: Jordan Lazare <Jordan.Lazare@amd.com>
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodrm: fix missing reference counting decrease
Insu Yun [Mon, 1 Feb 2016 16:08:29 +0000 (11:08 -0500)]
drm: fix missing reference counting decrease

[ Upstream commit dabe19540af9e563d526113bb102e1b9b9fa73f9 ]

In drm_dp_mst_allocate_vcpi, it returns true in two paths,
but in one path, there is no reference couting decrease.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoARM: nomadik: fix up SD/MMC DT settings
Linus Walleij [Mon, 1 Feb 2016 13:18:57 +0000 (14:18 +0100)]
ARM: nomadik: fix up SD/MMC DT settings

[ Upstream commit 418d5516568b3fdbc4e7b53677dd78aed8514565 ]

The DTSI file for the Nomadik does not properly specify how the
PL180 levelshifter is connected: the Nomadik actually needs all
the five st,sig-dir-* flags set to properly control all lines out.

Further this board supports full power cycling of the card, and
since this variant has no hardware clock gating, it needs a
ridiculously low frequency setting to keep up with the ever
overflowing FIFO.

The pin configuration set-up is a bit of a mystery, because of
course these pins are a mix of inputs and outputs. However the
reference implementation sets all pins to "output" with
unspecified initial value, so let's do that here as well.

Cc: stable@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years ago[media] saa7134-alsa: Only frees registered sound cards
Mauro Carvalho Chehab [Thu, 4 Feb 2016 17:59:43 +0000 (15:59 -0200)]
[media] saa7134-alsa: Only frees registered sound cards

[ Upstream commit ac75fe5d8fe4a0bf063be18fb29684405279e79e ]

That prevents this bug:
[ 2382.269496] BUG: unable to handle kernel NULL pointer dereference at 0000000000000540
[ 2382.270013] IP: [<ffffffffa01fe616>] snd_card_free+0x36/0x70 [snd]
[ 2382.270013] PGD 0
[ 2382.270013] Oops: 0002 [#1] SMP
[ 2382.270013] Modules linked in: saa7134_alsa(-) tda1004x saa7134_dvb videobuf2_dvb dvb_core tda827x tda8290 tuner saa7134 tveeprom videobuf2_dma_sg videobuf2_memops videobuf2_v4l2 videobuf2_core v4l2_common videodev media auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc tun bridge stp llc ebtables ip6table_filter ip6_tables nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack it87 hwmon_vid snd_hda_codec_idt snd_hda_codec_generic iTCO_wdt iTCO_vendor_support snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_seq pcspkr i2c_i801 snd_seq_device snd_pcm snd_timer lpc_ich snd mfd_core soundcore binfmt_misc i915 video i2c_algo_bit drm_kms_helper drm r8169 ata_generic serio_raw pata_acpi mii i2c_core [last unloaded: videobuf2_memops]
[ 2382.270013] CPU: 0 PID: 4899 Comm: rmmod Not tainted 4.5.0-rc1+ #4
[ 2382.270013] Hardware name: PCCHIPS P17G/P17G, BIOS 080012  05/14/2008
[ 2382.270013] task: ffff880039c38000 ti: ffff88003c764000 task.ti: ffff88003c764000
[ 2382.270013] RIP: 0010:[<ffffffffa01fe616>]  [<ffffffffa01fe616>] snd_card_free+0x36/0x70 [snd]
[ 2382.270013] RSP: 0018:ffff88003c767ea0  EFLAGS: 00010286
[ 2382.270013] RAX: ffff88003c767eb8 RBX: 0000000000000000 RCX: 0000000000006260
[ 2382.270013] RDX: ffffffffa020a060 RSI: ffffffffa0206de1 RDI: ffff88003c767eb0
[ 2382.270013] RBP: ffff88003c767ed8 R08: 0000000000019960 R09: ffffffff811a5412
[ 2382.270013] R10: ffffea0000d7c200 R11: 0000000000000000 R12: ffff88003c767ea8
[ 2382.270013] R13: 00007ffe760617f7 R14: 0000000000000000 R15: 0000557625d7f1e0
[ 2382.270013] FS:  00007f80bb1c0700(0000) GS:ffff88003f400000(0000) knlGS:0000000000000000
[ 2382.270013] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 2382.270013] CR2: 0000000000000540 CR3: 000000003c00f000 CR4: 00000000000006f0
[ 2382.270013] Stack:
[ 2382.270013]  000000003c767ed8 ffffffff00000000 ffff880000000000 ffff88003c767eb8
[ 2382.270013]  ffff88003c767eb8 ffffffffa049a890 00007ffe76060060 ffff88003c767ef0
[ 2382.270013]  ffffffffa049889d ffffffffa049a500 ffff88003c767f48 ffffffff8111079c
[ 2382.270013] Call Trace:
[ 2382.270013]  [<ffffffffa049889d>] saa7134_alsa_exit+0x1d/0x780 [saa7134_alsa]
[ 2382.270013]  [<ffffffff8111079c>] SyS_delete_module+0x19c/0x1f0
[ 2382.270013]  [<ffffffff8170fc2e>] entry_SYSCALL_64_fastpath+0x12/0x71
[ 2382.270013] Code: 20 a0 48 c7 c6 e1 6d 20 a0 48 89 e5 41 54 53 4c 8d 65 d0 48 89 fb 48 83 ec 28 c7 45 d0 00 00 00 00 49 8d 7c 24 08 e8 7a 55 ed e0 <4c> 89 a3 40 05 00 00 48 89 df e8 eb fd ff ff 85 c0 75 1a 48 8d
[ 2382.270013] RIP  [<ffffffffa01fe616>] snd_card_free+0x36/0x70 [snd]
[ 2382.270013]  RSP <ffff88003c767ea0>
[ 2382.270013] CR2: 0000000000000540

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoALSA: timer: Fix leftover link at closing
Takashi Iwai [Thu, 4 Feb 2016 16:06:13 +0000 (17:06 +0100)]
ALSA: timer: Fix leftover link at closing

[ Upstream commit 094fd3be87b0f102589e2d5c3fa5d06b7e20496d ]

In ALSA timer core, the active timer instance is managed in
active_list linked list.  Each element is added / removed dynamically
at timer start, stop and in timer interrupt.  The problem is that
snd_timer_interrupt() has a thinko and leaves the element in
active_list when it's the last opened element.  This eventually leads
to list corruption or use-after-free error.

This hasn't been revealed because we used to delete the list forcibly
in snd_timer_stop() in the past.  However, the recent fix avoids the
double-stop behavior (in commit [f784beb75ce8: ALSA: timer: Fix link
corruption due to double start or stop]), and this leak hits reality.

This patch fixes the link management in snd_timer_interrupt().  Now it
simply unlinks no matter which stream is.

BugLink: http://lkml.kernel.org/r/CACT4Y+Yy2aukHP-EDp8-ziNqNNmb-NTf=jDWXMP7jB8HDa2vng@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years ago[media] tda1004x: only update the frontend properties if locked
Mauro Carvalho Chehab [Wed, 3 Feb 2016 19:33:48 +0000 (17:33 -0200)]
[media] tda1004x: only update the frontend properties if locked

[ Upstream commit e8beb02343e7582980c6705816cd957cf4f74c7a ]

The tda1004x was updating the properties cache before locking.
If the device is not locked, the data at the registers are just
random values with no real meaning.

This caused the driver to fail with libdvbv5, as such library
calls GET_PROPERTY from time to time, in order to return the
DVB stats.

Tested with a saa7134 card 78:
ASUSTeK P7131 Dual, vendor PCI ID: 1043:4862

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoxhci: Fix list corruption in urb dequeue at host removal
Mathias Nyman [Tue, 26 Jan 2016 15:50:12 +0000 (17:50 +0200)]
xhci: Fix list corruption in urb dequeue at host removal

[ Upstream commit 5c82171167adb8e4ac77b91a42cd49fb211a81a0 ]

xhci driver frees data for all devices, both usb2 and and usb3 the
first time usb_remove_hcd() is called, including td_list and and xhci_ring
structures.

When usb_remove_hcd() is called a second time for the second xhci bus it
will try to dequeue all pending urbs, and touches td_list which is already
freed for that endpoint.

Cc: <stable@vger.kernel.org>
Reported-by: Joe Lawrence <joe.lawrence@stratus.com>
Tested-by: Joe Lawrence <joe.lawrence@stratus.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agousb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Broxton-M platforms
Lu Baolu [Tue, 26 Jan 2016 15:50:08 +0000 (17:50 +0200)]
usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Broxton-M platforms

[ Upstream commit ccc04afb72cddbdf7c0e1c17e92886405a71b754 ]

Intel Broxton M was verifed to require XHCI_PME_STUCK_QUIRK quirk as well.

Cc: stable@vger.kernel.org
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agousb: xhci: set SSIC port unused only if xhci_suspend succeeds
Lu Baolu [Tue, 26 Jan 2016 15:50:07 +0000 (17:50 +0200)]
usb: xhci: set SSIC port unused only if xhci_suspend succeeds

[ Upstream commit 92149c930cce1865d0d4aca2ab07c2b4b197b418 ]

XHCI_SSIC_PORT_UNUSED quirk was applied to the xHCI host controllers
in some Intel SoC chips.  With this quirk applied, SSIC port is set
to "unused" prior to xhci_suspend(). This may cause problem if host
fails to suspend.  In this case, the port is set to unused without
host further entering D3, and the port will not be usable anymore.

Cc: stable@vger.kernel.org
Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agousb: xhci: add a quirk bit for ssic port unused
Lu Baolu [Tue, 26 Jan 2016 15:50:06 +0000 (17:50 +0200)]
usb: xhci: add a quirk bit for ssic port unused

[ Upstream commit 7e70cbffe236721051bbaff965e477df06dcb190 ]

Two workarounds introduced by commit b8cb91e058cd ("xhci: Workaround
for PME stuck issues in Intel xhci") and commit abce329c27b3 ("xhci:
Workaround to get D3 working in Intel xHCI") share a single quirk bit
XHCI_PME_STUCK_QUIRK. These two workarounds actually are different and
might happen on different hardwares. Need to separate them by adding a
quirk bit for the later.

Cc: stable@vger.kernel.org
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agousb: xhci: handle both SSIC ports in PME stuck quirk
Lu Baolu [Tue, 26 Jan 2016 15:50:05 +0000 (17:50 +0200)]
usb: xhci: handle both SSIC ports in PME stuck quirk

[ Upstream commit fa89537783cb442263fa5a14df6c7693eaf32f11 ]

Commit abce329c27b3 ("xhci: Workaround to get D3 working in Intel xHCI")
adds a workaround for a limitation of PME storm caused by SSIC port in
some Intel SoCs. This commit only handled one SSIC port, while there
are actually two SSIC ports in the chips. This patch handles both SSIC
ports. Without this fix, users still see PME storm.

Cc: stable@vger.kernel.org # v4.2+
Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoxhci: create one unified function to calculate TRB TD remainder.
Mathias Nyman [Fri, 9 Oct 2015 10:30:08 +0000 (13:30 +0300)]
xhci: create one unified function to calculate TRB TD remainder.

[ Upstream commit c840d6ce772d47c777070ca4bbbfbf21d8d727a3 ]

xhci versions 1.0 and later report the untransferred data remaining in a
TD a bit differently than older hosts.

We used to have separate functions for these, and needed to check host
version before calling the right function.

Now Mediatek host has an additional quirk on how it uses the TD Size
field for remaining data. To prevent yet another function for calculating
remainder we instead want to make one quirk friendly unified function.

Tested-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agousb: xhci: Makefile: move xhci-pci and xhci-plat-hcd after xhci-hcd
Lu, Baolu [Fri, 9 Oct 2015 10:30:10 +0000 (13:30 +0300)]
usb: xhci: Makefile: move xhci-pci and xhci-plat-hcd after xhci-hcd

[ Upstream commit 8451a34ff6c7c756e9e0f0094a3ba856c9734e5d ]

Module xhci-pci and xhci-plat-hcd depend on xhci-hcd. Module xhci-hcd
should be put at a place before xhci-pci and xhci-plat-hcd. Otherwise,
xhci_hcd_init() might be executed after other functions in xhci-hcd if
they are all selected to be built in.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoxhci: Move xhci_pme_quirk() behind #ifdef CONFIG_PM
Tomer Barletz [Mon, 21 Sep 2015 14:46:11 +0000 (17:46 +0300)]
xhci: Move xhci_pme_quirk() behind #ifdef CONFIG_PM

[ Upstream commit 2b7627b73e81e5d23d5ae1490fe8e690af86e053 ]

xhci_pme_quirk() is only used when CONFIG_PM is defined.
Compiling a kernel without PM complains about this function

[reworded commit message -Mathias]
Cc: <stable@vger.kernel.org>
Signed-off-by: Tomer Barletz <barletz@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoxhci: call BIOS workaround to enable runtime suspend on Intel Braswell
Mathias Nyman [Tue, 21 Jul 2015 14:20:25 +0000 (17:20 +0300)]
xhci: call BIOS workaround to enable runtime suspend on Intel Braswell

[ Upstream commit c3c5819a350952439c3198aa46581f9e4c46557f ]

Intel xhci hw that require XHCI_PME_STUCK quirk have as default disabled
xhci from going to D3 state in runtime suspend. Driver needs to verify
it can deal with the hw by calling an ACPI _DSM method to get D3 enabled.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoxhci: Workaround to get D3 working in Intel xHCI
Rajmohan Mani [Tue, 21 Jul 2015 14:20:26 +0000 (17:20 +0300)]
xhci: Workaround to get D3 working in Intel xHCI

[ Upstream commit abce329c27b315cfc01be1a305ee976ee13ed4cf ]

The xHCI in Intel CherryView / Braswell Platform requires
a driver workaround to get xHCI D3 working. Without this
workaround, xHCI might not enter D3.

Workaround is to configure SSIC PORT as "unused" before D3
entry and "used" after D3 exit. This is done through a
vendor specific register (PORT2_SSIC_CONFIG_REG2 at offset
0x883c), in xhci suspend / resume callbacks.

Verified xHCI D3 works fine in CherryView / Braswell platform.

Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoradix-tree: fix race in gang lookup
Matthew Wilcox [Wed, 3 Feb 2016 00:57:52 +0000 (16:57 -0800)]
radix-tree: fix race in gang lookup

[ Upstream commit 46437f9a554fbe3e110580ca08ab703b59f2f95a ]

If the indirect_ptr bit is set on a slot, that indicates we need to redo
the lookup.  Introduce a new function radix_tree_iter_retry() which
forces the loop to retry the lookup by setting 'slot' to NULL and
turning the iterator back to point at the problematic entry.

This is a pretty rare problem to hit at the moment; the lookup has to
race with a grow of the radix tree from a height of 0.  The consequences
of hitting this race are that gang lookup could return a pointer to a
radix_tree_node instead of a pointer to whatever the user had inserted
in the tree.

Fixes: cebbd29e1c2f ("radix-tree: rewrite gang lookup using iterator")
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agodrivers/scsi/sg.c: mark VMA as VM_IO to prevent migration
Kirill A. Shutemov [Wed, 3 Feb 2016 00:57:35 +0000 (16:57 -0800)]
drivers/scsi/sg.c: mark VMA as VM_IO to prevent migration

[ Upstream commit 461c7fa126794157484dca48e88effa4963e3af3 ]

Reduced testcase:

    #include <fcntl.h>
    #include <unistd.h>
    #include <sys/mman.h>
    #include <numaif.h>

    #define SIZE 0x2000

    int main()
    {
        int fd;
        void *p;

        fd = open("/dev/sg0", O_RDWR);
        p = mmap(NULL, SIZE, PROT_EXEC, MAP_PRIVATE | MAP_LOCKED, fd, 0);
        mbind(p, SIZE, 0, NULL, 0, MPOL_MF_MOVE);
        return 0;
    }

We shouldn't try to migrate pages in sg VMA as we don't have a way to
update Sg_scatter_hold::pages accordingly from mm core.

Let's mark the VMA as VM_IO to indicate to mm core that the VMA is not
migratable.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Shiraz Hashim <shashim@codeaurora.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: syzkaller <syzkaller@googlegroups.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
5 years agoALSA: seq: Fix lockdep warnings due to double mutex locks
Takashi Iwai [Wed, 3 Feb 2016 07:32:44 +0000 (08:32 +0100)]
ALSA: seq: Fix lockdep warnings due to double mutex locks

[ Upstream commit 7f0973e973cd74aa40747c9d38844560cd184ee8 ]

The port subscription code uses double mutex locks for source and
destination ports, and this may become racy once when wrongly set up.
It leads to lockdep warning splat, typically triggered by fuzzer like
syzkaller, although the actual deadlock hasn't been seen, so far.

This patch simplifies the handling by reducing to two single locks, so
that no lockdep warning will be trigger any longer.

By splitting to two actions, a still-in-progress element shall be
added in one list while handling another.  For ignoring this element,
a new check is added in deliver_to_subscribers().

Along with it, the code to add/remove the subscribers list element was
cleaned up and refactored.

BugLink: http://lkml.kernel.org/r/CACT4Y+aKQXV7xkBW9hpQbzaDO7LrUvohxWh-UwMxXjDy-yBD=A@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>