Commit graph

1,089,026 commits

Author SHA1 Message Date
Daniel Henrique Barboza
749ed4a206 powerpc/mm/numa: skip NUMA_NO_NODE onlining in parse_numa_properties()
Executing node_set_online() when nid = NUMA_NO_NODE results in an
undefined behavior. node_set_online() will call node_set_state(), into
__node_set(), into set_bit(), and since NUMA_NO_NODE is -1 we'll end up
doing a negative shift operation inside
arch/powerpc/include/asm/bitops.h. This potential UB was detected
running a kernel with CONFIG_UBSAN.

The behavior was introduced by commit 10f78fd0da ("powerpc/numa: Fix a
regression on memoryless node 0"), where the check for nid > 0 was
removed to fix a problem that was happening with nid = 0, but the result
is that now we're trying to online NUMA_NO_NODE nids as well.

Checking for nid >= 0 will allow node 0 to be onlined while avoiding
this UB with NUMA_NO_NODE.

Fixes: 10f78fd0da ("powerpc/numa: Fix a regression on memoryless node 0")
Reported-by: Ping Fang <pifang@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220224182312.1012527-1-danielhb413@gmail.com
2022-03-01 23:41:01 +11:00
Christophe Leroy
973e2e6462 powerpc/interrupt: Remove struct interrupt_state
Since commit ceff77efa4 ("powerpc/64e/interrupt: Use new interrupt
context tracking scheme") struct interrupt_state has been empty and
unused.

Remove it.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1d862ce3eab3da6ca7ac47d4a78a18f154462511.1645806970.git.christophe.leroy@csgroup.eu
2022-03-01 23:41:00 +11:00
Hari Bathini
607451ce0a powerpc/fadump: register for fadump as early as possible
Crash recovery (fadump) is setup in the userspace by some service. This
service rebuilds initrd with dump capture capability, if it is not
already dump capture capable before proceeding to register for firmware
assisted dump (echo 1 > /sys/kernel/fadump/registered). But arming the
kernel with crash recovery support does not have to wait for userspace
configuration. So, register for fadump while setting it up itself. This
can at worst lead to a scenario, where /proc/vmcore is ready afer crash
but the initrd does not know how/where to offload it, which is always
better than not having a /proc/vmcore at all due to incomplete
configuration in the userspace at the time of crash.

Commit 0823c68b05 ("powerpc/fadump: re-register firmware-assisted dump
if already registered") ensures this change does not break userspace.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
[mpe: Reword comment]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220201105305.155511-1-hbathini@linux.ibm.com
2022-03-01 23:41:00 +11:00
Kajol Jain
29cf373c57 selftests/powerpc/pmu: Add interface test for mmcra register fields
The testcase uses event code 0x35340401e0 to verify the settings for
different fields in Monitor Mode Control Register A (MMCRA). The fields
include thresh_start, thresh_stop thresh_select, sdar mode, sample and
marked bit. Checks if these fields are translated correctly via perf
interface to MMCRA.

Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-21-kjain@linux.ibm.com
2022-03-01 23:40:58 +11:00
Xu Kuohai
4226961b00 libbpf: Skip forward declaration when counting duplicated type names
Currently if a declaration appears in the BTF before the definition, the
definition is dumped as a conflicting name, e.g.:

    $ bpftool btf dump file vmlinux format raw | grep "'unix_sock'"
    [81287] FWD 'unix_sock' fwd_kind=struct
    [89336] STRUCT 'unix_sock' size=1024 vlen=14

    $ bpftool btf dump file vmlinux format c | grep "struct unix_sock"
    struct unix_sock;
    struct unix_sock___2 {	<--- conflict, the "___2" is unexpected
		    struct unix_sock___2 *unix_sk;

This causes a compilation error if the dump output is used as a header file.

Fix it by skipping declaration when counting duplicated type names.

Fixes: 351131b51c ("libbpf: add btf_dump API for BTF-to-C conversion")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20220301053250.1464204-2-xukuohai@huawei.com
2022-03-01 13:40:57 +01:00
Kajol Jain
02f02feb6b selftests/powerpc/pmu/: Add interface test for mmcr3_src fields
The testcase uses event code 0x1340000001c040 to verify the settings for
different src fields in Monitor Mode Control Register 3 (MMCR3). Checks
if these fields are translated correctly via perf interface to MMCR3 on
ISA v3.1 platform.

Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-20-kjain@linux.ibm.com
2022-03-01 23:40:47 +11:00
Madhavan Srinivasan
9ee241f1b1 selftests/powerpc/pmu/: Add interface test for mmcr2_fcs_fch fields
The testcases uses cycles event to verify the freeze counter settings in
Monitor Mode Control Register 2 (MMCR2). Event modifier (exclude_kernel)
setting is used for the event attribute to check the FCxS and FCxH (
Freeze counter in privileged and hypervisor state ) settings via perf
interface.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
[mpe: Add error checking, check MSR for MSR_HV, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-19-kjain@linux.ibm.com
2022-03-01 23:40:36 +11:00
Madhavan Srinivasan
ac575b2606 selftests/powerpc/pmu/: Add interface test for mmcr2_l2l3 field
The testcases uses event code 0x010000046080 to verify the l2l3 bit
setting for Monitor Mode Control Register 2 (MMCR2). check if this bit
is set correctly via perf interface in ISA v3.1 platform.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-18-kjain@linux.ibm.com
2022-03-01 23:40:26 +11:00
Athira Rajeev
2becea3b6a selftests/powerpc/pmu/: Add interface test for mmcr1_comb field
The testcase uses event code "0x26880" to verify the settings for
different fields in Monitor Mode Control Register 1 (MMCR1). The field
include PMCxCOMB. Checks if this field are translated correctly via perf
interface to MMCR1

Add selftest for mmcr1 comb field.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-16-kjain@linux.ibm.com
2022-03-01 23:40:16 +11:00
Athira Rajeev
6e11374b08 selftests/powerpc/pmu/: Add interface test for mmcr0_pmc56 using pmc5
The testcase uses event code 0x500fa to verify the FC5-6 bit setting in
Monitor Mode Control Register 0 (MMCR0). Check if FC5-6 bit is not set
in MMCR0 when using Performance Monitor Counter 5 and 6 (PMC5 and PMC6).

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-15-kjain@linux.ibm.com
2022-03-01 23:40:06 +11:00
Athira Rajeev
d5172f2585 selftests/powerpc/pmu/: Add interface test for mmcr0_fc56 field using pmc1
The testcase uses event code 0x1001e to verify two bit settings (FC5-6
and PMC1CE) in Monitor Mode Control Register 0 (MMCR0). Check if FC5-6
bit to be set in MMCR0 when not using Performance Monitor Counter 5 and
6 (PMC5 and PMC6). And also PMC1CE is expected to be set when using
PMC1. Test if these fields are programmed correctly via perf interface.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-14-kjain@linux.ibm.com
2022-03-01 23:39:54 +11:00
Athira Rajeev
9ac7c6d5e4 selftests/powerpc/pmu/: Add interface test for mmcr0_pmcjce field
The testcase uses event code 0x500fa ("instructions") to verify the
PMCjCE bit setting in Monitor Mode Control Register 0 (MMCR0). This bit
is expected to be set in MMCR0 when using Performance Monitor Counter
5 (PMC5). Checks if perf interface sets this bit correctly.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-13-kjain@linux.ibm.com
2022-03-01 23:39:41 +11:00
Athira Rajeev
b24142b9d2 selftests/powerpc/pmu/: Add interface test for mmcr0_pmccext bit
The testcase uses cycles event to check the PMCCEXT bit setting in
Monitor Mode Control Register 0 (MMCR0). Check if perf interface sets
this control bit in MMCR0 on ISA v3.1 platform.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-12-kjain@linux.ibm.com
2022-03-01 23:39:27 +11:00
Athira Rajeev
a7c0ab2e61 selftests/powerpc/pmu/: Add interface test for mmcr0_cc56run field
The testcase uses event code 0x500fa ("instructions") to check the
CC56RUN bit setting in Monitor Mode Control Register 0(MMCR0). In ISA
v3.1 platform, this bit is expected to be set in MMCR0 when using
Performance Monitor Counter 5 and 6 (PMC5 and PMC6). Verify this is done
correctly by perf interface.

CC56RUN bit makes PMC5 and PMC6 count regardless of the run latch state.
This bit is set in power10 since PMC5 and PMC6 is used in power10 for
counting instructions and cycles. Hence added a check to skip this test
in other platforms

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-11-kjain@linux.ibm.com
2022-03-01 23:39:09 +11:00
Athira Rajeev
eb7aa044df selftests/powerpc/pmu/: Add interface test for mmcr0 exception bits
The testcase uses "instructions" event to verify two bits(PMAE and PMAO)
in Monitor Mode Control Register 0 (MMCR0). At the time of interrupt,
pmae bit ( which enables performance monitor exception ) is expected to
be cleared and pmao (which indicates performance monitor alert) bit is
expected to be set in MMCR0. And testcases handles these checks.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[mpe: Add error checking, drop GET_MMCR_FIELD, add to .gitignore]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-10-kjain@linux.ibm.com
2022-03-01 23:38:46 +11:00
Kajol Jain
13307f9584 selftests/powerpc/pmu: Add macro to extract mmcr3 and mmcra fields
Add macro and utility functions to fetch individual fields from Monitor
Mode Control Register 3(MMCR3)and Monitor Mode Control Register A(MMCRA)
PMU registers

Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-9-kjain@linux.ibm.com
2022-03-01 23:38:13 +11:00
Athira Rajeev
2b49e64106 selftests/powerpc/pmu: Add macro to extract mmcr0/mmcr1 fields
Add macro and utility functions to fetch individual fields from Monitor
Mode Control Register 0(MMCR0) and Monitor Mode Control Register
1(MMCR1) PMU register.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-8-kjain@linux.ibm.com
2022-03-01 23:38:13 +11:00
Madhavan Srinivasan
79c4e6aba8 selftests/powerpc/pmu: Add macros to extract mmcr fields
Along with it, Add macros and utility functions to fetch individual
fields from Monitor Mode Control Register 2(MMCR2) register.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-7-kjain@linux.ibm.com
2022-03-01 23:38:13 +11:00
Madhavan Srinivasan
54d4ba7f22 selftests/powerpc/pmu: Add event_init_sampling function
Extended event_init_opts() to include initialization of sampling
testcases. Patch adds an event_init_sampling() wrapper to initialize
event attribute fields for sampling events. This includes initializing
sample period, sample type and event type.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-6-kjain@linux.ibm.com
2022-03-01 23:38:13 +11:00
Kajol Jain
5f6c3061af selftests/powerpc/pmu: Add utility functions to post process the mmap buffer
Add couple of basic utility functions to post process the mmap buffer.
It includes function to read the total number of samples present in the
mmap buffer and function to get the address of the first sample.

Add function "get_intr_regs" which will return pointer to interrupt
registers present in the sample, incase sample type
PERF_SAMPLE_REGS_INTR is set.

Add functions "get_reg_value" which can be used to read any interrupt
register value from a given sample.

Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-5-kjain@linux.ibm.com
2022-03-01 23:38:13 +11:00
Madhavan Srinivasan
6523dce862 selftests/powerpc/pmu: Add macros to parse event codes
Each platform has raw event encoding format which specifies the bit
positions for different fields. The fields from event code gets
translated into performance monitoring mode control register (MMCRx)
settings. Patch add macros to extract individual fields from the event
code.

Add functions for sanity checks, since testcases currently are only
supported in power9 and power10.

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
[mpe: Read PVR directly rather than using /proc/cpuinfo]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-4-kjain@linux.ibm.com
2022-03-01 23:38:12 +11:00
Athira Rajeev
c315669e2f selftests/powerpc/pmu: Add support for perf sampling tests
Add support functions for enabling perf sampling test in a new folder
"sampling_tests" under "selftests/powerpc/pmu". This includes support
functions for allocating and processing the mmap buffer. These functions
are added/defined in "sampling_tests/misc.*" files.

Also updates the corresponding Makefiles in "selftests/powerpc" and
"sampling_tests" folder.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
[mpe: Drop unneeded bits from the Makefile]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220127072012.662451-3-kjain@linux.ibm.com
2022-03-01 23:37:49 +11:00
Daniel Palmer
ea49432d18
ARM: mstar: Select HAVE_ARM_ARCH_TIMER
The mstar SoCs have an arch timer but HAVE_ARM_ARCH_TIMER wasn't
selected. If MSC313E_TIMER isn't selected then the kernel gets
stuck at boot because there are no timers available.

Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Link: https://lore.kernel.org/r/20220301104349.3040422-1-daniel@0x0f.com'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-03-01 13:26:32 +01:00
Lina Wang
4ff2980b6b xfrm: fix tunnel model fragmentation behavior
in tunnel mode, if outer interface(ipv4) is less, it is easily to let
inner IPV6 mtu be less than 1280. If so, a Packet Too Big ICMPV6 message
is received. When send again, packets are fragmentized with 1280, they
are still rejected with ICMPV6(Packet Too Big) by xfrmi_xmit2().

According to RFC4213 Section3.2.2:
if (IPv4 path MTU - 20) is less than 1280
	if packet is larger than 1280 bytes
		Send ICMPv6 "packet too big" with MTU=1280
                Drop packet
        else
		Encapsulate but do not set the Don't Fragment
                flag in the IPv4 header.  The resulting IPv4
                packet might be fragmented by the IPv4 layer
                on the encapsulator or by some router along
                the IPv4 path.
	endif
else
	if packet is larger than (IPv4 path MTU - 20)
        	Send ICMPv6 "packet too big" with
                MTU = (IPv4 path MTU - 20).
                Drop packet.
        else
                Encapsulate and set the Don't Fragment flag
                in the IPv4 header.
        endif
endif
Packets should be fragmentized with ipv4 outer interface, so change it.

After it is fragemtized with ipv4, there will be double fragmenation.
No.48 & No.51 are ipv6 fragment packets, No.48 is double fragmentized,
then tunneled with IPv4(No.49& No.50), which obey spec. And received peer
cannot decrypt it rightly.

48              2002::10        2002::11 1296(length) IPv6 fragment (off=0 more=y ident=0xa20da5bc nxt=50)
49   0x0000 (0) 2002::10        2002::11 1304         IPv6 fragment (off=0 more=y ident=0x7448042c nxt=44)
50   0x0000 (0) 2002::10        2002::11 200          ESP (SPI=0x00035000)
51              2002::10        2002::11 180          Echo (ping) request
52   0x56dc     2002::10        2002::11 248          IPv6 fragment (off=1232 more=n ident=0xa20da5bc nxt=50)

xfrm6_noneed_fragment has fixed above issues. Finally, it acted like below:
1   0x6206 192.168.1.138   192.168.1.1 1316 Fragmented IP protocol (proto=Encap Security Payload 50, off=0, ID=6206) [Reassembled in #2]
2   0x6206 2002::10        2002::11    88   IPv6 fragment (off=0 more=y ident=0x1f440778 nxt=50)
3   0x0000 2002::10        2002::11    248  ICMPv6    Echo (ping) request

Signed-off-by: Lina Wang <lina.wang@mediatek.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2022-03-01 12:08:40 +01:00
Florian Westphal
3b836da408 netfilter: nf_queue: handle socket prefetch
In case someone combines bpf socket assign and nf_queue, then we will
queue an skb who references a struct sock that did not have its
reference count incremented.

As we leave rcu protection, there is no guarantee that skb->sk is still
valid.

For refcount-less skb->sk case, try to increment the reference count
and then override the destructor.

In case of failure we have two choices: orphan the skb and 'delete'
preselect or let nf_queue() drop the packet.

Do the latter, it should not happen during normal operation.

Fixes: cf7fbe660f ("bpf: Add socket assign support")
Acked-by: Joe Stringer <joe@cilium.io>
Signed-off-by: Florian Westphal <fw@strlen.de>
2022-03-01 11:51:15 +01:00
Florian Westphal
c387307024 netfilter: nf_queue: fix possible use-after-free
Eric Dumazet says:
  The sock_hold() side seems suspect, because there is no guarantee
  that sk_refcnt is not already 0.

On failure, we cannot queue the packet and need to indicate an
error.  The packet will be dropped by the caller.

v2: split skb prefetch hunk into separate change

Fixes: 271b72c7fa ("udp: RCU handling for Unicast packets.")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
2022-03-01 11:50:35 +01:00
Florian Westphal
2e78855d31 selftests: netfilter: add nfqueue TCP_NEW_SYN_RECV socket race test
causes:
BUG: KASAN: slab-out-of-bounds in sk_free+0x25/0x80
Write of size 4 at addr ffff888106df0284 by task nf-queue/1459
 sk_free+0x25/0x80
 nf_queue_entry_release_refs+0x143/0x1a0
 nf_reinject+0x233/0x770

... without 'netfilter: nf_queue: don't assume sk is full socket'.

Signed-off-by: Florian Westphal <fw@strlen.de>
2022-03-01 11:48:58 +01:00
Florian Westphal
747670fd9a netfilter: nf_queue: don't assume sk is full socket
There is no guarantee that state->sk refers to a full socket.

If refcount transitions to 0, sock_put calls sk_free which then ends up
with garbage fields.

I'd like to thank Oleksandr Natalenko and Jiri Benc for considerable
debug work and pointing out state->sk oddities.

Fixes: ca6fb06518 ("tcp: attach SYNACK messages to request sockets instead of listener")
Tested-by: Oleksandr Natalenko <oleksandr@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
2022-03-01 11:48:18 +01:00
Pali Rohár
c4deb8344a ARM: dts: turris-omnia: Set PCIe slot-power-limit-milliwatt properties
All 3 miniPCIe slots in Turris Omnia are designed for 10 W.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
2022-03-01 11:47:13 +01:00
Johannes Berg
94d9864cc8 mac80211: treat some SAE auth steps as final
When we get anti-clogging token required (added by the commit
mentioned below), or the other status codes added by the later
commit 4e56cde15f ("mac80211: Handle special status codes in
SAE commit") we currently just pretend (towards the internal
state machine of authentication) that we didn't receive anything.

This has the undesirable consequence of retransmitting the prior
frame, which is not expected, because the timer is still armed.

If we just disarm the timer at that point, it would result in
the undesirable side effect of being in this state indefinitely
if userspace crashes, or so.

So to fix this, reset the timer and set a new auth_data->waiting
in order to have no more retransmissions, but to have the data
destroyed when the timer actually fires, which will only happen
if userspace didn't continue (i.e. crashed or abandoned it.)

Fixes: a4055e74a2 ("mac80211: Don't destroy auth data in case of anti-clogging")
Reported-by: Jouni Malinen <j@w1.fi>
Link: https://lore.kernel.org/r/20220224103932.75964e1d7932.Ia487f91556f29daae734bf61f8181404642e1eec@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-03-01 11:33:13 +01:00
Arnd Bergmann
c687cdc66f - Enable Airoha SoC on armv7 config.
- Enable CPU freq for arm64 based SoCs.
 - Enable PMIC based (mt6397) RTC for mt8173
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEUdvKHhzqrUYPB/u8L21+TfbCqH4FAmId5MgXHG1hdHRoaWFz
 LmJnZ0BnbWFpbC5jb20ACgkQL21+TfbCqH4gSRAAtArvtvjefla4B46XYHo9Pt4x
 9jLApn1LjFaHm9yyAOkcmfFcGIMUnA2yUYlo0ClWz595MR9Nz3u8w4DyqmjQLZK0
 vgBrfhHsWSlqBhAES8vyzIOS+bWBIRg+tN8imb3cK6mMHcn84LLVmXwJhWFWg3CP
 7/3dywApFTTxHIcslDC2Y7XEz392dJKVA4NtAKCm2o/XFWKswV3L8gbYlEx+fVpg
 Ub2DNzVjtrNZiy6DxduQIK6fKV110wpN6Mr9FhkqD7fVeLzONYFHxhEW7GLAQxHB
 YRAjNpVjSvtImxA7KiV0Tbx7N4qyFH/rjZOjrZ1fxVyIUtFBTEWY1W3LT9XZtQkJ
 hDxN4kZLgaX6Ikawem0p8YQKCnj8YVv6R/95i2g1m1tbfp1/l9Xn6mlmcyJls33o
 UCXxekn/KcI31AHzWzhbOVJHoIbMHQvHudPVUcGwlw3zy0HfUB16RkNpJ4Fdd2VP
 sn4/c8mYs0JA0n1+HUMKNpUfNPKgGvRRnmlOvrlSN9o+Hy6Wi/IQQlMtI+PC38eo
 IqdzcRgMdl1T7ylVDGFudpuLPIO1u8KqBheApeBGE904pJpzMG8Rikas7dZenI5n
 j3nxygSs6gUEqr0Hfb5w8uvt+42IBFh/tlS4Dno/B++rJoug31PQVZB1KY870I1V
 rp7qcYbWjtq4jy2JvTg=
 =hCMQ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmId9U0ACgkQmmx57+YA
 GNkzkw//Zp49ncT0DaExqqQTqq2FwxWgT7Fv/+9+wFzKxdjaQVDhLcph8tEnaLnB
 j2jKZwHSrkI5T5yIX4+w5w5ZfJEKYiUjvh5bglIPCsFVTuU9E4nULWgrXwsYV+Yk
 UTCDaBTB4jgqmXUqD+XnjLskuDyMG321wWASsmV2PgR/6MdsI9A4h8Jbm4MJcUer
 u6eDPOAk/0pu3quDg9TLSsY8ptmEZPjSKmXiGu4b+q4AaBpRuFHLN4MrUVV8pJ1w
 DenyGlVLBUMRK954GHqyRDYX8SYnwSu4RUZUsexpuavaFAKuv1bFra/SfNkvoy7e
 t54bIbgVRsrsHlIhKUE7Ag+LDMzFqF1SMJkhZ1923Ai3DsUyt1UvAe5RmUtvKuJX
 YxkKREDlzbC8zCK5nZKjtjwXiRBlu0sqhuKw7zqA90eMiPZZiSK54goo5iuKTYCA
 APHnOgJvZrL9iJEmqsbNUtnWtJg4S2lLKRI7QTNj5HSdNW9f1IPQTe27X5xKt2m7
 f3oieiZD8OumVlWJCjNUgfHYhwUKu3jdkDuyNR1NguoSbwpLBGQ9BaVvzrpY1T8a
 A5OafZwX/HplYyij1M0sdxY0H9tk4qzu674orYywrcj7iIapWRpC6+y1D82SZVbg
 hnMU2kZ9ORtbeYv41HS6+Nv9uXpb3/Nf0QE3pnT4I6zaSHdjE7s=
 =AI73
 -----END PGP SIGNATURE-----

Merge tag 'v5.17-next-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/defconfig

- Enable Airoha SoC on armv7 config.
- Enable CPU freq for arm64 based SoCs.
- Enable PMIC based (mt6397) RTC for mt8173

* tag 'v5.17-next-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux:
  ARM: multi_v7_defconfig: Add support for Airoha EN7523 SoC
  arm64: defconfig: Enable cpufreq for MediaTek
  arm64: defconfig: Enable MT6397 RTC

Link: https://lore.kernel.org/r/9b90b407-025b-ec78-a626-faccdbc7ab39@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-03-01 11:28:29 +01:00
Arnd Bergmann
c199a67c42 Qualcomm defconfig updates for v5.18
The Qualcomm Snapdragon 8916 devices come in both 32- or 64-bit form,
 and even though the typical case so far has been to 64-bit, it's
 possible to run the Dragonboard 410c in either mode.
 
 Enable the relevant drivers in multi_v7_defconfig to enable this, and
 other Snapdragon 8916 devices to run the 32-bit kernel.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmIdnGgbHGJqb3JuLmFu
 ZGVyc3NvbkBsaW5hcm8ub3JnAAoJEAsfOT8Nma3FjScP/0PDtThnCBAIu5hr61rD
 uvhdzPCecHITFS4LdnLrw16IDMMK4t/wEMHegVtC94e8zXaGX+bCbcDGyLpUGHIo
 AQTS9ySltlPVTrHa1kfZ4jDlaKdV7g2tNqTZc9Po3+miEmYxy5E1ycceGWjdB4J/
 B7YnZbgWlCsfhbWpFLxgWrNthP2VqcA5wXVxFmG4EY1hnkj3f0vkn2NCEKIC9dy9
 itrsjLcWcQcr//0UByaWP3LfXDONJA5vAlYBkHUQAkz4PDklsY/lrYdba0MQ0Bno
 K3QWR06Y/Cw3eQJoxBPMIVOZr7CdSPX500DeqwrL7Bx1r7+6xKsRBdDEZaOb0DF6
 V+smGZGYPAfuH45b3yxt1KDGNoPjtD+Xx9JIDjcIOax4Mdlywp5aEjcmvouN3R0O
 lL3PR7y5K6iMZBN2ZDCrI2L0lKsQ82M35tz3eg/lOwchVCuvH066ZOu1f63J7IMG
 1qtMntS/jPw96gBp/lO48ouWg+iVQT9se9G2MQ5o9NnkdRB8yt3SrBqlQkEDCyZo
 vBw7/Xp2BAIoPmU3vi3L2OKK/Q3lzJRP6xUjMaYXs10h3m9dBESIX/24fWNleKTN
 wXbo11BtRn1DyIasq0EVtyXTM0D48lj1keSfnvCPceAKnirBqIswVU21WkOLHv93
 VZEJuO2JVeaXOR8oE3EExtfF
 =AfIE
 -----END PGP SIGNATURE-----

Merge tag 'qcom-defconfig-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/defconfig

Qualcomm defconfig updates for v5.18

The Qualcomm Snapdragon 8916 devices come in both 32- or 64-bit form,
and even though the typical case so far has been to 64-bit, it's
possible to run the Dragonboard 410c in either mode.

Enable the relevant drivers in multi_v7_defconfig to enable this, and
other Snapdragon 8916 devices to run the 32-bit kernel.

* tag 'qcom-defconfig-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  ARM: multi_v7_defconfig: Enable drivers for DragonBoard 410c

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-03-01 11:27:40 +01:00
Souptick Joarder (HPE)
e414c25e33 irqchip/nvic: Release nvic_base upon failure
smatch warning was reported as below ->

smatch warnings:
drivers/irqchip/irq-nvic.c:131 nvic_of_init()
warn: 'nvic_base' not released on lines: 97.

Release nvic_base upon failure.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220218163303.33344-1-jrdr.linux@gmail.com
2022-03-01 10:19:51 +00:00
Arnd Bergmann
d9bdba0782 ARM: PXA: fix up decompressor code
The earlier removal of two boards caused a build regression,
fix it by removing the extraneous '||'.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 28f74201e3 ("ARM: pxa: remove Intel Imote2 and Stargate 2 boards")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-03-01 11:16:57 +01:00
Arnd Bergmann
29cefaaf2b Qualcomm ARM64 DeviceTree updates for v5.18
New platforms: Snapdragon 625 and Snapdragon 632
 New boards: Google Herobrine R1, Fairphone FP3, SHIFT6mq, Samsung Galaxy
 Book2 and Snapdragon 8 Gen 1 Hardware Development Kit (HDK)
 
 On IPQ6018 the USB reference period is corrected, GICv2m support is
 enabled and the max-link-speed for PCIe is specified.
 
 IPQ8074 adds description of GIVv2m and SMEM, and ensures that TrustZone
 related memory is reserved from Linux.
 
 On the Snapdragon 7c Gen 3 (SC7280) description of display, displayport,
 L3 interconnect, bluetooth, CPU opp-tables are added. Another revision
 of the Google Herobrine is introduced and a bunch of cleanups are
 introduced.
 
 On Snapdragon 845 new support for the SHIFT6mq device is introduced, the
 OnePlus devices gains fuel gauge and the platform gains GSI DMA support,
 which is enabled for SPI (for now).
 
 On the Snapdragon 850 based WindowsOnSnapdragon laptops, initial support
 for Samsugn Galaxy Book2 is introduced and the Lenovo Yoga C630 gains
 description of its backlight controls.
 
 The Snapdragon 625 platform (MSM8953) the thereof derrived Snapdragon
 632 platform is introduced, with initial description of the Fairphone 3.
 
 Fairphone 4 on the SM7225 platform gains proper WLED configuration.
 
 On Snapdragon 855 (SM8150) description of the limits hardware (LMh) is
 introduced and the SPI and I2C devices are wired to the GSI DMA controller.
 
 On Snapdragon 865 (SM8250) the CPU and cluster idle states are
 introduced, the MSI interrupts for PCIe 1 and 2 are corrected and the
 CPUfreq driver gains knowledge about thermal pressure interrupts.
 
 On Snapdragon 8 Gen 1 (SM8450) LLCC, interconnect and remoteproc
 descriptions are added. The SM8450 Hardware Development Kit is
 introduced and the QRD has its remoteproc instances enabled.
 
 Cluster idle and RPMh parameters are corrected on SM8150, SM8350 and
 SM8540.
 
 The IPA device on SC7180, SC7280 and SM8350 gains knowledge of the AOSS
 QMP mailbox, allowing it to enable retention of IPA registers during
 power collapse.
 
 DeviceTree validation issues related to thermal zone naming, missing
 CPU, device and platform compatibles, APR, Google EC PWM, DB410c sound,
 QCS404 opp-tables and SM8250 PCIe nodes are corrected.
 
 A bunch of cleanups and style fixes for MSM8992, MSM8994, MSM8996 and
 MSM8916 are introduced as well.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmIdsU4bHGJqb3JuL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6TtP2dqiuyrXd/lua1TD3X5cubugw5JbsGwPk6SqoSOMkiSJbgIeH4oQan
 qqu+V/S9cCKijzV34IqtudMUUF3Z+BZDZQ0snU0iiuZ8B+W963lv+O6N7azeN/h9
 a0q/YuAr9+DMt8kVfI8cIpf4lRz9wS2jc7/0wbXn6UjjoxIRdcYz7jR5IVtNysNq
 syqh9e9Se6bJFwQ2vCvkOuZZ8JSjj/lWcTBNjMI5QEAm9gfQKUmK+cNkQWIenll/
 OA50XzSA5+AvSKvvG0TnLvfIAbkCsRwf3+XVXnIjvfYD4e2mZepbHBWhC6PTXyVO
 V79jLfxM4tj891t/w9qsaEuCF5GfXT4w+Mii+mHNQtm7tfLz3NDnwz68QuogjUmp
 9L6TpmbvmCwmOv1mHVk9kQPckG25CsaBg2CGIoFI3MTjMRPycIoiOpKSd+u4NejK
 kLlia0qBIJVCGllhDLgct51OUcG6Am6W9bl32L8KLNXHPNiTZYc=
 =EUCM
 -----END PGP SIGNATURE-----

Merge tag 'qcom-arm64-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt

Qualcomm ARM64 DeviceTree updates for v5.18

New platforms: Snapdragon 625 and Snapdragon 632
New boards: Google Herobrine R1, Fairphone FP3, SHIFT6mq, Samsung Galaxy
Book2 and Snapdragon 8 Gen 1 Hardware Development Kit (HDK)

On IPQ6018 the USB reference period is corrected, GICv2m support is
enabled and the max-link-speed for PCIe is specified.

IPQ8074 adds description of GIVv2m and SMEM, and ensures that TrustZone
related memory is reserved from Linux.

On the Snapdragon 7c Gen 3 (SC7280) description of display, displayport,
L3 interconnect, bluetooth, CPU opp-tables are added. Another revision
of the Google Herobrine is introduced and a bunch of cleanups are
introduced.

On Snapdragon 845 new support for the SHIFT6mq device is introduced, the
OnePlus devices gains fuel gauge and the platform gains GSI DMA support,
which is enabled for SPI (for now).

On the Snapdragon 850 based WindowsOnSnapdragon laptops, initial support
for Samsugn Galaxy Book2 is introduced and the Lenovo Yoga C630 gains
description of its backlight controls.

The Snapdragon 625 platform (MSM8953) the thereof derrived Snapdragon
632 platform is introduced, with initial description of the Fairphone 3.

Fairphone 4 on the SM7225 platform gains proper WLED configuration.

On Snapdragon 855 (SM8150) description of the limits hardware (LMh) is
introduced and the SPI and I2C devices are wired to the GSI DMA controller.

On Snapdragon 865 (SM8250) the CPU and cluster idle states are
introduced, the MSI interrupts for PCIe 1 and 2 are corrected and the
CPUfreq driver gains knowledge about thermal pressure interrupts.

On Snapdragon 8 Gen 1 (SM8450) LLCC, interconnect and remoteproc
descriptions are added. The SM8450 Hardware Development Kit is
introduced and the QRD has its remoteproc instances enabled.

Cluster idle and RPMh parameters are corrected on SM8150, SM8350 and
SM8540.

The IPA device on SC7180, SC7280 and SM8350 gains knowledge of the AOSS
QMP mailbox, allowing it to enable retention of IPA registers during
power collapse.

DeviceTree validation issues related to thermal zone naming, missing
CPU, device and platform compatibles, APR, Google EC PWM, DB410c sound,
QCS404 opp-tables and SM8250 PCIe nodes are corrected.

A bunch of cleanups and style fixes for MSM8992, MSM8994, MSM8996 and
MSM8916 are introduced as well.

* tag 'qcom-arm64-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (96 commits)
  arm64: dts: qcom: sdm632: Add device tree for Fairphone 3
  dt-bindings: arm: qcom: Document sdm632 and fairphone,fp3 board
  arm64: dts: qcom: Add SDM632 device tree
  arm64: dts: qcom: Add PM8953 PMIC
  arm64: dts: qcom: Add MSM8953 device tree
  dt-bindings: arm: cpus: Add Kryo 250 CPUs
  arm64: dts: qcom: msm8916-longcheer-l8150: Add light and proximity sensor
  arm64: dts: qcom: align Google CROS EC PWM node name with dtschema
  arm64: dts: qcom: Add support for Samsung Galaxy Book2
  arm64: dts: qcom: msm8996: convert xo_board to RPM_SMD_BB_CLK1
  arm64: dts: qcom: msm8996: add cxo and sleep-clk to gcc node
  arm64: dts: qcom: sdm845: add bi_tcxo to camcc
  arm64: dts: qcom: sdm845: enable dma for spi
  arm64: dts: qcom: sdm845: Add gsi dma node
  arm64: dts: qcom: sc7280: Add cpu OPP tables
  arm64: dts: qcom: sc7280: Add EPSS L3 interconnect provider
  arm64: dts: qcom: sm8450: Add LLCC/system-cache-controller node
  arm64: dts: qcom: ipq6018: drop the clock-frequency property
  arm64: dts: qcom: ipq8074: drop the clock-frequency property
  arm64: dts: qcom: sm8450: add interconnect nodes
  ...

Link: https://lore.kernel.org/r/20220301053929.1809684-1-bjorn.andersson@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-03-01 11:16:09 +01:00
Jiasheng Jiang
6ad27f522c nl80211: Handle nla_memdup failures in handle_nan_filter
As there's potential for failure of the nla_memdup(),
check the return value.

Fixes: a442b761b2 ("cfg80211: add add_nan_func / del_nan_func")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220301100020.3801187-1-jiasheng@iscas.ac.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-03-01 11:15:08 +01:00
Thierry Reding
cf5086d35d drm/tegra: Support YVYU, VYUY and YU24 formats
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-03-01 11:13:09 +01:00
Thierry Reding
a649b133c3 drm/tegra: Support semi-planar formats on Tegra114+
The NV12, NV21, NV16, NV61, NV24 and NV42 formats are supported by
Tegra114 and later display hardware. Add the necessary programming to
allow them to be used.

Note that this does not work for Tegra186 and later yet because those
generations have a different display architecture that doesn't support
the same formats.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-03-01 11:13:09 +01:00
Thierry Reding
28aa30b08d drm/tegra: Fix planar formats on Tegra186 and later
Use the correct pitch when programming the DC_WIN_PLANAR_STORAGE_UV
register's PITCH_U field to ensure the correct value is used in all
cases. This isn't currently causing any problems because the pitch
for both U and V planes is always the same.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-03-01 11:13:09 +01:00
Christophe JAILLET
025c6643a8 gpu: host1x: Fix a memory leak in 'host1x_remove()'
Add a missing 'host1x_channel_list_free()' call in the remove function,
as already done in the error handling path of the probe function.

Fixes: 8474b02531 ("gpu: host1x: Refactor channel allocation code")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-03-01 11:13:09 +01:00
Christophe JAILLET
e5d5db1a79 gpu: host1x: Fix an error handling path in 'host1x_probe()'
Add the missing 'host1x_bo_cache_destroy()' call in the error handling
path of the probe, as already done in the remove function.

In order to simplify the error handling, move the 'host1x_bo_cache_init()'
call after all the devm_ function.

Fixes: 1f39b1dfa5 ("drm/tegra: Implement buffer object cache")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2022-03-01 11:13:03 +01:00
Arnd Bergmann
40c13296f8 Qualcomm dts updates for v5.18
The MSM8226 platform gains description of USB, SoC power-domains,
 PMIC multi-purpose pins, SPMI regulators, the smbb battery charger and
 the LG G Watch R, on this platform, gains description of Bluetooth,
 WiFI, fuel gauge, SMBB battery charger and USB.
 
 DeviceTree validation issues in APQ8060, APQ8064, MDM9615, MSM8960,
 IPQ4019 and SDX55 are corrected.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmIdoMUbHGJqb3JuLmFu
 ZGVyc3NvbkBsaW5hcm8ub3JnAAoJEAsfOT8Nma3FT5cQAI8d+/PN6gNrzzb/YmrR
 QSnHTuUEYtFwof1tGReza076BPlOoDtvTWgC0ppq1OgenprWm2FM9AA5kOQinP2V
 j9FW741iOFe1D1cZa4DPLY76bTyUn2qDDTdBcU0G4Y8NlKke0eAaBS7ayPYvyKqQ
 lXhMr7zlm6RW4831Aq6mhZFYqBg+yVp6W6VrN/0ZhOSaVHXyVmJ9SO+Msn7mrRiS
 ji+yv67RwpEpRwkqcisx0jdaolkptFGnnU+XIq4mNGw5f87i5kC+8QTnB2v62g+2
 QBj9Q9ylcMFvcf++7PdSr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mh4Y9v7T7a0SGzg7HgM6hkGUl0rvy4uYVQDul+1MokawPY8NxoWtg2Mx
 0hOd4ZEDuwooLA3kO5UcvfsietaH/L/nCrqqFuBQqOu5BilyXHLinSzlisGwUwNa
 sZowUOVa/hJN8NTrad9KTWT3FYOfqbvC/KVDWVbV4OcXSryQEfo=
 =gkXg
 -----END PGP SIGNATURE-----

Merge tag 'qcom-dts-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt

Qualcomm dts updates for v5.18

The MSM8226 platform gains description of USB, SoC power-domains,
PMIC multi-purpose pins, SPMI regulators, the smbb battery charger and
the LG G Watch R, on this platform, gains description of Bluetooth,
WiFI, fuel gauge, SMBB battery charger and USB.

DeviceTree validation issues in APQ8060, APQ8064, MDM9615, MSM8960,
IPQ4019 and SDX55 are corrected.

* tag 'qcom-dts-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (27 commits)
  ARM: dts: qcom: msm8226: add power domains
  ARM: dts: qcom: apq8026-lg-lenok: Add Bluetooth
  ARM: dts: qcom: apq8026-lg-lenok: Add Wifi
  ARM: dts: qcom: msm8226: Add pinctrl for sdhci nodes
  ARM: dts: qcom: sdx55: Fix the address used for PCIe EP local addr space
  ARM: dts: qcom: apq8060-dragonboard: fix typo in eMMC
  ARM: dts: qcom: pm8226: Add node for the MPP
  ARM: dts: qcom: fill missing power-domain-cells for gcc controllers
  ARM: dts: qcom: msm8960: move vsdcc regulator out of simple-bus
  ARM: dts: qcom: add KPSS GCC compatible to clock nodes
  ARM: dts: qcom: fix gic_irq_domain_translate warnings for msm8960
  ARM: dts: qcom: rename eth node to ethernet
  ARM: dts: qcom: apq8060: correct mvs switch name
  ARM: dts: qcom: nexus7: remove vcss supply which never existed
  ARM: dts: qcom: apq8064: adjust dsi node name to match dt-schema
  ARM: dts: qcom: apq8064: make pci regs property dt-schema compliant
  ARM: dts: qcom: apq8064: correct ranges values
  ARM: dts: qcom: ipq4019: fix sleep clock
  ARM: dts: qcom: pm8226: Support SPMI regulators on PMIC sid 1
  ARM: dts: qcom: pm8226: Add vibration motor node
  ...

Link: https://lore.kernel.org/r/20220301042828.1805481-1-bjorn.andersson@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-03-01 11:11:08 +01:00
Randy Dunlap
5a6248c0a2 iwlwifi: mvm: check debugfs_dir ptr before use
When "debugfs=off" is used on the kernel command line, iwiwifi's
mvm module uses an invalid/unchecked debugfs_dir pointer and causes
a BUG:

 BUG: kernel NULL pointer dereference, address: 000000000000004f
 #PF: supervisor read access in kernel mode
 #PF: error_code(0x0000) - not-present page
 PGD 0 P4D 0
 Oops: 0000 [#1] PREEMPT SMP
 CPU: 1 PID: 503 Comm: modprobe Tainted: G        W         5.17.0-rc5 #7
 Hardware name: Dell Inc. Inspiron 15 5510/076F7Y, BIOS 2.4.1 11/05/2021
 RIP: 0010:iwl_mvm_dbgfs_register+0x692/0x700 [iwlmvm]
 Code: 69 a0 be 80 01 00 00 48 c7 c7 50 73 6a a0 e8 95 cf ee e0 48 8b 83 b0 1e 00 00 48 c7 c2 54 73 6a a0 be 64 00 00 00 48 8d 7d 8c <48> 8b 48 50 e8 15 22 07 e1 48 8b 43 28 48 8d 55 8c 48 c7 c7 5f 73
 RSP: 0018:ffffc90000a0ba68 EFLAGS: 00010246
 RAX: ffffffffffffffff RBX: ffff88817d6e3328 RCX: ffff88817d6e3328
 RDX: ffffffffa06a7354 RSI: 0000000000000064 RDI: ffffc90000a0ba6c
 RBP: ffffc90000a0bae0 R08: ffffffff824e4880 R09: ffffffffa069d620
 R10: ffffc90000a0ba00 R11: ffffffffffffffff R12: 0000000000000000
 R13: ffffc90000a0bb28 R14: ffff88817d6e3328 R15: ffff88817d6e3320
 FS:  00007f64dd92d740(0000) GS:ffff88847f640000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 000000000000004f CR3: 000000016fc79001 CR4: 0000000000770ee0
 PKRU: 55555554
 Call Trace:
  <TASK>
  ? iwl_mvm_mac_setup_register+0xbdc/0xda0 [iwlmvm]
  iwl_mvm_start_post_nvm+0x71/0x100 [iwlmvm]
  iwl_op_mode_mvm_start+0xab8/0xb30 [iwlmvm]
  _iwl_op_mode_start+0x6f/0xd0 [iwlwifi]
  iwl_opmode_register+0x6a/0xe0 [iwlwifi]
  ? 0xffffffffa0231000
  iwl_mvm_init+0x35/0x1000 [iwlmvm]
  ? 0xffffffffa0231000
  do_one_initcall+0x5a/0x1b0
  ? kmem_cache_alloc+0x1e5/0x2f0
  ? do_init_module+0x1e/0x220
  do_init_module+0x48/0x220
  load_module+0x2602/0x2bc0
  ? __kernel_read+0x145/0x2e0
  ? kernel_read_file+0x229/0x290
  __do_sys_finit_module+0xc5/0x130
  ? __do_sys_finit_module+0xc5/0x130
  __x64_sys_finit_module+0x13/0x20
  do_syscall_64+0x38/0x90
  entry_SYSCALL_64_after_hwframe+0x44/0xae
 RIP: 0033:0x7f64dda564dd
 Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 1b 29 0f 00 f7 d8 64 89 01 48
 RSP: 002b:00007ffdba393f88 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f64dda564dd
 RDX: 0000000000000000 RSI: 00005575399e2ab2 RDI: 0000000000000001
 RBP: 000055753a91c5e0 R08: 0000000000000000 R09: 0000000000000002
 R10: 0000000000000001 R11: 0000000000000246 R12: 00005575399e2ab2
 R13: 000055753a91ceb0 R14: 0000000000000000 R15: 000055753a923018
  </TASK>
 Modules linked in: btintel(+) btmtk bluetooth vfat snd_hda_codec_hdmi fat snd_hda_codec_realtek snd_hda_codec_generic iwlmvm(+) snd_sof_pci_intel_tgl mac80211 snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence soundwire_bus snd_sof_intel_hda snd_sof_pci snd_sof snd_sof_xtensa_dsp snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core btrfs snd_compress snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec raid6_pq iwlwifi snd_hda_core snd_pcm snd_timer snd soundcore cfg80211 intel_ish_ipc(+) thunderbolt rfkill intel_ishtp ucsi_acpi wmi i2c_hid_acpi i2c_hid evdev
 CR2: 000000000000004f
 ---[ end trace 0000000000000000 ]---

Check the debugfs_dir pointer for an error before using it.

Fixes: 8c082a99ed ("iwlwifi: mvm: simplify iwl_mvm_dbgfs_register")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Luca Coelho <luciano.coelho@intel.com>
Cc: linux-wireless@vger.kernel.org
Cc: Kalle Valo <kvalo@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20220223030630.23241-1-rdunlap@infradead.org
[change to make both conditional]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-03-01 11:10:00 +01:00
Arnd Bergmann
16e769e2ae - add power domains support for mt8195
- disable ACP on mt8192
 
 mt8186:
 - add support for power domains
 - add mmsys and mutex support needed for DRM
 - add reset control based on mmsys subsystem
 - add pmic wrapper
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEUdvKHhzqrUYPB/u8L21+TfbCqH4FAmId5EgXHG1hdHRoaWFz
 LmJnZ0BnbWFpbC5jb20ACgkQL21+TfbCqH4gEg/+LL7XjcWZlD8GwTfJEeZjgk3c
 06rne1kKh0mm9+VEIHOp0RsMf4IdbHwCbAt3xMMcdOqAxh4oaKchCE0fPS2d+mdA
 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G+8uBVbitHpZVCfmRvel6fAbnfgAxyf7sYy/
 Kdbp1apVnQ7nDeW/rhR7glNrJSUN+R2uBbfmXPyU+MOoPG+1Ckz6YR4VrjKx0M/N
 K7qkqwJxp7TkuFJXzqWi58apyHqBdM9LzsyroRjk8FqeDC60T6RQDhJXuXDpDp58
 na4WDaS5expzgWpGiJwrm2MfT0rbI9X7pyGRcCPY6kVwtnLX84npVal6ZbS8jCwp
 KRO13i/ZzZj9ZNlOhANgYodedW4dO/tyW39xMIzYrQ+5QjQ8IvD+DFnv50F1DzON
 5IbTBTDS1B07dIikIb9FFLrGZL/bqEtafg9kGsYfypmXfVPf3FY=
 =G//M
 -----END PGP SIGNATURE-----

Merge tag 'v5.17-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/drivers

- add power domains support for mt8195
- disable ACP on mt8192

mt8186:
- add support for power domains
- add mmsys and mutex support needed for DRM
- add reset control based on mmsys subsystem
- add pmic wrapper

* tag 'v5.17-next-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux:
  dt-bindings: arm: mediatek: mmsys: add support for MT8186
  dt-bindings: mediatek: add compatible for MT8186 pwrap
  soc: mediatek: pwrap: add pwrap driver for MT8186 SoC
  soc: mediatek: mmsys: add mmsys reset control for MT8186
  soc: mediatek: mtk-infracfg: Disable ACP on MT8192
  soc: mediatek: add MTK mutex support for MT8186
  soc: mediatek: mmsys: add mt8186 mmsys routing table
  soc: mediatek: pm-domains: Add support for mt8186
  dt-bindings: power: Add MT8186 power domains
  soc: mediatek: pm-domains: Add support for mt8195
  soc: mediatek: pm-domains: Move power status offset to power domain data
  soc: mediatek: pm-domains: Remove unused macro
  soc: mediatek: pm-domains: Add wakeup capacity support in power domain
  dt-bindings: power: Add MT8195 power domains

Link: https://lore.kernel.org/r/16a53482-5a8c-e95e-8cd4-b8304f110987@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2022-03-01 11:09:42 +01:00
Marc Zyngier
d2febf6bbe irqchip/qcom-pdc: Drop open coded version of __assign_bit()
The driver uses what looks like an open-coded version of __assign_bit().
Replace it with the real thing.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Maulik Shah <quic_mkshah@quicinc.com>
Link: https://lore.kernel.org/r/20220224101226.88373-6-maz@kernel.org
2022-03-01 10:06:25 +00:00
Marc Zyngier
a6aca2f460 irqchip/qcom-pdc: Fix broken locking
pdc_enable_intr() serves as a primitive to qcom_pdc_gic_{en,dis}able,
and has a raw spinlock for mutual exclusion, which is uses with
interruptible primitives.

This means that this critical section can itself be interrupted.
Should the interrupt also be a PDC interrupt, and the endpoint driver
perform an irq_disable() on that interrupt, we end-up in a deadlock.

Fix this by using the irqsave/irqrestore variants of the locking
primitives.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Maulik Shah <quic_mkshah@quicinc.com>
Link: https://lore.kernel.org/r/20220224101226.88373-5-maz@kernel.org
2022-03-01 10:06:25 +00:00
Marc Zyngier
d494d088ac irqchip/qcom-pdc: Kill qcom_pdc_translate helper
qcom_pdc_translate() really is nothing but an open coded version
of irq_domain_translate_twocell(). Get rid of it and use the common
version instead.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Maulik Shah <quic_mkshah@quicinc.com>
Link: https://lore.kernel.org/r/20220224101226.88373-4-maz@kernel.org
2022-03-01 10:06:24 +00:00
Marc Zyngier
4dc70713dc irqchip/qcom-pdc: Kill non-wakeup irqdomain
A careful look at the way the PDC driver works shows that:

- all interrupts are in the same space
- all interrupts are treated the same

And yet the driver creates two domains based on whether
the interrupt gets mapped directly or from the pinctrl code,
which is obviously a waste of resources.

Kill the non-wakeup domain and unify all the interrupt handling.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220224101226.88373-3-maz@kernel.org
2022-03-01 10:06:24 +00:00
Marc Zyngier
8d4c998919 irqchip/qcom-pdc: Kill PDC_NO_PARENT_IRQ
PDC_NO_PARENT_IRQ is pretty pointless, as all it indicates is
that the PDC terminates the interrupt hierarchy. Which is
exactly the same as not having a mapping in the GIC space.
This is also bad practice to treat the absence of a hwirq
as a hwirq itself.

Just explicitly use the region mapping pointer, and drop
the definition.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Maulik Shah <quic_mkshah@quicinc.com>
Link: https://lore.kernel.org/r/20220224101226.88373-2-maz@kernel.org
2022-03-01 10:06:24 +00:00
Golan Ben Ami
1db5fcbba2 iwlwifi: don't advertise TWT support
Some APs misbehave when TWT is used and cause our firmware to crash.
We don't know a reasonable way to detect and work around this problem
in the FW yet.  To prevent these crashes, disable TWT in the driver by
stopping to advertise TWT support.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=215523
Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
[reworded the commit message]
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20220301072926.153969-1-luca@coelho.fi
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-03-01 11:00:43 +01:00