linux.git
4 years agoMA-17911 soc: imx: Allow IMX8M_BUSFREQ to be loadable as module
Jindong Yue [Mon, 12 Apr 2021 09:11:00 +0000 (17:11 +0800)]
MA-17911 soc: imx: Allow IMX8M_BUSFREQ to be loadable as module

Allow imx8m busfreq driver to be loaded as a module.
Do not select IMX8M_BUSFREQ by default after enable ARCH_MXC.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
4 years agoMA-17597 clk: imx8mp: remove __init in imx_clk_init_on
Jindong Yue [Mon, 12 Apr 2021 09:10:25 +0000 (17:10 +0800)]
MA-17597 clk: imx8mp: remove __init in imx_clk_init_on

Fix below section mismatch build warnings:
  The function imx8mp_clocks_probe() references
  the function __init imx_clk_init_on().
  This is often because imx8mp_clocks_probe lacks a __init
  annotation or the annotation of imx_clk_init_on is wrong.

  FATAL: modpost: Section mismatches detected.
  Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
4 years agoMLK-25018 soc: imx: Correct the default noc setting on imx8mq
Jacky Bai [Wed, 18 Nov 2020 09:33:40 +0000 (17:33 +0800)]
MLK-25018 soc: imx: Correct the default noc setting on imx8mq

The config for lcdif should be removed, and need to add vpu
qos setting by default. this patch is just to add back the
vpu qos config that is missed when resolving cherry-pick
conflict for patch:
3a3f54750294: MLK-19380 driver: soc: update the noc QoS setting on imx8mq

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
4 years agoLF-3709 PCI: imx: fix the build warning
Richard Zhu [Wed, 14 Apr 2021 02:01:37 +0000 (10:01 +0800)]
LF-3709 PCI: imx: fix the build warning

Fix the build warning introduced by the previouse commit merge
conflictions.

Fixes: commit 1713c6ce909c ("MLK-25283-4 PCI: imx: adjust the l1ss support to proper place")

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
4 years agoLF-3707 Revert "LF-3696: caam: fix that the caam driver cannot identify the SoC"
Alice Guo [Thu, 15 Apr 2021 06:03:07 +0000 (14:03 +0800)]
LF-3707 Revert "LF-3696: caam: fix that the caam driver cannot identify the SoC"

This reverts commit ed321757672f3d8b8ad0e2d40a19a9b2411d0940.

caam test failed with 5.10.27-lf-5.10.y-1.0.0-2413-ged321757672f.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
4 years agoMLK-25426 remoteproc: imx_rproc: fix firmware reload
Peng Fan [Tue, 13 Apr 2021 03:29:52 +0000 (11:29 +0800)]
MLK-25426 remoteproc: imx_rproc: fix firmware reload

ENABLE_M4 should be set to 1 when loading code to TCM, otherwise
you will not able to replace the firmware after you stop m4.

Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoLF-3689-2 net: stmmac: let PHY keep RXC clock on during LPI
Joakim Zhang [Wed, 7 Apr 2021 09:44:31 +0000 (17:44 +0800)]
LF-3689-2 net: stmmac: let PHY keep RXC clock on during LPI

i.MX EQOS MAC RX logic depends on RXC clock from PHY, so let PHY keep
RXC clock on during LPI, otherwise RXC clock would stop when PHY in LPI.
AR8031 PHY doesn't implement this feature, RTL8211FD PHY does.

This patch fixes below error log during suspend/resume test with WoL enabled.
imx-dwmac 30bf0000.ethernet eth0: Timeout accessing MAC_VLAN_Tag_Filter

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
4 years agoLF-3689-1 net: stmmac: fix MAC WoL unwork if PHY doesn't support WoL
Joakim Zhang [Wed, 7 Apr 2021 07:04:07 +0000 (15:04 +0800)]
LF-3689-1 net: stmmac: fix MAC WoL unwork if PHY doesn't support WoL

Both get and set WoL will check device_can_wakeup(), if MAC supports
PMT, it will set device wakeup capability. After commit 1d8e5b0f3f2c ("net:
stmmac: Support WOL with phy"), device wakeup capability will be
overwrite in stmmac_init_phy() according to phy's Wol feature. If phy
doesn't support WoL, then MAC will lose wakeup capability. To fix this
issue, only overwrite device wakeup capability when MAC doesn't support
PMT.

Fixes: commit 1d8e5b0f3f2c ("net: stmmac: Support WOL with phy")
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
4 years agoMerge tag 'v5.10.29' into lf-5.10.y
Jason Liu [Mon, 12 Apr 2021 10:52:32 +0000 (18:52 +0800)]
Merge tag 'v5.10.29' into lf-5.10.y

This is the 5.10.29 stable release

* tag 'v5.10.29': (152 commits)
  Linux 5.10.29
  init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM
  init/Kconfig: make COMPILE_TEST depend on !S390
  ...

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
4 years agoLF-3696: caam: fix that the caam driver cannot identify the SoC
Alice Guo [Fri, 9 Apr 2021 10:45:09 +0000 (18:45 +0800)]
LF-3696: caam: fix that the caam driver cannot identify the SoC

When imx8_soc_info_driver uses module_platform_driver() to regitser
itself, the caam driver cannot identify the SoC in the machine because
soc_id it needs has not been provided yet, so add return -EPROBE_DEFER.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
4 years agosoc: imx8m: change to use platform driver
Alice Guo [Mon, 4 Jan 2021 09:15:44 +0000 (17:15 +0800)]
soc: imx8m: change to use platform driver

Directly reading ocotp register depends on that bootloader enables ocotp
clk, which is not always effective, so change to use nvmem API. Using
nvmem API requires to support driver defer probe and thus change
soc-imx8m.c to use platform driver.

The other reason is that directly reading ocotp register causes kexec
kernel hang because the 1st kernel running will disable unused clks
after kernel boots up, and then ocotp clk will be disabled even if
bootloader enables it. When kexec kernel, ocotp clk needs to be enabled
before reading ocotp registers, and nvmem API with platform driver
supported can accomplish this.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoarm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID
Alice Guo [Mon, 4 Jan 2021 09:15:43 +0000 (17:15 +0800)]
arm64: dts: imx8m: add NVMEM provider and consumer to read soc unique ID

In order to be able to use NVMEM APIs to read soc unique ID, add the
nvmem data cell and name for nvmem-cells to the "soc" node, and add a
nvmem node which provides soc unique ID to efuse@30350000.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoarm64: dts: imx8m: add SoC ID compatible
Alice Guo [Mon, 4 Jan 2021 09:15:42 +0000 (17:15 +0800)]
arm64: dts: imx8m: add SoC ID compatible

Add compatible string to .dtsi files for binding of imx8_soc_info and
device.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agodt-bindings: soc: imx8m: add DT Binding doc for soc unique ID
Alice Guo [Mon, 4 Jan 2021 09:15:41 +0000 (17:15 +0800)]
dt-bindings: soc: imx8m: add DT Binding doc for soc unique ID

Add DT Binding doc for the Unique ID of i.MX 8M series.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
4 years agoLinux 5.10.29
Greg Kroah-Hartman [Sat, 10 Apr 2021 11:36:11 +0000 (13:36 +0200)]
Linux 5.10.29

Tested-by: A. Rabusov <a.rabusov@tum.de>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Tested-by: Hulk Robot <hulkrobot@huawei.com>
Tested-by: Jason Self <jason@bluehome.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Link: https://lore.kernel.org/r/20210409095304.818847860@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoinit/Kconfig: make COMPILE_TEST depend on HAS_IOMEM
Masahiro Yamada [Sat, 13 Mar 2021 05:07:08 +0000 (21:07 -0800)]
init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM

commit ea29b20a828511de3348334e529a3d046a180416 upstream.

I read the commit log of the following two:

bc083a64b6c0 ("init/Kconfig: make COMPILE_TEST depend on !UML")
334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390")

Both are talking about HAS_IOMEM dependency missing in many drivers.

So, 'depends on HAS_IOMEM' seems the direct, sensible solution to me.

This does not change the behavior of UML. UML still cannot enable
COMPILE_TEST because it does not provide HAS_IOMEM.

The current dependency for S390 is too strong. Under the condition of
CONFIG_PCI=y, S390 provides HAS_IOMEM, hence can enable COMPILE_TEST.

I also removed the meaningless 'default n'.

Link: https://lkml.kernel.org/r/20210224140809.1067582-1-masahiroy@kernel.org
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: KP Singh <kpsingh@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Quentin Perret <qperret@google.com>
Cc: Valentin Schneider <valentin.schneider@arm.com>
Cc: "Enrico Weigelt, metux IT consult" <lkml@metux.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoinit/Kconfig: make COMPILE_TEST depend on !S390
Heiko Carstens [Wed, 18 Nov 2020 20:32:33 +0000 (21:32 +0100)]
init/Kconfig: make COMPILE_TEST depend on !S390

commit 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e upstream.

While allmodconfig and allyesconfig build for s390 there are also
various bots running compile tests with randconfig, where PCI is
disabled. This reveals that a lot of drivers should actually depend on
HAS_IOMEM.
Adding this to each device driver would be a never ending story,
therefore just disable COMPILE_TEST for s390.

The reasoning is more or less the same as described in
commit bc083a64b6c0 ("init/Kconfig: make COMPILE_TEST depend on !UML").

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agobpf, x86: Validate computation of branch displacements for x86-32
Piotr Krysiuk [Tue, 6 Apr 2021 20:59:39 +0000 (21:59 +0100)]
bpf, x86: Validate computation of branch displacements for x86-32

commit 26f55a59dc65ff77cd1c4b37991e26497fc68049 upstream.

The branch displacement logic in the BPF JIT compilers for x86 assumes
that, for any generated branch instruction, the distance cannot
increase between optimization passes.

But this assumption can be violated due to how the distances are
computed. Specifically, whenever a backward branch is processed in
do_jit(), the distance is computed by subtracting the positions in the
machine code from different optimization passes. This is because part
of addrs[] is already updated for the current optimization pass, before
the branch instruction is visited.

And so the optimizer can expand blocks of machine code in some cases.

This can confuse the optimizer logic, where it assumes that a fixed
point has been reached for all machine code blocks once the total
program size stops changing. And then the JIT compiler can output
abnormal machine code containing incorrect branch displacements.

To mitigate this issue, we assert that a fixed point is reached while
populating the output image. This rejects any problematic programs.
The issue affects both x86-32 and x86-64. We mitigate separately to
ease backporting.

Signed-off-by: Piotr Krysiuk <piotras@gmail.com>
Reviewed-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agobpf, x86: Validate computation of branch displacements for x86-64
Piotr Krysiuk [Mon, 5 Apr 2021 21:52:15 +0000 (22:52 +0100)]
bpf, x86: Validate computation of branch displacements for x86-64

commit e4d4d456436bfb2fe412ee2cd489f7658449b098 upstream.

The branch displacement logic in the BPF JIT compilers for x86 assumes
that, for any generated branch instruction, the distance cannot
increase between optimization passes.

But this assumption can be violated due to how the distances are
computed. Specifically, whenever a backward branch is processed in
do_jit(), the distance is computed by subtracting the positions in the
machine code from different optimization passes. This is because part
of addrs[] is already updated for the current optimization pass, before
the branch instruction is visited.

And so the optimizer can expand blocks of machine code in some cases.

This can confuse the optimizer logic, where it assumes that a fixed
point has been reached for all machine code blocks once the total
program size stops changing. And then the JIT compiler can output
abnormal machine code containing incorrect branch displacements.

To mitigate this issue, we assert that a fixed point is reached while
populating the output image. This rejects any problematic programs.
The issue affects both x86-32 and x86-64. We mitigate separately to
ease backporting.

Signed-off-by: Piotr Krysiuk <piotras@gmail.com>
Reviewed-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agotools/resolve_btfids: Add /libbpf to .gitignore
Stanislav Fomichev [Fri, 12 Feb 2021 01:00:53 +0000 (17:00 -0800)]
tools/resolve_btfids: Add /libbpf to .gitignore

[ Upstream commit 90a82b1fa40d0cee33d1c9306dc54412442d1e57 ]

This is what I see after compiling the kernel:

 # bpf-next...bpf-next/master
 ?? tools/bpf/resolve_btfids/libbpf/

Fixes: fc6b48f692f8 ("tools/resolve_btfids: Build libbpf and libsubcmd in separate directories")
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210212010053.668700-1-sdf@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agokbuild: Do not clean resolve_btfids if the output does not exist
Jiri Olsa [Thu, 11 Feb 2021 12:40:04 +0000 (13:40 +0100)]
kbuild: Do not clean resolve_btfids if the output does not exist

[ Upstream commit 0e1aa629f1ce9e8cb89e0cefb9e3bfb3dfa94821 ]

Nathan reported issue with cleaning empty build directory:

  $ make -s O=build distclean
  ../../scripts/Makefile.include:4: *** \
  O=/ho...build/tools/bpf/resolve_btfids does not exist.  Stop.

The problem that tools scripts require existing output
directory, otherwise it fails.

Adding check around the resolve_btfids clean target to
ensure the output directory is in place.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/bpf/20210211124004.1144344-1-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agokbuild: Add resolve_btfids clean to root clean target
Jiri Olsa [Fri, 5 Feb 2021 12:40:20 +0000 (13:40 +0100)]
kbuild: Add resolve_btfids clean to root clean target

[ Upstream commit 50d3a3f81689586697a38cd60070181ebe626ad9 ]

The resolve_btfids tool is used during the kernel build,
so we should clean it on kernel's make clean.

Invoking the the resolve_btfids clean as part of root
'make clean'.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20210205124020.683286-5-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agotools/resolve_btfids: Set srctree variable unconditionally
Jiri Olsa [Fri, 5 Feb 2021 12:40:19 +0000 (13:40 +0100)]
tools/resolve_btfids: Set srctree variable unconditionally

[ Upstream commit 7962cb9b640af98ccb577f46c8b894319e6c5c20 ]

We want this clean to be called from tree's root Makefile,
which defines same srctree variable and that will screw
the make setup.

We actually do not use srctree being passed from outside,
so we can solve this by setting current srctree value
directly.

Also changing the way how srctree is initialized as suggested
by Andrri.

Also root Makefile does not define the implicit RM variable,
so adding RM initialization.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210205124020.683286-4-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agotools/resolve_btfids: Check objects before removing
Jiri Olsa [Fri, 5 Feb 2021 12:40:18 +0000 (13:40 +0100)]
tools/resolve_btfids: Check objects before removing

[ Upstream commit f23130979c2f15ea29a431cd9e1ea7916337bbd4 ]

We want this clean to be called from tree's root clean
and that one is silent if there's nothing to clean.

Adding check for all object to clean and display CLEAN
messages only if there are objects to remove.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210205124020.683286-3-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agotools/resolve_btfids: Build libbpf and libsubcmd in separate directories
Jiri Olsa [Fri, 5 Feb 2021 12:40:17 +0000 (13:40 +0100)]
tools/resolve_btfids: Build libbpf and libsubcmd in separate directories

[ Upstream commit fc6b48f692f89cc48bfb7fd1aa65454dfe9b2d77 ]

Setting up separate build directories for libbpf and libpsubcmd,
so it's separated from other objects and we don't get them mixed
in the future.

It also simplifies cleaning, which is now simple rm -rf.

Also there's no need for FEATURE-DUMP.libbpf and bpf_helper_defs.h
files in .gitignore anymore.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210205124020.683286-2-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agomath: Export mul_u64_u64_div_u64
David S. Miller [Wed, 24 Mar 2021 23:42:54 +0000 (16:42 -0700)]
math: Export mul_u64_u64_div_u64

[ Upstream commit bf45947864764548697e7515fe693e10f173f312 ]

Fixes: f51d7bf1dbe5 ("ptp_qoriq: fix overflow in ptp_qoriq_adjfine() u64 calcalation")
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoio_uring: fix timeout cancel return code
Pavel Begunkov [Thu, 25 Mar 2021 18:32:42 +0000 (18:32 +0000)]
io_uring: fix timeout cancel return code

[ Upstream commit 1ee4160c73b2102a52bc97a4128a89c34821414f ]

When we cancel a timeout we should emit a sensible return code, like
-ECANCELED but not 0, otherwise it may trick users.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/7b0ad1065e3bd1994722702bd0ba9e7bc9b0683b.1616696997.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agocifs: Silently ignore unknown oplock break handle
Vincent Whitchurch [Fri, 19 Mar 2021 13:57:11 +0000 (14:57 +0100)]
cifs: Silently ignore unknown oplock break handle

[ Upstream commit 219481a8f90ec3a5eed9638fb35609e4b1aeece7 ]

Make SMB2 not print out an error when an oplock break is received for an
unknown handle, similar to SMB1.  The debug message which is printed for
these unknown handles may also be misleading, so fix that too.

The SMB2 lease break path is not affected by this patch.

Without this, a program which writes to a file from one thread, and
opens, reads, and writes the same file from another thread triggers the
below errors several times a minute when run against a Samba server
configured with "smb2 leases = no".

 CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2
 00000000424d53fe 00000040 00000000 00000012  .SMB@...........
 0000001000000001 00000000 ffffffff ffffffff  ................
 0000002000000000 00000000 00000000 00000000  ................
 0000003000000000 00000000 00000000 00000000  ................

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Reviewed-by: Tom Talpey <tom@talpey.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agocifs: revalidate mapping when we open files for SMB1 POSIX
Ronnie Sahlberg [Thu, 25 Mar 2021 06:26:35 +0000 (16:26 +1000)]
cifs: revalidate mapping when we open files for SMB1 POSIX

[ Upstream commit cee8f4f6fcabfdf229542926128e9874d19016d5 ]

RHBZ: 1933527

Under SMB1 + POSIX, if an inode is reused on a server after we have read and
cached a part of a file, when we then open the new file with the
re-cycled inode there is a chance that we may serve the old data out of cache
to the application.
This only happens for SMB1 (deprecated) and when posix are used.
The simplest solution to avoid this race is to force a revalidate
on smb1-posix open.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoia64: fix format strings for err_inject
Sergei Trofimovich [Thu, 25 Mar 2021 04:37:41 +0000 (21:37 -0700)]
ia64: fix format strings for err_inject

[ Upstream commit 95d44a470a6814207d52dd6312203b0f4ef12710 ]

Fix warning with %lx / u64 mismatch:

  arch/ia64/kernel/err_inject.c: In function 'show_resources':
  arch/ia64/kernel/err_inject.c:62:22: warning:
    format '%lx' expects argument of type 'long unsigned int',
    but argument 3 has type 'u64' {aka 'long long unsigned int'}
     62 |  return sprintf(buf, "%lx", name[cpu]);   \
        |                      ^~~~~~~

Link: https://lkml.kernel.org/r/20210313104312.1548232-1-slyfox@gentoo.org
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoia64: mca: allocate early mca with GFP_ATOMIC
Sergei Trofimovich [Thu, 25 Mar 2021 04:37:38 +0000 (21:37 -0700)]
ia64: mca: allocate early mca with GFP_ATOMIC

[ Upstream commit f2a419cf495f95cac49ea289318b833477e1a0e2 ]

The sleep warning happens at early boot right at secondary CPU
activation bootup:

    smp: Bringing up secondary CPUs ...
    BUG: sleeping function called from invalid context at mm/page_alloc.c:4942
    in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1
    CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.12.0-rc2-00007-g79e228d0b611-dirty #99
    ..
    Call Trace:
      show_stack+0x90/0xc0
      dump_stack+0x150/0x1c0
      ___might_sleep+0x1c0/0x2a0
      __might_sleep+0xa0/0x160
      __alloc_pages_nodemask+0x1a0/0x600
      alloc_page_interleave+0x30/0x1c0
      alloc_pages_current+0x2c0/0x340
      __get_free_pages+0x30/0xa0
      ia64_mca_cpu_init+0x2d0/0x3a0
      cpu_init+0x8b0/0x1440
      start_secondary+0x60/0x700
      start_ap+0x750/0x780
    Fixed BSP b0 value from CPU 1

As I understand interrupts are not enabled yet and system has a lot of
memory.  There is little chance to sleep and switch to GFP_ATOMIC should
be a no-op.

Link: https://lkml.kernel.org/r/20210315085045.204414-1-slyfox@gentoo.org
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoselftests/vm: fix out-of-tree build
Rong Chen [Thu, 25 Mar 2021 04:37:26 +0000 (21:37 -0700)]
selftests/vm: fix out-of-tree build

[ Upstream commit 19ec368cbc7ee1915e78c120b7a49c7f14734192 ]

When building out-of-tree, attempting to make target from $(OUTPUT) directory:

  make[1]: *** No rule to make target '$(OUTPUT)/protection_keys.c', needed by '$(OUTPUT)/protection_keys_32'.

Link: https://lkml.kernel.org/r/20210315094700.522753-1-rong.a.chen@intel.com
Signed-off-by: Rong Chen <rong.a.chen@intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoscsi: target: pscsi: Clean up after failure in pscsi_map_sg()
Martin Wilck [Tue, 23 Mar 2021 21:24:31 +0000 (22:24 +0100)]
scsi: target: pscsi: Clean up after failure in pscsi_map_sg()

[ Upstream commit 36fa766faa0c822c860e636fe82b1affcd022974 ]

If pscsi_map_sg() fails, make sure to drop references to already allocated
bios.

Link: https://lore.kernel.org/r/20210323212431.15306-2-mwilck@suse.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoptp_qoriq: fix overflow in ptp_qoriq_adjfine() u64 calcalation
Yangbo Lu [Tue, 23 Mar 2021 08:02:29 +0000 (16:02 +0800)]
ptp_qoriq: fix overflow in ptp_qoriq_adjfine() u64 calcalation

[ Upstream commit f51d7bf1dbe5522c51c93fe8faa5f4abbdf339cd ]

Current calculation for diff of TMR_ADD register value may have
64-bit overflow in this code line, when long type scaled_ppm is
large.

adj *= scaled_ppm;

This patch is to resolve it by using mul_u64_u64_div_u64().

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoplatform/x86: intel_pmc_core: Ignore GBE LTR on Tiger Lake platforms
David E. Box [Fri, 19 Mar 2021 20:18:44 +0000 (13:18 -0700)]
platform/x86: intel_pmc_core: Ignore GBE LTR on Tiger Lake platforms

[ Upstream commit d1635448f1105e549b4041aab930dbc6945fc635 ]

Due to a HW limitation, the Latency Tolerance Reporting (LTR) value
programmed in the Tiger Lake GBE controller is not large enough to allow
the platform to enter Package C10, which in turn prevents the platform from
achieving its low power target during suspend-to-idle.  Ignore the GBE LTR
value on Tiger Lake. LTR ignore functionality is currently performed solely
by a debugfs write call. Split out the LTR code into its own function that
can be called by both the debugfs writer and by this work around.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Sasha Neftin <sasha.neftin@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Reviewed-by: Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>
Link: https://lore.kernel.org/r/20210319201844.3305399-2-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoblock: clear GD_NEED_PART_SCAN later in bdev_disk_changed
Chris Chiu [Tue, 23 Mar 2021 08:52:19 +0000 (16:52 +0800)]
block: clear GD_NEED_PART_SCAN later in bdev_disk_changed

[ Upstream commit 5116784039f0421e9a619023cfba3e302c3d9adc ]

The GD_NEED_PART_SCAN is set by bdev_check_media_change to initiate
a partition scan while removing a block device. It should be cleared
after blk_drop_paritions because blk_drop_paritions could return
-EBUSY and then the consequence __blkdev_get has no chance to do
delete_partition if GD_NEED_PART_SCAN already cleared.

It causes some problems on some card readers. Ex. Realtek card
reader 0bda:0328 and 0bda:0158. The device node of the partition
will not disappear after the memory card removed. Thus the user
applications can not update the device mapping correctly.

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1920874
Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210323085219.24428-1-chris.chiu@canonical.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agox86/build: Turn off -fcf-protection for realmode targets
Arnd Bergmann [Tue, 23 Mar 2021 12:48:36 +0000 (13:48 +0100)]
x86/build: Turn off -fcf-protection for realmode targets

[ Upstream commit 9fcb51c14da2953de585c5c6e50697b8a6e91a7b ]

The new Ubuntu GCC packages turn on -fcf-protection globally,
which causes a build failure in the x86 realmode code:

  cc1: error: ‘-fcf-protection’ is not compatible with this target

Turn it off explicitly on compilers that understand this option.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210323124846.1584944-1-arnd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agodrm/msm/disp/dpu1: icc path needs to be set before dpu runtime resume
Kalyan Thota [Mon, 22 Mar 2021 09:17:12 +0000 (02:17 -0700)]
drm/msm/disp/dpu1: icc path needs to be set before dpu runtime resume

[ Upstream commit 627dc55c273dab308303a5217bd3e767d7083ddb ]

DPU runtime resume will request for a min vote on the AXI bus as
it is a necessary step before turning ON the AXI clock.

The change does below
1) Move the icc path set before requesting runtime get_sync.
2) remove the dependency of hw catalog for min ib vote
as it is initialized at a later point.

Signed-off-by: Kalyan Thota <kalyan_t@codeaurora.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agokselftest/arm64: sve: Do not use non-canonical FFR register value
Andre Przywara [Fri, 19 Mar 2021 12:01:28 +0000 (12:01 +0000)]
kselftest/arm64: sve: Do not use non-canonical FFR register value

[ Upstream commit 7011d72588d16a9e5f5d85acbc8b10019809599c ]

The "First Fault Register" (FFR) is an SVE register that mimics a
predicate register, but clears bits when a load or store fails to handle
an element of a vector. The supposed usage scenario is to initialise
this register (using SETFFR), then *read* it later on to learn about
elements that failed to load or store. Explicit writes to this register
using the WRFFR instruction are only supposed to *restore* values
previously read from the register (for context-switching only).
As the manual describes, this register holds only certain values, it:
"... contains a monotonic predicate value, in which starting from bit 0
there are zero or more 1 bits, followed only by 0 bits in any remaining
bit positions."
Any other value is UNPREDICTABLE and is not supposed to be "restored"
into the register.

The SVE test currently tries to write a signature pattern into the
register, which is *not* a canonical FFR value. Apparently the existing
setups treat UNPREDICTABLE as "read-as-written", but a new
implementation actually only stores canonical values. As a consequence,
the sve-test fails immediately when comparing the FFR value:
-----------
 # ./sve-test
Vector length:  128 bits
PID:    207
Mismatch: PID=207, iteration=0, reg=48
        Expected [cf00]
        Got      [0f00]
Aborted
-----------

Fix this by only populating the FFR with proper canonical values.
Effectively the requirement described above limits us to 17 unique
values over 16 bits worth of FFR, so we condense our signature down to 4
bits (2 bits from the PID, 2 bits from the generation) and generate the
canonical pattern from it. Any bits describing elements above the
minimum 128 bit are set to 0.

This aligns the FFR usage to the architecture and fixes the test on
microarchitectures implementing FFR in a more restricted way.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviwed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210319120128.29452-1-andre.przywara@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoplatform/x86: thinkpad_acpi: Allow the FnLock LED to change state
Esteve Varela Colominas [Mon, 15 Mar 2021 19:58:24 +0000 (20:58 +0100)]
platform/x86: thinkpad_acpi: Allow the FnLock LED to change state

[ Upstream commit 3d677f12ea3a2097a16ded570623567403dea959 ]

On many recent ThinkPad laptops, there's a new LED next to the ESC key,
that indicates the FnLock status.
When the Fn+ESC combo is pressed, FnLock is toggled, which causes the
Media Key functionality to change, making it so that the media keys
either perform their media key function, or function as an F-key by
default. The Fn key can be used the access the alternate function at any
time.

With the current linux kernel, the LED doens't change state if you press
the Fn+ESC key combo. However, the media key functionality *does*
change. This is annoying, since the LED will stay on if it was on during
bootup, and it makes it hard to keep track what the current state of the
FnLock is.

This patch calls an ACPI function, that gets the current media key
state, when the Fn+ESC key combo is pressed. Through testing it was
discovered that this function causes the LED to update correctly to
reflect the current state when this function is called.

The relevant ACPI calls are the following:
\_SB_.PCI0.LPC0.EC0_.HKEY.GMKS: Get media key state, returns 0x603 if the FnLock mode is enabled, and 0x602 if it's disabled.
\_SB_.PCI0.LPC0.EC0_.HKEY.SMKS: Set media key state, sending a 1 will enable FnLock mode, and a 0 will disable it.

Relevant discussion:
https://bugzilla.kernel.org/show_bug.cgi?id=207841
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1881015

Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com>
Link: https://lore.kernel.org/r/20210315195823.23212-1-esteve.varela@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agonet: ipa: fix init header command validation
Alex Elder [Sat, 20 Mar 2021 14:17:28 +0000 (09:17 -0500)]
net: ipa: fix init header command validation

[ Upstream commit b4afd4b90a7cfe54c7cd9db49e3c36d552325eac ]

We use ipa_cmd_header_valid() to ensure certain values we will
program into hardware are within range, well in advance of when we
actually program them.  This way we avoid having to check for errors
when we actually program the hardware.

Unfortunately the dev_err() call for a bad offset value does not
supply the arguments to match the format specifiers properly.
Fix this.

There was also supposed to be a check to ensure the size to be
programmed fits in the field that holds it.  Add this missing check.

Rearrange the way we ensure the header table fits in overall IPA
memory range.

Finally, update ipa_cmd_table_valid() so the format of messages
printed for errors matches what's done in ipa_cmd_header_valid().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agonetfilter: nftables: skip hook overlap logic if flowtable is stale
Pablo Neira Ayuso [Wed, 17 Mar 2021 20:19:57 +0000 (21:19 +0100)]
netfilter: nftables: skip hook overlap logic if flowtable is stale

[ Upstream commit 86fe2c19eec4728fd9a42ba18f3b47f0d5f9fd7c ]

If the flowtable has been previously removed in this batch, skip the
hook overlap checks. This fixes spurious EEXIST errors when removing and
adding the flowtable in the same batch.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agonetfilter: conntrack: Fix gre tunneling over ipv6
Ludovic Senecaux [Thu, 4 Mar 2021 09:10:50 +0000 (04:10 -0500)]
netfilter: conntrack: Fix gre tunneling over ipv6

[ Upstream commit 8b2030b4305951f44afef80225f1475618e25a73 ]

This fix permits gre connections to be tracked within ip6tables rules

Signed-off-by: Ludovic Senecaux <linuxludo@free.fr>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agodrm/msm: Ratelimit invalid-fence message
Rob Clark [Wed, 17 Mar 2021 16:40:38 +0000 (09:40 -0700)]
drm/msm: Ratelimit invalid-fence message

[ Upstream commit 7ad48d27a2846bfda29214fb454d001c3e02b9e7 ]

We have seen a couple cases where low memory situations cause something
bad to happen, followed by a flood of these messages obscuring the root
cause.  Lets ratelimit the dmesg spam so that next time it happens we
don't lose the kernel traces leading up to this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agodrm/msm/adreno: a5xx_power: Don't apply A540 lm_setup to other GPUs
Konrad Dybcio [Sun, 28 Feb 2021 12:36:51 +0000 (13:36 +0100)]
drm/msm/adreno: a5xx_power: Don't apply A540 lm_setup to other GPUs

[ Upstream commit 4a9d36b0610aa7034340e976652e5b43320dd7c5 ]

While passing the A530-specific lm_setup func to A530 and A540
to !A530 was fine back when only these two were supported, it
certainly is not a good idea to send A540 specifics to smaller
GPUs like A508 and friends.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agodrm/msm/dsi_pll_7nm: Fix variable usage for pll_lockdet_rate
Dmitry Baryshkov [Wed, 24 Feb 2021 23:05:28 +0000 (02:05 +0300)]
drm/msm/dsi_pll_7nm: Fix variable usage for pll_lockdet_rate

[ Upstream commit 9daaf31307856defb1070685418ce5a484ecda3a ]

The PLL_LOCKDET_RATE_1 was being programmed with a hardcoded value
directly, but the same value was also being specified in the
dsi_pll_regs struct pll_lockdet_rate variable: let's use it!

Based on 362cadf34b9f ("drm/msm/dsi_pll_10nm: Fix variable usage for
pll_lockdet_rate")

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agomac80211: choose first enabled channel for monitor
Karthikeyan Kathirvel [Thu, 11 Mar 2021 05:29:07 +0000 (10:59 +0530)]
mac80211: choose first enabled channel for monitor

[ Upstream commit 041c881a0ba8a75f71118bd9766b78f04beed469 ]

Even if the first channel from sband channel list is invalid
or disabled mac80211 ends up choosing it as the default channel
for monitor interfaces, making them not usable.

Fix this by assigning the first available valid or enabled
channel instead.

Signed-off-by: Karthikeyan Kathirvel <kathirve@codeaurora.org>
Link: https://lore.kernel.org/r/1615440547-7661-1-git-send-email-kathirve@codeaurora.org
[reword commit message, comment, code cleanups]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agomac80211: Check crypto_aead_encrypt for errors
Daniel Phan [Tue, 9 Mar 2021 20:41:36 +0000 (12:41 -0800)]
mac80211: Check crypto_aead_encrypt for errors

[ Upstream commit 58d25626f6f0ea5bcec3c13387b9f835d188723d ]

crypto_aead_encrypt returns <0 on error, so if these calls are not checked,
execution may continue with failed encrypts.  It also seems that these two
crypto_aead_encrypt calls are the only instances in the codebase that are
not checked for errors.

Signed-off-by: Daniel Phan <daniel.phan36@gmail.com>
Link: https://lore.kernel.org/r/20210309204137.823268-1-daniel.phan36@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agomISDN: fix crash in fritzpci
Tong Zhang [Thu, 11 Mar 2021 04:27:35 +0000 (23:27 -0500)]
mISDN: fix crash in fritzpci

[ Upstream commit a9f81244d2e33e6dfcef120fefd30c96b3f7cdb0 ]

setup_fritz() in avmfritz.c might fail with -EIO and in this case the
isac.type and isac.write_reg is not initialized and remains 0(NULL).
A subsequent call to isac_release() will dereference isac->write_reg and
crash.

[    1.737444] BUG: kernel NULL pointer dereference, address: 0000000000000000
[    1.737809] #PF: supervisor instruction fetch in kernel mode
[    1.738106] #PF: error_code(0x0010) - not-present page
[    1.738378] PGD 0 P4D 0
[    1.738515] Oops: 0010 [#1] SMP NOPTI
[    1.738711] CPU: 0 PID: 180 Comm: systemd-udevd Not tainted 5.12.0-rc2+ #78
[    1.739077] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-48-gd9c812dda519-p
rebuilt.qemu.org 04/01/2014
[    1.739664] RIP: 0010:0x0
[    1.739807] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
[    1.740200] RSP: 0018:ffffc9000027ba10 EFLAGS: 00010202
[    1.740478] RAX: 0000000000000000 RBX: ffff888102f41840 RCX: 0000000000000027
[    1.740853] RDX: 00000000000000ff RSI: 0000000000000020 RDI: ffff888102f41800
[    1.741226] RBP: ffffc9000027ba20 R08: ffff88817bc18440 R09: ffffc9000027b808
[    1.741600] R10: 0000000000000001 R11: 0000000000000001 R12: ffff888102f41840
[    1.741976] R13: 00000000fffffffb R14: ffff888102f41800 R15: ffff8881008b0000
[    1.742351] FS:  00007fda3a38a8c0(0000) GS:ffff88817bc00000(0000) knlGS:0000000000000000
[    1.742774] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    1.743076] CR2: ffffffffffffffd6 CR3: 00000001021ec000 CR4: 00000000000006f0
[    1.743452] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[    1.743828] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[    1.744206] Call Trace:
[    1.744339]  isac_release+0xcc/0xe0 [mISDNipac]
[    1.744582]  fritzpci_probe.cold+0x282/0x739 [avmfritz]
[    1.744861]  local_pci_probe+0x48/0x80
[    1.745063]  pci_device_probe+0x10f/0x1c0
[    1.745278]  really_probe+0xfb/0x420
[    1.745471]  driver_probe_device+0xe9/0x160
[    1.745693]  device_driver_attach+0x5d/0x70
[    1.745917]  __driver_attach+0x8f/0x150
[    1.746123]  ? device_driver_attach+0x70/0x70
[    1.746354]  bus_for_each_dev+0x7e/0xc0
[    1.746560]  driver_attach+0x1e/0x20
[    1.746751]  bus_add_driver+0x152/0x1f0
[    1.746957]  driver_register+0x74/0xd0
[    1.747157]  ? 0xffffffffc00d8000
[    1.747334]  __pci_register_driver+0x54/0x60
[    1.747562]  AVM_init+0x36/0x1000 [avmfritz]
[    1.747791]  do_one_initcall+0x48/0x1d0
[    1.747997]  ? __cond_resched+0x19/0x30
[    1.748206]  ? kmem_cache_alloc_trace+0x390/0x440
[    1.748458]  ? do_init_module+0x28/0x250
[    1.748669]  do_init_module+0x62/0x250
[    1.748870]  load_module+0x23ee/0x26a0
[    1.749073]  __do_sys_finit_module+0xc2/0x120
[    1.749307]  ? __do_sys_finit_module+0xc2/0x120
[    1.749549]  __x64_sys_finit_module+0x1a/0x20
[    1.749782]  do_syscall_64+0x38/0x90

Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agokunit: tool: Fix a python tuple typing error
David Gow [Tue, 23 Feb 2021 05:49:30 +0000 (21:49 -0800)]
kunit: tool: Fix a python tuple typing error

[ Upstream commit 7421b1a4d10c633ca5f14c8236d3e2c1de07e52b ]

The first argument to namedtuple() should match the name of the type,
which wasn't the case for KconfigEntryBase.

Fixing this is enough to make mypy show no python typing errors again.

Fixes 97752c39bd ("kunit: kunit_tool: Allow .kunitconfig to disable config items")
Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Daniel Latypov <dlatypov@google.com>
Acked-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agonet: pxa168_eth: Fix a potential data race in pxa168_eth_remove
Pavel Andrianov [Wed, 10 Mar 2021 08:10:46 +0000 (11:10 +0300)]
net: pxa168_eth: Fix a potential data race in pxa168_eth_remove

[ Upstream commit 0571a753cb07982cc82f4a5115e0b321da89e1f3 ]

pxa168_eth_remove() firstly calls unregister_netdev(),
then cancels a timeout work. unregister_netdev() shuts down a device
interface and removes it from the kernel tables. If the timeout occurs
in parallel, the timeout work (pxa168_eth_tx_timeout_task) performs stop
and open of the device. It may lead to an inconsistent state and memory
leaks.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Pavel Andrianov <andrianov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agonet/mlx5e: Enforce minimum value check for ICOSQ size
Tariq Toukan [Tue, 12 Jan 2021 11:29:14 +0000 (13:29 +0200)]
net/mlx5e: Enforce minimum value check for ICOSQ size

[ Upstream commit 5115daa675ccf70497fe56e8916cf738d8212c10 ]

The ICOSQ size should not go below MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE.
Enforce this where it's missing.

Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agobpf, x86: Use kvmalloc_array instead kmalloc_array in bpf_jit_comp
Yonghong Song [Tue, 9 Mar 2021 01:56:47 +0000 (17:56 -0800)]
bpf, x86: Use kvmalloc_array instead kmalloc_array in bpf_jit_comp

[ Upstream commit de920fc64cbaa031f947e9be964bda05fd090380 ]

x86 bpf_jit_comp.c used kmalloc_array to store jited addresses
for each bpf insn. With a large bpf program, we have see the
following allocation failures in our production server:

    page allocation failure: order:5, mode:0x40cc0(GFP_KERNEL|__GFP_COMP),
                             nodemask=(null),cpuset=/,mems_allowed=0"
    Call Trace:
    dump_stack+0x50/0x70
    warn_alloc.cold.120+0x72/0xd2
    ? __alloc_pages_direct_compact+0x157/0x160
    __alloc_pages_slowpath+0xcdb/0xd00
    ? get_page_from_freelist+0xe44/0x1600
    ? vunmap_page_range+0x1ba/0x340
    __alloc_pages_nodemask+0x2c9/0x320
    kmalloc_order+0x18/0x80
    kmalloc_order_trace+0x1d/0xa0
    bpf_int_jit_compile+0x1e2/0x484
    ? kmalloc_order_trace+0x1d/0xa0
    bpf_prog_select_runtime+0xc3/0x150
    bpf_prog_load+0x480/0x720
    ? __mod_memcg_lruvec_state+0x21/0x100
    __do_sys_bpf+0xc31/0x2040
    ? close_pdeo+0x86/0xe0
    do_syscall_64+0x42/0x110
    entry_SYSCALL_64_after_hwframe+0x44/0xa9
    RIP: 0033:0x7f2f300f7fa9
    Code: Bad RIP value.

Dumped assembly:

    ffffffff810b6d70 <bpf_int_jit_compile>:
    ; {
    ffffffff810b6d70: e8 eb a5 b4 00        callq   0xffffffff81c01360 <__fentry__>
    ffffffff810b6d75: 41 57                 pushq   %r15
    ...
    ffffffff810b6f39: e9 72 fe ff ff        jmp     0xffffffff810b6db0 <bpf_int_jit_compile+0x40>
    ;       addrs = kmalloc_array(prog->len + 1, sizeof(*addrs), GFP_KERNEL);
    ffffffff810b6f3e: 8b 45 0c              movl    12(%rbp), %eax
    ;       return __kmalloc(bytes, flags);
    ffffffff810b6f41: be c0 0c 00 00        movl    $3264, %esi
    ;       addrs = kmalloc_array(prog->len + 1, sizeof(*addrs), GFP_KERNEL);
    ffffffff810b6f46: 8d 78 01              leal    1(%rax), %edi
    ;       if (unlikely(check_mul_overflow(n, size, &bytes)))
    ffffffff810b6f49: 48 c1 e7 02           shlq    $2, %rdi
    ;       return __kmalloc(bytes, flags);
    ffffffff810b6f4d: e8 8e 0c 1d 00        callq   0xffffffff81287be0 <__kmalloc>
    ;       if (!addrs) {
    ffffffff810b6f52: 48 85 c0              testq   %rax, %rax

Change kmalloc_array() to kvmalloc_array() to avoid potential
allocation error for big bpf programs.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210309015647.3657852-1-yhs@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoplatform/x86: intel-hid: Support Lenovo ThinkPad X1 Tablet Gen 2
Alban Bedel [Mon, 22 Feb 2021 14:15:59 +0000 (15:15 +0100)]
platform/x86: intel-hid: Support Lenovo ThinkPad X1 Tablet Gen 2

[ Upstream commit 56678a5f44ef5f0ad9a67194bbee2280c6286534 ]

Like a few other system the Lenovo ThinkPad X1 Tablet Gen 2 miss the
HEBC method, which prevent the power button from working. Add a quirk
to enable the button array on this system family and fix the power
button.

Signed-off-by: Alban Bedel <albeu@free.fr>
Tested-by: Alexander Kobel <a-kobel@a-kobel.de>
Link: https://lore.kernel.org/r/20210222141559.3775-1-albeu@free.fr
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agobus: ti-sysc: Fix warning on unbind if reset is not deasserted
Tony Lindgren [Thu, 18 Feb 2021 11:06:57 +0000 (13:06 +0200)]
bus: ti-sysc: Fix warning on unbind if reset is not deasserted

[ Upstream commit a7b5d7c4969aba8d1f04c29048906abaa71fb6a9 ]

We currently get thefollowing on driver unbind if a reset is configured
and asserted:

WARNING: CPU: 0 PID: 993 at drivers/reset/core.c:432 reset_control_assert
...
(reset_control_assert) from [<c0fecda8>] (sysc_remove+0x190/0x1e4)
(sysc_remove) from [<c0a2bb58>] (platform_remove+0x24/0x3c)
(platform_remove) from [<c0a292fc>] (__device_release_driver+0x154/0x214)
(__device_release_driver) from [<c0a2a210>] (device_driver_detach+0x3c/0x8c)
(device_driver_detach) from [<c0a27d64>] (unbind_store+0x60/0xd4)
(unbind_store) from [<c0546bec>] (kernfs_fop_write_iter+0x10c/0x1cc)

Let's fix it by checking the reset status.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoARM: dts: am33xx: add aliases for mmc interfaces
Mans Rullgard [Thu, 28 Jan 2021 15:56:44 +0000 (15:56 +0000)]
ARM: dts: am33xx: add aliases for mmc interfaces

[ Upstream commit 9bbce32a20d6a72c767a7f85fd6127babd1410ac ]

Without DT aliases, the numbering of mmc interfaces is unpredictable.
Adding them makes it possible to refer to devices consistently.  The
popular suggestion to use UUIDs obviously doesn't work with a blank
device fresh from the factory.

See commit fa2d0aa96941 ("mmc: core: Allow setting slot index via
device tree alias") for more discussion.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
4 years agoMLK-25346: arm64: defconfig: Add i.MX8QM cockpit config
Nitin Garg [Tue, 23 Mar 2021 21:08:08 +0000 (16:08 -0500)]
MLK-25346: arm64: defconfig: Add i.MX8QM cockpit config

Add config to support 2 cluster cockpit on i.MX8QM.
make imx_v8_defconfig imx8qm_cockpit.config

Signed-off-by: Seb Fagard <sebastien.fagard@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
4 years agoMLK-25346: arm64: dts: imx8qm: Add Cockpit domain device trees
Nitin Garg [Fri, 26 Mar 2021 19:52:14 +0000 (14:52 -0500)]
MLK-25346: arm64: dts: imx8qm: Add Cockpit domain device trees

Add i.MX8QM Cockpit domain device trees for the
2 clusters of the SOC.

Signed-off-by: Seb Fagard <sebastien.fagard@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
4 years agoMLK-25346: arm64: dts: imx8qm: add MU8A and MU8B node in lsio
Nitin Garg [Tue, 23 Mar 2021 20:51:55 +0000 (15:51 -0500)]
MLK-25346: arm64: dts: imx8qm: add MU8A and MU8B node in lsio

Add the MU8 A & B for communication between partitions
of cortex-A53 and cortex-A72 clusters in cockpit
configuration.

Signed-off-by: Seb Fagard <sebastien.fagard@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
4 years agoLF-882 arm64: imx8qm-ss-lvds.dtsi: add definition for lvds_ipg_clk
Seb Fagard [Mon, 20 Jan 2020 17:00:08 +0000 (18:00 +0100)]
LF-882 arm64: imx8qm-ss-lvds.dtsi: add definition for lvds_ipg_clk

Each lvds subsystem must be independent from the other:
- add 'lvds_ipg_clk' clock definiton as needed by 'lvds1_subsys'
  and 'lvds2_subsys'.

Signed-off-by: Seb Fagard <sebastien.fagard@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
4 years agoMLK-25346: rtc: add readonly option to rtc-imx-sc driver
Nitin Garg [Tue, 23 Mar 2021 20:42:46 +0000 (15:42 -0500)]
MLK-25346: rtc: add readonly option to rtc-imx-sc driver

Setting RTC time requires ownership of SCU's SYSTEM
resource. Add an 'readonly' option to the driver to
allow usage of the RTC even without owning the SYSTEM
resource. In that case, time setting is not allowed.

Signed-off-by: Fabrice Goucem <fabrice.goucem@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
4 years agoMLK-25346: net: add imx-shmem-net driver
Nitin Garg [Tue, 23 Mar 2021 20:37:57 +0000 (15:37 -0500)]
MLK-25346: net: add imx-shmem-net driver

This driver uses the shared memory and the mailbox units to
provide a virtual network interface toward a peer device on
the same SoC. This new driver is based on ivshmem-net driver,
where we replace ivshmem's registers by struct 'regs' in the
context, and push in MU all modifications to 'regs' value lstate.

FEATURES:
Only 2 identical devices in different HW partitions and connected
by an MU can talk to each other.
All MU transaction may timeout: if first message sent through MU,
then the driver will be probed again.
The driver supports peer's partition reset:
driver registers to SCFW service to receive a notification when
peer's partition resets.
The driver supports multiple devices
(i.e. multiple connections to different partitions).

Signed-off-by: Seb Fagard <sebastien.fagard@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
4 years agoMLK-25346: irqchip/gic: change affinity settings strategy
Nitin Garg [Tue, 23 Mar 2021 20:33:53 +0000 (15:33 -0500)]
MLK-25346: irqchip/gic: change affinity settings strategy

Instead of setting the same affinity for all interrupts
at boot time, only set it when interrupts are registered.
This way, a cluster will not mess up the other cluster's
settings in Cockpit configuration.

Signed-off-by: Seb Fagard <sebastien.fagard@nxp.com>
Signed-off-by: Nitin Garg <nitin.garg@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
4 years agoarm64: imx8mx: vpu: integrate vsi 20210409 release
Zhou Peng [Fri, 9 Apr 2021 12:23:25 +0000 (20:23 +0800)]
arm64: imx8mx: vpu: integrate vsi 20210409 release

- M865SW-729: VSI V4L2 Engineer release package 20210409
  M865SW-725: [VPU/V4l2] utest met error when handle some hevc streams like these, 10bits->8bits->10bits bit-depth changing
  M865SW-727: [VPU/V4L2] common: potential risk in code
  M865SW-658: [VPU/V4L2] encoder: support resolution change stream transcoding.
  M865SW-696: [VPU/V4L2] VC8000E: Flush encoder then get V4L2_EVENT_CODEC_ERROR event
  M865SW-697: [VPU/V4L2] encoder: the bitrate of encoding vp8 is not accurate

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 9d01ea827a624280ada828f68fc1a12036ff1812)

4 years agoLF-3673: ASoC: ak5558: Fix the value for gpiod_set_value
Shengjiu Wang [Fri, 9 Apr 2021 09:31:08 +0000 (17:31 +0800)]
LF-3673: ASoC: ak5558: Fix the value for gpiod_set_value

The GPIO is defined as ACTIVE_LOW, so the value need
to be corrected for each purpose.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
4 years agoLF-3623: media: imx8: isi: fix Can't match soc version
Guoniu.zhou [Mon, 29 Mar 2021 07:32:15 +0000 (15:32 +0800)]
LF-3623: media: imx8: isi: fix Can't match soc version

ISI core driver depend on soc version info but driver provided the info
is not ready when ISI core driver probe, so return -EPROBE_DEFER replaced
with -EINVAL.

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3687: media: isi: refine message handle for isi device driver
Guoniu.zhou [Thu, 8 Apr 2021 06:32:52 +0000 (14:32 +0800)]
LF-3687: media: isi: refine message handle for isi device driver

ISI capture device driver will depend on mediamix reset driver when do
probe, but sometimes the driver is not ready when isi capture driver
probe, so for this case, driver only return the error value and don't
print error message

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3685: media: cap: move s_power subdev from open to streamon
Guoniu.zhou [Thu, 8 Apr 2021 02:16:45 +0000 (10:16 +0800)]
LF-3685: media: cap: move s_power subdev from open to streamon

When user open video device, most of cases it will go through all video
device node registered in system. If power on subdev when open, it will
cost about 500ms due to ov5640 loading firmware. So move the operation
from open to streamon.

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3683: media: csi2: replace hard code with macro for isp dewarp control
Guoniu.zhou [Wed, 7 Apr 2021 10:15:14 +0000 (18:15 +0800)]
LF-3683: media: csi2: replace hard code with macro for isp dewarp control

Replace hard code with marco for isp dewarp control in mediamix GPR

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoMLK-24711: media: csi: samsung: fix print error info when csi driver probe
Guoniu.zhou [Wed, 7 Apr 2021 09:26:48 +0000 (17:26 +0800)]
MLK-24711: media: csi: samsung: fix print error info when csi driver probe

"gpr" property only used for iMX8MP platform, so add checking before
get the property handle

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoMLK-25258: media: imx: unregister v4l2 async notifier when no sensor connected
Guoniu.zhou [Sat, 20 Feb 2021 08:00:54 +0000 (16:00 +0800)]
MLK-25258: media: imx: unregister v4l2 async notifier when no sensor connected

In order to support hotplug-like mechanism, driver will call subdev notifier
complete function manually if there is sensor connected. If there there is no
valid sensor conneted when imx8-media-dev driver loaded, it will unregister
video device subdev. But in some case, sensor driver will be loaded after it.
In order to cover the case, imx8-media-dev driver unregister v4l2 async notifier
if there is no sensor connected. After sensor driver load, user can unload imx8-
media-dev driver and load it again.

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-10: media: isi: m2m: fix v4l2-compliance buffer ioctls test fail issue
Guoniu.zhou [Fri, 19 Feb 2021 10:18:09 +0000 (18:18 +0800)]
LF-3334-10: media: isi: m2m: fix v4l2-compliance buffer ioctls test fail issue

Fix VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF test fail issue, log as bellow:
  test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
    fail: v4l2-test-buffers.cpp(614): q.reqbufs(node, 1)

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-09: media: isi: m2m: fix v4l2-compliance multiple opens test fail issue
Guoniu.zhou [Fri, 19 Feb 2021 10:14:13 +0000 (18:14 +0800)]
LF-3334-09: media: isi: m2m: fix v4l2-compliance multiple opens test fail issue

Fix isi memory to memory multiple opens test fail issue, log as bellow:
  test second /dev/video0 open: FAIL
  fail: v4l2-compliance.cpp(735): !ok
  test for unlimited opens: FAIL

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-08: media: isi: m2m: add subscribe event support
Guoniu.zhou [Fri, 5 Feb 2021 06:37:33 +0000 (14:37 +0800)]
LF-3334-08: media: isi: m2m: add subscribe event support

Add subscribe event support

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-07: media: isi: m2m: fix v4l2-compliance S_FMT test fail issue
Guoniu.zhou [Fri, 5 Feb 2021 06:31:40 +0000 (14:31 +0800)]
LF-3334-07: media: isi: m2m: fix v4l2-compliance S_FMT test fail issue

Fix v4l2-compliance S_FMT test fail issue
  test VIDIOC_S_FMT: FAIL
    fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-formats.cpp(1103): S_FMT cannot handle an invalid format

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-06: media: isi: m2m: fix v4l2-compliance TRY_FMT test fail issue
Guoniu.zhou [Fri, 5 Feb 2021 06:24:23 +0000 (14:24 +0800)]
LF-3334-06: media: isi: m2m: fix v4l2-compliance TRY_FMT test fail issue

Fix v4l2-compliance TRY_FMT test fail issue
  test VIDIOC_TRY_FMT: FAIL
    fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-formats.cpp(467): pix_mp.field == V4L2_FIELD_ANY

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-05: media: isi: m2m: fix v4l2-compliance G_FMT test fail issue
Guoniu.zhou [Fri, 5 Feb 2021 03:06:34 +0000 (11:06 +0800)]
LF-3334-05: media: isi: m2m: fix v4l2-compliance G_FMT test fail issue

Fix v4l2-compliance G_FMT test fail issue, error log as bellow:
[  110.057121] Unable to handle kernel NULL pointer dereference at virtual address 000000000000000c
  ...
[  110.227985] Call trace:
[  110.230431]  mxc_isi_m2m_g_fmt_vid_cap+0x48/0xb0
[  110.235046]  v4l_g_fmt+0xc8/0x2f0
[  110.238358]  __video_do_ioctl+0x180/0x3e4
[  110.242365]  video_usercopy+0x190/0x410
[  110.246197]  video_ioctl2+0x18/0x24
[  110.249684]  v4l2_ioctl+0x44/0x64
[  110.252998]  __arm64_sys_ioctl+0xa8/0xf0
[  110.256920]  el0_svc_common.constprop.0+0x78/0x1a0
[  110.261708]  do_el0_svc+0x24/0x90
[  110.265022]  el0_svc+0x14/0x20
[  110.268074]  el0_sync_handler+0x1a4/0x1b0
[  110.272080]  el0_sync+0x174/0x180
[  110.275395] Code: b9489405 b9000e65 b9001664 f9446404 (b9400c84)
[  110.281487] ---[ end trace 115fd9c0a779b4d9 ]---

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-04: media: isi: cap: fix v4l2-compliance buffer ioctls test fail issue
Guoniu.zhou [Wed, 3 Feb 2021 07:33:44 +0000 (15:33 +0800)]
LF-3334-04: media: isi: cap: fix v4l2-compliance buffer ioctls test fail issue

Fix v4l2-compliance VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF test fail issue, error
as bellow:

  test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: FAIL
    fail: v4l2-test-buffers.cpp(722): q.create_bufs(node, 1, &fmt) != EINVAL

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-03: media: isi: cap: fix v4l2-compliance EVENT test fail issue
Guoniu.zhou [Wed, 3 Feb 2021 06:57:34 +0000 (14:57 +0800)]
LF-3334-03: media: isi: cap: fix v4l2-compliance EVENT test fail issue

Fix v4l2-compliance (UN)SUBSCRIBE_EVENT/DQEVENT test fail issue, error log as bellow:
  test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-02: media: isi: cap: fix v4l2-compliance TRY_FMT/S_FMT test fail issue
Guoniu.zhou [Tue, 2 Feb 2021 06:30:57 +0000 (14:30 +0800)]
LF-3334-02: media: isi: cap: fix v4l2-compliance TRY_FMT/S_FMT test fail issue

Fix v4l2-compliance TRY_FMT/S_FMT test fail issue, error log as bellow:
  test VIDIOC_TRY_FMT: FAIL
    fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-formats.cpp(346): colorspace >= 0xff
    fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-formats.cpp(464): testColorspace(node->has_inputs || node->has_output)
  test VIDIOC_S_FMT: FAIL

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3334-01: media: isi: cap: fix v4l2-compliance G_FMT test fail issue
Guoniu.zhou [Thu, 4 Feb 2021 07:13:14 +0000 (15:13 +0800)]
LF-3334-01: media: isi: cap: fix v4l2-compliance G_FMT test fail issue

Fix v4l2-compliance G_FMT test fail issue, error log as bellow:
  test VIDIOC_G_FMT: FAIL
    fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-formats.cpp(343): pixelformat != V4L2_PIX_FMT_JPEG && pixelformat != G
    fail: ../../../v4l-utils-1.18.1/utils/v4l2-compliance/v4l2-test-formats.cpp(464): testColorspace(node->has_inputs || node->has_output)

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3695: media: i2c: ov5640: fix QQVGA mode undefined issue
Guoniu.zhou [Fri, 9 Apr 2021 10:01:00 +0000 (18:01 +0800)]
LF-3695: media: i2c: ov5640: fix QQVGA mode undefined issue

Fix QQVGA mode undefined issue

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
4 years agoLF-3694: media: i2c: ov5640: add QQVGA mode support
Guoniu.zhou [Fri, 9 Apr 2021 08:50:16 +0000 (16:50 +0800)]
LF-3694: media: i2c: ov5640: add QQVGA mode support

Add QQVGA mode support for OV5640

Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
4 years agoMLK-25349-3 PCI: imx: clear vreg bypass when pcie vph voltage is 3v3
Richard Zhu [Tue, 23 Mar 2021 00:54:43 +0000 (08:54 +0800)]
MLK-25349-3 PCI: imx: clear vreg bypass when pcie vph voltage is 3v3

Both 1.8v and 3.3v power supplies can be used by i.MX8MQ PCIe PHY.
In default, the PCIE_VPH voltage is suggested to be 1.8v refer to data
sheet. When PCIE_VPH is supplied by 3.3v in the HW schematic design,
the VREG_BYPASS bits of GPR registers should be cleared from default
value 1b'1 to 1b'0. Thus, the internal 3v3 to 1v8 translator would be
turned on.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
(cherry picked from commit 94e84f467b688ce79eb3239f1516f6009b75a19b)

4 years agoMLK-25349-2 arm64: dts: imx8mq-evk: add one regulator used to power up pcie phy
Richard Zhu [Tue, 23 Mar 2021 00:54:27 +0000 (08:54 +0800)]
MLK-25349-2 arm64: dts: imx8mq-evk: add one regulator used to power up pcie phy

Both 1.8v and 3.3v power supplies can be used by i.MX8MQ PCIe PHY.
In default, the PCIE_VPH voltage is suggested to be 1.8v refer to data
sheet. When PCIE_VPH is supplied by 3.3v in the HW schematic design,
the VREG_BYPASS bits of GPR registers should be cleared from default
value 1b'1 to 1b'0. Thus, the internal 3v3 to 1v8 translator would be
turned on.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
(cherry picked from commit d9f9d0c73d3965e6a7b130e2b762a8ff7d4f04a7)

4 years agoMLK-25349-1 dt-bindings: imx6q-pcie: add one regulator used to power up pcie phy
Richard Zhu [Tue, 23 Mar 2021 00:54:18 +0000 (08:54 +0800)]
MLK-25349-1 dt-bindings: imx6q-pcie: add one regulator used to power up pcie phy

Both 1.8v and 3.3v power supplies can be used by i.MX8MQ PCIe PHY.
In default, the PCIE_VPH voltage is suggested to be 1.8v refer to data
sheet. When PCIE_VPH is supplied by 3.3v in the HW schematic design,
the VREG_BYPASS bits of GPR registers should be cleared from default
value 1b'1 to 1b'0. Thus, the internal 3v3 to 1v8 translator would be
turned on.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
(cherry picked from commit c14681471c737280d93d1e5f83221576caf352ee)

4 years agoMLK-25334-2 PCI: imx: export one property to disable l1ss support or not
Richard Zhu [Mon, 8 Mar 2021 05:08:02 +0000 (13:08 +0800)]
MLK-25334-2 PCI: imx: export one property to disable l1ss support or not

Some HW boards might not support the L1.1 ASPM, although the L1.1 ASPM
is supported by the SOC chip.
So, export one property to disable L1.1 ASPM supported or not.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
(cherry picked from commit 4e42c418396d545a48a4eb47a04ce73a27b0415e)

4 years agoMLK-25334-1 dt-bindings: imx6q-pcie: add one property to disable l1ss support or not
Richard Zhu [Tue, 9 Mar 2021 07:13:13 +0000 (15:13 +0800)]
MLK-25334-1 dt-bindings: imx6q-pcie: add one property to disable l1ss support or not

HW board design may not support the L1.1 ASPM, although the L1.1 ASPM
can be supported by the SOC chip.
So, export one property to disable L1.1 ASPM supported or not.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
(cherry picked from commit 7bd2d56b72d33e223305aa2ef9046c0e38f225e6)

4 years agoMLK-25333-3 clk: imx8mq: correct one pcie1 ctrl clock sel
Richard Zhu [Tue, 9 Mar 2021 06:49:32 +0000 (14:49 +0800)]
MLK-25333-3 clk: imx8mq: correct one pcie1 ctrl clock sel

Correct one of the imx8mq_pcie1_ctrl_sels, from "sys2_pll_250m"
to "sys2_pll_333m".

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
(cherry picked from commit 6c34e907db3da694a63dbd44668189f769e686fe)

4 years agoMLK-25333-2 clk: imx8mm: remove the parent setting in clock driver
Richard Zhu [Thu, 8 Apr 2021 08:03:38 +0000 (16:03 +0800)]
MLK-25333-2 clk: imx8mm: remove the parent setting in clock driver

Since the parent clock setting had been done in dts node.
Remove the codes from clock driver.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
4 years agoMLK-25333-1 arm64: dts: specify the clock rate and parent of pcie clocks
Richard Zhu [Thu, 8 Apr 2021 08:02:33 +0000 (16:02 +0800)]
MLK-25333-1 arm64: dts: specify the clock rate and parent of pcie clocks

Specify the clock rate and parent of i.MX8MQ/MM PCIe clocks.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
4 years agoMLK-25283-4 PCI: imx: adjust the l1ss support to proper place
Richard Zhu [Tue, 9 Feb 2021 02:48:33 +0000 (10:48 +0800)]
MLK-25283-4 PCI: imx: adjust the l1ss support to proper place

Add one final quirk to adjust the l1ss support to proper place.
Only enable the L1sub support when both RC and EP supports the L1sub.
In this case, remove the over-ride of the CLKREQ# signal, let HW to
control it automatically.
Since "dis_gpio" GPIO pin is used as M.2 Key-E interface PIN56 for
power control of EP device, adjust active sequence just after the
turn-on of the power domains.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
4 years agoMLK-25283-3 arm64: dts: imx8mp: set clkreq input and add view port property
Richard Zhu [Tue, 9 Feb 2021 02:37:14 +0000 (10:37 +0800)]
MLK-25283-3 arm64: dts: imx8mp: set clkreq input and add view port property

Set the PCIe CLKREQ# as input and add the num-viewport property for
i.MX8MP PCIe RC port.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
4 years agoMLK-25283-2 arm64: dts: imx8mq: fix the l1ss failure
Richard Zhu [Tue, 20 Oct 2020 08:42:33 +0000 (16:42 +0800)]
MLK-25283-2 arm64: dts: imx8mq: fix the l1ss failure

fix the clkreq# is always low issue when L1.1 ASPM is enabled.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
4 years agoMLK-25283-1 dt-binding: imx6q-pcie: add the l1sub for imx8m pcie
Richard Zhu [Tue, 9 Feb 2021 02:34:49 +0000 (10:34 +0800)]
MLK-25283-1 dt-binding: imx6q-pcie: add the l1sub for imx8m pcie

Add one clkreq reset to support the L1sub for i.MX8M PCIe.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
4 years agoMLK-25282-2 clk: imx8mp: remove the pcie phy clock
Richard Zhu [Sun, 7 Feb 2021 03:09:07 +0000 (11:09 +0800)]
MLK-25282-2 clk: imx8mp: remove the pcie phy clock

In the i.MX8MP PCIe design, the PCIe PHY REF clock comes from external
OSC or internal system PLL. It is configured in the IOMUX_GPR14 register
directly, and can't be contolled by CCM at all.
Remove it from clock driver to clean up codes.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
4 years agoMLK-25282-1 arm64: dts: imx8mp: correct the pcie phy clock
Richard Zhu [Sun, 7 Feb 2021 03:07:19 +0000 (11:07 +0800)]
MLK-25282-1 arm64: dts: imx8mp: correct the pcie phy clock

In the i.MX8MP PCIe design, the PCIe PHY REF clock comes from external
OSC or internal system PLL. It is configured in the IOMUX_GPR14 register
directly, and can't be contolled by CCM at all.
So, correct it in the DTS node.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
4 years agoMLK-25302: clk: imx8qxp: whitelist M4 lpuart
Shenwei Wang [Tue, 23 Mar 2021 19:51:40 +0000 (14:51 -0500)]
MLK-25302: clk: imx8qxp: whitelist M4 lpuart

Add m4 lpuart0 to the array of imx8qxp_clk_scu_rsrc_table.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
4 years agoLF-3434: arm64: dts: imx8m: add pmu node
Alice Guo [Mon, 22 Feb 2021 10:07:58 +0000 (18:07 +0800)]
LF-3434: arm64: dts: imx8m: add pmu node

Adding pmu node supports to use perf tool to monitor the CPU performance
of the inmate cell when enabling Jailhouse and running dual Linux OS.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
4 years agousb: cdns3: fix static checker warning.
Frank Li [Wed, 10 Mar 2021 16:01:25 +0000 (10:01 -0600)]
usb: cdns3: fix static checker warning.

The patch c450e48eb570: "usb: cdns3: add power lost support for
system resume" from Feb 18, 2021, leads to the following static
checker warning:

        drivers/usb/cdns3/core.c:551 cdns_resume()
        error: uninitialized symbol 'ret'.

drivers/usb/cdns3/core.c
544
545     if (!role_changed) {
546            if (cdns->role == USB_ROLE_HOST)
547                  ret = cdns_drd_host_on(cdns);
548     else if (cdns->role == USB_ROLE_DEVICE)
549            ret = cdns_drd_gadget_on(cdns);

"ret" is uninitialized at else branch.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@kernel.org>