Commit graph

874,496 commits

Author SHA1 Message Date
Vivek Gautam
b869aae883 UPSTREAM: firmware: qcom_scm-64: Add atomic version of qcom_scm_call
There are scnenarios where drivers are required to make a
scm call in atomic context, such as in one of the qcom's
arm-smmu-500 errata [1].

[1] ("https://source.codeaurora.org/quic/la/kernel/msm-4.9/
      tree/drivers/iommu/arm-smmu.c?h=msm-4.9#n4842")

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Andy Gross <agross@kernel.org>
Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit 1a5ea3b7a6ac6c133660b9aeda95b2087c8eec47)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Bug: 146449535
Change-Id: Ic9c14f2334271d23b04293e1cebdaaf6a1fbbe9d
2019-12-20 09:57:41 -08:00
Amit Kucheria
9df826d676 UPSTREAM: cpufreq: qcom-hw: Move driver initialization earlier
Allow qcom-hw driver to initialize right after the cpufreq and thermal
subsystems are initialised in core_initcall so we get earlier access to
thermal mitigation.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Taniya Das <tdas@codeaurora.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/eacce8d08388b0bdfc908d2701fe7c2b78d90441.1571656015.git.amit.kucheria@linaro.org
(cherry picked from commit 11ff4bdd1ab4a6c75d49fbd752a1d9b79e8ca8cb)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Bug: 146449535
Change-Id: I27f281e4634139a18c86bfa889b97c77cfc6ddd0
2019-12-20 09:57:40 -08:00
Amit Kucheria
d3e7f43a9f UPSTREAM: cpufreq: Initialize cpufreq-dt driver earlier
This allows HW drivers that depend on cpufreq-dt to initialize earlier.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/353c745d4ca1feff600bd44154c01c013f185ca4.1571656015.git.amit.kucheria@linaro.org
(cherry picked from commit 57db08f41b2a8f6c22036290400a59a2b3ff3390)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Bug: 146449535
Change-Id: I129f901aa517f4b6ce6619ef24c291c71d7610e7
2019-12-20 09:57:40 -08:00
Amit Kucheria
98117f2abf UPSTREAM: cpufreq: Initialize the governors in core_initcall
Initialize the cpufreq governors earlier to allow for earlier
performance control during the boot process.

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/b98eae9b44eb2f034d7f5d12a161f5f831be1eb7.1571656015.git.amit.kucheria@linaro.org
(cherry picked from commit 3f6ec871e1c2b360aaf022e90bb99dcc016b3874)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Bug: 146449535
Change-Id: Ib5599ade3811fb44a15cda6ee3791d997207cad5
2019-12-20 09:57:40 -08:00
John Stultz
1fc7351d13 ANDROID: tty: serial_core: Export uart_console_device so it can be used by modules
In order to support serial console w/ SERIAL_QCOM_GENI=m,
we need to export the uart_console_device() symbol so things
will build

Change-Id: I3067c3aaadf84f46ede3162aa8cee4028a3e42d8
Bug: 146449535
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-12-20 09:57:39 -08:00
John Stultz
2eb9ebfdf6 ANDROID: gki_defconfig: Add qcom pcie options to gki_defconfig
The qcom PCIE support isn't able to be added as a module, so I
propose enabling CONFIG_PCIE_QCOM and CONFIG_PCIEPORTBUS in
the gki_defconfig.

For consistency, this also adds CONFIG_PCIEPORTBUS=y and RAS=y
(previously missing) to the x86 gki_defconfig

Change-Id: I04941e17f660dd13b2ef2ab3150acae3ce670b19
Bug: 146449535
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-12-20 09:57:39 -08:00
John Stultz
9b09257521 ANDROID: Kconfig.gki: Add entries for qcom clk drivers
Add a Kconfig.gki option to enable qcom clk drivers.

This is needed as the qcom clk drivers are also used as power
domain sources. Unfortunately the powerdomain logic stops
returning EPROBE_DEFER when initcall_done is true (after
initcalls, but before modules load). This results in the drivers
(in our case, the smmu which is built in) that depend on the clk
provided power-domain to fail to load.

This issue seems to be due to the following commit, which when
reverted resolve the problem and allows dependent drivers to
still load once the clk modules are loaded:
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e01afc32502555beb2057ddd74401be38475d851

I'm working with the patch author and Bjorn to try to find
a good upstream solution, but in the meantime, set the qcom
clks to =y for now.

Bug: 146449535
Change-Id: Iaf6655a22243335083c0f7b3a673e795cea68021
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-12-20 09:57:38 -08:00
John Stultz
33931f4741 ANDROID: Kconfig.gki: Add PINCTRL_MSM to QCOM Hidden configs
This allows pinctrl drivers to work as a module on qcom hardware

Change-Id: I6df13dd45985751afcdaa7c27c3674f06bbbc083
Bug: 146449535
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-12-20 09:57:37 -08:00
John Stultz
a379092513 ANDROID: Kconfig.gki: Add hidden CONFIG_WANT_DEV_COREDUMP for DRM_MSM driver
In order to work with the modularized DRM_MSM driver, we
need to enable CONFIG_WANT_DEV_COREDUMP

Change-Id: Ieeab292a0aad851edd49d368156fc18fe78fccb7
Bug: 146449535
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-12-20 09:57:37 -08:00
Bjorn Andersson
21ccb4de91 ANDROID: PCI: qcom: Add support for SDM845 PCIe controller
The SDM845 has one Gen2 and one Gen3 controller, add support for these.

Due to lack of hardware only the Gen2 controller has been verified.

Bug: 146449535
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit ff885cfa19c77f4e16b797c3aa9a5f588fecf50c
https://git.linaro.org/landing-teams/working/qualcomm/kernel.git
qclt/integration-linux-qcomlt  - An unstable rebased branch)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I76e60cca47c9b6cab5252a28a9748e5f8fe4b51b
2019-12-20 09:57:36 -08:00
Bjorn Andersson
ff69e44c1b ANDROID: PCI: qcom: Fix the fixup of PCI_VENDOR_ID_QCOM
There exists non-bridge PCIe devices with PCI_VENDOR_ID_QCOM, so limit
the fixup to only affect the PCIe 2.0 (0x106) and PCIe 3.0 (0x107)
bridges.

Bug: 146449535
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit 5ed49c7a1ca12470415229233a3e6b4216a76c62
https://git.linaro.org/landing-teams/working/qualcomm/kernel.git
qclt/integration-linux-qcomlt  - An unstable rebased branch)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Ibfd2b2dd41f6a22c832afb3d8e805c3602acba95
2019-12-20 09:57:36 -08:00
Bjorn Andersson
2a8fed9ac3 ANDROID: phy: qcom: qmp: Add SDM845 QHP PCIe PHY
Add the GEN3 QHP PCIe PHY found in SDM845.

Bug: 146449535
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit a130c83138d047998fef41b659d58749983cec5a
https://git.linaro.org/landing-teams/working/qualcomm/kernel.git
qclt/integration-linux-qcomlt  - An unstable rebased branch)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I9c85d21d1557a6cf17af57022d9ca31913acbec8
2019-12-20 09:57:35 -08:00
Bjorn Andersson
fdd437cdd7 ANDROID: phy: qcom: qmp: Add SDM845 PCIe QMP PHY support
qcom_qmp_phy_init() is extended to support the additional register
writes needed in PCS MISC and the appropriate sequences and resources
are defined for the GEN2 PCIe QMP PHY found in SDM845.

Bug: 146449535
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit ea22de53ffeb5c9a8b725b471e8ed4935ac3aaf5
https://git.linaro.org/landing-teams/working/qualcomm/kernel.git
qclt/integration-linux-qcomlt  - An unstable rebased branch)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Ia763ff19382898dcbecf538cf001a7402ad7a934
2019-12-20 09:57:35 -08:00
Bjorn Andersson
10de10131f ANDROID: phy: qcom: qmp: Use power_on/off ops for PCIe
The PCIe PHY needs to be initialized as part of the PCI initialization
and should therefore implement the power_on/power_off ops, rather than
init/exit.

Bug: 146449535
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit 49020f887a7ee8da2271e0e3f3eeb83925f80fb8
https://git.linaro.org/landing-teams/working/qualcomm/kernel.git
qclt/integration-linux-qcomlt  - An unstable rebased branch)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I90bec4df92abb86984ef617a65d0ed98e8702545
2019-12-20 09:57:34 -08:00
Bjorn Andersson
43782e30b8 ANDROID: phy: qcom-qmp: Increase PHY ready timeout
It's typical for the QHP PHY to take slightly above 1ms to initialize,
so increase the timeout of the PHY ready check to 10ms - as already done
in the downstream PCIe driver.

Bug: 146449535
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
(cherry picked from commit d62d7294de98c504a345b0750ad4d0f53587f516
https://git.linaro.org/landing-teams/working/qualcomm/kernel.git
qclt/integration-linux-qcomlt  - An unstable rebased branch)
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I5b1c06406a97b4a2592549bcf668796c141bcccb
2019-12-20 09:57:34 -08:00
Alistair Delva
de90777010 ANDROID: gki_defconfig: Enable CONFIG_GNSS_CMDLINE_SERIAL
Enables a GNSS serial driver for cuttlefish.

Bug: 146517987
Change-Id: Ife42306a3052e49365e3f0004f220424f0be7782
Signed-off-by: Alistair Delva <adelva@google.com>
2019-12-19 15:35:48 -08:00
Alistair Delva
51e81764d9 ANDROID: gnss: Add command line test driver
This driver enables the "takeover" of a serdev bus device by the GNSS
subsystem. It can be used to test the GNSS subsystem without needing to
write a specific hardware backend.

The new module supports the following parameters:

  gnss_cmdline.serdev=driver/port/serdev
  gnss_cmdline.type=<protocol number>

An example which allows GNSS to wrap a platform serial8250 port and
advertise NMEA-0183 data is:

  gnss_cmdline.serdev=serial8250/serial0/serial0-0
                        ^          ^       ^
                       driver     port    serdev
  gnss_cmdline.type=0
                    ^
                    GNSS_TYPE_NMEA

Bug: 146517987
Change-Id: I421386ee4f2ba8f1f0832d9c56a067a600892d3c
Signed-off-by: Alistair Delva <adelva@google.com>
2019-12-19 15:35:47 -08:00
Alistair Delva
4070d32e75 ANDROID: serdev: add platform device support
Enables devices on a platform bus, such as serial8250 on the ISA bus, to
be enumerated by the serdev subsystem. This enables further layering by
e.g. the gnss subsystem.

With this in change, these devices can now register with the serdev core
and show up as serdev tty ports (serialX) and child devices (serialX-Y).

serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a U6_16550A
serial serial0: tty port ttyS0 registered
serial8250: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a U6_16550A
serial serial1: tty port ttyS1 registered
serial8250: ttyS2 at I/O 0x3e8 (irq = 4, base_baud = 115200) is a U6_16550A
serial serial2: tty port ttyS2 registered
serial8250: ttyS3 at I/O 0x2e8 (irq = 3, base_baud = 115200) is a U6_16550A
serial serial3: tty port ttyS3 registered

The modalias shows up like this:

  # cat /sys/bus/serial/devices/serial0-0/modalias
  platform:serial8250

Bug: 146517987
Change-Id: I3711c9d9ecd66fad638a45a8745e97569ae01791
Signed-off-by: Alistair Delva <adelva@google.com>
2019-12-19 15:35:46 -08:00
Yu Chen
8a880b68c5 ANDROID: usb: gadget: Add configfs attribuite for controling match_existing_only
Currently the "match_existing_only" of usb_gadget_driver in configfs is
set to one which is not flexible.
Dwc3 udc will be removed when usb core switch to host mode. This causes
failure of writing name of dwc3 udc to configfs's UDC attribuite.
To fix this we need to add a way to change the config of
"match_existing_only".
There are systems like Android do not support udev, so adding
"match_existing_only" attribute to allow configuration by user is cost little.
This patch adds a configfs attribuite for controling match_existing_only
which allow user to config "match_existing_only".

Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Binghui Wang <wangbinghui@hisilicon.com>
Bug: 146450171
Signed-off-by: Yu Chen <chenyu56@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I7c61a45cd4d22a188838659d4cc3f0fbe0ac1bcf
2019-12-19 21:04:38 +00:00
Ram Muthiah
5527e65c43 ANDROID: gki_defconfig: enable ARM64_SW_TTBR0_PAN
Bug: 146537847
Bug: 143710295
Test: Treehugger
Change-Id: I1e64095a563a8b7a3f3ced160cec72ca5d1e8a8d
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
2019-12-19 11:28:48 -08:00
Ram Muthiah
e060d9b6f1 ANDROID: gki_defconfig: Set BINFMT_MISC as =m
Bug: 145774383
Test: Treehugger
Change-Id: I7a3c395875504c455e4e720c807f52d083d35f9b
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
2019-12-19 11:23:33 -08:00
Guenter Roeck
8dd35aa435 FROMLIST: ARM: Remove arm_pm_restart()
All users of arm_pm_restart() have been converted to use the kernel
restart handler.

Bug: 146512338
Change-Id: I32c19f5c730bb7b02c4e474bb2292c25483d6900
Link: https://lore.kernel.org/patchwork/patch/1139631/
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2019-12-18 15:49:14 -08:00
Guenter Roeck
953287c407 FROMLIST: ARM64: Remove arm_pm_restart()
All users of arm_pm_restart() have been converted to use the kernel
restart handler.

Bug: 146512338
Change-Id: I7d3ab4bef10559a28e38cb50ee02698ce939824c
Link: https://lore.kernel.org/patchwork/patch/1139630/
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2019-12-18 15:48:47 -08:00
Guenter Roeck
8efc26b4c1 FROMLIST: ARM: Register with kernel restart handler
By making use of the kernel restart handler, board specific restart
handlers can be prioritized amongst available mechanisms for a particular
board or system.

Select the default priority of 128 to indicate that the restart callback
in the machine description is the default restart mechanism.

Bug: 146512338
Change-Id: I9253eab4b521d8b39196909cb0780aa0aaa041db
Link: https://lore.kernel.org/patchwork/patch/1139629/
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2019-12-18 15:48:19 -08:00
Guenter Roeck
1704a701e1 FROMLIST: drivers: firmware: psci: Register with kernel restart handler
Register with kernel restart handler instead of setting arm_pm_restart
directly. This enables support for replacing the PSCI restart handler
with a different handler if necessary for a specific board.

Select a priority of 129 to indicate a higher than default priority, but
keep it as low as possible since PSCI reset is known to fail on some
boards.

Bug: 146512338
Change-Id: I15bf41931fa8301e141b4b5d22b6bcede5fd726d
Link: https://lore.kernel.org/patchwork/patch/1139628/
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Stefan Agner <stefan.agner@toradex.com>
2019-12-18 15:47:58 -08:00
Guenter Roeck
390baafa19 FROMLIST: ARM: xen: Register with kernel restart handler
Register with kernel restart handler instead of setting arm_pm_restart
directly.

Select a high priority of 192 to ensure that default restart handlers
are replaced if Xen is running.

Bug: 146512338
Change-Id: I1bfa30771cb3d1289177ba86b3378e3f6cd01e1c
Link: https://lore.kernel.org/patchwork/patch/1139627/
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2019-12-18 15:47:34 -08:00
Guenter Roeck
b0ac347088 FROMLIST: ARM: prima2: Register with kernel restart handler
Register with kernel restart handler instead of setting arm_pm_restart
directly. By doing this, the prima2 reset handler can be prioritized
among other restart methods available on a particular board.

Select a high priority of 192 since the original code overwrites the
default arm restart handler.

Bug: 146512338
Change-Id: I7b1f295a8a68c75d502ce050429297c2644233fb
Link: https://lore.kernel.org/patchwork/patch/1139626/
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2019-12-18 15:44:33 -08:00
Youlin Wang
183905b9fd ANDROID: ASoC: add hikey960-i2s DT bindings
Adds DT bindings documentation for
the hikey960-i2s driver and audio card device.

Bug: 146450171
Signed-off-by: Youlin Wang <wangyoulin1@hisilicon.com>
Signed-off-by: Tanglei Han <hantanglei@huawei.com>
Signed-off-by: Guangke Ji <jiguangke@huawei.com>
Signed-off-by: Feng Chen <puck.chen@hisilicon.com>
Signed-off-by: Kaihua Zhong <zhongkaihua@huawei.com>
Signed-off-by: Jun Chen <chenjun14@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Yiping Xu <xuyiping@hisilicon.com>
Signed-off-by: Pengcheng Li <lipengcheng8@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: If9f8ce65c78e1e1e6b2e0439b590e7558763d631
2019-12-18 18:07:51 +00:00
Youlin Wang
6e7f3a3fda ANDROID: sound: Add hikey960 i2s audio driver
Add i2s driver for hisi3660 soc found on the hikey960 board.
Add conpile line in make file.
Technical support by Guangke Ji.

Bug: 146450171
Signed-off-by: Youlin Wang <wangyoulin1@hisilicon.com>
Signed-off-by: Tanglei Han <hantanglei@huawei.com>
Signed-off-by: Guangke Ji <jiguangke@huawei.com>
Signed-off-by: Feng Chen <puck.chen@hisilicon.com>
Signed-off-by: Kaihua Zhong <zhongkaihua@huawei.com>
Signed-off-by: Jun Chen <chenjun14@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Yiping Xu <xuyiping@hisilicon.com>
Signed-off-by: Pengcheng Li <lipengcheng8@huawei.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I90e66ff47ebd2cd42fa233a4c4dbac6e74cd01d3
2019-12-18 18:07:51 +00:00
John Stultz
59ed578ff8 ANDROID: HACK: adv7511: Add poweron delay to allow for EDID probing to work
For some reason on HiKey960 the edid probing doesn't work
properly unless we delay a bit at poweron.

Bug: 146450171
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Id8bcf9158d3060e065a6a9ec06bbe0323b73dc8e
2019-12-18 18:07:51 +00:00
John Stultz
5dc9892e95 ANDROID: drm: kirin: Fix Makefile to correct for module builds
Fix kirin driver module builds

Bug: 146450171
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I01f4054b49bd5fe41311ac11f51f6d3f56162df3
2019-12-18 18:07:51 +00:00
John Stultz
5e895b756f ANDROID: drm: kirin960: Remove one mode-line that seems to be causing trouble
Alessio Balsini reported issues with his GeeekPi 7" monitor
after we added the wider mode support.

While this mode may work ok on HiKey, I suspect its just a bit
too far off for HiKey960.

So lets remove it for now.

Bug: 146450171
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I54221c44f2ee6af16d3772831a24c2872a6f738c
2019-12-18 18:07:51 +00:00
Vincent Donnefort
baebfbe17b ANDROID: drm: kirin: remove wait for VACTIVE IRQ
For each display cycle, the Kirin960 display IP will generate a VACTIVE
interrupt followed by a VBLANK. During a FBIOPAN ioctl, the driver will then
wait for the first one to then wait for the second one. This is an issue when
the CPU load is too low: the wait_event() function might trigger a transition
to a deep sleep state and then, waking up from that state will take too much
time to catch the VBLANK interrupt on time, the difference between those two
interrupts being only 60 us.

  * Ideal case:                   ACT                VBL
                                   +                  +
                                   v                  v
                    ---> wait(ACT) +------> wait(VBL) +-->

  * Our case:                     ACT VBL        ACT VBL
                                   +   +          +   +
                                   v   v          v   v
                    ---> wait(ACT) +------> wait(VBL) +-->

The wait for VACTIVE IRQ can safely be removed: there is no hardware access
performed between the VACTIVE and the VBLANK IRQs.

This behavior has been introduced from 4.11 with the following patch:

    a3fbb53f4 drm/atomic: Wait for vblank whenever a plane is added to state.

Bug: 146450171
Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I66e276c08f04257135c3d05483ce70c58d5070b6
2019-12-18 18:07:51 +00:00
Xu YiPing
dc4dcb4749 ANDROID: drm: kirin: Add kirin960 dpe driver support
add kirin960 dpe driver support

Bug: 146450171
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com>
[jstultz: includes fixes folded in to remove LDI enable
 call, fix rdma_stride calculation, and fix hdmi hotplug
 crashes]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Ifdf3ef522f929c23f7da49b3c692550a3b3d6c49
2019-12-18 18:07:51 +00:00
John Stultz
711b81c4a6 ANDROID: drm: kirin: Introduce kirin960
Add initial kirin960 support files.

Bug: 146450171
Signed-off-by: Xu YiPing <xuyiping@hisilicon.com>
[jstultz: fold in some other changes, this patch really needs to be
 split up into some cleaner steps]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I934004f4a15e1bba341807f6c63c13bf6c661698
2019-12-18 18:07:51 +00:00
Yu Chen
1794dc2e49 ANDROID: arm64: dts: hi3660: Add support for usb on Hikey960
This patch adds support for usb on Hikey960.

Bug: 146450171
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>
Cc: Wei Xu <xuwei5@hisilicon.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: John Stultz <john.stultz@linaro.org>
Cc: Binghui Wang <wangbinghui@hisilicon.com>
Signed-off-by: Yu Chen <chenyu56@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I3325fbdaf6eea8cd1facb3d64bf0bf7f1c81fb23
2019-12-18 18:07:51 +00:00
John Stultz
b12a34dcf2 ANDROID: arm64: dts: hikey960: Fix bootwarning on mapping reboot reason syscon
Avoid bootwarning mapping reboot reason syscon

Bug: 146450171
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I2f79450c0be8bb19f547159992ee6b54d897f8c5
2019-12-18 18:07:51 +00:00
Chen Jun
6defa0d59d ANDROID: arm64: dts: hi3660: adb reboot node
Add "hisilicon,hi3660-reboot" node for hi3660.

Eventually when we've transitioned to UEFI this can be dropped.
As we can then use syscon-reboot-mode.

Bug: 146450171
Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Chen Jun <chenjun14@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I5612ec7f58af38d6d06cee8f5adbf285660ce21a
2019-12-18 18:07:51 +00:00
Shihui Zhao
d00b1a418a ANDROID: arm64: dts: hi3660: enable gpu
enable gpu in the hi3660/hikey960 dts

Bug: 146450171
Signed-off-by: Shihui Zhao <zhaoshihui3@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I5e72a7dc14e760f442db5b9e55b0df26597cfbcd
2019-12-18 18:07:51 +00:00
Youlin Wang
08e75f3872 ANDROID: arm64: dts: hi3660-hikey960: Add i2s & sound device
Bug: 146450171
Signed-off-by: Youlin Wang <wangyoulin1@hisilicon.com>
Signed-off-by: Tanglei Han <hantanglei@huawei.com>
Signed-off-by: Guangke Ji <jiguangke@huawei.com>
Signed-off-by: Feng Chen <puck.chen@hisilicon.com>
Signed-off-by: Kaihua Zhong <zhongkaihua@huawei.com>
Signed-off-by: Jun Chen <chenjun14@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Yiping Xu <xuyiping@hisilicon.com>
Signed-off-by: Pengcheng Li <lipengcheng8@huawei.com>
Cc: Wei Xu <xuwei5@hisilicon.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I746999c06398779a5380c043a1fc7349f373694c
2019-12-18 18:07:51 +00:00
cailiwei
33d8879c11 ANDROID: arm64: dts: hi3660: add display driver dts
Bug: 146450171
Signed-off-by: Liwei Cai <cailiwei@hisilicon.com>
Signed-off-by: Xiubin Zhang <zhangxiubin1@huawei.com>
[jstultz: Cleanup unused hisifb bits]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: If9df111ad81475caec22fe75168544b010477e04
2019-12-18 18:05:06 +00:00
John Stultz
114e6d48b8 ANDROID: arm64: dts: hikey960: Add CMA entry for ION/framebuffers
Add CMA entry, as the DRM driver requires phys contig
memory for framebuffers. These are normally allocated
out of ION by gralloc for the graphics framebuffer.

NOTE: On the 4gb boards, if we don't specify the address,
the cma region we use for the framebuffer and ion heap
may be placed in memory mapped above 32bits.

Due to addresses being masked to 32bits for DMA, this
resulted in crashes on newer 4gb boards.

Thus this patch forces CMA address to be lower in memory.

I've picked an address just past a previous CMA reserved
chunk, so we shouldn't be adding to any fragmentation.

Extra thanks to Ryan Grachek <ryan@edited.us> who
helped isolate the issue with the CMA buffers being over
the 32bit barrier.

Bug: 146450171
Change-Id: Ibb7ff1d85a9b93e41c440ffacf6a1ccf6aecb1ca
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-12-18 18:04:34 +00:00
Yongqin Liu
d139b82ae2 ANDROID: mm/memory.c: export mm_trace_rss_stat
to workaround following error:
    ERROR: "mm_trace_rss_stat" [drivers/gpu/arm_gpu/mali_kbase.ko] undefined!
reported when make modules

Test: test 5.5.0-rc1-mainline with hikey960 with GKI method

Change-Id: Icb56b0c760780c3f9081f82d921406d17f4f1c08
[adelva: workaround for Mali driver on hikey960]
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Signed-off-by: Alistair Delva <adelva@google.com>
2019-12-18 18:02:56 +00:00
Greg Kroah-Hartman
45d92463d4 ANDROID: update ABI for 5.4.5
Leaf changes summary: 1 artifact changed
Changed leaf types summary: 1 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'struct flow_dissector at flow_dissector.h:267:1' changed:
  type size changed from 448 to 480 (in bits)
  there are data member changes:
   type 'unsigned short int[26]' of 'flow_dissector::offset' changed:
     type name changed from 'unsigned short int[26]' to 'unsigned short int[27]'
     array type size changed from 416 to 432
     array type subrange 1 changed length from 26 to 27
, size changed from 416 to 432 (in bits) (by +16 bits)

  one impacted interface:
    function bool __skb_flow_dissect(const net*, const sk_buff*, flow_dissector*, void*, void*, __be16, int, int, unsigned int)

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1a4277b8bc5bada6444c914f76d80b24fec94aac
2019-12-18 17:48:28 +01:00
Greg Kroah-Hartman
09cdc723de This is the 5.4.5 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl36QR4ACgkQONu9yGCS
 aT4prg/9Eiypkpf0V1QtxGLmE1M0ylsXhwwvl8YfED2ku/zqzFxm3ht+IQkGBFl9
 x7Y4LMkPJenfbQYV3iMk5hgjPJ4CNJiqXI+uD6le2SSp+vRi7U9DzH/JPNgd80qp
 JSSuAeK43l3dTUx+zNOfziLnnczf8X1gT4V00LArIFQHF+kATZKAaKcRx7Wqouw8
 mCt+UoJgGa9Et+yKjDbBIlmALs9e2xPR0ltwxBNCgJO99KE+qDZAXeLAOsPppA7K
 h2zWpMSczbq9X4MejN2Jbj3aGZueHoXwmtlbXiSglMefAJF1vEt7NmJzdZ4TCWCw
 ajVOhiW7+PGqmV46nMuSLxDef2osITHR+x8TOUlLMYsqNywUluHnf44GHmzqurzY
 6vI1y+nCWKes6Xb2nV5XofphOUNJEMcHXmwntKWicnuexTeBiWWS06UYdxn+ECEY
 VRwt4rsWmTGwNQpKHG8Kwyi+OLy85JC7iWJORKhpRKrHd1mTNRFNkUtH1BKpkd9b
 QokoL3YIeyA8pCWYFzCjT5WJy+YvDKI2pp3edByKilg3z2pRPr5c6VYU5mERSIuw
 EKDuVYHfo/m6mKHfdoBW8LugOB33bbe2Y446b8J+ELwwlv/SnRVIadzzZeQcHudg
 +FG7jwN+vTBSD1TuPSKg6WzbirM6R4HnGaMyYOdAd6Bzlkg0/CU=
 =MihI
 -----END PGP SIGNATURE-----

Merge 5.4.5 into android-5.4

Changes in 5.4.5
	inet: protect against too small mtu values.
	mqprio: Fix out-of-bounds access in mqprio_dump
	net: bridge: deny dev_set_mac_address() when unregistering
	net: dsa: fix flow dissection on Tx path
	net: ethernet: ti: cpsw: fix extra rx interrupt
	net: sched: fix dump qlen for sch_mq/sch_mqprio with NOLOCK subqueues
	net_sched: validate TCA_KIND attribute in tc_chain_tmplt_add()
	net: thunderx: start phy before starting autonegotiation
	net/tls: Fix return values to avoid ENOTSUPP
	openvswitch: support asymmetric conntrack
	tcp: md5: fix potential overestimation of TCP option space
	tipc: fix ordering of tipc module init and exit routine
	net/mlx5e: Query global pause state before setting prio2buffer
	net: ipv6: add net argument to ip6_dst_lookup_flow
	net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
	tcp: fix rejected syncookies due to stale timestamps
	tcp: tighten acceptance of ACKs not matching a child socket
	tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE()
	net: core: rename indirect block ingress cb function
	net: sched: allow indirect blocks to bind to clsact in TC
	cls_flower: Fix the behavior using port ranges with hw-offload
	gre: refetch erspan header from skb->data after pskb_may_pull()
	Fixed updating of ethertype in function skb_mpls_pop
	hsr: fix a NULL pointer dereference in hsr_dev_xmit()
	net: Fixed updating of ethertype in skb_mpls_push()
	net/mlx5e: Fix TXQ indices to be sequential
	act_ct: support asymmetric conntrack
	net/mlx5e: Fix SFF 8472 eeprom length
	net/mlx5e: Fix freeing flow with kfree() and not kvfree()
	net/mlx5e: Fix translation of link mode into speed
	net/mlx5e: ethtool, Fix analysis of speed setting
	page_pool: do not release pool until inflight == 0.
	xdp: obtain the mem_id mutex before trying to remove an entry.
	ionic: keep users rss hash across lif reset
	net: mscc: ocelot: unregister the PTP clock on deinit
	r8169: add missing RX enabling for WoL on RTL8125
	Linux 5.4.5

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I65207949c27553e0bdc8d10740c9f11d97ff8ebf
2019-12-18 16:54:08 +01:00
Greg Kroah-Hartman
9a08897100 Linux 5.4.5 2019-12-18 16:09:17 +01:00
Heiner Kallweit
68159412b2 r8169: add missing RX enabling for WoL on RTL8125
[ Upstream commit 00222d1394104f0fd6c01ca9f578afec9e0f148b ]

RTL8125 also requires to enable RX for WoL.

v2: add missing Fixes tag

Fixes: f1bce4ad2f ("r8169: add support for RTL8125")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18 16:09:17 +01:00
Vladimir Oltean
157560f95d net: mscc: ocelot: unregister the PTP clock on deinit
[ Upstream commit 9385973fe8db9743fa93bf17245635be4eb8c4a6 ]

Currently a switch driver deinit frees the regmaps, but the PTP clock is
still out there, available to user space via /dev/ptpN. Any PTP
operation is a ticking time bomb, since it will attempt to use the freed
regmaps and thus trigger kernel panics:

[    4.291746] fsl_enetc 0000:00:00.2 eth1: error -22 setting up slave phy
[    4.291871] mscc_felix 0000:00:00.5: Failed to register DSA switch: -22
[    4.308666] mscc_felix: probe of 0000:00:00.5 failed with error -22
[    6.358270] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000088
[    6.367090] Mem abort info:
[    6.369888]   ESR = 0x96000046
[    6.369891]   EC = 0x25: DABT (current EL), IL = 32 bits
[    6.369892]   SET = 0, FnV = 0
[    6.369894]   EA = 0, S1PTW = 0
[    6.369895] Data abort info:
[    6.369897]   ISV = 0, ISS = 0x00000046
[    6.369899]   CM = 0, WnR = 1
[    6.369902] user pgtable: 4k pages, 48-bit VAs, pgdp=00000020d58c7000
[    6.369904] [0000000000000088] pgd=00000020d5912003, pud=00000020d5915003, pmd=0000000000000000
[    6.369914] Internal error: Oops: 96000046 [#1] PREEMPT SMP
[    6.420443] Modules linked in:
[    6.423506] CPU: 1 PID: 262 Comm: phc_ctl Not tainted 5.4.0-03625-gb7b2a5dadd7f #204
[    6.431273] Hardware name: LS1028A RDB Board (DT)
[    6.435989] pstate: 40000085 (nZcv daIf -PAN -UAO)
[    6.440802] pc : css_release+0x24/0x58
[    6.444561] lr : regmap_read+0x40/0x78
[    6.448316] sp : ffff800010513cc0
[    6.451636] x29: ffff800010513cc0 x28: ffff002055873040
[    6.456963] x27: 0000000000000000 x26: 0000000000000000
[    6.462289] x25: 0000000000000000 x24: 0000000000000000
[    6.467617] x23: 0000000000000000 x22: 0000000000000080
[    6.472944] x21: ffff800010513d44 x20: 0000000000000080
[    6.478270] x19: 0000000000000000 x18: 0000000000000000
[    6.483596] x17: 0000000000000000 x16: 0000000000000000
[    6.488921] x15: 0000000000000000 x14: 0000000000000000
[    6.494247] x13: 0000000000000000 x12: 0000000000000000
[    6.499573] x11: 0000000000000000 x10: 0000000000000000
[    6.504899] x9 : 0000000000000000 x8 : 0000000000000000
[    6.510225] x7 : 0000000000000000 x6 : ffff800010513cf0
[    6.515550] x5 : 0000000000000000 x4 : 0000000fffffffe0
[    6.520876] x3 : 0000000000000088 x2 : ffff800010513d44
[    6.526202] x1 : ffffcada668ea000 x0 : ffffcada64d8b0c0
[    6.531528] Call trace:
[    6.533977]  css_release+0x24/0x58
[    6.537385]  regmap_read+0x40/0x78
[    6.540795]  __ocelot_read_ix+0x6c/0xa0
[    6.544641]  ocelot_ptp_gettime64+0x4c/0x110
[    6.548921]  ptp_clock_gettime+0x4c/0x58
[    6.552853]  pc_clock_gettime+0x5c/0xa8
[    6.556699]  __arm64_sys_clock_gettime+0x68/0xc8
[    6.561331]  el0_svc_common.constprop.2+0x7c/0x178
[    6.566133]  el0_svc_handler+0x34/0xa0
[    6.569891]  el0_sync_handler+0x114/0x1d0
[    6.573908]  el0_sync+0x140/0x180
[    6.577232] Code: d503201f b00119a1 91022263 b27b7be4 (f9004663)
[    6.583349] ---[ end trace d196b9b14cdae2da ]---
[    6.587977] Kernel panic - not syncing: Fatal exception
[    6.593216] SMP: stopping secondary CPUs
[    6.597151] Kernel Offset: 0x4ada54400000 from 0xffff800010000000
[    6.603261] PHYS_OFFSET: 0xffffd0a7c0000000
[    6.607454] CPU features: 0x10002,21806008
[    6.611558] Memory Limit: none

And now that ocelot->ptp_clock is checked at exit, prevent a potential
error where ptp_clock_register returned a pointer-encoded error, which
we are keeping in the ocelot private data structure. So now,
ocelot->ptp_clock is now either NULL or a valid pointer.

Fixes: 4e3b0468e6 ("net: mscc: PTP Hardware Clock (PHC) support")
Cc: Antoine Tenart <antoine.tenart@bootlin.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18 16:09:14 +01:00
Shannon Nelson
dd561233e0 ionic: keep users rss hash across lif reset
[ Upstream commit ffac2027e18f006f42630f2e01a8a9bd8dc664b5 ]

If the user has specified their own RSS hash key, don't
lose it across queue resets such as DOWN/UP, MTU change,
and number of channels change.  This is fixed by moving
the key initialization to a little earlier in the lif
creation.

Also, let's clean up the RSS config a little better on
the way down by setting it all to 0.

Fixes: aa3198819b ("ionic: Add RSS support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18 16:09:12 +01:00
Jonathan Lemon
9bd01a33c7 xdp: obtain the mem_id mutex before trying to remove an entry.
[ Upstream commit 86c76c09898332143be365c702cf8d586ed4ed21 ]

A lockdep splat was observed when trying to remove an xdp memory
model from the table since the mutex was obtained when trying to
remove the entry, but not before the table walk started:

Fix the splat by obtaining the lock before starting the table walk.

Fixes: c3f812cea0d7 ("page_pool: do not release pool until inflight == 0.")
Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Tested-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-18 16:09:10 +01:00