]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/log
mirror_ubuntu-bionic-kernel.git
6 years agoi2c-qcom-cci: Fix run queue completion timeout
Todor Tomov [Wed, 13 Dec 2017 15:24:33 +0000 (17:24 +0200)]
i2c-qcom-cci: Fix run queue completion timeout

BugLink: http://bugs.launchpad.net/bugs/1763040
Convert ms to jiffies.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
(cherry picked from commit ad7e386206b243ec61a762e2381d2ba0bfd65273
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agocamss: Do not register if no cameras are present
Todor Tomov [Tue, 20 Sep 2016 14:51:53 +0000 (17:51 +0300)]
camss: Do not register if no cameras are present

BugLink: http://bugs.launchpad.net/bugs/1763040
If no camera sensors are defined in DT (or they are diabled)
do not register the camss driver.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
(cherry picked from commit bc67d1ae420c3a3e0789967757da00f7ad68391c
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agocamss: vfe: Skip first four frames from sensor
Todor Tomov [Fri, 7 Apr 2017 10:22:52 +0000 (13:22 +0300)]
camss: vfe: Skip first four frames from sensor

BugLink: http://bugs.launchpad.net/bugs/1763040
As the first four frames from sensor are low quality frames - skip them.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
(cherry picked from commit 09c9976cdd1e50a2e123bd3b1c6ba95a1c5d8994
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoi2c: Add Qualcomm Camera Control Interface driver
Todor Tomov [Fri, 13 Oct 2017 10:56:41 +0000 (13:56 +0300)]
i2c: Add Qualcomm Camera Control Interface driver

BugLink: http://bugs.launchpad.net/bugs/1763040
This commit adds basic I2C bus support for the Camera Control Interface
(CCI) controller found on the Qualcomm SoC processors.

CCI versions supported:
- 1.0.8 - found on MSM8916/APQ8016 - support for the only CCI I2C bus;
- 1.4.0 - found on MSM8996/APQ8096 - support for first (out of two)
  I2C bus.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
(cherry picked from commit 786b2e3c1b0201dbc6e9ef3468ea46e96dc2e4f2
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoov5645: I2C address change
Todor Tomov [Mon, 2 Oct 2017 13:28:45 +0000 (16:28 +0300)]
ov5645: I2C address change

BugLink: http://bugs.launchpad.net/bugs/1763040
As soon as the sensor is powered on, change the I2C address to the one
specified in DT. This allows to use multiple physical sensors connected
to the same I2C bus.

Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
(cherry picked from commit 788ed89c55fac229cd5fb5966b1c7f80f41f168e
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoregulator: smd: Allow REGULATOR_QCOM_SMD_RPM=m
Amit Kucheria [Mon, 11 Dec 2017 05:44:42 +0000 (11:14 +0530)]
regulator: smd: Allow REGULATOR_QCOM_SMD_RPM=m

BugLink: http://bugs.launchpad.net/bugs/1763040
Fixes build breakage

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
(cherry picked from commit 46bc80121d2067f9a79f4f4a031fe218ca95ccca
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agocpufreq: Add apq8016 to cpufreq-dt-platdev blacklist
Georgi Djakov [Wed, 20 Sep 2017 13:52:25 +0000 (16:52 +0300)]
cpufreq: Add apq8016 to cpufreq-dt-platdev blacklist

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
(cherry picked from commit cca8df19e56f9258ad8ba0686369895f48b25401
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoPM / OPP: Add a helper to get an opp regulator for device
Georgi Djakov [Thu, 12 May 2016 11:41:33 +0000 (14:41 +0300)]
PM / OPP: Add a helper to get an opp regulator for device

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
(cherry picked from commit 0482a1c2fd22ac6d6898fd0f42e846c74d5d6c5e
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoPM / OPP: HACK: Allow to set regulator without opp_list
Georgi Djakov [Thu, 28 Apr 2016 13:20:12 +0000 (16:20 +0300)]
PM / OPP: HACK: Allow to set regulator without opp_list

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
(cherry picked from commit b7d4d64534e950f6aea4b562d39dd8b27d7d45dd
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoPM / OPP: Drop RCU usage in dev_pm_opp_adjust_voltage()
Georgi Djakov [Thu, 25 Aug 2016 15:43:35 +0000 (18:43 +0300)]
PM / OPP: Drop RCU usage in dev_pm_opp_adjust_voltage()

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
(cherry picked from commit 97c58e3fefb76f8e0cc7c2b8ee73d9d704f917f3
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoPM / OPP: Support adjusting OPP voltages at runtime
Stephen Boyd [Sat, 19 Sep 2015 00:52:06 +0000 (17:52 -0700)]
PM / OPP: Support adjusting OPP voltages at runtime

BugLink: http://bugs.launchpad.net/bugs/1763040
On some SoCs the Adaptive Voltage Scaling (AVS) technique is
employed to optimize the operating voltage of a device. At a
given frequency, the hardware monitors dynamic factors and either
makes a suggestion for how much to adjust a voltage for the
current frequency, or it automatically adjusts the voltage
without software intervention. Add an API to the OPP library for
the former case, so that AVS type devices can update the voltages
for an OPP when the hardware determines the voltage should
change. The assumption is that drivers like CPUfreq or devfreq
will register for the OPP notifiers and adjust the voltage
according to suggestions that AVS makes.

Cc: Nishanth Menon <nm@ti.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
(cherry picked from commit 8fcd0e8c8b3789274169925b30182af4698fcd9b
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoregulator: smd: Add floor and corner operations
Andy Gross [Sat, 19 Sep 2015 00:52:05 +0000 (17:52 -0700)]
regulator: smd: Add floor and corner operations

BugLink: http://bugs.launchpad.net/bugs/1763040
This patch addes the Qualcomm specific functions for setting the floor and
corner voltages on the regulators.

Signed-off-by: Andy Gross <agross@codeaurora.org>
[georgi.djakov@linaro.org: Make work with struct regulator]
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 976dbf494c836fd009cfcad61f0947239e1ff72f
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agopower: avs: cpr: Register with cpufreq-dt
Georgi Djakov [Mon, 24 Apr 2017 12:17:06 +0000 (15:17 +0300)]
power: avs: cpr: Register with cpufreq-dt

BugLink: http://bugs.launchpad.net/bugs/1763040
The CPR driver currently is handling most of the dependencies including
populating the OPPs, so just register it with cpufreq-dt.

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
(cherry picked from commit bcd483a0fb6956a7dd42c32c852b20a0919f236f
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agopower: avs: cpr: fix with new reg_sequence structures
Srinivas Kandagatla [Wed, 16 Sep 2015 15:55:12 +0000 (16:55 +0100)]
power: avs: cpr: fix with new reg_sequence structures

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
(cherry picked from commit 9c916989b35efff5e578786accee3ef1c7de032b
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agopower: avs: cpr: Use raw mem access for qfprom
Georgi Djakov [Sun, 14 Jun 2015 19:22:47 +0000 (22:22 +0300)]
power: avs: cpr: Use raw mem access for qfprom

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
(cherry picked from commit 5ad1757e08cd53ed4bd2db884da4c6dd454dbc12
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agopower: avs: Add support for CPR (Core Power Reduction)
Stephen Boyd [Sat, 19 Sep 2015 00:52:09 +0000 (17:52 -0700)]
power: avs: Add support for CPR (Core Power Reduction)

BugLink: http://bugs.launchpad.net/bugs/1763040
CPR (Core Power Reduction) is a technology that reduces core
power on a CPU or other device. It reads voltage settings in
efuse from product test process as initial settings and populates
OPPs for the device being "monitored". Each OPP corresponds to a
"corner" that has a range of valid voltages for a particular
frequency. While the device is running at a particular frequency,
CPR monitors dynamic factors such as temperature, etc. and
adjusts the voltage for that frequency accordingly to save power
and meet silicon characteristic requirements.

This driver is based on work by others on codeaurora.org[1].

[1] https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/tree/drivers/regulator/cpr-regulator.c?h=msm-3.10

Cc: <devicetree@vger.kernel.org>
Cc: David Collins <collinsd@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
(cherry picked from commit f6d8f1b702bf6a008d3cf7c69fb754310777e6ef
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoHACK: drm/msm/iommu: Remove runtime_put calls in map/unmap
Archit Taneja [Tue, 18 Apr 2017 07:56:15 +0000 (13:26 +0530)]
HACK: drm/msm/iommu: Remove runtime_put calls in map/unmap

BugLink: http://bugs.launchpad.net/bugs/1763040
The system hangs when we try to enable GPU with the runtime ops
as the are in  msm_iommu's map/unmap. Comment out the runtime_put()
calls for now. It seems like a device links issue. Needs more debug.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
(cherry picked from commit ecd376209a0c16d1dc5792151b01be2f946747d9
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: enable LEDS_QCOM_LPG
Nicolas Dechesne [Tue, 13 Mar 2018 11:35:04 +0000 (12:35 +0100)]
arm64: defconfig: enable LEDS_QCOM_LPG

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 37cd0466aac75f20c4eb73d28293cd6d0cc5f983
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: distro.config: enable 'BBR' TCP congestion algorithm
Koen Kooi [Wed, 14 Feb 2018 13:58:39 +0000 (14:58 +0100)]
kernel: distro.config: enable 'BBR' TCP congestion algorithm

BugLink: http://bugs.launchpad.net/bugs/1763040
Coupled with the 'fq' qdisc it can do packet pacing to fight both bufferbloat and packet loss.

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit c2d8ececedf19f1310493698f79f4735b4c0aa1a
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: distro.config: enable 'fq' and 'fq_codel' qdiscs
Koen Kooi [Wed, 14 Feb 2018 13:58:38 +0000 (14:58 +0100)]
kernel: distro.config: enable 'fq' and 'fq_codel' qdiscs

BugLink: http://bugs.launchpad.net/bugs/1763040
'fq_codel' is designed to fight bufferbloat, 'fq' can do similar things when coupled with the 'BBR' TCP congestion algorithm.

Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit e5ce8134178b920a4803dc4eb7ae87058d4dcdc1
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: distro.config: enable 'schedutil' CPUfreq governor
Koen Kooi [Wed, 14 Feb 2018 12:24:57 +0000 (13:24 +0100)]
kernel: distro.config: enable 'schedutil' CPUfreq governor

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit b451aee0904ea08d15e252c293eb2084f4080d11
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: configs: set USB_CONFIG_F_FS in distro.config
Nicolas Dechesne [Wed, 14 Feb 2018 08:04:41 +0000 (09:04 +0100)]
kernel: configs: set USB_CONFIG_F_FS in distro.config

BugLink: http://bugs.launchpad.net/bugs/1763040
We initially add it to arch/arm64/defconfig, however USB_CONFIG_F_FS depends on
USB_CONFIGFS which is not set in arch/arm64/defconfig, so doing a savedefconfig
would prune it. Since we have USB_CONFIGFS in kernel/configs/distro.config , it
is better to set USB_CONFIG_F_FS there as well.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 3c0bd6e79736c381322e9d25e87812d97f4a7104
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: Enable QRTR features
Ramon Fried [Mon, 12 Feb 2018 11:12:54 +0000 (13:12 +0200)]
arm64: defconfig: Enable QRTR features

BugLink: http://bugs.launchpad.net/bugs/1763040
Needed for RMTFS, modem and GPS to work properly.

Signed-off-by: Ramon Fried <rfried@codeaurora.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 16f323a9ef6b4ad0045a100f43cd7e503f490108
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: enable CONFIG_USB_CONFIGFS_F_FS by default
Ramon Fried [Tue, 6 Feb 2018 12:50:49 +0000 (14:50 +0200)]
arm64: defconfig: enable CONFIG_USB_CONFIGFS_F_FS by default

BugLink: http://bugs.launchpad.net/bugs/1763040
Allows creation of USB composite functions in userspace.
Required for diag USB support.

Signed-off-by: Ramon Fried <rfried@codeaurora.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 4255a1c29ebea8f80621603915866723f436ecea
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: configs: add freq stat to sysfs
Ramon Fried [Tue, 6 Feb 2018 12:37:40 +0000 (14:37 +0200)]
kernel: configs: add freq stat to sysfs

BugLink: http://bugs.launchpad.net/bugs/1763040
It's useful for testing cpu frequency

Signed-off-by: Ramon Fried <rfried@codeaurora.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 5c4ed6e4d87964c606cc939c790cddb8760899cd
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: configs: Enable camera drivers
Todor Tomov [Mon, 3 Apr 2017 10:46:17 +0000 (13:46 +0300)]
arm64: configs: Enable camera drivers

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Todor Tomov <todor.tomov@linaro.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit b82b34782cabaf10c3301229b043fda976e87549
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: disable ANALOG_TV and DIGITAL_TV
Nicolas Dechesne [Fri, 2 Feb 2018 15:30:46 +0000 (16:30 +0100)]
arm64: defconfig: disable ANALOG_TV and DIGITAL_TV

BugLink: http://bugs.launchpad.net/bugs/1763040
They are not really needed in our default builds.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit c0a48d8f59ebf8abcc580cc693ea5253a06ad21a
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: configs: add more USB net drivers
Nicolas Dechesne [Wed, 17 Jan 2018 18:40:22 +0000 (19:40 +0100)]
kernel: configs: add more USB net drivers

BugLink: http://bugs.launchpad.net/bugs/1763040
They are useful to debug, let's keep them for now.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 330377d14150297921d73f962f6c634b6a11071b
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: configs: enable BT_QCOMSMD
Nicolas Dechesne [Fri, 12 Jan 2018 14:21:46 +0000 (15:21 +0100)]
arm64: configs: enable BT_QCOMSMD

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 318690951bbfd9fbf92f0b2254b7686e03962e88
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: enable CFG80211_DEFAULT_PS by default
Nicolas Dechesne [Tue, 12 Dec 2017 09:07:34 +0000 (10:07 +0100)]
arm64: defconfig: enable CFG80211_DEFAULT_PS by default

BugLink: http://bugs.launchpad.net/bugs/1763040
WCN36xx driver issues related to power save mode have been fixed, and it is not
safe to set power save mode ON by default again.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit f4bb5cdc73e88f1fbd8fc63987fc857c295164ef
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoForce the SMD regulator driver to be compiled-in
Amit Kucheria [Mon, 11 Dec 2017 10:23:37 +0000 (15:53 +0530)]
Force the SMD regulator driver to be compiled-in

BugLink: http://bugs.launchpad.net/bugs/1763040
Allowing REGULATOR_QCOM_SMD_RPM to be a module requires solving exporting
some symbols and fixing some dependencies. Since this driver is due to be
refactored, let's take a shortcut to simply disallow modules for now.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
(cherry picked from commit ebe10495a722f38cd4f4cfb124e0dc301f01e54b
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: configs: enable dm_mod and dm_crypt
Nicolas Dechesne [Mon, 4 Dec 2017 09:32:31 +0000 (10:32 +0100)]
kernel: configs: enable dm_mod and dm_crypt

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit f7a6ea5d560bf63ae1942b1b344d97590a1c14dd
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: enable new trigger modes for leds
Amit Kucheria [Mon, 6 Nov 2017 07:08:13 +0000 (12:38 +0530)]
arm64: defconfig: enable new trigger modes for leds

BugLink: http://bugs.launchpad.net/bugs/1763040
Most development boards and devices have one or more LEDs. It is useful
during debugging if they can be wired to show different behaviours such as
disk or cpu activity or a load-average dependent heartbeat. Enable panic
and disk activity triggers so they can be tied to LED activity during
debugging as well.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit cf473151158b4480420068365fd320a3ebd849c8
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: enable QCOM_TSENS
Nicolas Dechesne [Tue, 28 Nov 2017 09:49:14 +0000 (15:19 +0530)]
arm64: defconfig: enable QCOM_TSENS

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
(cherry picked from commit 391ea1ed2111eb6f0d65931d30be30516af20b3e
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: enable ondemand governor as default
Amit Kucheria [Mon, 27 Nov 2017 12:29:41 +0000 (17:59 +0530)]
arm64: defconfig: enable ondemand governor as default

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
(cherry picked from commit 91644661f4e105f711d82de93cf2a027391836c3
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: Enable a53/apcs and avs
Amit Kucheria [Mon, 27 Nov 2017 11:28:12 +0000 (16:58 +0530)]
arm64: defconfig: Enable a53/apcs and avs

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
(cherry picked from commit fba87646c0750af8d3cd0aca9b8d0d3df3cfe7dc
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: configs: enable QCOM Venus
Nicolas Dechesne [Thu, 2 Nov 2017 16:50:50 +0000 (17:50 +0100)]
arm64: configs: enable QCOM Venus

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 2f28ff9bcfdddf3769b5ebd816f1d03092955e68
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: distro.config: enable debug friendly USB network adpater
Nicolas Dechesne [Fri, 24 Nov 2017 08:56:09 +0000 (09:56 +0100)]
kernel: distro.config: enable debug friendly USB network adpater

BugLink: http://bugs.launchpad.net/bugs/1763040
The DB410c has no built in Ethernet, so let's make sure that we can at least get
USB/Ether adaptors to work without any modules.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit b0746b1ec12dc9f61d8d771f9a0dcb093c21dd09
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: configs: enable WCN36xx
Nicolas Dechesne [Thu, 2 Nov 2017 16:48:31 +0000 (17:48 +0100)]
arm64: configs: enable WCN36xx

BugLink: http://bugs.launchpad.net/bugs/1763040
powersave is disabled by default, as it is known to cause problems on
Dragonboard 410c, with the current firmware.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit dacc00ec2283a68e36cc638bc23956ca102f75b8
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agokernel: configs; add distro.config
Nicolas Dechesne [Thu, 2 Nov 2017 16:13:07 +0000 (17:13 +0100)]
kernel: configs; add distro.config

BugLink: http://bugs.launchpad.net/bugs/1763040
Inherit distro.config from 4.9 release branch, the following commits have been
squashed:

f4feb382e577 kernel: configs: distro.config: Build media as modules
26d98682451b distro.config: enable USB device class drivers
9dc089f6ba24 configs: distro.config: enable ZRAM
8f39767444e1 config: enable new trigger modes for leds
45ef9272de5d kernel: configs: distro.config: add legacy instruction support for arm64
3cfc9326cd47 kernel: configs: add more Bluetooth and WLAN options
2757af8ec7cc kernel: configs: distro.config: add NETFILTER_XT_MATCH_HASHLIMIT
d4396e667fa4 distro.config: enable USB_LAN78XX
c5c7d5af0fca distro.config: extend connectivity options
2bcb6580ca8e kernel: configs: enable Docker support in distro.config
f90d65adbd5f configs: move DEBUG configs in their own config file
69e32eeae256 configs: add SPI_SPIDEV as module in distro.config
dba8b2c42e18 kernel: configs: add CONFIG_INPUT_JOYDEV in distro.config
98ab2d98ae3c kernel: configs: add I2C_CHARDEV in distro.config
17a895de7d8b kernel: add DRM_LOAD_EDID_FIRMWARE in distro.config
84408f7db7e8 kernel: configs: Enable input misc device drivers
139a0dbd4b37 kernel: configs: update distro config from release branch
a390f24b3b7e kernel: configs: improve distro.config, mostly for systemd
666238880c31 kernel: configs: update distro.config
3e2ff9ab7131 kernel: configs: move linaro distro.conf as proper %.config fragment

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit 83a947d5c5fd3fa66163f8a036b0c42a0fab88b9
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: enable QCOM audio drivers for APQ8016 and DB410c
Nicolas Dechesne [Fri, 22 Sep 2017 09:18:39 +0000 (11:18 +0200)]
arm64: defconfig: enable QCOM audio drivers for APQ8016 and DB410c

BugLink: http://bugs.launchpad.net/bugs/1763040
Support for:
* analog on board MSM8916 WCD codec
* HDMI using onboard ADV7511

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit cbb9a7b290d4623e425cd3591fdf8c2a0f1dadc4
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoarm64: defconfig: enable REMOTEPROC
Nicolas Dechesne [Fri, 22 Sep 2017 09:44:14 +0000 (11:44 +0200)]
arm64: defconfig: enable REMOTEPROC

BugLink: http://bugs.launchpad.net/bugs/1763040
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
(cherry picked from commit e0153474e81f3e75c12157066ef39311bc3895dc
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agomedia: venus: cleanup set_property controls
Stanimir Varbanov [Wed, 29 Nov 2017 13:25:21 +0000 (08:25 -0500)]
media: venus: cleanup set_property controls

BugLink: http://bugs.launchpad.net/bugs/1763040
Move ptype (property type) initialization out of switch case
and save few lines of code.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit f3105f0ae4d9fda5b3922319dfe248cdb504c2a8)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agomedia: venus: venc: Apply inloop deblocking filter
Loic Poulain [Fri, 24 Nov 2017 09:34:02 +0000 (04:34 -0500)]
media: venus: venc: Apply inloop deblocking filter

BugLink: http://bugs.launchpad.net/bugs/1763040
Deblocking filter allows to reduce blocking artifacts and improve
visual quality. This is configurable via the V4L2 API but eventually
not applied to the encoder.

Note that alpha and beta deblocking values are 32-bit signed (-6;+6).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit f7d12fea16cbcc38d08092c6267e75fabeaa9093)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agomedia: venus: venc: configure entropy mode
Loic Poulain [Fri, 24 Nov 2017 09:34:01 +0000 (04:34 -0500)]
media: venus: venc: configure entropy mode

BugLink: http://bugs.launchpad.net/bugs/1763040
H264 entropy mode can be selected via V4L2 API but is eventually not
applied. Configure encoder with selected mode, CALVC (def) or CABAC.

Note that hw/firmware also expects a CABAC model configuration which
currently doesn't have existing V4L2 API control. For now, use model_0
which seems always supported and so the default one.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit a7837e11679e015ef6c4b3f04ae09d17b0980c4e)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agomedia: venus: venc: set correctly GOP size and number of B-frames
Stanimir Varbanov [Fri, 1 Dec 2017 15:08:01 +0000 (10:08 -0500)]
media: venus: venc: set correctly GOP size and number of B-frames

BugLink: http://bugs.launchpad.net/bugs/1763040
This change fixes the calculation of B-frames and GOP size by
adopt v4l2 controls with the firmware interface expectations.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: fixed two small checkpatch comments]
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 8fc58186bb41ff8789ad9e993c03a23d67698709)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoclk: qcom: msm8916: Fix return value check in qcom_apcs_msm8916_clk_probe()
Wei Yongjun [Thu, 4 Jan 2018 06:34:43 +0000 (06:34 +0000)]
clk: qcom: msm8916: Fix return value check in qcom_apcs_msm8916_clk_probe()

BugLink: http://bugs.launchpad.net/bugs/1763040
In case of error, the function dev_get_regmap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 81ac38847a1d ("clk: qcom: Add APCS clock controller support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
(cherry picked from commit 55c19eee3b471e7ca7e38783836f7b7137c9d14f)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoclk: qcom: Add APCS clock controller support
Georgi Djakov [Tue, 5 Dec 2017 15:47:01 +0000 (17:47 +0200)]
clk: qcom: Add APCS clock controller support

BugLink: http://bugs.launchpad.net/bugs/1763040
Add a driver for the APCS clock controller. It is part of the APCS
hardware block, which among other things implements also a combined
mux and half integer divider functionality. It can choose between a
fixed-rate clock or the dedicated APCS (A53) PLL. The source and the
divider can be set both at the same time.

This is required for enabling CPU frequency scaling on MSM8916-based
platforms.

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Amit Kucheria <amit.kucheria@linaro.org>
[sboyd@codeaurora.org: Include rcg header for parent_map, drop
multiple unneeded includes, add COMPILE_TEST to APCS depends,
made tristate/modular]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 81ac38847a1d7fdd74a232cae195ff8f0fb4ab21)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoclk: qcom: Add regmap mux-div clocks support
Georgi Djakov [Tue, 5 Dec 2017 15:46:59 +0000 (17:46 +0200)]
clk: qcom: Add regmap mux-div clocks support

BugLink: http://bugs.launchpad.net/bugs/1763040
Add support for hardware that can switch both parent clock and divider
at the same time. This avoids generating intermediate frequencies from
either the old parent clock and new divider or new parent clock and
old divider combinations.

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Tested-by: Amit Kucheria <amit.kucheria@linaro.org>
[sboyd@codeaurora.org: Change a comment style, drop parent_map in
favor of a u32 array instead, export symbols for clk_ops and mux
function]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 081bfeed5f1b8394d993afa6b0ce20ed3e868960)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoclk: qcom: Add A53 PLL support
Georgi Djakov [Tue, 5 Dec 2017 15:46:58 +0000 (17:46 +0200)]
clk: qcom: Add A53 PLL support

BugLink: http://bugs.launchpad.net/bugs/1763040
The CPUs on Qualcomm MSM8916-based platforms are clocked by two PLLs,
a primary (A53) CPU PLL and a secondary fixed-rate GPLL0. These sources
are connected to a mux and half-integer divider, which is feeding the
CPU cores.

This patch adds support for the primary CPU PLL which generates the
higher range of frequencies above 1GHz.

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Amit Kucheria <amit.kucheria@linaro.org>
[sboyd@codeaurora.org: Move to devm provider registration,
NUL terminate frequency table, made tristate/modular]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 0c6ab1b8f8940d4ddbfff7ddff080cbfb5f32b02)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agomailbox: qcom: Create APCS child device for clock controller
Georgi Djakov [Tue, 5 Dec 2017 15:46:57 +0000 (17:46 +0200)]
mailbox: qcom: Create APCS child device for clock controller

BugLink: http://bugs.launchpad.net/bugs/1763040
There is a clock controller functionality provided by the APCS hardware
block of msm8916 devices. The device-tree would represent an APCS node
with both mailbox and clock provider properties.
Create a platform child device for the clock controller functionality so
the driver can probe and use APCS as parent.

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
(cherry picked from commit c815d769b598196bdbd104a7e049d07ae6fba0d2)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agomailbox: qcom: Convert APCS IPC driver to use regmap
Georgi Djakov [Tue, 5 Dec 2017 15:46:56 +0000 (17:46 +0200)]
mailbox: qcom: Convert APCS IPC driver to use regmap

BugLink: http://bugs.launchpad.net/bugs/1763040
This hardware block provides more functionalities that just IPC. Convert
it to regmap to allow other child platform devices to use the same regmap.

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
(cherry picked from commit c6a8b171ca8e338a3012420041346f0e50f7f649)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agowcn36xx: release DMA memory in case of error
Ramon Fried [Tue, 23 Jan 2018 15:20:13 +0000 (17:20 +0200)]
wcn36xx: release DMA memory in case of error

BugLink: http://bugs.launchpad.net/bugs/1763040
wcn36xx_dxe_init() doesn't check for the return value of
wcn36xx_dxe_init_descs(), release the resources in case an error ocurred.

Signed-off-by: Ramon Fried <rfried@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
(cherry picked from commit d0bb950b9f5f4e5894ec3053c0d2bb24be5f8dd8)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agowcn36xx: fix incorrect assignment to msg_body.min_ch_time
Colin Ian King [Fri, 29 Dec 2017 09:07:31 +0000 (09:07 +0000)]
wcn36xx: fix incorrect assignment to msg_body.min_ch_time

BugLink: http://bugs.launchpad.net/bugs/1763040
The second assignment to msg_body.min_ch_time is incorrect, it
should actually be to msg_body.max_ch_time.

Thanks to Bjorn Andersson for identifying the correct way to fix
this as my original fix was incorrect.

Detected by CoverityScan, CID#1463042 ("Unused Value")

Fixes: 2f3bef4b247e ("wcn36xx: Add hardware scan offload support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
(cherry picked from commit 4c8cf8df2f42a78f9357dba71c967705c5bd98bd)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agowcn36xx: Reduce spinlock in indication handler
Bjorn Andersson [Sat, 9 Dec 2017 00:35:08 +0000 (16:35 -0800)]
wcn36xx: Reduce spinlock in indication handler

BugLink: http://bugs.launchpad.net/bugs/1763040
The purpose of pushing indication on a list and handle these in a
separate worker is to allow the handlers to sleep. It does therefor not
make much sense to hold the queue spinlock through the entire indication
worker function.

By removing items from the queue early we don't need to hold the lock
throughout the indication worker, allowing the individual handlers to
sleep.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
(cherry picked from commit 6d1f37323f5b796dbba4e2d9069778fc5b9bb2a2)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agowcn36xx: Add hardware scan offload support
Loic Poulain [Fri, 8 Dec 2017 09:35:30 +0000 (10:35 +0100)]
wcn36xx: Add hardware scan offload support

BugLink: http://bugs.launchpad.net/bugs/1763040
Current hw_scan implementation does not trigger offloaded
hardware scan and seems to only put the device in a kind of
listening mode (beacon/probe-response) for software scan.
Since no probe request are generated by the software, current
scanning method is similar to a passive scan.

This patch introduces support for 'true' hardware offloaded scan.
Hardware scan is configured and started via the start-scan-offload
firmware message. Once scan has been completed a scan indicator
message is received from firmware.

Moreover, this patch includes support for directed probe-request,
allowing connection with hidden APs. It also fixes scan issues with
band-steering AP which are not 'visible' with passive scan (due to
hidden ssid in beacons).

Let's keep the 'legacy' scanning method in case scan-offload is not
supported.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
(cherry picked from commit 2f3bef4b247e4843ebf81123004fa9252b948724)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agowcn36xx: set default BTLE coexistence config
Eyal Ilsar [Thu, 16 Nov 2017 08:01:26 +0000 (10:01 +0200)]
wcn36xx: set default BTLE coexistence config

BugLink: http://bugs.launchpad.net/bugs/1763040
If the value for the firmware configuration parameters
BTC_STATIC_LEN_LE_BT and BTC_STATIC_LEN_LE_WLAN are not set the duty
cycle between BT and WLAN is such that if BT (including BLE) is active
WLAN gets 0 bandwidth. When tuning these parameters having a too high
value for WLAN means that BLE performance degrades.
The "sweet" point of roughly half of the maximal values was empirically
found to achieve a balance between BLE and Wi-Fi coexistence
performance.

Signed-off-by: Eyal Ilsar <eilsar@codeaurora.org>
Signed-off-by: Ramon Fried <rfried@codeaurora.org>
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
(cherry picked from commit 4119b6160a35693655199f3e9e4a4d7b154a75b0)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agodrm/msm: gpu: Only sync fences on rings that exist
Jordan Crouse [Wed, 13 Dec 2017 20:45:44 +0000 (13:45 -0700)]
drm/msm: gpu: Only sync fences on rings that exist

BugLink: http://bugs.launchpad.net/bugs/1763040
The fault recovery code tries to sync fences on all possible rings
instead of only the rings that actually exist which will fault the
kernel when the number of rings are less than the maximum amount.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit 7ddae82e12593ff3d44e628c02fbfa765508aa48)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agodrm/msm: fix msm_rd_dump_submit prototype
Arnd Bergmann [Thu, 2 Nov 2017 11:21:32 +0000 (12:21 +0100)]
drm/msm: fix msm_rd_dump_submit prototype

BugLink: http://bugs.launchpad.net/bugs/1763040
The prototype of msm_rd_dump_submit() has recently changed. However,
we have two declarations of this functions, and the other one
remains the old version, leading to this:

drivers/gpu/drm/msm/msm_gpu.c: In function 'recover_worker':
drivers/gpu/drm/msm/msm_gpu.c:295:23: error: passing argument 1 of 'msm_rd_dump_submit' from incompatible pointer type [-Werror=incompatible-pointer-types]

This changes the second one to match the first again.

Fixes: 2165e2b9cba2 ("drm/msm: split rd debugfs file")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit e6756d7c1a7ebe04def1b24b45ce01ef6c4175bc)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agodrm/msm: fix spelling mistake: "ringubffer" -> "ringbuffer"
Colin Ian King [Thu, 2 Nov 2017 09:33:45 +0000 (09:33 +0000)]
drm/msm: fix spelling mistake: "ringubffer" -> "ringbuffer"

BugLink: http://bugs.launchpad.net/bugs/1763040
Trivial fix to spelling mistake in DRM_DEV_ERROR error message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
(cherry picked from commit 3a9016ba0e8f3cf4196eae99b5b18172c9b71045)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: remove procfs context interface
John Johansen [Mon, 9 Apr 2018 05:53:32 +0000 (22:53 -0700)]
UBUNTU: SAUCE: LSM stacking: remove procfs context interface

BugLink: http://bugs.launchpad.net/bugs/1763062
The procfs context interface won't be a part of further LSM stacking
patches, so don't expose or carry it.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: add apparmor and selinux proc dirs
John Johansen [Fri, 6 Apr 2018 22:45:21 +0000 (15:45 -0700)]
UBUNTU: SAUCE: LSM stacking: add apparmor and selinux proc dirs

BugLink: http://bugs.launchpad.net/bugs/1763062
Add the apparmor and selinux dirs to inspect security context without
altering the display LSM.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: check for invalid zero sized writes
Colin Ian King [Tue, 3 Oct 2017 12:12:54 +0000 (13:12 +0100)]
UBUNTU: SAUCE: LSM stacking: check for invalid zero sized writes

BugLink: http://bugs.launchpad.net/bugs/1720779
BugLink: http://bugs.launchpad.net/bugs/1763062
Writing zero bytes to /proc/$pid/task/$pid/attr/context via
security_setprocattr cause an oops in memcpy_erms. Fix this by
checking for zero size and returning -EINVAL for this invalid
write size.

Detected by running stress-ng --procfs 0

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: add configs for LSM stacking
John Johansen [Mon, 25 Sep 2017 16:21:31 +0000 (12:21 -0400)]
UBUNTU: SAUCE: LSM stacking: add configs for LSM stacking

BugLink: http://bugs.launchpad.net/bugs/1763062
Add the config options for LSM stacking. Default to only apparmor
being in the stack. Users can experiment with stacking by specifying
the
     security=

kernel boot parameter.
  eg.
     security=apparmor,selinux

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: add Kconfig to set default display LSM
John Johansen [Wed, 27 Sep 2017 11:50:19 +0000 (07:50 -0400)]
UBUNTU: SAUCE: LSM stacking: add Kconfig to set default display LSM

BugLink: http://bugs.launchpad.net/bugs/1763062
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: add /proc/<pid>/attr/display_lsm
John Johansen [Thu, 28 Sep 2017 15:09:43 +0000 (11:09 -0400)]
UBUNTU: SAUCE: LSM stacking: add /proc/<pid>/attr/display_lsm

BugLink: http://bugs.launchpad.net/bugs/1763062
Add /proc/<pid>/attr/display_lsm so that scripts can easily introspect
the display lsm of a give task.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: make sure LSM blob align on 64 bit boundaries
John Johansen [Thu, 28 Sep 2017 17:47:13 +0000 (13:47 -0400)]
UBUNTU: SAUCE: LSM stacking: make sure LSM blob align on 64 bit boundaries

BugLink: http://bugs.launchpad.net/bugs/1763062
The security->task blob reserving the first 12 bytes means that LSM
blobs don't align on 64 byte boundaries. This is not a problem
for x86 but if an LSM stores a long or ptr in its blob, then some
architectures require it be aligned to the arch word size and
will through a fault.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: provide a way to specify the default display lsm
John Johansen [Wed, 27 Sep 2017 06:05:22 +0000 (02:05 -0400)]
UBUNTU: SAUCE: LSM stacking: provide a way to specify the default display lsm

BugLink: http://bugs.launchpad.net/bugs/1763062
When the system boots up the desired default display LSM maybe different
than the first LSM initialized. Allow it to be set by specifying an
LSM with
  security.display=apparmor

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: verify display LSM
John Johansen [Wed, 27 Sep 2017 05:28:08 +0000 (01:28 -0400)]
UBUNTU: SAUCE: LSM stacking: verify display LSM

BugLink: http://bugs.launchpad.net/bugs/1763062
Make sure the display LSM is verified to be a registered LSM, to
avoid breakage when a bad name is passed.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: keep an index for each registered LSM
John Johansen [Wed, 27 Sep 2017 05:13:17 +0000 (01:13 -0400)]
UBUNTU: SAUCE: LSM stacking: keep an index for each registered LSM

BugLink: http://bugs.launchpad.net/bugs/1763062
Keep an index of the registered LSMs so that it can be used in table
lookups and ordering comparisons.

pulled from the full LSM stacking patch

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: inherit current display LSM
John Johansen [Wed, 27 Sep 2017 04:45:16 +0000 (00:45 -0400)]
UBUNTU: SAUCE: LSM stacking: inherit current display LSM

BugLink: http://bugs.launchpad.net/bugs/1763062
If a current display LSM is set it should be inherited. As per 2017
LSS discussion.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: provide prctl interface for setting context
John Johansen [Tue, 26 Sep 2017 18:58:26 +0000 (14:58 -0400)]
UBUNTU: SAUCE: LSM stacking: provide prctl interface for setting context

BugLink: http://bugs.launchpad.net/bugs/1763062
Separate out the prctl interface added in the full LSM stacking patches
to allow tasks to set the display "LSM".

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: allow selecting multiple LSMs using kernel boot params
John Johansen [Tue, 26 Sep 2017 15:06:30 +0000 (11:06 -0400)]
UBUNTU: SAUCE: LSM stacking: allow selecting multiple LSMs using kernel boot params

BugLink: http://bugs.launchpad.net/bugs/1763062
The base stacking code does not provide a way for users to specify the
desired stack using the kernel boot parameters. Enable specifying an
LSM stack on the command line by providing a comma separated list

ie.
  security=apparmor,selinux

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: fixup stacking kconfig
John Johansen [Mon, 25 Sep 2017 16:03:19 +0000 (12:03 -0400)]
UBUNTU: SAUCE: LSM stacking: fixup stacking kconfig

BugLink: http://bugs.launchpad.net/bugs/1763062
The stack configs in the base stacking patches are confusing and
separate the selinux/smack stacking from the other LSMs with an
"extreme" stacking entry which is extremely confusing.

Switch the "extreme" stacking to a select for mutually exclusive
LSMs, which provides a better explanation of what is happening.

Fixes: 6c5100029055 ("LSM: general but not extreme module stacking")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: fixup apparmor stacking enablement
John Johansen [Wed, 27 Sep 2017 06:10:17 +0000 (02:10 -0400)]
UBUNTU: SAUCE: LSM stacking: fixup apparmor stacking enablement

BugLink: http://bugs.launchpad.net/bugs/1763062
AppArmor doesn't need to register twice.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: add stacking support to apparmor network hooks
John Johansen [Wed, 27 Sep 2017 07:08:55 +0000 (03:08 -0400)]
UBUNTU: SAUCE: LSM stacking: add stacking support to apparmor network hooks

BugLink: http://bugs.launchpad.net/bugs/1763062
The stacking patches weren't developed against apparmor networking hooks.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: add support for stacking getpeersec_stream
John Johansen [Tue, 26 Sep 2017 19:12:35 +0000 (15:12 -0400)]
UBUNTU: SAUCE: LSM stacking: add support for stacking getpeersec_stream

BugLink: http://bugs.launchpad.net/bugs/1763062
getpeersec_stream needs to use the "current" display LSM set by the
prctl.

Split out the getpeersec_stream implementation from the full stacking
patch.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: fixup: alloc_task_ctx is dead code
John Johansen [Sun, 3 Sep 2017 19:10:20 +0000 (12:10 -0700)]
UBUNTU: SAUCE: LSM stacking: fixup: alloc_task_ctx is dead code

BugLink: http://bugs.launchpad.net/bugs/1763062
Fixes: 7b27ec622c90 ("LSM: manage credential security blobs)
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: fixup initialize task->security
John Johansen [Tue, 26 Sep 2017 19:03:19 +0000 (15:03 -0400)]
UBUNTU: SAUCE: LSM stacking: fixup initialize task->security

BugLink: http://bugs.launchpad.net/bugs/1763062
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: General stacking
Casey Schaufler [Wed, 7 Mar 2018 22:39:43 +0000 (14:39 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: General stacking

BugLink: http://bugs.launchpad.net/bugs/1763062
Leverage the infrastructure management of the security blobs
to allow stacking of security modules in all but the most
extreme case. Security modules are informed of the location
of their data within the blobs at module initialization.

Stacking is optional. If stacking is not configured the old
limit of one "major" security module applies. If stacking is
configured TOMOYO can be configured with an of the other
modules. SELinux, Smack and AppArmor use (or in the AppArmor
case, threaten to use) secids, which are not (yet) shareable.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: Manage remaining security blobs
Casey Schaufler [Wed, 7 Mar 2018 22:38:28 +0000 (14:38 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: Manage remaining security blobs

BugLink: http://bugs.launchpad.net/bugs/1763062
Move management of the inode, ipc, key, msg_msg, sock and superblock
security blobs from the security modules to the infrastructure.
Use of the blob pointers is abstracted in the security modules.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: Manage task security blobs
Casey Schaufler [Wed, 7 Mar 2018 22:37:29 +0000 (14:37 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: Manage task security blobs

BugLink: http://bugs.launchpad.net/bugs/1763062
Move management of task security blobs into the security
infrastructure. Modules are required to identify the space
they require. At this time there are no modules that use
task blobs.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: Manage file security blobs
Casey Schaufler [Wed, 7 Mar 2018 22:36:23 +0000 (14:36 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: Manage file security blobs

BugLink: http://bugs.launchpad.net/bugs/1763062
Move the management of file security blobs from the individual
security modules to the security infrastructure. The security modules
using file blobs have been updated accordingly. Modules are required
to identify the space they need at module initialization. In some
cases a module no longer needs to supply a blob management hook, in
which case the hook has been removed.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: LSM: Manage credential security blobs
Casey Schaufler [Wed, 7 Mar 2018 22:35:10 +0000 (14:35 -0800)]
UBUNTU: SAUCE: LSM stacking: LSM: Manage credential security blobs

BugLink: http://bugs.launchpad.net/bugs/1763062
Move the management of credential security blobs from the
individual security modules to the security infrastructure.
The security modules using credential blobs have been updated
accordingly. Modules are required to identify the space they
require at module initialization. In some cases a module no
longer needs to supply a blob management hook, in which case
the hook has been removed.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoUBUNTU: SAUCE: LSM stacking: procfs: add smack subdir to attrs
Casey Schaufler [Wed, 7 Mar 2018 22:31:19 +0000 (14:31 -0800)]
UBUNTU: SAUCE: LSM stacking: procfs: add smack subdir to attrs

BugLink: http://bugs.launchpad.net/bugs/1763062
Back in 2007 I made what turned out to be a rather serious
mistake in the implementation of the Smack security module.
The SELinux module used an interface in /proc to manipulate
the security context on processes. Rather than use a similar
interface, I used the same interface. The AppArmor team did
likewise. Now /proc/.../attr/current will tell you the
security "context" of the process, but it will be different
depending on the security module you're using.

This patch provides a subdirectory in /proc/.../attr for
Smack. Smack user space can use the "current" file in
this subdirectory and never have to worry about getting
SELinux attributes by mistake. Programs that use the
old interface will continue to work (or fail, as the case
may be) as before.

The original implementation is by Kees Cook.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
---
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: ensure for-loop actually iterates and free's buffers
Colin Ian King [Mon, 26 Mar 2018 15:10:18 +0000 (16:10 +0100)]
RDMA/hns: ensure for-loop actually iterates and free's buffers

BugLink: https://bugs.launchpad.net/bugs/1762757
The current for-loop zeros variable i and only loops once, hence
not all the buffers are free'd.  Fix this by setting i correctly.

Detected by CoverityScan, CID#1463415 ("Operands don't affect result")

Fixes: a5073d6054f7 ("RDMA/hns: Add eq support of hip08")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 38759d6175d338fbf9282c8ea2b51f3b7ab9bc98)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Fix cq record doorbell enable in kernel
Yixian Liu [Wed, 21 Mar 2018 06:11:18 +0000 (14:11 +0800)]
RDMA/hns: Fix cq record doorbell enable in kernel

BugLink: https://bugs.launchpad.net/bugs/1762755
Upon detecting both kernel and user space support record doorbell,
the kernel needs to enable this capability in hardware by db_en,
and it should take place before cq context configuration in
hns_roce_cq_alloc. Currently, db_en is configured after cq alloc
and db_map_user has similar problem.

Reported-by: Xiping Zhang <zhangxiping3@huawei.com>
Fixes: 9b44703d0a21 ("RDMA/hns: Support cq record doorbell for the user space")
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit e95955773d4357a0b09a43128352047afce8f35b)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Fix init resp when alloc ucontext
Yixian Liu [Mon, 19 Mar 2018 13:36:07 +0000 (21:36 +0800)]
RDMA/hns: Fix init resp when alloc ucontext

BugLink: https://bugs.launchpad.net/bugs/1762755
The data in resp will be copied from kernel to userspace, thus it needs to
be initialized to zeros to avoid copying uninited stack memory.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: e088a685eae9 ("RDMA/hns: Support rq record doorbell for the user space")
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit df7e40425813c50cd252e6f5e348a81ef1acae56)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Fix cqn type and init resp
Yixian Liu [Thu, 15 Mar 2018 07:23:14 +0000 (15:23 +0800)]
RDMA/hns: Fix cqn type and init resp

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch changes the type of cqn from u32 to u64 to keep
userspace and kernel consistent, initializes resp both for
cq and qp to zeros, and also changes the condition judgment
of outlen considering future caps extension.

Suggested-by: Jason Gunthorpe <jgg@mellanox.com>
Fixes: e088a685eae9 (hns: Support rq record doorbell for the user space)
Fixes: 9b44703d0a21 (hns: Support cq record doorbell for the user space)
Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
(cherry picked from commit 7b48221cf41a90cf4bfc36e6d699b7fa4169c970)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Support cq record doorbell for kernel space
Yixian Liu [Fri, 9 Mar 2018 10:36:32 +0000 (18:36 +0800)]
RDMA/hns: Support cq record doorbell for kernel space

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch updates to support cq record doorbell for
the kernel space.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 86188a8810ed0b73ce6653daa3c4bc29e8a79a7c)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Support rq record doorbell for kernel space
Yixian Liu [Fri, 9 Mar 2018 10:36:31 +0000 (18:36 +0800)]
RDMA/hns: Support rq record doorbell for kernel space

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch updates to support rq record doorbell for
the kernel space.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 472bc0fbd47cb89f72607328b6b09b4a962ec200)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Support cq record doorbell for the user space
Yixian Liu [Fri, 9 Mar 2018 10:36:30 +0000 (18:36 +0800)]
RDMA/hns: Support cq record doorbell for the user space

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch updates to support cq record doorbell for
the user space.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 9b44703d0a21980441cb120ffe4c6880dd453191)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Support rq record doorbell for the user space
Yixian Liu [Fri, 9 Mar 2018 10:36:29 +0000 (18:36 +0800)]
RDMA/hns: Support rq record doorbell for the user space

BugLink: https://bugs.launchpad.net/bugs/1762755
This patch adds interfaces and definitions to support the rq record
doorbell for the user space.

Signed-off-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit e088a685eae94a0607b8f7b99949a0e14d748813)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoRDMA/hns: Fix the endian problem for hns
oulijun [Mon, 5 Feb 2018 13:14:00 +0000 (21:14 +0800)]
RDMA/hns: Fix the endian problem for hns

BugLink: https://bugs.launchpad.net/bugs/1762755
The hip06 and hip08 run on a little endian ARM, it needs to
revise the annotations to indicate that the HW uses little
endian data in the various DMA buffers, and flow the necessary
swaps throughout.

The imm_data use big endian mode. The cpu_to_le32/le32_to_cpu
swaps are no-op for this, which makes the only substantive
change the handling of imm_data which is now mandatory swapped.

This also keep match with the userspace hns driver and resolve
the warning by sparse.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 8b9b8d143b467ec9c65f87b7c2596dc2aabe6737)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoMAINTAINERS: Add John Garry as maintainer for HiSilicon LPC driver
John Garry [Wed, 14 Mar 2018 18:15:59 +0000 (02:15 +0800)]
MAINTAINERS: Add John Garry as maintainer for HiSilicon LPC driver

BugLink: https://bugs.launchpad.net/bugs/1762758
Add John Garry as maintainer for drivers/bus/hisi_lpc.c, the HiSilicon LPC
driver.

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 6183d9b3ce7979eda940e594a5c342171a5da998)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoHISI LPC: Add ACPI support
John Garry [Wed, 14 Mar 2018 18:15:58 +0000 (02:15 +0800)]
HISI LPC: Add ACPI support

BugLink: https://bugs.launchpad.net/bugs/1762758
Based on the previous patches, this patch supports the LPC host on
Hip06/Hip07 for ACPI FW.

It is the responsibility of the LPC host driver to enumerate the child
devices, as the ACPI scan code will not enumerate children of "indirect IO"
hosts.

The ACPI table for the LPC host controller and the child devices is in the
following format:

  Device (LPC0) {
    Name (_HID, "HISI0191")  // HiSi LPC
    Name (_CRS, ResourceTemplate () {
      Memory32Fixed (ReadWrite, 0xa01b0000, 0x1000)
    })
  }

  Device (LPC0.IPMI) {
    Name (_HID, "IPI0001")
    Name (LORS, ResourceTemplate() {
      QWordIO (
        ResourceConsumer,
        MinNotFixed,     // _MIF
        MaxNotFixed,     // _MAF
        PosDecode,
        EntireRange,
        0x0,             // _GRA
        0xe4,            // _MIN
        0x3fff,          // _MAX
        0x0,             // _TRA
        0x04,            // _LEN
        , ,
        BTIO
      )
    })

Since the IO resources of the child devices need to be translated from LPC
bus addresses to logical PIO addresses, and we shouldn't modify the
resources of the devices generated in the FW scan, a per-child MFD is
created as a substitute.  The MFD IO resources will be the translated bus
addresses of the ACPI child.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
(cherry picked from commit e0aa1563f8945d9b8f472426d100bed190a4308f)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoACPI / scan: Do not enumerate Indirect IO host children
John Garry [Wed, 14 Mar 2018 18:15:57 +0000 (02:15 +0800)]
ACPI / scan: Do not enumerate Indirect IO host children

BugLink: https://bugs.launchpad.net/bugs/1762758
Through the logical PIO framework, systems which otherwise have no IO space
access to legacy ISA/LPC devices may access these devices through so-called
"indirect IO" method.  In this, IO space accesses for non-PCI hosts are
redirected to a host LLDD to manually generate the IO space (bus) accesses.
Hosts are able to register a region in logical PIO space to map to its bus
address range.

Indirect IO child devices have an associated host-specific bus address.
Special translation is required to map between a logical PIO address for a
device and its host bus address.

Since in the ACPI tables the child device IO resources would be the
host-specific values, it is required the ACPI scan code should not
enumerate these devices, and that this should be the responsibility of the
host driver so that it can "fixup" the resources so that they map to the
appropriate logical PIO addresses.

To avoid enumerating these child devices, add a check from
acpi_device_enumeration_by_parent() as to whether the parent for a device
is a member of a known list of "indirect IO" hosts.  For now, the HiSilicon
LPC host controller ID is added.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit dfda4492322ed0a1eb9c4d4715c4b90c9af57352)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoACPI / scan: Rename acpi_is_serial_bus_slave() for more general use
John Garry [Wed, 14 Mar 2018 18:15:56 +0000 (02:15 +0800)]
ACPI / scan: Rename acpi_is_serial_bus_slave() for more general use

BugLink: https://bugs.launchpad.net/bugs/1762758
Currently the ACPI scan has special handling for serial bus slaves, in that
it makes it the responsibility of the slave device's parent to enumerate
the device.

To support other types of slave devices which require the same special
handling but where the bus is not strictly a serial bus, such as devices on
the HiSilicon LPC controller bus, rename acpi_is_serial_bus_slave() to
acpi_device_enumeration_by_parent(), so that the name can fit the wider
purpose.

Also rename the associated device flag acpi_device_flags.serial_bus_slave
to .enumeration_by_parent.

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit d87fb0917a073d71300b2b31b3773f6690bd1712)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoHISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings
Zhichang Yuan [Wed, 21 Mar 2018 22:23:02 +0000 (17:23 -0500)]
HISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings

BugLink: https://bugs.launchpad.net/bugs/1762758
The low-pin-count (LPC) interface of Hip06/Hip07 accesses I/O port space of
peripherals.

Implement the LPC host controller driver which performs the I/O operations
on the underlying hardware.  We don't want to touch existing drivers such
as ipmi-bt, so this driver applies the indirect-IO introduced in the
previous patch after registering an indirect-IO node to the indirect-IO
devices list which will be searched by the I/O accessors to retrieve the
host-local I/O port.

The driver config is set as a bool instead of a tristate.  The reason here
is that, by the very nature of the driver providing a logical PIO range, it
does not make sense to have this driver as a loadable module.  Another more
specific reason is that the Huawei D03 board which includes Hip06 SoC
requires the LPC bus for UART console, so should be built in.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Zou Rongrong <zourongrong@huawei.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rob Herring <robh@kernel.org> # dts part
(cherry picked from commit adf38bb0b5956ab5469acb1ca981a9287c7ad1d8)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
6 years agoof: Add missing I/O range exception for indirect-IO devices
Zhichang Yuan [Wed, 14 Mar 2018 18:15:54 +0000 (02:15 +0800)]
of: Add missing I/O range exception for indirect-IO devices

BugLink: https://bugs.launchpad.net/bugs/1762758
There are some special ISA/LPC devices that work on a specific I/O range
where it is not correct to specify a 'ranges' property in the DTS parent
node as CPU addresses translated from DTS node are only for memory space on
some architectures, such as ARM64.  Without the parent 'ranges' property,
of_translate_address() returns an error.

Here we add special handling for this case.

During the OF address translation, some checking will be performed to
identify whether the device node is registered as indirect-IO.  If it is,
the I/O translation will be done in a different way from that one of PCI
MMIO.  In this way, the I/O 'reg' property of the special ISA/LPC devices
will be parsed correctly.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de> # earlier draft
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
(cherry picked from commit 65af618d2c559f8eb19d80d03a23029651a59de4)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>