]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-kernel-next.git/log
ti-linux-kernel/ti-linux-kernel-next.git
5 years agoMerge branch 'ti-linux-4.19.y-next' of git.ti.com:ti-linux-kernel/ti-linux-kernel... ti-rt-linux-4.14.y-next-20190106 ti-rt-linux-4.19.y-next-20190106
LCPD Auto Merger [Sun, 6 Jan 2019 08:27:18 +0000 (02:27 -0600)]
Merge branch 'ti-linux-4.19.y-next' of git.ti.com:ti-linux-kernel/ti-linux-kernel-next into ti-rt-linux-4.19.y-next

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel-next.git
TI-Branch: ti-linux-4.19.y-next

* 'ti-linux-4.19.y-next' of git.ti.com:ti-linux-kernel/ti-linux-kernel-next:
  arm64: dts: ti: k3-am654-base-board: Enable ECAP PWM
  arm64: dts: ti: k3-am65-main: Add ECAP PWM node
  pwm: Enable TI ECAP driver for ARCH_K3
  dt-bindings: pwm: tiecap: Add TI AM654 SoC specific compatible
  dt-bindings: i2c: omap: Add new compatible for AM654 SoCs
  mmc: sdhci-omap: Workaround errata regarding SDR104/HS200 tuning failures (i929)
  dt-bindings: sdhci-omap: Add note for cpu_thermal
  mmc: sdhci-omap: Add platform specific reset callback
  mmc: sdhci-omap: Remove redundant structure assignments
  mmc: sdhci-omap: Fix DCRC error handling during tuning
  clk: keystone: sci-clk: add support from parsing clock info from DT
  dt-bindings: clock: ti,sci-clk: Add support for parsing clock info from DT
  soc: ti: Add TI_MESSAGE_MANAGER to default K3 AM65x SoC options

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'connectivity-next' of git://git.ti.com/~nsekhar/ti-linux-kernel/nsekhar... ti-linux-4.14.y-next-20190106 ti-linux-4.19.y-next-20190106
LCPD Auto Merger [Sun, 6 Jan 2019 08:23:36 +0000 (02:23 -0600)]
Merge branch 'connectivity-next' of git://git.ti.com/~nsekhar/ti-linux-kernel/nsekhar-ti-linux-kernel into ti-linux-4.19.y-next

TI-Feature: connectivity_next
TI-Tree: git://git.ti.com/~nsekhar/ti-linux-kernel/nsekhar-ti-linux-kernel.git
TI-Branch: connectivity-next

* 'connectivity-next' of git://git.ti.com/~nsekhar/ti-linux-kernel/nsekhar-ti-linux-kernel:
  arm64: dts: ti: k3-am654-base-board: Enable ECAP PWM
  arm64: dts: ti: k3-am65-main: Add ECAP PWM node
  pwm: Enable TI ECAP driver for ARCH_K3
  dt-bindings: pwm: tiecap: Add TI AM654 SoC specific compatible
  dt-bindings: i2c: omap: Add new compatible for AM654 SoCs
  mmc: sdhci-omap: Workaround errata regarding SDR104/HS200 tuning failures (i929)
  dt-bindings: sdhci-omap: Add note for cpu_thermal
  mmc: sdhci-omap: Add platform specific reset callback
  mmc: sdhci-omap: Remove redundant structure assignments
  mmc: sdhci-omap: Fix DCRC error handling during tuning

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'platform-ti-linux-4.19.y-next' of git://git.ti.com/~rrnayak/ti-linux...
LCPD Auto Merger [Sun, 6 Jan 2019 08:23:34 +0000 (02:23 -0600)]
Merge branch 'platform-ti-linux-4.19.y-next' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.19.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.19.y-next

* 'platform-ti-linux-4.19.y-next' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  clk: keystone: sci-clk: add support from parsing clock info from DT
  dt-bindings: clock: ti,sci-clk: Add support for parsing clock info from DT
  soc: ti: Add TI_MESSAGE_MANAGER to default K3 AM65x SoC options

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into...
LCPD Auto Merger [Fri, 4 Jan 2019 21:38:06 +0000 (15:38 -0600)]
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y

* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ti_config_fragments: rpmsg: Enable rpmsg-proto module
  net/rpmsg: add support for new rpmsg sockets
  ARM: dts: da850: Add alias for DSP node
  remoteproc/davinci: Add a trace to print missing ids
  remoteproc/davinci: Switch a debug trace statement to use %pK
  remoteproc/davinci: Use %zx for formating size_t
  rpmsg: virtio_rpmsg_bus: move back rpmsg_hdr into a public header
  remoteproc/wkup_m3: set deny_sysfs_ops flag
  remoteproc: introduce deny_sysfs_ops flag

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'rpmsg-ti-linux-4.19.y-intg' of git://git.ti.com/rpmsg/rpmsg into ti...
LCPD Auto Merger [Fri, 4 Jan 2019 20:55:01 +0000 (14:55 -0600)]
Merge branch 'rpmsg-ti-linux-4.19.y-intg' of git://git.ti.com/rpmsg/rpmsg into ti-linux-4.19.y

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

* 'rpmsg-ti-linux-4.19.y-intg' of git://git.ti.com/rpmsg/rpmsg:
  ti_config_fragments: rpmsg: Enable rpmsg-proto module
  net/rpmsg: add support for new rpmsg sockets
  ARM: dts: da850: Add alias for DSP node
  remoteproc/davinci: Add a trace to print missing ids
  remoteproc/davinci: Switch a debug trace statement to use %pK
  remoteproc/davinci: Use %zx for formating size_t
  rpmsg: virtio_rpmsg_bus: move back rpmsg_hdr into a public header
  remoteproc/wkup_m3: set deny_sysfs_ops flag
  remoteproc: introduce deny_sysfs_ops flag

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'rpmsg-ti-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg into rpmsg-ti...
Suman Anna [Fri, 4 Jan 2019 20:19:40 +0000 (14:19 -0600)]
Merge branch 'rpmsg-ti-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg into rpmsg-ti-linux-4.19.y-intg

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into...
LCPD Auto Merger [Fri, 4 Jan 2019 16:31:14 +0000 (10:31 -0600)]
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y

* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (124 commits)
  drm/omap: fix incorrect union usage
  drm/omap: populate DSI platform bus earlier
  drm/omap: fix bus_flags for panel-dpi
  drm/omap: dsi: Fix missing of_platform_depopulate()
  drm/omap: Move DISPC runtime PM handling to omapdrm
  drm/omap: dsi: Ensure the device is active during probe
  drm/omap: hdmi4: Ensure the device is active during bind
  drm/omap: Populate DSS children in omapdss driver
  drm/omap: fix use of freed memory
  drm/omap: Replace drm_dev_unref with drm_dev_put
  drm/omap: Replace drm_gem_object_unreference_unlocked with put function
  drm/omap: Replace drm_gem_object_{un/reference} with put,get functions
  drm/omap: Substitute format_is_yuv() with format->is_yuv
  drm/omap: partial workaround for DRA7xx DMM errata i878
  drm/omap: dmm_tiler: Fix interrupt request/free sequence during probe/remove
  drm/omap: dmm_tiler: No need to check if irq is valid in omap_dmm_remove
  drm/omap: remove set but not used variable 'frame_height'
  drm/omap: Use ERR_CAST directly instead of ERR_PTR(PTR_ERR())
  drm/omap: remove unused header tcm-sita.h
  drm/omap: Don't call .set_timings() operation recursively
  ...

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'audio_display-ti-linux-4.19.y' of git.ti.com:~jyrisarha/ti-linux-kernel...
LCPD Auto Merger [Fri, 4 Jan 2019 15:40:40 +0000 (09:40 -0600)]
Merge branch 'audio_display-ti-linux-4.19.y' of git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree into ti-linux-4.19.y

TI-Feature: audio-display
TI-Tree: git@git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git
TI-Branch: audio_display-ti-linux-4.19.y

* 'audio_display-ti-linux-4.19.y' of git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree: (124 commits)
  drm/omap: fix incorrect union usage
  drm/omap: populate DSI platform bus earlier
  drm/omap: fix bus_flags for panel-dpi
  drm/omap: dsi: Fix missing of_platform_depopulate()
  drm/omap: Move DISPC runtime PM handling to omapdrm
  drm/omap: dsi: Ensure the device is active during probe
  drm/omap: hdmi4: Ensure the device is active during bind
  drm/omap: Populate DSS children in omapdss driver
  drm/omap: fix use of freed memory
  drm/omap: Replace drm_dev_unref with drm_dev_put
  drm/omap: Replace drm_gem_object_unreference_unlocked with put function
  drm/omap: Replace drm_gem_object_{un/reference} with put,get functions
  drm/omap: Substitute format_is_yuv() with format->is_yuv
  drm/omap: partial workaround for DRA7xx DMM errata i878
  drm/omap: dmm_tiler: Fix interrupt request/free sequence during probe/remove
  drm/omap: dmm_tiler: No need to check if irq is valid in omap_dmm_remove
  drm/omap: remove set but not used variable 'frame_height'
  drm/omap: Use ERR_CAST directly instead of ERR_PTR(PTR_ERR())
  drm/omap: remove unused header tcm-sita.h
  drm/omap: Don't call .set_timings() operation recursively
  ...

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'ti/4.19-pull' of https://bitbucket.itg.ti.com/scm/~a0400822/linux into...
Jyri Sarha [Fri, 4 Jan 2019 14:12:14 +0000 (16:12 +0200)]
Merge branch 'ti/4.19-pull' of https://bitbucket.itg.ti.com/scm/~a0400822/linux into audio_display-ti-linux-4.19.y

drm/omap: mainline backports for 2019 LTS

* 'ti/4.19-pull' of https://bitbucket.itg.ti.com/scm/~a0400822/linux: (124 commits)
  drm/omap: fix incorrect union usage
  drm/omap: populate DSI platform bus earlier
  drm/omap: fix bus_flags for panel-dpi
  drm/omap: dsi: Fix missing of_platform_depopulate()
  drm/omap: Move DISPC runtime PM handling to omapdrm
  drm/omap: dsi: Ensure the device is active during probe
  drm/omap: hdmi4: Ensure the device is active during bind
  drm/omap: Populate DSS children in omapdss driver
  drm/omap: fix use of freed memory
  drm/omap: Replace drm_dev_unref with drm_dev_put
  drm/omap: Replace drm_gem_object_unreference_unlocked with put function
  drm/omap: Replace drm_gem_object_{un/reference} with put,get functions
  drm/omap: Substitute format_is_yuv() with format->is_yuv
  drm/omap: partial workaround for DRA7xx DMM errata i878
  drm/omap: dmm_tiler: Fix interrupt request/free sequence during probe/remove
  drm/omap: dmm_tiler: No need to check if irq is valid in omap_dmm_remove
  drm/omap: remove set but not used variable 'frame_height'
  drm/omap: Use ERR_CAST directly instead of ERR_PTR(PTR_ERR())
  drm/omap: remove unused header tcm-sita.h
  drm/omap: Don't call .set_timings() operation recursively
  ...

5 years agoti_config_fragments: rpmsg: Enable rpmsg-proto module
Suman Anna [Wed, 2 Jan 2019 22:18:49 +0000 (16:18 -0600)]
ti_config_fragments: rpmsg: Enable rpmsg-proto module

Add support to build the rpmsg sockets driver "rpmsg-proto"
explicitly now for both v5 and v7 platforms. The dependent
REMOTEPROC and RPMSG_VIRTIO modules are also enabled. This
enables the TI MessageQ IPC stack for various v5 (OMAP-L138)
and v7 (66AK2x, DRA7xx, AM57xx etc) platforms.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoMerge branch 'rpmsg-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg into rpmsg-ti-linux...
Suman Anna [Fri, 4 Jan 2019 07:50:00 +0000 (01:50 -0600)]
Merge branch 'rpmsg-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg into rpmsg-ti-linux-4.19.y

Pull in the updated rpmsg base feature branch that adds a new
rpmsg bus driver, rpmsg-proto. The rpmsg-proto driver implements
a remote processor messaging socket interface, and supports the
MessageQ stack in the TI IPC product.

The merge also includes a minor fix to the rpmsg core to expose
the common rpmsg_hdr that will be part of every transport message
sent over the virtio rpmsg ring transport.

* 'rpmsg-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg:
  net/rpmsg: add support for new rpmsg sockets
  rpmsg: virtio_rpmsg_bus: move back rpmsg_hdr into a public header

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoMerge branch 'rproc-linux-4.19.y' of git://git.ti.com/rpmsg/remoteproc into rpmsg...
Suman Anna [Fri, 4 Jan 2019 07:44:50 +0000 (01:44 -0600)]
Merge branch 'rproc-linux-4.19.y' of git://git.ti.com/rpmsg/remoteproc into rpmsg-ti-linux-4.19.y

Pull in the updated remoteproc feature branch that includes few cleanups
and enhancements to the Davinci remoteproc driver to load the DSP core on
the OMAP-L138 SoCs. The remoteproc driver continues to support the legacy-mode
devices on non-DT platforms, and the DT-mode device is supported on the
OMAP-L138 LCDK board.

The merge also includes an enhancement to the remoteproc core to allow
individual remoteproc drivers to deny sysfs operations for changing the
firmware and starting/stopping the remoteprocs. The Wakeup M3 remoteproc
has also been updated to deny these operations for certain usage scenarios.

* 'rproc-linux-4.19.y' of git://git.ti.com/rpmsg/remoteproc:
  ARM: dts: da850: Add alias for DSP node
  remoteproc/davinci: Add a trace to print missing ids
  remoteproc/davinci: Switch a debug trace statement to use %pK
  remoteproc/davinci: Use %zx for formating size_t
  remoteproc/wkup_m3: set deny_sysfs_ops flag
  remoteproc: introduce deny_sysfs_ops flag

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoarm64: dts: ti: k3-am654-base-board: Enable ECAP PWM
Vignesh R [Thu, 3 Jan 2019 12:21:04 +0000 (17:51 +0530)]
arm64: dts: ti: k3-am654-base-board: Enable ECAP PWM

commit e577d79424c07af63d0f19817a425bf4ccf0ec81 upstream.

Enable ECAP PWM which is used for LCD backlight.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoarm64: dts: ti: k3-am65-main: Add ECAP PWM node
Vignesh R [Thu, 3 Jan 2019 12:21:03 +0000 (17:51 +0530)]
arm64: dts: ti: k3-am65-main: Add ECAP PWM node

commit 07c663b0ee576a33c29f211d2e23484a9aa5ff30 upstream.

Add DT entry for ECAP0 PWM node present in main domain

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agopwm: Enable TI ECAP driver for ARCH_K3
Vignesh R [Thu, 3 Jan 2019 12:21:02 +0000 (17:51 +0530)]
pwm: Enable TI ECAP driver for ARCH_K3

commit 6f37709fb0a61f09ca96348044c5bb13e333e518 upstream

K3 devices have the same ECAP IP as OMAP SoCs. Enable driver to be built
for K3 devices. Also, drop reference to AM33xx in help text, as IP is
found on multiple TI SoCs.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agodt-bindings: pwm: tiecap: Add TI AM654 SoC specific compatible
Vignesh R [Thu, 3 Jan 2019 12:21:01 +0000 (17:51 +0530)]
dt-bindings: pwm: tiecap: Add TI AM654 SoC specific compatible

commit 3c413e7e39224d171ef697277cd4629b59103101 upstream.

Add a new compatible string "ti,am654-ecap" to support PWM ECAP IP of
TI AM654 SoC.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agodt-bindings: i2c: omap: Add new compatible for AM654 SoCs
Vignesh R [Thu, 3 Jan 2019 12:21:00 +0000 (17:51 +0530)]
dt-bindings: i2c: omap: Add new compatible for AM654 SoCs

commit ab214c48387aaaadcf8246b4b00d8b78286fde1b upstream.

AM654 SoCs have same I2C IP as OMAP SoCs. Add new compatible to
handle AM654 SoCs. While at that reformat the existing compatible list
for older SoCs to list one valid compatible per line.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agommc: sdhci-omap: Workaround errata regarding SDR104/HS200 tuning failures (i929)
Faiz Abbas [Wed, 2 Jan 2019 13:54:07 +0000 (19:24 +0530)]
mmc: sdhci-omap: Workaround errata regarding SDR104/HS200 tuning failures (i929)

commit 961de0a856e3a30c0238d1269c0b17f9b179b6c3 upstream.

Errata i929 in certain OMAP5/DRA7XX/AM57XX silicon revisions
(SPRZ426D - November 2014 - Revised February 2018 [1]) mentions
unexpected tuning pattern errors. A small failure band may be present
in the tuning range which may be missed by the current algorithm.
Furthermore, the failure bands vary with temperature leading to
different optimum tuning values for different temperatures.

As suggested in the related Application Report (SPRACA9B - October 2017
- Revised July 2018 [2]), tuning should be done in two stages.
In stage 1, assign the optimum ratio in the maximum pass window for the
current temperature. In stage 2, if the chosen value is close to the
small failure band, move away from it in the appropriate direction.

References:
[1] http://www.ti.com/lit/pdf/sprz426
[2] http://www.ti.com/lit/pdf/SPRACA9

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agodt-bindings: sdhci-omap: Add note for cpu_thermal
Faiz Abbas [Wed, 2 Jan 2019 13:54:06 +0000 (19:24 +0530)]
dt-bindings: sdhci-omap: Add note for cpu_thermal

commit 58fe8bbacd285af44831f68da1d2d50f0e2fc9a9 upstream.

The driver fetches a thermal zone using the string "cpu_thermal" for
tuning operation. Add a note for the same.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agommc: sdhci-omap: Add platform specific reset callback
Faiz Abbas [Wed, 2 Jan 2019 13:54:05 +0000 (19:24 +0530)]
mmc: sdhci-omap: Add platform specific reset callback

commit 5b0d62108b468b13410533c0ceea3821942bf592 upstream.

The TRM (SPRUIC2C - January 2017 - Revised May 2018 [1]) forbids
assertion of data reset while tuning is happening. Implement a
platform specific callback that takes care of this condition.

[1] http://www.ti.com/lit/pdf/spruic2 Section 25.5.1.2.4

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agommc: sdhci-omap: Remove redundant structure assignments
Faiz Abbas [Wed, 2 Jan 2019 13:54:04 +0000 (19:24 +0530)]
mmc: sdhci-omap: Remove redundant structure assignments

commit 52b5f5cfa2f736f3e478b65490736b62412dc11c upstream.

The sdhci_execute_tuning() function has assignment of
private pointers multiple times. Remove the redundant assignment.

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agommc: sdhci-omap: Fix DCRC error handling during tuning
Faiz Abbas [Wed, 2 Jan 2019 13:54:03 +0000 (19:24 +0530)]
mmc: sdhci-omap: Fix DCRC error handling during tuning

commit db2039fcfd5754d15986340152e4503737f68f8d upstream.

Commit 7d33c3581536 ("mmc: sdhci-omap: Workaround for Errata i802")
disabled DCRC interrupts during tuning. This write to the interrupt
enable register gets overwritten in sdhci_prepare_data() and the
interrupt is not in fact disabled. Fix this by disabling the interrupt
in the host->ier variable.

Fixes: 7d33c3581536 ("mmc: sdhci-omap: Workaround for Errata i802")
Cc: <stable@vger.kernel.org>
Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into...
LCPD Auto Merger [Thu, 3 Jan 2019 12:36:57 +0000 (06:36 -0600)]
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y

* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ti_config_fragments: Add display to audio_display.cfg
  drm/tilcdc: Register cpufreq notifier after we have initialized crtc

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'audio_display-ti-linux-4.19.y' of git.ti.com:~jyrisarha/ti-linux-kernel...
LCPD Auto Merger [Thu, 3 Jan 2019 12:00:53 +0000 (06:00 -0600)]
Merge branch 'audio_display-ti-linux-4.19.y' of git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree into ti-linux-4.19.y

TI-Feature: audio-display
TI-Tree: git@git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git
TI-Branch: audio_display-ti-linux-4.19.y

* 'audio_display-ti-linux-4.19.y' of git.ti.com:~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree:
  ti_config_fragments: Add display to audio_display.cfg
  drm/tilcdc: Register cpufreq notifier after we have initialized crtc

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'ti/4.19-pull' of https://bitbucket.itg.ti.com/scm/~a0400822/linux into...
Jyri Sarha [Thu, 3 Jan 2019 11:36:03 +0000 (13:36 +0200)]
Merge branch 'ti/4.19-pull' of https://bitbucket.itg.ti.com/scm/~a0400822/linux into audio_display-ti-linux-4.19.y

4.19 A&D config fragment for omapdrm for 2019.00

* 'ti/4.19-pull' of https://bitbucket.itg.ti.com/scm/~a0400822/linux: (447 commits)
  ti_config_fragments: Add display to audio_display.cfg
  ti_config_fragments: v8_defconfig_map.txt: remove android-base-arm64.config
  ti_config_fragments: defconfig_map.txt: remove android-base-arm.config
  firmware: ti_sci: Add support for processor control
  arm64: dts: ti: k3-am65-mcu: Add the MCU RAM node
  arm64: dts: ti: k3-am65: add MCU SRAM ranges in interconnect nodes
  rpmsg: add a description field
  samples/rpmsg: Introduce a module parameter for message count
  remoteproc: add an api to do pa to da conversion
  remoteproc: add api for retrieving a rproc unique id
  remoteproc: add name in rproc_mem_entry struct
  remoteproc: Check for NULL firmwares in sysfs interface
  Linux 4.19.9
  HID: quirks: fix RetroUSB.com devices
  mac80211: ignore NullFunc frames in the duplicate detection
  mac80211: fix reordering of buffered broadcast packets
  mac80211: ignore tx status for PS stations in ieee80211_tx_status_ext
  mac80211: Clear beacon_int in ieee80211_do_stop
  mac80211: fix GFP_KERNEL under tasklet context
  mac80211_hwsim: Timer should be initialized before device registered
  ...

5 years agodrm/omap: fix incorrect union usage
Sebastian Reichel [Wed, 21 Nov 2018 16:09:14 +0000 (17:09 +0100)]
drm/omap: fix incorrect union usage

commit 3c613a3bddd322c87677604d81e267fee22c6f14 upstream.

The DSI encoder sets dssdev->ops->dsi.set_config, which is stored at the
same offset as dssdev->ops->hdmi.set_hdmi_mode. The code in omap_encoder
only checks if dssdev->ops->hdmi.set_hdmi_mode is NULL. Due to the way
union works, it won't be NULL if dsi.set_config is set. This means
dsi_set_config will be called with config=hdmi_mode=false=NULL parameter
resulting in a NULL dereference. Also the dereference happens while
console is locked, so kernel hangs without any debug output without
"fb.lockless_register_fb=1" parameter.

This restructures the code, so that the HDMI mode is only configured
for HDMI output types.

Fixes: 83910ad3f51fb ("drm/omap: Move most omap_dss_driver operations to omap_dss_device_ops")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: Tony Lindgren <tony@atomide.com>
[tomi.valkeinen@ti.com: dropped the safeguard]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181121160916.22017-5-sebastian.reichel@collabora.com
5 years agodrm/omap: populate DSI platform bus earlier
Sebastian Reichel [Wed, 21 Nov 2018 16:09:12 +0000 (17:09 +0100)]
drm/omap: populate DSI platform bus earlier

commit 0a02d495531e0bbe32c3f7361232ba61b981199a upstream.

After the changes from 4.20 the DSI encoder tries to find the
attached panel before populating the DSI bus. If the panel is
not found -EPROBE_DEFER is returned, so the DSI bus is never
populated and the panel never added.

Fix this by populating the DSI bus before searching for the
video sink in dsi_init_output().

Fixes: 27d624527d992 ("drm/omap: dss: Acquire next dssdev at probe time")
Acked-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181121160916.22017-3-sebastian.reichel@collabora.com
5 years agodrm/omap: fix bus_flags for panel-dpi
Tomi Valkeinen [Mon, 26 Nov 2018 09:24:47 +0000 (11:24 +0200)]
drm/omap: fix bus_flags for panel-dpi

commit 0a7f54ea0e1ed5a8f666e2adee7943b3991b4987 upstream.

panel-dpi used to convey the bus-flags via the videomode, but recent
changes changed the use of videomode to DRM's drm_display_mode which
does not contain bus-flags. This broke panel-dpi, which didn't
explicitly store the bus-flags into dssdev->bus_flags.

Fix this by setting dssdev->bus_flags. Also change the bus_flags type to
u32, as that is the type used in the DRM framework, and we would get a
warning with drm_bus_flags_from_videomode() otherwise.

Fixes: 3fbda31e814868d8477ddf52d74b7b8f596578e8 ("drm/omap: Split mode fixup and mode set from encoder enable")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181126092447.11864-1-tomi.valkeinen@ti.com
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
5 years agodrm/omap: dsi: Fix missing of_platform_depopulate()
Tony Lindgren [Tue, 6 Nov 2018 15:28:02 +0000 (07:28 -0800)]
drm/omap: dsi: Fix missing of_platform_depopulate()

commit cbed7545db7ae5907d7dc9d4002717d46cae29e9 upstream.

We're missing a call to of_platform_depopulate() on errors for dsi.
Looks like dss is already doing this.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181106152802.38599-1-tony@atomide.com
5 years agodrm/omap: Move DISPC runtime PM handling to omapdrm
Laurent Pinchart [Sat, 10 Nov 2018 11:16:54 +0000 (13:16 +0200)]
drm/omap: Move DISPC runtime PM handling to omapdrm

commit 24ec84e854c68ceda59a26027114eb7f260f9411 upstream.

The internal encoders (DSI, HDMI4, HDMI5 and VENC) runtime PM handlers
attempt to manage the runtime PM state of the connected DISPC, based on
the rationale that the DISPC providing data to the encoders requires
ensuring that the display is active whenever the encoders are active.

While the DISPC provides data to the encoders, it doesn't as such
constitute a resource that encoders require in order to be taken out
of suspend, contrary to for instance a functional clock or a power
supply. Encoders registers can be accessed without the DISPC being
active, and while the encoders will not output any video stream without
being fed by the DISPC, the DISPC PM state doesn't influence the
encoders PM state.

For this reason the DISPC PM state is better managed from the omapdrm
driver, in the CRTC enable and disable operations. This allows the
encoders PM state to be handled separately from the DISPC, and in
particular at times when the DISPC may not be available (for instance at
probe due to the DSS probe being deferred, or at remove time du to the
DISPC being already removed).

Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from bind to probe")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181110111654.4387-5-laurent.pinchart@ideasonboard.com
5 years agodrm/omap: dsi: Ensure the device is active during probe
Laurent Pinchart [Sat, 10 Nov 2018 11:16:53 +0000 (13:16 +0200)]
drm/omap: dsi: Ensure the device is active during probe

commit 350c03e880038bf60184500bab9025d3361c0b0e upstream.

The probe function performs hardware access to read the number of
supported data lanes from a configuration register and thus requires the
device to be active. Ensure this by surrounding the access with
dsi_runtime_get() and dsi_runtime_put() calls.

Fixes: edb715dffdee ("drm/omap: dss: dsi: Move initialization code from bind to probe")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181110111654.4387-4-laurent.pinchart@ideasonboard.com
5 years agodrm/omap: hdmi4: Ensure the device is active during bind
Laurent Pinchart [Sat, 10 Nov 2018 11:16:52 +0000 (13:16 +0200)]
drm/omap: hdmi4: Ensure the device is active during bind

commit f8523b64d2d2f94bb429c15166d7601d39243c4d upstream.

The bind function performs hardware access (in hdmi4_cec_init()) and
thus requires the device to be active. Ensure this by surrounding the
bind function by hdmi_runtime_get() and hdmi_runtime_put() calls.

Fixes: 27d624527d99 ("drm/omap: dss: Acquire next dssdev at probe time")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181110111654.4387-3-laurent.pinchart@ideasonboard.com
5 years agodrm/omap: Populate DSS children in omapdss driver
Laurent Pinchart [Sat, 10 Nov 2018 11:16:51 +0000 (13:16 +0200)]
drm/omap: Populate DSS children in omapdss driver

commit e0c827aca0730b51f38081aa4e8ecf0912aab55f upstream.

The DSS DT node contains children that describe the DSS components
(DISPC and internal encoders). Each of those components is handled by a
platform driver, and thus needs to be backed by a platform device.

The corresponding platform devices are created in mach-omap2 code by a
call to of_platform_populate(). While this approach has worked so far,
it doesn't model the hardware architecture very well, as it creates
child devices before the parent is ready to handle them. This would be
akin to creating I2C slaves before the I2C master is available.

The task can be easily performed in the omapdss driver code instead,
simplifying mach-omap2 code. We however can't remove the mach-omap2 code
completely as the omap2fb driver still depends on it, but we can move it
to the omap2fb-specific section, where it can stay until the omap2fb
driver gets removed.

This has the added benefit of not allowing DSS components to probe
before the DSS itself, which led to runtime PM issues when the DSS probe
is deferred.

Fixes: 27d624527d99 ("drm/omap: dss: Acquire next dssdev at probe time")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181110111654.4387-2-laurent.pinchart@ideasonboard.com
5 years agodrm/omap: fix use of freed memory
Tomi Valkeinen [Wed, 26 Sep 2018 10:02:56 +0000 (13:02 +0300)]
drm/omap: fix use of freed memory

commit 2e65c7a6a15f006bf720f555ad1b63c6aadc5c9f upstream.

omap_connector_destroy() does:

kfree(omap_connector);
omapdss_device_put(omap_connector->output);
omapdss_device_put(omap_connector->display);

Fix this by moving the kfree after the omapdss_device_puts.

This bug was introduced in 949ea2ef3fed4e1d0f9b80ec21ed81a9833ac248

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
5 years agodrm/omap: Replace drm_dev_unref with drm_dev_put
Thomas Zimmermann [Mon, 18 Jun 2018 13:07:27 +0000 (15:07 +0200)]
drm/omap: Replace drm_dev_unref with drm_dev_put

commit 08bafffe472cffb1eb9032b83aaef8560103ea3e upstream.

This patch unifies the naming of DRM functions for reference counting
of struct drm_device. The resulting code is more aligned with the rest
of the Linux kernel interfaces.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: Replace drm_gem_object_unreference_unlocked with put function
Thomas Zimmermann [Mon, 18 Jun 2018 13:07:26 +0000 (15:07 +0200)]
drm/omap: Replace drm_gem_object_unreference_unlocked with put function

commit e64d0229340dff8746a1b55e0bcf0dbac6cb5874 upstream.

This patch unifies the naming of DRM functions for reference counting
of struct drm_gem_object. The resulting code is more aligned with the
rest of the Linux kernel interfaces.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: Replace drm_gem_object_{un/reference} with put,get functions
Thomas Zimmermann [Mon, 18 Jun 2018 13:07:25 +0000 (15:07 +0200)]
drm/omap: Replace drm_gem_object_{un/reference} with put,get functions

commit 3ce11806c0ba279b5893bb9eb1d193e1acbef7b6 upstream.

This patch unifies the naming of DRM functions for reference counting
of struct drm_gem_object. The resulting code is more aligned with the
rest of the Linux kernel interfaces.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: Substitute format_is_yuv() with format->is_yuv
Ayan Kumar Halder [Tue, 17 Jul 2018 17:13:45 +0000 (18:13 +0100)]
drm/omap: Substitute format_is_yuv() with format->is_yuv

commit e58febe1d99c6557bc7a4397426e9d470cc7f430 upstream.

drm_format_info table has a field 'is_yuv' to denote if the format
is yuv or not. The driver is expected to use this instead of
having a function for the same purpose.

Signed-off-by: Ayan Kumar halder <ayan.halder@arm.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: partial workaround for DRA7xx DMM errata i878
Tomi Valkeinen [Wed, 26 Sep 2018 09:11:30 +0000 (12:11 +0300)]
drm/omap: partial workaround for DRA7xx DMM errata i878

commit f5b9930b85dc6319fd6bcc259e447eff62fc691c upstream.

Errata i878 says that MPU should not be used to access RAM and DMM at
the same time. As it's not possible to prevent MPU accessing RAM, we
need to access DMM via a proxy.

This patch changes DMM driver to access DMM registers via sDMA. Instead
of doing a normal readl/writel call to read/write a register, we use
sDMA to copy 4 bytes from/to the DMM registers.

This patch provides only a partial workaround for i878, as not only DMM
register reads/writes are affected, but also accesses to the DMM mapped
buffers (framebuffers, usually).

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agodrm/omap: dmm_tiler: Fix interrupt request/free sequence during probe/remove
Peter Ujfalusi [Wed, 26 Sep 2018 09:11:29 +0000 (12:11 +0300)]
drm/omap: dmm_tiler: Fix interrupt request/free sequence during probe/remove

commit 176c866d40551565e78893fc0cb2bc8eed7b3c80 upstream.

The interrupts should be enabled after the driver initialization to avoid
early interrupts while the driver is not yet ready to handle them.

On removal the interrupts must be disabled before other resources are
released, freed up.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: dmm_tiler: No need to check if irq is valid in omap_dmm_remove
Peter Ujfalusi [Wed, 26 Sep 2018 09:11:28 +0000 (12:11 +0300)]
drm/omap: dmm_tiler: No need to check if irq is valid in omap_dmm_remove

commit 157aa884c90647390917e080176bedc9d0253357 upstream.

The driver probe would fail if the irq is not available.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: remove set but not used variable 'frame_height'
YueHaibing [Tue, 11 Sep 2018 12:00:53 +0000 (12:00 +0000)]
drm/omap: remove set but not used variable 'frame_height'

commit 3a75010cecc93d299aec56caae8516ea40287a98 upstream.

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/omapdrm/dss/dispc.c: In function 'dispc_ovl_setup_common':
drivers/gpu/drm/omapdrm/dss/dispc.c:2627:19: warning:
 variable 'frame_height' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: Use ERR_CAST directly instead of ERR_PTR(PTR_ERR())
zhong jiang [Tue, 11 Sep 2018 11:54:35 +0000 (19:54 +0800)]
drm/omap: Use ERR_CAST directly instead of ERR_PTR(PTR_ERR())

commit 993d52e2f71560d539b3f194be2970eb9d8ce9c1 upstream.

We prefer to use ERR_CAST to do so.
The issue is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agodrm/omap: remove unused header tcm-sita.h
Corentin Labbe [Tue, 25 Sep 2018 19:16:37 +0000 (19:16 +0000)]
drm/omap: remove unused header tcm-sita.h

commit c7d6a0d6764680df33057d23173e786266a5b71d upstream.

tcm-sita.h is unused since commit 0d6fa53fd805 ("drm/omap: Use bitmaps for TILER placement")
Let's remove it.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agoMerge tag 'omapdrm-4.20' into ti/4.19
Tomi Valkeinen [Wed, 12 Dec 2018 08:50:46 +0000 (10:50 +0200)]
Merge tag 'omapdrm-4.20' into ti/4.19

omapdrm changes for v4.20

Big amount of changes from Laurent, reworking the driver towards the
model used by the other DRM drivers by reverting the direction of many
of the operations on the display pipeline. The aim of this work is to
allow omapdrm to use the common DRM panels and bridges.  Not all of the
operations are dealt in these patches, so more work needs to be done.

The only change visible to the user should be the change in module
dependencies: e.g. earlier a panel module depended on an encoder module,
but now the encoder module depends on the panel module, which affects
the order in which to unload the modules.

5 years agoti_config_fragments: Add display to audio_display.cfg
Tomi Valkeinen [Wed, 12 Dec 2018 11:30:02 +0000 (13:30 +0200)]
ti_config_fragments: Add display to audio_display.cfg

Add display related config items to audio_display.cfg, including touch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5 years agonet/rpmsg: add support for new rpmsg sockets
Suman Anna [Fri, 5 Oct 2018 20:19:23 +0000 (15:19 -0500)]
net/rpmsg: add support for new rpmsg sockets

Add the support for a new socket address and protocol family -
remote-processor messaging sockets. This rpmsg protocol driver
provides the necessary support to expose a rpmsg communication
channel through the socket API to userspace under the AF_RPMSG
address family. The usage relies on leveraging the socket API's
connect() for Tx sockets and bind() for Rx sockets to exchange
messages to/from a remote processor. All message communication
is performed using the userspace created sockets, and even though
the probed rpmsg proto devices do create an embedded rpmsg endpoint
for receiving messages, they are not really designed to process
any such unexpected Rx messages.

This driver forms the kernel transport portion of the the TI
IPC MessageQ stack. The MessageQ stack usage of the AF_RPMSG
socket interface is not really designed to handle multiple
rpmsg-proto devices published from the same remote processor,
so a restriction is imposed to allow only a single rpmsg device
even though there are no such restrictions imposed by the
rpmsg bus infrastructure. This can be scaled to make it more
generic if needed but probably will require some userspace
interface adjustments.

This patch is based on some quite an old rpmsg socket support
patch from Ohad and some work by Rob Tivy. This has been updated
rather heavily to work with all the rpmsg framework changes in
4.9+ kernels.

Signed-off-by: Ohad Ben Cohen <ohad@wizery.com>
[s-anna@ti.com: adapted, improved and modified for latest kernel]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoARM: dts: da850: Add alias for DSP node
Suman Anna [Wed, 2 Jan 2019 21:13:43 +0000 (15:13 -0600)]
ARM: dts: da850: Add alias for DSP node

Add alias for the lone DSP remoteproc processor node present
on the OMAP-L13x/DA8xx SoCs. The alias uses the stem "rproc".
The alias is added to assign a fixed remoteproc id to the DSP
processor.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/davinci: Add a trace to print missing ids
Suman Anna [Mon, 15 Jan 2018 18:41:31 +0000 (12:41 -0600)]
remoteproc/davinci: Add a trace to print missing ids

The remoteproc fixed ids for Davinci remoteprocs are required
by some rpmsg client drivers to identify a remote processor in
a fixed manner to userspace. Add a trace during probe to warn
developers if this unique id (alias id for DT devices and platform
device id for non-DT devices) is not defined for the DSP remoteproc
device.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/davinci: Switch a debug trace statement to use %pK
Suman Anna [Wed, 2 Jan 2019 21:34:37 +0000 (15:34 -0600)]
remoteproc/davinci: Switch a debug trace statement to use %pK

Modify a debug trace statement to use %pK instead of %p for printing
the kernel virtual address for the mapped DSP internal memory regions.
The latter always prints a hashed address, and switching to %pK allows
the actual mapped address to be printed under proper conditions (by
writing a proper value to /proc/sys/kernel/kptr_restrict). The default
behavior is unchanged.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc/davinci: Use %zx for formating size_t
Bjorn Andersson [Fri, 17 Aug 2018 00:49:19 +0000 (17:49 -0700)]
remoteproc/davinci: Use %zx for formating size_t

da8xx_rproc_mem size is of type size_t, so use %zx to format the debug
print of it to avoid a compile warning.

Acked-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[s-anna@ti.com: cherry-pick commit '1e28dbbeced6' from v4.20]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoclk: keystone: sci-clk: add support from parsing clock info from DT
Tero Kristo [Thu, 20 Dec 2018 21:07:30 +0000 (23:07 +0200)]
clk: keystone: sci-clk: add support from parsing clock info from DT

Currently the sci-clk driver queries clock data from the firmware, which
can be pretty slow operation in certain cases. Add an option for the
driver to probe the available clocks from DT also, in this case the
number of clocks probed from firmware gets cut down drastically. To
enable the feature, a new flag ti,scan-clocks-from-dt can be added
under the clock provider node.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
5 years agodt-bindings: clock: ti,sci-clk: Add support for parsing clock info from DT
Tero Kristo [Mon, 31 Dec 2018 08:29:02 +0000 (10:29 +0200)]
dt-bindings: clock: ti,sci-clk: Add support for parsing clock info from DT

By default, the available clock info is queried from firmware, which can
be quite a lengthy operation if there is a very large amount of clocks
available. Add option for parsing the used clocks from DT instead, and
only register these which can improve the boot time of the device quite
a lot.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agosoc: ti: Add TI_MESSAGE_MANAGER to default K3 AM65x SoC options
Tero Kristo [Thu, 20 Dec 2018 07:58:12 +0000 (09:58 +0200)]
soc: ti: Add TI_MESSAGE_MANAGER to default K3 AM65x SoC options

This fixes the following warning with make allmodconfig:

WARNING: unmet direct dependencies detected for TI_SCI_PROTOCOL
  Depends on [m]: TI_MESSAGE_MANAGER [=m]
  Selected by [y]:
  - ARCH_K3_AM6_SOC [=y] && ARM64 [=y] && ARCH_K3 [=y]

Reported-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into...
LCPD Auto Merger [Tue, 25 Dec 2018 00:30:16 +0000 (18:30 -0600)]
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y

* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  rpmsg: add a description field
  samples/rpmsg: Introduce a module parameter for message count
  remoteproc: add an api to do pa to da conversion
  remoteproc: add api for retrieving a rproc unique id
  remoteproc: add name in rproc_mem_entry struct
  remoteproc: Check for NULL firmwares in sysfs interface
  ti_config_fragments: v8_rpmsg: Enable OMAP HwSpinlock driver
  arm64: dts: ti: k3-am65-main: Add hwspinlock node
  hwspinlock/omap: Add support for TI K3 SoCs
  dt-bindings: hwlock: Update OMAP binding for TI K3 AM65x SoCs
  hwspinlock/omap: Add a trace during probe
  ti_config_fragments: v8_defconfig_map: Add v8 rpmsg config file
  ti_config_fragments: v8_rpmsg: Add RPMsg domain config fragment file
  ti_config_fragments: defconfig_map: Include RPMsg config fragment
  ti_config_fragments: rpmsg: Add RPMsg domain config fragment file
  rpmsg: char: Migrate to iter versions of read and write

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'rpmsg-ti-linux-4.19.y-intg' of git://git.ti.com/rpmsg/rpmsg into ti...
LCPD Auto Merger [Mon, 24 Dec 2018 23:39:57 +0000 (17:39 -0600)]
Merge branch 'rpmsg-ti-linux-4.19.y-intg' of git://git.ti.com/rpmsg/rpmsg into ti-linux-4.19.y

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

* 'rpmsg-ti-linux-4.19.y-intg' of git://git.ti.com/rpmsg/rpmsg:
  rpmsg: add a description field
  samples/rpmsg: Introduce a module parameter for message count
  remoteproc: add an api to do pa to da conversion
  remoteproc: add api for retrieving a rproc unique id
  remoteproc: add name in rproc_mem_entry struct
  remoteproc: Check for NULL firmwares in sysfs interface
  ti_config_fragments: v8_rpmsg: Enable OMAP HwSpinlock driver
  arm64: dts: ti: k3-am65-main: Add hwspinlock node
  hwspinlock/omap: Add support for TI K3 SoCs
  dt-bindings: hwlock: Update OMAP binding for TI K3 AM65x SoCs
  hwspinlock/omap: Add a trace during probe
  ti_config_fragments: v8_defconfig_map: Add v8 rpmsg config file
  ti_config_fragments: v8_rpmsg: Add RPMsg domain config fragment file
  ti_config_fragments: defconfig_map: Include RPMsg config fragment
  ti_config_fragments: rpmsg: Add RPMsg domain config fragment file
  rpmsg: char: Migrate to iter versions of read and write

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agorpmsg: virtio_rpmsg_bus: move back rpmsg_hdr into a public header
Suman Anna [Tue, 9 Jan 2018 18:45:04 +0000 (12:45 -0600)]
rpmsg: virtio_rpmsg_bus: move back rpmsg_hdr into a public header

Commit e88dae5da46d ("rpmsg: Move virtio specifics from public header")
has moved the struct rpmsg_hdr definition from the public rpmsg.h and
made it private to virtio_rpmsg_bus module. This structure is a common
header used in all virtio rpmsg messages, and used by various virtio
rpmsg bus drivers. So, move this back into the virtio_rpmsg specific
public header to make it visible to various rpmsg drivers.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoMerge branch 'rpmsg-ti-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg into rpmsg-ti...
Suman Anna [Fri, 21 Dec 2018 18:27:12 +0000 (12:27 -0600)]
Merge branch 'rpmsg-ti-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg into rpmsg-ti-linux-4.19.y-intg

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoMerge branch 'hwspinlock-linux-4.19.y' of git://git.ti.com/rpmsg/hwspinlock into...
Suman Anna [Fri, 21 Dec 2018 17:41:09 +0000 (11:41 -0600)]
Merge branch 'hwspinlock-linux-4.19.y' of git://git.ti.com/rpmsg/hwspinlock into rpmsg-ti-linux-4.19.y

Pull in the hwspinlock feature tree to bring in the base rpmsg domain
config fragments and the defconfig_builder infrastructure used by TI
Integration kernels. The merge also brings in the support for the
HwSpinlock IP present on K3 AM65x SoCs, including the dependent platform
tree that adds the board support for all the AM65x boards.

* 'hwspinlock-linux-4.19.y' of git://git.ti.com/rpmsg/hwspinlock: (132 commits)
  ti_config_fragments: v8_rpmsg: Enable OMAP HwSpinlock driver
  arm64: dts: ti: k3-am65-main: Add hwspinlock node
  hwspinlock/omap: Add support for TI K3 SoCs
  dt-bindings: hwlock: Update OMAP binding for TI K3 AM65x SoCs
  hwspinlock/omap: Add a trace during probe
  ti_config_fragments: v8_defconfig_map: Add v8 rpmsg config file
  ti_config_fragments: v8_rpmsg: Add RPMsg domain config fragment file
  ti_config_fragments: defconfig_map: Include RPMsg config fragment
  ti_config_fragments: rpmsg: Add RPMsg domain config fragment file
  dmaengine: ti: k3-udma: Try to use the highest TPL channels for MEM_TO_MEM
  dmaengine: ti: k3-udma: Only allow MEM_TO_MEM transfer on the main UDMA
  ti_config_fragments/defconfig_map.txt: add missing baseport.cfg entries
  ti_config_fragments: v8_baseport: Forward port v8_baseport cfg from 4.14
  arm64: dts: ti: k3-am6: Add NAVSS and PDMA nodes
  dmaengine: ti: k3-udma: Add glue layer for non DMAengine users
  dmaengine: ti: New driver for K3 UDMA
  dmaengine: ti: Add cppi5 header for UDMA
  dt-bindings: dma: ti: Add document for K3 UDMA
  dmaengine: Add function to request slave channel from a dma_device
  dmaengine: Add support for reporting DMA cached data amount
  ...

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoMerge branch 'rpmsg-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg into rpmsg-ti-linux...
Suman Anna [Fri, 21 Dec 2018 17:23:11 +0000 (11:23 -0600)]
Merge branch 'rpmsg-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg into rpmsg-ti-linux-4.19.y

Merge the baseline rpmsg and remoteproc patches into the RPMsg domain
integration branch: rpmsg-ti-linux-4.19.y. These are baselined on the
vanilla v4.19 kernel and includes some upstream backports from v4.20
kernel. The patches also include few additional enhancements to
rpmsg/remoteproc cores.

The enhancements to remoteproc core include adding API to allow rpmsg
bus drivers to be able to retrieve a SoC-wide unique rproc id for usage
by some rpmsg drivers/userspace stacks and an API to perform physical
to device address translations. Also included is a minor improvement
that checks for NULL firmwares on the sysfs 'firmware' file interface.

The enhancements to rpmsg core are primarily about adding a new descriptor
field to the rpmsg channel device to allow multiple instances of a rpmsg
client driver, and is an enhanced version of the equivalent feature on
4.14 kernel providing backward compatibility.

Note that the support for rpmsg buffers in HIGHMEM and/or regular
carveouts is already supported in mainline kernel (default CMA pools
in Linux are allocated from HIGHMEM range since 3.18 if the platform
has large enough memory for HIGHMEM).

* 'rpmsg-linux-4.19.y' of git://git.ti.com/rpmsg/rpmsg:
  rpmsg: add a description field
  samples/rpmsg: Introduce a module parameter for message count
  remoteproc: add an api to do pa to da conversion
  remoteproc: add api for retrieving a rproc unique id
  remoteproc: add name in rproc_mem_entry struct
  remoteproc: Check for NULL firmwares in sysfs interface
  rpmsg: char: Migrate to iter versions of read and write

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into...
LCPD Auto Merger [Fri, 21 Dec 2018 14:31:26 +0000 (08:31 -0600)]
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y

* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  ti_config_fragments: v8_defconfig_map.txt: remove android-base-arm64.config
  ti_config_fragments: defconfig_map.txt: remove android-base-arm.config

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'integration-ti-linux-4.19.y' of git://git.ti.com/ti-linux-kernel/kernel...
LCPD Auto Merger [Fri, 21 Dec 2018 13:39:23 +0000 (07:39 -0600)]
Merge branch 'integration-ti-linux-4.19.y' of git://git.ti.com/ti-linux-kernel/kernel-integration-tree into ti-linux-4.19.y

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

* 'integration-ti-linux-4.19.y' of git://git.ti.com/ti-linux-kernel/kernel-integration-tree:
  ti_config_fragments: v8_defconfig_map.txt: remove android-base-arm64.config
  ti_config_fragments: defconfig_map.txt: remove android-base-arm.config

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoti_config_fragments: v8_defconfig_map.txt: remove android-base-arm64.config
Praneeth Bajjuri [Thu, 20 Dec 2018 07:25:22 +0000 (07:25 +0000)]
ti_config_fragments: v8_defconfig_map.txt: remove android-base-arm64.config

android-base-arm64.config doesn't exist in android kernel configs
project yet.

Hence removing from the v8_defconfig_map file to generate the needed
android defconfig file for TI ARMv8 family of devices.

Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agoti_config_fragments: defconfig_map.txt: remove android-base-arm.config
Praneeth Bajjuri [Thu, 20 Dec 2018 07:25:21 +0000 (07:25 +0000)]
ti_config_fragments: defconfig_map.txt: remove android-base-arm.config

android-base-arm.config doesn't exist in android kernel configs
project yet.

Hence removing from the defconfig_map file to generate the needed
android defconfig file for am57x family of devices.

Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into...
LCPD Auto Merger [Thu, 20 Dec 2018 09:39:40 +0000 (03:39 -0600)]
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y

* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  firmware: ti_sci: Add support for processor control
  arm64: dts: ti: k3-am65-mcu: Add the MCU RAM node
  arm64: dts: ti: k3-am65: add MCU SRAM ranges in interconnect nodes

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel...
LCPD Auto Merger [Thu, 20 Dec 2018 08:40:00 +0000 (02:40 -0600)]
Merge branch 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.19.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.19.y

* 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  firmware: ti_sci: Add support for processor control
  arm64: dts: ti: k3-am65-mcu: Add the MCU RAM node
  arm64: dts: ti: k3-am65: add MCU SRAM ranges in interconnect nodes

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoremoteproc/wkup_m3: set deny_sysfs_ops flag
Suman Anna [Mon, 10 Sep 2018 17:48:34 +0000 (12:48 -0500)]
remoteproc/wkup_m3: set deny_sysfs_ops flag

The Wakeup M3 remote processor is controlled by the wkup_m3_ipc
client driver, so set the newly introduced 'deny_sysfs_ops' flag
to not allow any overriding of the remoteproc firmware or state
from userspace.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: introduce deny_sysfs_ops flag
Suman Anna [Mon, 10 Sep 2018 17:30:26 +0000 (12:30 -0500)]
remoteproc: introduce deny_sysfs_ops flag

The remoteproc framework provides sysfs interfaces for changing
the firmware name and for starting/stopping a remote processor
through the sysfs files 'state' and 'firmware'. These interfaces
are currently allowed irrespective of how the remoteprocs were
booted (like remoteproc self auto-boot, remoteproc client-driven
boot etc). These interfaces can adversely affect a remoteproc
and its clients especially when a remoteproc is being controlled
by a remoteproc client driver(s). Also, not all remoteproc
drivers may want to support the sysfs interfaces by default.

Add support to deny the sysfs state/firmware change by introducing
a state flag 'deny_sysfs_ops' that the individual remoteproc drivers
can set based on their usage needs. The default behavior is to
allow the sysfs operations as before.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agofirmware: ti_sci: Add support for processor control
Suman Anna [Wed, 19 Dec 2018 14:01:14 +0000 (08:01 -0600)]
firmware: ti_sci: Add support for processor control

Texas Instrument's System Control Interface (TI-SCI) Message Protocol
is used in Texas Instrument's System on Chip (SoC) such as those
in K3 family AM654 SoC to communicate between various compute
processors with a central system controller entity.

The system controller provides various services including the control
of other compute processors within the SoC. Extend the TI-SCI protocol
support to add various TI-SCI commands to invoke services associated
with power and reset control, and boot vector management of the
various compute processors from the Linux kernel.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoarm64: dts: ti: k3-am65-mcu: Add the MCU RAM node
Suman Anna [Wed, 19 Dec 2018 01:26:30 +0000 (19:26 -0600)]
arm64: dts: ti: k3-am65-mcu: Add the MCU RAM node

Add the on-chip SRAM present within the MCU domain as a mmio-sram node.
The K3 AM65x SoCs have 512 KB of such memory. Any specific memory range
within this RAM needed by a software module ought to be reserved using
an appropriate child node.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoarm64: dts: ti: k3-am65: add MCU SRAM ranges in interconnect nodes
Suman Anna [Wed, 19 Dec 2018 01:26:29 +0000 (19:26 -0600)]
arm64: dts: ti: k3-am65: add MCU SRAM ranges in interconnect nodes

Add the address space for the MCU SRAM memory to the ranges property
of the cbass_mcu interconnect node so that the addresses within the
mcu_sram nodes and its children can be translated properly by the
relevant OF address API.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agorpmsg: add a description field
Ohad Ben-Cohen [Wed, 13 Jun 2018 08:21:10 +0000 (11:21 +0300)]
rpmsg: add a description field

Add a new description field to the rpmsg bus infrastructure
that can be passed onto the rpmsg client drivers for additional
information. The current rpmsg bus client drivers need to have
a fixed id_table for proper matching, this new field can allow
flexibility for the client drivers (eg: like creating unique
cdevs).

The description field is published through an enhanced name
service announcement message structure. The name service
message processing logic is updated to maintain backward
compatibility with the previous message structure.

Based on an initial patch from Ohad Ben-Cohen.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
[s-anna@ti.com: forward port, add sysfs documentation, fixup qcom drivers]
Signed-off-by: Suman Anna <s-anna@ti.com>
[t-kristo@ti.com: reworked to support both rpmsg with/without the desc field]
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agosamples/rpmsg: Introduce a module parameter for message count
Suman Anna [Wed, 18 Jul 2018 21:44:55 +0000 (16:44 -0500)]
samples/rpmsg: Introduce a module parameter for message count

The current rpmsg_client_sample uses a fixed number of messages to
be sent to each instance. This is currently set at 100. Introduce
an optional module parameter 'count' so that the number of messages
to be exchanged can be made flexible.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: add an api to do pa to da conversion
Subramaniam Chanderashekarapuram [Mon, 18 Aug 2014 22:13:17 +0000 (17:13 -0500)]
remoteproc: add an api to do pa to da conversion

Added an api to provide memory translation from a
physical address to a device virtual address.
Since, carveouts and mappings are stored separately,
we need to traverse both lists.

Also stored the physical addresses for RSC_DEVMEM entries
to enable pa to da conversion for dev mem address spaces too.

Signed-off-by: Subramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: add api for retrieving a rproc unique id
Suman Anna [Mon, 15 Jan 2018 18:01:54 +0000 (12:01 -0600)]
remoteproc: add api for retrieving a rproc unique id

A new api, rproc_get_id(), is added to allow remoteproc/rpmsg clients
to be able to retrieve a fixed unique id associated with a rproc
device. Each of the rprocs is given an ida index as well, but this
is dynamic depending on the order rproc_alloc is called (probe order),
and also depends on what remote processor devices are instantiated.
This unique id needs to be supported for both DT and non-DT devices.
The platform device id or the remoteproc alias id are therefore
chosen for non-DT and DT devices respectively, with the assumption
that the remoteproc devices are created with known platform device
ids or alias ids in DT.

Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: add name in rproc_mem_entry struct
Loic Pallardy [Fri, 27 Jul 2018 13:14:39 +0000 (15:14 +0200)]
remoteproc: add name in rproc_mem_entry struct

[ Upstream commit 3265230c5b05fe919291d09e266a8aedc85ebad0 ]

Add name field in struct rproc_mem_entry.
This new field will be used to match memory area
requested in resource table with pre-registered carveout.

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[s-anna@ti.com: cherry-pick commit '3265230c5b05' from v4.20]
Signed-off-by: Suman Anna <s-anna@ti.com>
5 years agoremoteproc: Check for NULL firmwares in sysfs interface
Suman Anna [Sat, 15 Sep 2018 00:37:22 +0000 (19:37 -0500)]
remoteproc: Check for NULL firmwares in sysfs interface

[ Upstream commit faeadbb64094757150a8c2a3175ca418dbdd472c ]

The remoteproc framework provides a sysfs file 'firmware'
for modifying the firmware image name from userspace. Add
an additional check to ensure NULL firmwares are errored
out right away, rather than getting a delayed error while
requesting a firmware during the start of a remoteproc
later on.

Tested-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[s-anna@ti.com: cherry-pick commit 'faeadbb64094' from v4.20]

5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into... ti-rt-linux-4.14.y-next-20181214 ti-rt-linux-4.19.y-next-20181214
LCPD Auto Merger [Fri, 14 Dec 2018 00:20:39 +0000 (18:20 -0600)]
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y

* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (119 commits)
  Linux 4.19.9
  HID: quirks: fix RetroUSB.com devices
  mac80211: ignore NullFunc frames in the duplicate detection
  mac80211: fix reordering of buffered broadcast packets
  mac80211: ignore tx status for PS stations in ieee80211_tx_status_ext
  mac80211: Clear beacon_int in ieee80211_do_stop
  mac80211: fix GFP_KERNEL under tasklet context
  mac80211_hwsim: Timer should be initialized before device registered
  cfg80211: Fix busy loop regression in ieee80211_ie_split_ric()
  libnvdimm, pfn: Pad pfn namespaces relative to other regions
  kgdboc: fix KASAN global-out-of-bounds bug in param_set_kgdboc_var()
  gnss: sirf: fix activation retry handling
  tty: do not set TTY_IO_ERROR flag if console port
  tty: serial: 8250_mtk: always resume the device in probe.
  Drivers: hv: vmbus: Offload the handling of channels to two workqueues
  x86/efi: Allocate e820 buffer before calling efi_exit_boot_service
  kprobes/x86: Fix instruction patching corruption when copying more than one RIP-relative instruction
  drm/i915: Downgrade Gen9 Plane WM latency error
  drm/amdgpu/gmc8: always load MC firmware in the driver
  drm/amdgpu/gmc8: update MC firmware for polaris
  ...

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'linux-4.19.y' of http://git.kernel.org/pub/scm/linux/kernel/git/stable... ti-linux-4.14.y-next-20181214 ti-linux-4.19.y-next-20181214
LCPD Auto Merger [Thu, 13 Dec 2018 22:30:30 +0000 (16:30 -0600)]
Merge branch 'linux-4.19.y' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into ti-linux-4.19.y

* 'linux-4.19.y' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (408 commits)
  Linux 4.19.9
  HID: quirks: fix RetroUSB.com devices
  mac80211: ignore NullFunc frames in the duplicate detection
  mac80211: fix reordering of buffered broadcast packets
  mac80211: ignore tx status for PS stations in ieee80211_tx_status_ext
  mac80211: Clear beacon_int in ieee80211_do_stop
  mac80211: fix GFP_KERNEL under tasklet context
  mac80211_hwsim: Timer should be initialized before device registered
  cfg80211: Fix busy loop regression in ieee80211_ie_split_ric()
  libnvdimm, pfn: Pad pfn namespaces relative to other regions
  kgdboc: fix KASAN global-out-of-bounds bug in param_set_kgdboc_var()
  gnss: sirf: fix activation retry handling
  tty: do not set TTY_IO_ERROR flag if console port
  tty: serial: 8250_mtk: always resume the device in probe.
  Drivers: hv: vmbus: Offload the handling of channels to two workqueues
  x86/efi: Allocate e820 buffer before calling efi_exit_boot_service
  kprobes/x86: Fix instruction patching corruption when copying more than one RIP-relative instruction
  drm/i915: Downgrade Gen9 Plane WM latency error
  drm/amdgpu/gmc8: always load MC firmware in the driver
  drm/amdgpu/gmc8: update MC firmware for polaris
  ...

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'linux-4.19.y-rt' of https://git.kernel.org/pub/scm/linux/kernel/git...
LCPD Auto Merger [Thu, 13 Dec 2018 21:31:51 +0000 (15:31 -0600)]
Merge branch 'linux-4.19.y-rt' of https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel into ti-rt-linux-4.19.y

TI-Feature: linux_rt-4-19
TI-Tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
TI-Branch: linux-4.19.y-rt

* 'linux-4.19.y-rt' of https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel: (295 commits)
  v4.19.8-rt6
  x86/mm/pat: disable preemption __split_large_page() after spin_lock()
  drm/i915: disable tracing on -RT
  hrtimer: move state change before hrtimer_cancel in do_nanosleep()
  x86/fpu: Disable preemption around local_bh_disable()
  v4.19.8-rt5
  Linux 4.19.8
  blk-mq: punt failed direct issue to dispatch list
  tipc: use destination length for copy string
  arc: [devboards] Add support of NFSv3 ACL
  ARC: change defconfig defaults to ARCv2
  btrfs: tree-checker: Don't check max block group size as current max chunk size limit is unreliable
  Input: elan_i2c - add support for ELAN0621 touchpad
  Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARR
  Input: elan_i2c - add ELAN0620 to the ACPI table
  Input: cros_ec_keyb - fix button/switch capability reports
  Input: matrix_keypad - check for errors from of_get_named_gpio()
  Input: synaptics - add PNP ID for ThinkPad P50 to SMBus
  Input: xpad - quirk all PDP Xbox One gamepads
  scsi: lpfc: fix block guard enablement on SLI3 adapters
  ...

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agov4.19.8-rt6
Sebastian Andrzej Siewior [Thu, 13 Dec 2018 17:18:57 +0000 (18:18 +0100)]
v4.19.8-rt6

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
5 years agox86/mm/pat: disable preemption __split_large_page() after spin_lock()
Sebastian Andrzej Siewior [Tue, 11 Dec 2018 20:53:43 +0000 (21:53 +0100)]
x86/mm/pat: disable preemption __split_large_page() after spin_lock()

Commit "x86/mm/pat: Disable preemption around __flush_tlb_all()" added a
warning if __flush_tlb_all() is invoked in preemptible context. On !RT
the warning does not trigger because a spin lock is acquired which
disables preemption. On RT the spin lock does not disable preemption and
so the warning is seen.

Disable preemption to avoid the warning __flush_tlb_all().

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
5 years agodrm/i915: disable tracing on -RT
Sebastian Andrzej Siewior [Thu, 6 Dec 2018 08:52:20 +0000 (09:52 +0100)]
drm/i915: disable tracing on -RT

Luca Abeni reported this:
| BUG: scheduling while atomic: kworker/u8:2/15203/0x00000003
| CPU: 1 PID: 15203 Comm: kworker/u8:2 Not tainted 4.19.1-rt3 #10
| Call Trace:
|  rt_spin_lock+0x3f/0x50
|  gen6_read32+0x45/0x1d0 [i915]
|  g4x_get_vblank_counter+0x36/0x40 [i915]
|  trace_event_raw_event_i915_pipe_update_start+0x7d/0xf0 [i915]

The tracing events use trace_i915_pipe_update_start() among other events
use functions acquire spin locks. A few trace points use
intel_get_crtc_scanline(), others use ->get_vblank_counter() wich also
might acquire a sleeping lock.

Based on this I don't see any other way than disable trace points on RT.

Cc: stable-rt@vger.kernel.org
Reported-by: Luca Abeni <lucabe72@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
5 years agohrtimer: move state change before hrtimer_cancel in do_nanosleep()
Sebastian Andrzej Siewior [Thu, 6 Dec 2018 09:15:13 +0000 (10:15 +0100)]
hrtimer: move state change before hrtimer_cancel in do_nanosleep()

There is a small window between setting t->task to NULL and waking the
task up (which would set TASK_RUNNING). So the timer would fire, run and
set ->task to NULL while the other side/do_nanosleep() wouldn't enter
freezable_schedule(). After all we are peemptible here (in
do_nanosleep() and on the timer wake up path) and on KVM/virt the
virt-CPU might get preempted.
So do_nanosleep() wouldn't enter freezable_schedule() but cancel the
timer which is still running and wait for it via
hrtimer_wait_for_timer(). Then wait_event()/might_sleep() would complain
that it is invoked with state != TASK_RUNNING.
This isn't a problem since it would be reset to TASK_RUNNING later
anyway and we don't rely on the previous state.

Move the state update to TASK_RUNNING before hrtimer_cancel() so there
are no complains from might_sleep() about wrong state.

Cc: stable-rt@vger.kernel.org
Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
5 years agox86/fpu: Disable preemption around local_bh_disable()
Sebastian Andrzej Siewior [Tue, 11 Dec 2018 14:10:33 +0000 (15:10 +0100)]
x86/fpu: Disable preemption around local_bh_disable()

__fpu__restore_sig() restores the content of the FPU state in the CPUs
and in order to avoid concurency it disbles BH. On !RT it also disables
preemption but on RT we can get preempted in BH.

Add preempt_disable() while the FPU state is restored.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into...
LCPD Auto Merger [Thu, 13 Dec 2018 11:36:52 +0000 (05:36 -0600)]
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y

TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y

* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
  kbuild: dtbinst: Install overlays
  dmaengine: ti: k3-udma: Fix compiler warning in udma_get_chan_pair
  clk: keystone: sci-clk: add slack to clk-set-rate passed to firmware
  clk: keystone: sci-clk: increase the max gap size to 50 for clk ids
  HACK: firmware: ti_sci: increase timeout to 10000ms
  arm64: dts: ti: am6: Add the trng node
  char: hwrng: Kconfig: Or ARCH_K3 dependency for HW_RANDOM_OMAP
  arm64: dts: k3-am6: Add crypto accelarator node
  sa2ul: Add 3DES ECB & CBC Mode support
  crypto: sa2ul: Add hmac(sha256) HMAC algorithm support
  crypto: sa2ul: Add hmac(sha1) HMAC algorithm support
  crypto: sa2ul: Add hmac(sha256)cbc(aes) AEAD Algo support
  crypto: sha256_generic: Export the Transform function
  crypto: sa2ul: Add aead support for hmac(sha1)cbc(aes) algorithm
  crypto: sa2ul: Add AES ECB Mode support
  crypto: sa2ul: Add crypto driver
  dt-bindings: crypto: k3: Add sa2ul bindings documentation

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoMerge branch 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel...
LCPD Auto Merger [Thu, 13 Dec 2018 08:39:55 +0000 (02:39 -0600)]
Merge branch 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.19.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.19.y

* 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
  kbuild: dtbinst: Install overlays
  dmaengine: ti: k3-udma: Fix compiler warning in udma_get_chan_pair
  clk: keystone: sci-clk: add slack to clk-set-rate passed to firmware
  clk: keystone: sci-clk: increase the max gap size to 50 for clk ids
  HACK: firmware: ti_sci: increase timeout to 10000ms
  arm64: dts: ti: am6: Add the trng node
  char: hwrng: Kconfig: Or ARCH_K3 dependency for HW_RANDOM_OMAP
  arm64: dts: k3-am6: Add crypto accelarator node
  sa2ul: Add 3DES ECB & CBC Mode support
  crypto: sa2ul: Add hmac(sha256) HMAC algorithm support
  crypto: sa2ul: Add hmac(sha1) HMAC algorithm support
  crypto: sa2ul: Add hmac(sha256)cbc(aes) AEAD Algo support
  crypto: sha256_generic: Export the Transform function
  crypto: sa2ul: Add aead support for hmac(sha1)cbc(aes) algorithm
  crypto: sa2ul: Add AES ECB Mode support
  crypto: sa2ul: Add crypto driver
  dt-bindings: crypto: k3: Add sa2ul bindings documentation

Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
5 years agoLinux 4.19.9
Greg Kroah-Hartman [Thu, 13 Dec 2018 08:16:23 +0000 (09:16 +0100)]
Linux 4.19.9

5 years agoHID: quirks: fix RetroUSB.com devices
Nic Soudée [Thu, 6 Dec 2018 16:59:25 +0000 (11:59 -0500)]
HID: quirks: fix RetroUSB.com devices

commit 868613f1c0ccf7b832f38b48b18cca31cdeb3d26 upstream.

SNES RetroPort and RetroPad register only 4 gamepad buttons
when they should register all 8 buttons. This is described here:

https://ask.fedoraproject.org/en/question/128102

This is happening because of:

Commit 190d7f02ce8e ("HID: input: do not increment usages when
    duplicate is found")

Here, I add the quirk HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE
(created for backward compatibility with the change in 190d7f02ce8e)
for the two products.

Tested with both RetroPort and RetroPad.

Cc: stable@vger.kernel.org # v4.18+
Signed-off-by: Nic Soudée <nsoudee@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomac80211: ignore NullFunc frames in the duplicate detection
Emmanuel Grumbach [Mon, 3 Dec 2018 19:16:07 +0000 (21:16 +0200)]
mac80211: ignore NullFunc frames in the duplicate detection

commit 990d71846a0b7281bd933c34d734e6afc7408e7e upstream.

NullFunc packets should never be duplicate just like
QoS-NullFunc packets.

We saw a client that enters / exits power save with
NullFunc frames (and not with QoS-NullFunc) despite the
fact that the association supports HT.
This specific client also re-uses a non-zero sequence number
for different NullFunc frames.
At some point, the client had to send a retransmission of
the NullFunc frame and we dropped it, leading to a
misalignment in the power save state.
Fix this by never consider a NullFunc frame as duplicate,
just like we do for QoS NullFunc frames.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=201449

CC: <stable@vger.kernel.org>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomac80211: fix reordering of buffered broadcast packets
Felix Fietkau [Wed, 28 Nov 2018 21:39:16 +0000 (22:39 +0100)]
mac80211: fix reordering of buffered broadcast packets

commit 9ec1190d065998650fd9260dea8cf3e1f56c0e8c upstream.

If the buffered broadcast queue contains packets, letting new packets bypass
that queue can lead to heavy reordering, since the driver is probably throttling
transmission of buffered multicast packets after beacons.

Keep buffering packets until the buffer has been cleared (and no client
is in powersave mode).

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomac80211: ignore tx status for PS stations in ieee80211_tx_status_ext
Felix Fietkau [Tue, 13 Nov 2018 19:32:13 +0000 (20:32 +0100)]
mac80211: ignore tx status for PS stations in ieee80211_tx_status_ext

commit a317e65face482371de30246b6494feb093ff7f9 upstream.

Make it behave like regular ieee80211_tx_status calls, except for the lack of
filtered frame processing.
This fixes spurious low-ack triggered disconnections with powersave clients
connected to an AP.

Fixes: f027c2aca0cf4 ("mac80211: add ieee80211_tx_status_noskb")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomac80211: Clear beacon_int in ieee80211_do_stop
Ben Greear [Tue, 23 Oct 2018 20:36:52 +0000 (13:36 -0700)]
mac80211: Clear beacon_int in ieee80211_do_stop

commit 5c21e8100dfd57c806e833ae905e26efbb87840f upstream.

This fixes stale beacon-int values that would keep a netdev
from going up.

To reproduce:

Create two VAP on one radio.
vap1 has beacon-int 100, start it.
vap2 has beacon-int 240, start it (and it will fail
  because beacon-int mismatch).
reconfigure vap2 to have beacon-int 100 and start it.
  It will fail because the stale beacon-int 240 will be used
  in the ifup path and hostapd never gets a chance to set the
  new beacon interval.

Cc: stable@vger.kernel.org
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomac80211: fix GFP_KERNEL under tasklet context
Yan-Hsuan Chuang [Tue, 23 Oct 2018 03:24:44 +0000 (11:24 +0800)]
mac80211: fix GFP_KERNEL under tasklet context

commit c752cac9db1b0c469db7ba9d17af4ba708984db5 upstream.

cfg80211_sta_opmode_change_notify needs a gfp_t flag to hint the nl80211
stack when allocating new skb, but it is called under tasklet context
here with GFP_KERNEL and kernel will yield a warning about it.

Cc: stable@vger.kernel.org
Fixes: ff84e7bfe176 ("mac80211: Add support to notify ht/vht opmode modification.")
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agomac80211_hwsim: Timer should be initialized before device registered
Vasyl Vavrychuk [Wed, 17 Oct 2018 22:02:12 +0000 (01:02 +0300)]
mac80211_hwsim: Timer should be initialized before device registered

commit a1881c9b8a1edef0a5ae1d5c1b61406fe3402114 upstream.

Otherwise if network manager starts configuring Wi-Fi interface
immidiatelly after getting notification of its creation, we will get
NULL pointer dereference:

  BUG: unable to handle kernel NULL pointer dereference at           (null)
  IP: [<ffffffff95ae94c8>] hrtimer_active+0x28/0x50
  ...
  Call Trace:
   [<ffffffff95ae9997>] ? hrtimer_try_to_cancel+0x27/0x110
   [<ffffffff95ae9a95>] ? hrtimer_cancel+0x15/0x20
   [<ffffffffc0803bf0>] ? mac80211_hwsim_config+0x140/0x1c0 [mac80211_hwsim]

Cc: stable@vger.kernel.org
Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@globallogic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agocfg80211: Fix busy loop regression in ieee80211_ie_split_ric()
Jouni Malinen [Wed, 5 Dec 2018 10:55:54 +0000 (12:55 +0200)]
cfg80211: Fix busy loop regression in ieee80211_ie_split_ric()

commit 312ca38ddda64bac6513ec68e0ac3789b4eb44dc upstream.

This function was modified to support the information element extension
case (WLAN_EID_EXTENSION) in a manner that would result in an infinite
loop when going through set of IEs that include WLAN_EID_RIC_DATA and
contain an IE that is in the after_ric array. The only place where this
can currently happen is in mac80211 ieee80211_send_assoc() where
ieee80211_ie_split_ric() is called with after_ric[].

This can be triggered by valid data from user space nl80211
association/connect request (i.e., requiring GENL_UNS_ADMIN_PERM). The
only known application having an option to include WLAN_EID_RIC_DATA in
these requests is wpa_supplicant and it had a bug that prevented this
specific contents from being used (and because of that, not triggering
this kernel bug in an automated test case ap_ft_ric) and now that this
bug is fixed, it has a workaround to avoid this kernel issue.
WLAN_EID_RIC_DATA is currently used only for testing purposes, so this
does not cause significant harm for production use cases.

Fixes: 2512b1b18d07 ("mac80211: extend ieee80211_ie_split to support EXTENSION")
Cc: stable@vger.kernel.org
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agolibnvdimm, pfn: Pad pfn namespaces relative to other regions
Dan Williams [Sat, 24 Nov 2018 18:47:04 +0000 (10:47 -0800)]
libnvdimm, pfn: Pad pfn namespaces relative to other regions

commit ae86cbfef3818300f1972e52f67a93211acb0e24 upstream.

Commit cfe30b872058 "libnvdimm, pmem: adjust for section collisions with
'System RAM'" enabled Linux to workaround occasions where platform
firmware arranges for "System RAM" and "Persistent Memory" to collide
within a single section boundary. Unfortunately, as reported in this
issue [1], platform firmware can inflict the same collision between
persistent memory regions.

The approach of interrogating iomem_resource does not work in this
case because platform firmware may merge multiple regions into a single
iomem_resource range. Instead provide a method to interrogate regions
that share the same parent bus.

This is a stop-gap until the core-MM can grow support for hotplug on
sub-section boundaries.

[1]: https://github.com/pmem/ndctl/issues/76

Fixes: cfe30b872058 ("libnvdimm, pmem: adjust for section collisions with...")
Cc: <stable@vger.kernel.org>
Reported-by: Patrick Geary <patrickg@supermicro.com>
Tested-by: Patrick Geary <patrickg@supermicro.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agokgdboc: fix KASAN global-out-of-bounds bug in param_set_kgdboc_var()
Macpaul Lin [Wed, 17 Oct 2018 15:08:38 +0000 (23:08 +0800)]
kgdboc: fix KASAN global-out-of-bounds bug in param_set_kgdboc_var()

commit dada6a43b0402eba438a17ac86fdc64ac56a4607 upstream.

This patch is trying to fix KE issue due to
"BUG: KASAN: global-out-of-bounds in param_set_kgdboc_var+0x194/0x198"
reported by Syzkaller scan."

[26364:syz-executor0][name:report8t]BUG: KASAN: global-out-of-bounds in param_set_kgdboc_var+0x194/0x198
[26364:syz-executor0][name:report&]Read of size 1 at addr ffffff900e44f95f by task syz-executor0/26364
[26364:syz-executor0][name:report&]
[26364:syz-executor0]CPU: 7 PID: 26364 Comm: syz-executor0 Tainted: G W 0
[26364:syz-executor0]Call trace:
[26364:syz-executor0][<ffffff9008095cf8>] dump_bacIctrace+Ox0/0x470
[26364:syz-executor0][<ffffff9008096de0>] show_stack+0x20/0x30
[26364:syz-executor0][<ffffff90089cc9c8>] dump_stack+Oxd8/0x128
[26364:syz-executor0][<ffffff90084edb38>] print_address_description +0x80/0x4a8
[26364:syz-executor0][<ffffff90084ee270>] kasan_report+Ox178/0x390
[26364:syz-executor0][<ffffff90084ee4a0>] _asan_report_loadi_noabort+Ox18/0x20
[26364:syz-executor0][<ffffff9008b092ac>] param_set_kgdboc_var+Ox194/0x198
[26364:syz-executor0][<ffffff900813af64>] param_attr_store+Ox14c/0x270
[26364:syz-executor0][<ffffff90081394c8>] module_attr_store+0x60/0x90
[26364:syz-executor0][<ffffff90086690c0>] sysfs_kl_write+Ox100/0x158
[26364:syz-executor0][<ffffff9008666d84>] kernfs_fop_write+0x27c/0x3a8
[26364:syz-executor0][<ffffff9008508264>] do_loop_readv_writev+0x114/0x1b0
[26364:syz-executor0][<ffffff9008509ac8>] do_readv_writev+0x4f8/0x5e0
[26364:syz-executor0][<ffffff9008509ce4>] vfs_writev+0x7c/Oxb8
[26364:syz-executor0][<ffffff900850ba64>] SyS_writev+Oxcc/0x208
[26364:syz-executor0][<ffffff90080883f0>] elO_svc_naked +0x24/0x28
[26364:syz-executor0][name:report&]
[26364:syz-executor0][name:report&]The buggy address belongs to the variable:
[26364:syz-executor0][name:report&] kgdb_tty_line+Ox3f/0x40
[26364:syz-executor0][name:report&]
[26364:syz-executor0][name:report&]Memory state around the buggy address:
[26364:syz-executor0] ffffff900e44f800: 00 00 00 00 00 04 fa fa fa fa fa fa 00 fa fa fa
[26364:syz-executor0] ffffff900e44f880: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
[26364:syz-executor0]> ffffff900e44f900: fa fa fa fa 04 fa fa fa fa fa fa fa 00 00 00 00
[26364:syz-executor0][name:report&]                                       ^
[26364:syz-executor0] ffffff900e44f980: 00 fa fa fa fa fa fa fa 04 fa fa fa fa fa fa fa
[26364:syz-executor0] ffffff900e44fa00: 04 fa fa fa fa fa fa fa 00 fa fa fa fa fa fa fa
[26364:syz-executor0][name:report&]
[26364:syz-executor0][name:panic&]Disabling lock debugging due to kernel taint
[26364:syz-executor0]------------[cut here]------------

After checking the source code, we've found there might be an out-of-bounds
access to "config[len - 1]" array when the variable "len" is zero.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agognss: sirf: fix activation retry handling
Johan Hovold [Wed, 5 Dec 2018 10:21:49 +0000 (11:21 +0100)]
gnss: sirf: fix activation retry handling

commit 06fd9ab12b804451b14d538adbf98a57c2d6846b upstream.

Fix activation helper which would return -ETIMEDOUT even if the last
retry attempt was successful.

Also change the semantics of the retries variable so that it actually
holds the number of retries (rather than tries).

Fixes: d2efbbd18b1e ("gnss: add driver for sirfstar-based receivers")
Cc: stable <stable@vger.kernel.org> # 4.19
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agotty: do not set TTY_IO_ERROR flag if console port
Chanho Park [Thu, 22 Nov 2018 09:23:47 +0000 (18:23 +0900)]
tty: do not set TTY_IO_ERROR flag if console port

commit 2a48602615e0a2f563549c7d5c8d507f904cf96e upstream.

Since Commit 761ed4a94582 ('tty: serial_core: convert uart_close to use
tty_port_close') and Commit 4dda864d7307 ('tty: serial_core: Fix serial
console crash on port shutdown), a serial port which is used as
console can be stuck when logging out if there is a remained process.
After logged out, agetty will try to grab the serial port but it will
be failed because the previous process did not release the port
correctly. To fix this, TTY_IO_ERROR bit should not be enabled of
tty_port_close if the port is console port.

Reproduce step:
- Run background processes from serial console
$ while true; do sleep 10; done &

- Log out
$ logout
-> Stuck

- Read journal log by journalctl | tail
Jan 28 16:07:01 ubuntu systemd[1]: Stopped Serial Getty on ttyAMA0.
Jan 28 16:07:01 ubuntu systemd[1]: Started Serial Getty on ttyAMA0.
Jan 28 16:07:02 ubuntu agetty[1643]: /dev/ttyAMA0: not a tty

Fixes: 761ed4a94582 ("tty: serial_core: convert uart_close to use tty_port_close")
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Rob Herring <robh@kernel.org>
Cc: Jiri Slaby <jslaby@suse.com>
Signed-off-by: Chanho Park <parkch98@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>