--- /dev/null
+From 3692fec8bb476e8583e559ff5783a6adef306cf2 Mon Sep 17 00:00:00 2001
+From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
+Date: Sat, 26 Nov 2022 11:55:49 +0900
+Subject: block: mq-deadline: Rename deadline_is_seq_writes()
+
+From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
+
+commit 3692fec8bb476e8583e559ff5783a6adef306cf2 upstream.
+
+Rename deadline_is_seq_writes() to deadline_is_seq_write() (remove the
+"s" plural) to more correctly reflect the fact that this function tests
+a single request, not multiple requests.
+
+Fixes: 015d02f48537 ("block: mq-deadline: Do not break sequential write streams to zoned HDDs")
+Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
+Link: https://lore.kernel.org/r/20221126025550.967914-2-damien.lemoal@opensource.wdc.com
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ block/mq-deadline.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/block/mq-deadline.c
++++ b/block/mq-deadline.c
+@@ -294,7 +294,7 @@ static inline int deadline_check_fifo(st
+ /*
+ * Check if rq has a sequential request preceding it.
+ */
+-static bool deadline_is_seq_writes(struct deadline_data *dd, struct request *rq)
++static bool deadline_is_seq_write(struct deadline_data *dd, struct request *rq)
+ {
+ struct request *prev = deadline_earlier_request(rq);
+
+@@ -353,7 +353,7 @@ deadline_fifo_request(struct deadline_da
+ list_for_each_entry(rq, &per_prio->fifo_list[DD_WRITE], queuelist) {
+ if (blk_req_can_dispatch_to_zone(rq) &&
+ (blk_queue_nonrot(rq->q) ||
+- !deadline_is_seq_writes(dd, rq)))
++ !deadline_is_seq_write(dd, rq)))
+ goto out;
+ }
+ rq = NULL;
--- /dev/null
+From 90e7cb78b81543998217b0eb446c067ce2191a79 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Thu, 5 Jan 2023 19:42:20 +0800
+Subject: net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit 90e7cb78b81543998217b0eb446c067ce2191a79 upstream.
+
+Add missing mutex_unlock() before returning from
+mlx5_fw_fatal_reporter_err_work().
+
+Fixes: 9078e843efec ("net/mlx5: Avoid recovery in probe flows")
+Reported-by: kernel test robot <lkp@intel.com>
+Reported-by: Dan Carpenter <error27@gmail.com>
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Signed-off-by: Shay Drory <shayd@nvidia.com>
+Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/health.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
+@@ -677,6 +677,7 @@ static void mlx5_fw_fatal_reporter_err_w
+ mutex_lock(&dev->intf_state_mutex);
+ if (test_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags)) {
+ mlx5_core_err(dev, "health works are not permitted at this stage\n");
++ mutex_unlock(&dev->intf_state_mutex);
+ return;
+ }
+ mutex_unlock(&dev->intf_state_mutex);
--- /dev/null
+From 8ccc99362b60c6f27bb46f36fdaaccf4ef0303de Mon Sep 17 00:00:00 2001
+From: Paolo Abeni <pabeni@redhat.com>
+Date: Wed, 18 Jan 2023 13:24:12 +0100
+Subject: net/ulp: use consistent error code when blocking ULP
+
+From: Paolo Abeni <pabeni@redhat.com>
+
+commit 8ccc99362b60c6f27bb46f36fdaaccf4ef0303de upstream.
+
+The referenced commit changed the error code returned by the kernel
+when preventing a non-established socket from attaching the ktls
+ULP. Before to such a commit, the user-space got ENOTCONN instead
+of EINVAL.
+
+The existing self-tests depend on such error code, and the change
+caused a failure:
+
+ RUN global.non_established ...
+ tls.c:1673:non_established:Expected errno (22) == ENOTCONN (107)
+ non_established: Test failed at step #3
+ FAIL global.non_established
+
+In the unlikely event existing applications do the same, address
+the issue by restoring the prior error code in the above scenario.
+
+Note that the only other ULP performing similar checks at init
+time - smc_ulp_ops - also fails with ENOTCONN when trying to attach
+the ULP to a non-established socket.
+
+Reported-by: Sabrina Dubroca <sd@queasysnail.net>
+Fixes: 2c02d41d71f9 ("net/ulp: prevent ULP without clone op from entering the LISTEN status")
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
+Link: https://lore.kernel.org/r/7bb199e7a93317fb6f8bf8b9b2dc71c18f337cde.1674042685.git.pabeni@redhat.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/tcp_ulp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/ipv4/tcp_ulp.c
++++ b/net/ipv4/tcp_ulp.c
+@@ -139,7 +139,7 @@ static int __tcp_set_ulp(struct sock *sk
+ if (sk->sk_socket)
+ clear_bit(SOCK_SUPPORT_ZC, &sk->sk_socket->flags);
+
+- err = -EINVAL;
++ err = -ENOTCONN;
+ if (!ulp_ops->clone && sk->sk_state == TCP_LISTEN)
+ goto out_err;
+
--- /dev/null
+From 87b93b678e95c7d93fe6a55b0e0fbda26d8c7760 Mon Sep 17 00:00:00 2001
+From: Geetha sowjanya <gakula@marvell.com>
+Date: Fri, 13 Jan 2023 11:49:02 +0530
+Subject: octeontx2-pf: Avoid use of GFP_KERNEL in atomic context
+
+From: Geetha sowjanya <gakula@marvell.com>
+
+commit 87b93b678e95c7d93fe6a55b0e0fbda26d8c7760 upstream.
+
+Using GFP_KERNEL in preemption disable context, causing below warning
+when CONFIG_DEBUG_ATOMIC_SLEEP is enabled.
+
+[ 32.542271] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274
+[ 32.550883] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0
+[ 32.558707] preempt_count: 1, expected: 0
+[ 32.562710] RCU nest depth: 0, expected: 0
+[ 32.566800] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G W 6.2.0-rc2-00269-gae9dcb91c606 #7
+[ 32.576188] Hardware name: Marvell CN106XX board (DT)
+[ 32.581232] Call trace:
+[ 32.583670] dump_backtrace.part.0+0xe0/0xf0
+[ 32.587937] show_stack+0x18/0x30
+[ 32.591245] dump_stack_lvl+0x68/0x84
+[ 32.594900] dump_stack+0x18/0x34
+[ 32.598206] __might_resched+0x12c/0x160
+[ 32.602122] __might_sleep+0x48/0xa0
+[ 32.605689] __kmem_cache_alloc_node+0x2b8/0x2e0
+[ 32.610301] __kmalloc+0x58/0x190
+[ 32.613610] otx2_sq_aura_pool_init+0x1a8/0x314
+[ 32.618134] otx2_open+0x1d4/0x9d0
+
+To avoid use of GFP_ATOMIC for memory allocation, disable preemption
+after all memory allocation is done.
+
+Fixes: 4af1b64f80fb ("octeontx2-pf: Fix lmtst ID used in aura free")
+Signed-off-by: Geetha sowjanya <gakula@marvell.com>
+Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
+Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
++++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+@@ -1370,7 +1370,6 @@ int otx2_sq_aura_pool_init(struct otx2_n
+ if (err)
+ goto fail;
+
+- get_cpu();
+ /* Allocate pointers and free them to aura/pool */
+ for (qidx = 0; qidx < hw->tot_tx_queues; qidx++) {
+ pool_id = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx);
+@@ -1388,13 +1387,14 @@ int otx2_sq_aura_pool_init(struct otx2_n
+ err = otx2_alloc_rbuf(pfvf, pool, &bufptr);
+ if (err)
+ goto err_mem;
++ get_cpu();
+ pfvf->hw_ops->aura_freeptr(pfvf, pool_id, bufptr);
++ put_cpu();
+ sq->sqb_ptrs[sq->sqb_count++] = (u64)bufptr;
+ }
+ }
+
+ err_mem:
+- put_cpu();
+ return err ? -ENOMEM : 0;
+
+ fail:
--- /dev/null
+From 55ba18dc62deff5910c0fa64486dea1ff20832ff Mon Sep 17 00:00:00 2001
+From: Kevin Hao <haokexin@gmail.com>
+Date: Wed, 18 Jan 2023 15:13:00 +0800
+Subject: octeontx2-pf: Fix the use of GFP_KERNEL in atomic context on rt
+
+From: Kevin Hao <haokexin@gmail.com>
+
+commit 55ba18dc62deff5910c0fa64486dea1ff20832ff upstream.
+
+The commit 4af1b64f80fb ("octeontx2-pf: Fix lmtst ID used in aura
+free") uses the get/put_cpu() to protect the usage of percpu pointer
+in ->aura_freeptr() callback, but it also unnecessarily disable the
+preemption for the blockable memory allocation. The commit 87b93b678e95
+("octeontx2-pf: Avoid use of GFP_KERNEL in atomic context") tried to
+fix these sleep inside atomic warnings. But it only fix the one for
+the non-rt kernel. For the rt kernel, we still get the similar warnings
+like below.
+ BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46
+ in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0
+ preempt_count: 1, expected: 0
+ RCU nest depth: 0, expected: 0
+ 3 locks held by swapper/0/1:
+ #0: ffff800009fc5fe8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock+0x24/0x30
+ #1: ffff000100c276c0 (&mbox->lock){+.+.}-{3:3}, at: otx2_init_hw_resources+0x8c/0x3a4
+ #2: ffffffbfef6537e0 (&cpu_rcache->lock){+.+.}-{2:2}, at: alloc_iova_fast+0x1ac/0x2ac
+ Preemption disabled at:
+ [<ffff800008b1908c>] otx2_rq_aura_pool_init+0x14c/0x284
+ CPU: 20 PID: 1 Comm: swapper/0 Tainted: G W 6.2.0-rc3-rt1-yocto-preempt-rt #1
+ Hardware name: Marvell OcteonTX CN96XX board (DT)
+ Call trace:
+ dump_backtrace.part.0+0xe8/0xf4
+ show_stack+0x20/0x30
+ dump_stack_lvl+0x9c/0xd8
+ dump_stack+0x18/0x34
+ __might_resched+0x188/0x224
+ rt_spin_lock+0x64/0x110
+ alloc_iova_fast+0x1ac/0x2ac
+ iommu_dma_alloc_iova+0xd4/0x110
+ __iommu_dma_map+0x80/0x144
+ iommu_dma_map_page+0xe8/0x260
+ dma_map_page_attrs+0xb4/0xc0
+ __otx2_alloc_rbuf+0x90/0x150
+ otx2_rq_aura_pool_init+0x1c8/0x284
+ otx2_init_hw_resources+0xe4/0x3a4
+ otx2_open+0xf0/0x610
+ __dev_open+0x104/0x224
+ __dev_change_flags+0x1e4/0x274
+ dev_change_flags+0x2c/0x7c
+ ic_open_devs+0x124/0x2f8
+ ip_auto_config+0x180/0x42c
+ do_one_initcall+0x90/0x4dc
+ do_basic_setup+0x10c/0x14c
+ kernel_init_freeable+0x10c/0x13c
+ kernel_init+0x2c/0x140
+ ret_from_fork+0x10/0x20
+
+Of course, we can shuffle the get/put_cpu() to only wrap the invocation
+of ->aura_freeptr() as what commit 87b93b678e95 does. But there are only
+two ->aura_freeptr() callbacks, otx2_aura_freeptr() and
+cn10k_aura_freeptr(). There is no usage of perpcu variable in the
+otx2_aura_freeptr() at all, so the get/put_cpu() seems redundant to it.
+We can move the get/put_cpu() into the corresponding callback which
+really has the percpu variable usage and avoid the sprinkling of
+get/put_cpu() in several places.
+
+Fixes: 4af1b64f80fb ("octeontx2-pf: Fix lmtst ID used in aura free")
+Signed-off-by: Kevin Hao <haokexin@gmail.com>
+Link: https://lore.kernel.org/r/20230118071300.3271125-1-haokexin@gmail.com
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 11 ++---------
+ drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 ++
+ 2 files changed, 4 insertions(+), 9 deletions(-)
+
+--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
++++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+@@ -1012,7 +1012,6 @@ static void otx2_pool_refill_task(struct
+ rbpool = cq->rbpool;
+ free_ptrs = cq->pool_ptrs;
+
+- get_cpu();
+ while (cq->pool_ptrs) {
+ if (otx2_alloc_rbuf(pfvf, rbpool, &bufptr)) {
+ /* Schedule a WQ if we fails to free atleast half of the
+@@ -1032,7 +1031,6 @@ static void otx2_pool_refill_task(struct
+ pfvf->hw_ops->aura_freeptr(pfvf, qidx, bufptr + OTX2_HEAD_ROOM);
+ cq->pool_ptrs--;
+ }
+- put_cpu();
+ cq->refill_task_sched = false;
+ }
+
+@@ -1387,9 +1385,7 @@ int otx2_sq_aura_pool_init(struct otx2_n
+ err = otx2_alloc_rbuf(pfvf, pool, &bufptr);
+ if (err)
+ goto err_mem;
+- get_cpu();
+ pfvf->hw_ops->aura_freeptr(pfvf, pool_id, bufptr);
+- put_cpu();
+ sq->sqb_ptrs[sq->sqb_count++] = (u64)bufptr;
+ }
+ }
+@@ -1435,21 +1431,18 @@ int otx2_rq_aura_pool_init(struct otx2_n
+ if (err)
+ goto fail;
+
+- get_cpu();
+ /* Allocate pointers and free them to aura/pool */
+ for (pool_id = 0; pool_id < hw->rqpool_cnt; pool_id++) {
+ pool = &pfvf->qset.pool[pool_id];
+ for (ptr = 0; ptr < num_ptrs; ptr++) {
+ err = otx2_alloc_rbuf(pfvf, pool, &bufptr);
+ if (err)
+- goto err_mem;
++ return -ENOMEM;
+ pfvf->hw_ops->aura_freeptr(pfvf, pool_id,
+ bufptr + OTX2_HEAD_ROOM);
+ }
+ }
+-err_mem:
+- put_cpu();
+- return err ? -ENOMEM : 0;
++ return 0;
+ fail:
+ otx2_mbox_reset(&pfvf->mbox.mbox, 0);
+ otx2_aura_pool_free(pfvf);
+--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
++++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
+@@ -733,8 +733,10 @@ static inline void cn10k_aura_freeptr(vo
+ u64 ptrs[2];
+
+ ptrs[1] = buf;
++ get_cpu();
+ /* Free only one buffer at time during init and teardown */
+ __cn10k_aura_freeptr(pfvf, aura, ptrs, 2);
++ put_cpu();
+ }
+
+ /* Alloc pointer from pool/aura */
--- /dev/null
+From 80f8a66dede0a4b4e9e846765a97809c6fe49ce5 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet@google.com>
+Date: Fri, 13 Jan 2023 12:43:26 +0000
+Subject: Revert "wifi: mac80211: fix memory leak in ieee80211_if_add()"
+
+From: Eric Dumazet <edumazet@google.com>
+
+commit 80f8a66dede0a4b4e9e846765a97809c6fe49ce5 upstream.
+
+This reverts commit 13e5afd3d773c6fc6ca2b89027befaaaa1ea7293.
+
+ieee80211_if_free() is already called from free_netdev(ndev)
+because ndev->priv_destructor == ieee80211_if_free
+
+syzbot reported:
+
+general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] PREEMPT SMP KASAN
+KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027]
+CPU: 0 PID: 10041 Comm: syz-executor.0 Not tainted 6.2.0-rc2-syzkaller-00388-g55b98837e37d #0
+Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
+RIP: 0010:pcpu_get_page_chunk mm/percpu.c:262 [inline]
+RIP: 0010:pcpu_chunk_addr_search mm/percpu.c:1619 [inline]
+RIP: 0010:free_percpu mm/percpu.c:2271 [inline]
+RIP: 0010:free_percpu+0x186/0x10f0 mm/percpu.c:2254
+Code: 80 3c 02 00 0f 85 f5 0e 00 00 48 8b 3b 48 01 ef e8 cf b3 0b 00 48 ba 00 00 00 00 00 fc ff df 48 8d 78 20 48 89 f9 48 c1 e9 03 <80> 3c 11 00 0f 85 3b 0e 00 00 48 8b 58 20 48 b8 00 00 00 00 00 fc
+RSP: 0018:ffffc90004ba7068 EFLAGS: 00010002
+RAX: 0000000000000000 RBX: ffff88823ffe2b80 RCX: 0000000000000004
+RDX: dffffc0000000000 RSI: ffffffff81c1f4e7 RDI: 0000000000000020
+RBP: ffffe8fffe8fc220 R08: 0000000000000005 R09: 0000000000000000
+R10: 0000000000000000 R11: 1ffffffff2179ab2 R12: ffff8880b983d000
+R13: 0000000000000003 R14: 0000607f450fc220 R15: ffff88823ffe2988
+FS: 00007fcb349de700(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
+CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 0000001b32220000 CR3: 000000004914f000 CR4: 00000000003506f0
+DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
+Call Trace:
+<TASK>
+netdev_run_todo+0x6bf/0x1100 net/core/dev.c:10352
+ieee80211_register_hw+0x2663/0x4040 net/mac80211/main.c:1411
+mac80211_hwsim_new_radio+0x2537/0x4d80 drivers/net/wireless/mac80211_hwsim.c:4583
+hwsim_new_radio_nl+0xa09/0x10f0 drivers/net/wireless/mac80211_hwsim.c:5176
+genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:968
+genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline]
+genl_rcv_msg+0x4ff/0x7e0 net/netlink/genetlink.c:1065
+netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564
+genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076
+netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline]
+netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356
+netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932
+sock_sendmsg_nosec net/socket.c:714 [inline]
+sock_sendmsg+0xd3/0x120 net/socket.c:734
+____sys_sendmsg+0x712/0x8c0 net/socket.c:2476
+___sys_sendmsg+0x110/0x1b0 net/socket.c:2530
+__sys_sendmsg+0xf7/0x1c0 net/socket.c:2559
+do_syscall_x64 arch/x86/entry/common.c:50 [inline]
+do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
+entry_SYSCALL_64_after_hwframe+0x63/0xcd
+
+Reported-by: syzbot <syzkaller@googlegroups.com>
+Fixes: 13e5afd3d773 ("wifi: mac80211: fix memory leak in ieee80211_if_add()")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Cc: Zhengchao Shao <shaozhengchao@huawei.com>
+Cc: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Kalle Valo <kvalo@kernel.org>
+Link: https://lore.kernel.org/r/20230113124326.3533978-1-edumazet@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/mac80211/iface.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -2260,7 +2260,6 @@ int ieee80211_if_add(struct ieee80211_lo
+
+ ret = cfg80211_register_netdevice(ndev);
+ if (ret) {
+- ieee80211_if_free(ndev);
+ free_netdev(ndev);
+ return ret;
+ }
powerpc-vmlinux.lds-define-runtime_discard_exit.patch
powerpc-vmlinux.lds-don-t-discard-.rela-for-relocatable-builds.patch
powerpc-vmlinux.lds-don-t-discard-.comment.patch
+octeontx2-pf-avoid-use-of-gfp_kernel-in-atomic-context.patch
+net-ulp-use-consistent-error-code-when-blocking-ulp.patch
+octeontx2-pf-fix-the-use-of-gfp_kernel-in-atomic-context-on-rt.patch
+net-mlx5-fix-missing-mutex_unlock-in-mlx5_fw_fatal_reporter_err_work.patch
+block-mq-deadline-rename-deadline_is_seq_writes.patch
+revert-wifi-mac80211-fix-memory-leak-in-ieee80211_if_add.patch
+soc-qcom-apr-make-qcom-protection-domain-optional-again.patch
--- /dev/null
+From 599d41fb8ea8bd2a99ca9525dd69405020e43dda Mon Sep 17 00:00:00 2001
+From: Stephan Gerhold <stephan@gerhold.net>
+Date: Thu, 29 Dec 2022 16:16:48 +0100
+Subject: soc: qcom: apr: Make qcom,protection-domain optional again
+
+From: Stephan Gerhold <stephan@gerhold.net>
+
+commit 599d41fb8ea8bd2a99ca9525dd69405020e43dda upstream.
+
+APR should not fail if the service device tree node does not have
+the qcom,protection-domain property, since this functionality does
+not exist on older platforms such as MSM8916 and MSM8996.
+
+Ignore -EINVAL (returned when the property does not exist) to fix
+a regression on 6.2-rc1 that prevents audio from working:
+
+ qcom,apr remoteproc0:smd-edge.apr_audio_svc.-1.-1:
+ Failed to read second value of qcom,protection-domain
+ qcom,apr remoteproc0:smd-edge.apr_audio_svc.-1.-1:
+ Failed to add apr 3 svc
+
+Fixes: 6d7860f5750d ("soc: qcom: apr: Add check for idr_alloc and of_property_read_string_index")
+Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
+Reviewed-by: Bjorn Andersson <andersson@kernel.org>
+Signed-off-by: Bjorn Andersson <andersson@kernel.org>
+Link: https://lore.kernel.org/r/20221229151648.19839-3-stephan@gerhold.net
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/soc/qcom/apr.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/soc/qcom/apr.c
++++ b/drivers/soc/qcom/apr.c
+@@ -461,9 +461,10 @@ static int apr_add_device(struct device
+ goto out;
+ }
+
++ /* Protection domain is optional, it does not exist on older platforms */
+ ret = of_property_read_string_index(np, "qcom,protection-domain",
+ 1, &adev->service_path);
+- if (ret < 0) {
++ if (ret < 0 && ret != -EINVAL) {
+ dev_err(dev, "Failed to read second value of qcom,protection-domain\n");
+ goto out;
+ }