Skip to contentSkip to conversation

5.18.13-rc1 review

PATCH In review Greg Kroah-Hartman 13 participants 258 messages Jul 19, 2022 – Jul 21, 2022 Page 2 of 2

Subsystems (3)
lore
Share & tools
lore
author maintainer
#157 lore raw

PATCH 157/231 s390/nospec: build expoline.o for modules_prepare target

In reply to Greg Kroah-Hartman

From: Vasily Gorbik <[email protected]>

[ Upstream commit c4e789572557aa147b13bf7fe09cc99663ed0cf5 ]

When CONFIG_EXPOLINE_EXTERN is used expoline thunks are generated from arch/s390/lib/expoline.S and postlinked into every module. This is also true for external modules. Add expoline.o build to the modules_prepare target.

---
 arch/s390/Makefile                      | 8 +++++++-
 arch/s390/lib/Makefile                  | 3 ++-
 arch/s390/lib/expoline/Makefile         | 3 +++
 arch/s390/lib/{ => expoline}/expoline.S | 0
 4 files changed, 12 insertions(+), 2 deletions(-)
 create mode 100644 arch/s390/lib/expoline/Makefile
 rename arch/s390/lib/{ => expoline}/expoline.S (100%)
arch/s390/Makefile +7 -1
index eba70d585cb2..5b7e761b2d50 100644
@@ -80,7 +80,7 @@ endif
 
 ifdef CONFIG_EXPOLINE
   ifdef CONFIG_EXPOLINE_EXTERN
-    KBUILD_LDFLAGS_MODULE += arch/s390/lib/expoline.o
+    KBUILD_LDFLAGS_MODULE += arch/s390/lib/expoline/expoline.o
     CC_FLAGS_EXPOLINE := -mindirect-branch=thunk-extern
     CC_FLAGS_EXPOLINE += -mfunction-return=thunk-extern
   else
@@ -162,6 +162,12 @@ vdso_prepare: prepare0
 	$(Q)$(MAKE) $(build)=arch/s390/kernel/vdso64 include/generated/vdso64-offsets.h
 	$(if $(CONFIG_COMPAT),$(Q)$(MAKE) \
 		$(build)=arch/s390/kernel/vdso32 include/generated/vdso32-offsets.h)
+
+ifdef CONFIG_EXPOLINE_EXTERN
+modules_prepare: expoline_prepare
+expoline_prepare: prepare0
+	$(Q)$(MAKE) $(build)=arch/s390/lib/expoline arch/s390/lib/expoline/expoline.o
+endif
 endif
 
 # Don't use tabs in echo arguments
arch/s390/lib/Makefile +2 -1
index 5d415b3db6d1..580d2e3265cb 100644
@@ -7,7 +7,6 @@ lib-y += delay.o string.o uaccess.o find.o spinlock.o
 obj-y += mem.o xor.o
 lib-$(CONFIG_KPROBES) += probes.o
 lib-$(CONFIG_UPROBES) += probes.o
-obj-$(CONFIG_EXPOLINE_EXTERN) += expoline.o
 obj-$(CONFIG_S390_KPROBES_SANITY_TEST) += test_kprobes_s390.o
 test_kprobes_s390-objs += test_kprobes_asm.o test_kprobes.o
 
@@ -22,3 +21,5 @@ obj-$(CONFIG_S390_MODULES_SANITY_TEST) += test_modules.o
 obj-$(CONFIG_S390_MODULES_SANITY_TEST_HELPERS) += test_modules_helpers.o
 
 lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
+
+obj-$(CONFIG_EXPOLINE_EXTERN) += expoline/
arch/s390/lib/expoline/Makefile new file +3 -0
new file mode 100644
index 000000000000..854631d9cb03
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-y += expoline.o
arch/s390/lib/expoline/expoline.S renamed from arch/s390/lib/expoline.S +0 -0
similarity index 100%
rename from arch/s390/lib/expoline.S
rename to arch/s390/lib/expoline/expoline.S
Signature · 1 line
2.35.1
author maintainer
#158 lore raw

PATCH 158/231 scsi: megaraid: Clear READ queue maps nr_queues

In reply to Greg Kroah-Hartman

From: Ming Lei <[email protected]>

[ Upstream commit 8312cd3a7b835ae3033a679e5f0014a40e7891c5 ]

The megaraid SCSI driver sets set->nr_maps as 3 if poll_queues is > 0, and blk-mq actually initializes each map's nr_queues as nr_hw_queues. Consequently the driver has to clear READ queue map's nr_queues, otherwise the queue map becomes broken if poll_queues is set as non-zero.

---
 drivers/scsi/megaraid/megaraid_sas_base.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/scsi/megaraid/megaraid_sas_base.c +3 -0
index db6793608447..f5deb0e561a9 100644
@@ -3195,6 +3195,9 @@ static int megasas_map_queues(struct Scsi_Host *shost)
 	qoff += map->nr_queues;
 	offset += map->nr_queues;
 
+	/* we never use READ queue, so can't cheat blk-mq */
+	shost->tag_set.map[HCTX_TYPE_READ].nr_queues = 0;
+
 	/* Setup Poll hctx */
 	map = &shost->tag_set.map[HCTX_TYPE_POLL];
 	map->nr_queues = instance->iopoll_q_count;
Signature · 1 line
2.35.1
author maintainer
#159 lore raw

PATCH 159/231 scsi: ufs: core: Drop loglevel of WriteBoost message

In reply to Greg Kroah-Hartman

From: Bjorn Andersson <[email protected]>

[ Upstream commit 2ae57c995003a7840cb6b5ec5f0c06193695321b ]

Commit '3b5f3c0d0548 ("scsi: ufs: core: Tidy up WB configuration code")' changed the log level of the write boost enable/disable notification from debug to info. This results in a lot of noise in the kernel log during normal operation.

Drop it back to debug level to avoid this.

---
 drivers/scsi/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +1 -1
index 4c9eb4be449c..452ad0612067 100644
@@ -5722,7 +5722,7 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable)
 	}
 
 	hba->dev_info.wb_enabled = enable;
-	dev_info(hba->dev, "%s Write Booster %s\n",
+	dev_dbg(hba->dev, "%s Write Booster %s\n",
 			__func__, enable ? "enabled" : "disabled");
 
 	return ret;
Signature · 1 line
2.35.1
author maintainer
#160 lore raw

PATCH 160/231 nvme: fix block device naming collision

In reply to Greg Kroah-Hartman

From: Israel Rukshin <[email protected]>

[ Upstream commit 6961b5e02876b3b47f030a1f1ee8fd3e631ac270 ]

The issue exists when multipath is enabled and the namespace is shared, but all the other controller checks at nvme_is_unique_nsid() are false. The reason for this issue is that nvme_is_unique_nsid() returns false when is called from nvme_mpath_alloc_disk() due to an uninitialized value of head->shared. The patch fixes it by setting head->shared before nvme_mpath_alloc_disk() is called.

Fixes 5974ea7ce0f9 ("nvme: allow duplicate NSIDs for private namespaces")
---
 drivers/nvme/host/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/nvme/host/core.c +3 -3
index a2862a56fadc..0fef31c935de 100644
@@ -3726,7 +3726,7 @@ static int nvme_add_ns_cdev(struct nvme_ns *ns)
 }
 
 static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
-		unsigned nsid, struct nvme_ns_ids *ids)
+		unsigned nsid, struct nvme_ns_ids *ids, bool is_shared)
 {
 	struct nvme_ns_head *head;
 	size_t size = sizeof(*head);
@@ -3750,6 +3750,7 @@ static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
 	head->subsys = ctrl->subsys;
 	head->ns_id = nsid;
 	head->ids = *ids;
+	head->shared = is_shared;
 	kref_init(&head->ref);
 
 	if (head->ids.csi) {
@@ -3830,12 +3831,11 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
 				nsid);
 			goto out_unlock;
 		}
-		head = nvme_alloc_ns_head(ctrl, nsid, ids);
+		head = nvme_alloc_ns_head(ctrl, nsid, ids, is_shared);
 		if (IS_ERR(head)) {
 			ret = PTR_ERR(head);
 			goto out_unlock;
 		}
-		head->shared = is_shared;
 	} else {
 		ret = -EINVAL;
 		if (!is_shared || !head->shared) {
Signature · 1 line
2.35.1
author maintainer
#161 lore raw

PATCH 161/231 ksmbd: use SOCK_NONBLOCK type for kernel_accept()

In reply to Greg Kroah-Hartman

From: Namjae Jeon <[email protected]>

[ Upstream commit fe0fde09e1cb83effcf8fafa372533f438d93a1a ]

I found that normally it is O_NONBLOCK but there are different value for some arch.

/include/linux/net.h:
#ifndef SOCK_NONBLOCK
#define SOCK_NONBLOCK O_NONBLOCK
#endif

/arch/alpha/include/asm/socket.h:
#define SOCK_NONBLOCK 0x40000000

Use SOCK_NONBLOCK instead of O_NONBLOCK for kernel_accept().

---
 fs/ksmbd/transport_tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ksmbd/transport_tcp.c +1 -1
index 8fef9de787d3..143bba4e4db8 100644
@@ -230,7 +230,7 @@ static int ksmbd_kthread_fn(void *p)
 			break;
 		}
 		ret = kernel_accept(iface->ksmbd_socket, &client_sk,
-				    O_NONBLOCK);
+				    SOCK_NONBLOCK);
 		mutex_unlock(&iface->sock_release_lock);
 		if (ret) {
 			if (ret == -EAGAIN)
Signature · 1 line
2.35.1
author maintainer
#162 lore raw

PATCH 162/231 powerpc/xive/spapr: correct bitmap allocation size

In reply to Greg Kroah-Hartman

From: Nathan Lynch <[email protected]>

[ Upstream commit 19fc5bb93c6bbdce8292b4d7eed04e2fa118d2fe ]

kasan detects access beyond the end of the xibm->bitmap allocation:

BUG: KASAN: slab-out-of-bounds in _find_first_zero_bit+0x40/0x140
Read of size 8 at addr c00000001d1d0118 by task swapper/0/1

CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.19.0-rc2-00001-g90df023b36dd #28
Call Trace:
[c00000001d98f770] [c0000000012baab8] dump_stack_lvl+0xac/0x108 (unreliable)
[c00000001d98f7b0] [c00000000068faac] print_report+0x37c/0x710
[c00000001d98f880] [c0000000006902c0] kasan_report+0x110/0x354
[c00000001d98f950] [c000000000692324] __asan_load8+0xa4/0xe0
[c00000001d98f970] [c0000000011c6ed0] _find_first_zero_bit+0x40/0x140
[c00000001d98f9b0] [c0000000000dbfbc] xive_spapr_get_ipi+0xcc/0x260
[c00000001d98fa70] [c0000000000d6d28] xive_setup_cpu_ipi+0x1e8/0x450
[c00000001d98fb30] [c000000004032a20] pSeries_smp_probe+0x5c/0x118
[c00000001d98fb60] [c000000004018b44] smp_prepare_cpus+0x944/0x9ac
[c00000001d98fc90] [c000000004009f9c] kernel_init_freeable+0x2d4/0x640
[c00000001d98fd90] [c0000000000131e8] kernel_init+0x28/0x1d0
[c00000001d98fe10] [c00000000000cd54] ret_from_kernel_thread+0x5c/0x64

Allocated by task 0:
 kasan_save_stack+0x34/0x70
 __kasan_kmalloc+0xb4/0xf0
 __kmalloc+0x268/0x540
 xive_spapr_init+0x4d0/0x77c
 pseries_init_irq+0x40/0x27c
 init_IRQ+0x44/0x84
 start_kernel+0x2a4/0x538
 start_here_common+0x1c/0x20

The buggy address belongs to the object at c00000001d1d0118
 which belongs to the cache kmalloc-8 of size 8

The buggy address is located 0 bytes inside of
8-byte region [c00000001d1d0118, c00000001d1d0120)

The buggy address belongs to the physical page:
page:c00c000000074740 refcount:1 mapcount:0 mapping:0000000000000000 index:0xc00000001d1d0558 pfn:0x1d1d
flags: 0x7ffff000000200(slab|node=0|zone=0|lastcpupid=0x7ffff)
raw: 007ffff000000200 c00000001d0003c8 c00000001d0003c8 c00000001d010480
raw: c00000001d1d0558 0000000001e1000a 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 c00000001d1d0000: fc 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 c00000001d1d0080: fc fc 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
>c00000001d1d0100: fc fc fc 02 fc fc fc fc fc fc fc fc fc fc fc fc
                            ^
 c00000001d1d0180: fc fc fc fc 04 fc fc fc fc fc fc fc fc fc fc fc
 c00000001d1d0200: fc fc fc fc fc 04 fc fc fc fc fc fc fc fc fc fc

This happens because the allocation uses the wrong unit (bits) when it should pass (BITS_TO_LONGS(count) * sizeof(long)) or equivalent. With small numbers of bits, the allocated object can be smaller than sizeof(long), which results in invalid accesses.

Use bitmap_zalloc() to allocate and initialize the irq bitmap, paired with bitmap_free() for consistency.

---
 arch/powerpc/sysdev/xive/spapr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/sysdev/xive/spapr.c +3 -2
index 503f544d28e2..b0d36e430dbc 100644
@@ -13,6 +13,7 @@
 #include <linux/of.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/bitmap.h>
 #include <linux/cpumask.h>
 #include <linux/mm.h>
 #include <linux/delay.h>
@@ -55,7 +56,7 @@ static int __init xive_irq_bitmap_add(int base, int count)
 	spin_lock_init(&xibm->lock);
 	xibm->base = base;
 	xibm->count = count;
-	xibm->bitmap = kzalloc(xibm->count, GFP_KERNEL);
+	xibm->bitmap = bitmap_zalloc(xibm->count, GFP_KERNEL);
 	if (!xibm->bitmap) {
 		kfree(xibm);
 		return -ENOMEM;
@@ -73,7 +74,7 @@ static void xive_irq_bitmap_remove_all(void)
 
 	list_for_each_entry_safe(xibm, tmp, &xive_irq_bitmaps, list) {
 		list_del(&xibm->list);
-		kfree(xibm->bitmap);
+		bitmap_free(xibm->bitmap);
 		kfree(xibm);
 	}
 }
Signature · 1 line
2.35.1
author maintainer
#163 lore raw

PATCH 163/231 vdpa/mlx5: Initialize CVQ vringh only once

In reply to Greg Kroah-Hartman

From: Eli Cohen <[email protected]>

[ Upstream commit ace9252446ec615cd79a5f77d90edb25c0b9d024 ]

Currently, CVQ vringh is initialized inside setup_virtqueues() which is called every time a memory update is done. This is undesirable since it resets all the context of the vring, including the available and used indices.

Move the initialization to mlx5_vdpa_set_status() when VIRTIO_CONFIG_S_DRIVER_OK is set.

Message-Id: <[email protected]>

---
 drivers/vdpa/mlx5/net/mlx5_vnet.c |   31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)
drivers/vdpa/mlx5/net/mlx5_vnet.c +20 -11
@@ -1965,7 +1965,6 @@ static int verify_driver_features(struct
 static int setup_virtqueues(struct mlx5_vdpa_dev *mvdev)
 {
 	struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
-	struct mlx5_control_vq *cvq = &mvdev->cvq;
 	int err;
 	int i;
 
@@ -1975,16 +1974,6 @@ static int setup_virtqueues(struct mlx5_
 			goto err_vq;
 	}
 
-	if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ)) {
-		err = vringh_init_iotlb(&cvq->vring, mvdev->actual_features,
-					MLX5_CVQ_MAX_ENT, false,
-					(struct vring_desc *)(uintptr_t)cvq->desc_addr,
-					(struct vring_avail *)(uintptr_t)cvq->driver_addr,
-					(struct vring_used *)(uintptr_t)cvq->device_addr);
-		if (err)
-			goto err_vq;
-	}
-
 	return 0;
 
 err_vq:
@@ -2257,6 +2246,21 @@ static void clear_vqs_ready(struct mlx5_
 	ndev->mvdev.cvq.ready = false;
 }
 
+static int setup_cvq_vring(struct mlx5_vdpa_dev *mvdev)
+{
+	struct mlx5_control_vq *cvq = &mvdev->cvq;
+	int err = 0;
+
+	if (mvdev->actual_features & BIT_ULL(VIRTIO_NET_F_CTRL_VQ))
+		err = vringh_init_iotlb(&cvq->vring, mvdev->actual_features,
+					MLX5_CVQ_MAX_ENT, false,
+					(struct vring_desc *)(uintptr_t)cvq->desc_addr,
+					(struct vring_avail *)(uintptr_t)cvq->driver_addr,
+					(struct vring_used *)(uintptr_t)cvq->device_addr);
+
+	return err;
+}
+
 static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status)
 {
 	struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
@@ -2269,6 +2273,11 @@ static void mlx5_vdpa_set_status(struct
 
 	if ((status ^ ndev->mvdev.status) & VIRTIO_CONFIG_S_DRIVER_OK) {
 		if (status & VIRTIO_CONFIG_S_DRIVER_OK) {
+			err = setup_cvq_vring(mvdev);
+			if (err) {
+				mlx5_vdpa_warn(mvdev, "failed to setup control VQ vring\n");
+				goto err_setup;
+			}
 			err = setup_driver(mvdev);
 			if (err) {
 				mlx5_vdpa_warn(mvdev, "failed to setup driver\n");
author maintainer
#164 lore raw

PATCH 164/231 vduse: Tie vduse mgmtdev and its device

In reply to Greg Kroah-Hartman

From: Parav Pandit <[email protected]>

[ Upstream commit 0e0348ac3f0a6e6606f1aa5acb1803ada913aa3d ]

vduse devices are not backed by any real devices such as PCI. Hence it doesn't have any parent device linked to it.

Kernel driver model in [1] suggests to avoid an empty device release callback.

Hence tie the mgmtdevice object's life cycle to an allocate dummy struct device instead of static one.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/core-api/kobject.rst?h=v5.18-rc7#n284

Message-Id: <[email protected]>

---
 drivers/vdpa/vdpa_user/vduse_dev.c | 60 ++++++++++++++++++------------
 1 file changed, 37 insertions(+), 23 deletions(-)
drivers/vdpa/vdpa_user/vduse_dev.c +37 -23
index 160e40d03084..02709f8a78bd 100644
@@ -1475,16 +1475,12 @@ static char *vduse_devnode(struct device *dev, umode_t *mode)
 	return kasprintf(GFP_KERNEL, "vduse/%s", dev_name(dev));
 }
 
-static void vduse_mgmtdev_release(struct device *dev)
-{
-}
-
-static struct device vduse_mgmtdev = {
-	.init_name = "vduse",
-	.release = vduse_mgmtdev_release,
+struct vduse_mgmt_dev {
+	struct vdpa_mgmt_dev mgmt_dev;
+	struct device dev;
 };
 
-static struct vdpa_mgmt_dev mgmt_dev;
+static struct vduse_mgmt_dev *vduse_mgmt;
 
 static int vduse_dev_init_vdpa(struct vduse_dev *dev, const char *name)
 {
@@ -1509,7 +1505,7 @@ static int vduse_dev_init_vdpa(struct vduse_dev *dev, const char *name)
 	}
 	set_dma_ops(&vdev->vdpa.dev, &vduse_dev_dma_ops);
 	vdev->vdpa.dma_dev = &vdev->vdpa.dev;
-	vdev->vdpa.mdev = &mgmt_dev;
+	vdev->vdpa.mdev = &vduse_mgmt->mgmt_dev;
 
 	return 0;
 }
@@ -1555,34 +1551,52 @@ static struct virtio_device_id id_table[] = {
 	{ 0 },
 };
 
-static struct vdpa_mgmt_dev mgmt_dev = {
-	.device = &vduse_mgmtdev,
-	.id_table = id_table,
-	.ops = &vdpa_dev_mgmtdev_ops,
-};
+static void vduse_mgmtdev_release(struct device *dev)
+{
+	struct vduse_mgmt_dev *mgmt_dev;
+
+	mgmt_dev = container_of(dev, struct vduse_mgmt_dev, dev);
+	kfree(mgmt_dev);
+}
 
 static int vduse_mgmtdev_init(void)
 {
 	int ret;
 
-	ret = device_register(&vduse_mgmtdev);
-	if (ret)
+	vduse_mgmt = kzalloc(sizeof(*vduse_mgmt), GFP_KERNEL);
+	if (!vduse_mgmt)
+		return -ENOMEM;
+
+	ret = dev_set_name(&vduse_mgmt->dev, "vduse");
+	if (ret) {
+		kfree(vduse_mgmt);
 		return ret;
+	}
 
-	ret = vdpa_mgmtdev_register(&mgmt_dev);
+	vduse_mgmt->dev.release = vduse_mgmtdev_release;
+
+	ret = device_register(&vduse_mgmt->dev);
 	if (ret)
-		goto err;
+		goto dev_reg_err;
 
-	return 0;
-err:
-	device_unregister(&vduse_mgmtdev);
+	vduse_mgmt->mgmt_dev.id_table = id_table;
+	vduse_mgmt->mgmt_dev.ops = &vdpa_dev_mgmtdev_ops;
+	vduse_mgmt->mgmt_dev.device = &vduse_mgmt->dev;
+	ret = vdpa_mgmtdev_register(&vduse_mgmt->mgmt_dev);
+	if (ret)
+		device_unregister(&vduse_mgmt->dev);
+
+	return ret;
+
+dev_reg_err:
+	put_device(&vduse_mgmt->dev);
 	return ret;
 }
 
 static void vduse_mgmtdev_exit(void)
 {
-	vdpa_mgmtdev_unregister(&mgmt_dev);
-	device_unregister(&vduse_mgmtdev);
+	vdpa_mgmtdev_unregister(&vduse_mgmt->mgmt_dev);
+	device_unregister(&vduse_mgmt->dev);
 }
 
 static int vduse_init(void)
Signature · 1 line
2.35.1
author maintainer
#165 lore raw

PATCH 165/231 platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver

In reply to Greg Kroah-Hartman

From: Gayatri Kammela <[email protected]>

[ Upstream commit d63eae6747eb8b3192e89712f6553c6aa162f872 ]

Add Alder Lake N (ADL-N) to the list of the platforms that Intel's PMC core driver supports. Alder Lake N reuses all the TigerLake PCH IPs.

---
 drivers/platform/x86/intel/pmc/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/intel/pmc/core.c +1 -0
index 8ee15a7252c7..c3ec5dc88bbf 100644
@@ -1911,6 +1911,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
 	X86_MATCH_INTEL_FAM6_MODEL(ATOM_TREMONT_L,	&icl_reg_map),
 	X86_MATCH_INTEL_FAM6_MODEL(ROCKETLAKE,		&tgl_reg_map),
 	X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L,		&tgl_reg_map),
+	X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_N,		&tgl_reg_map),
 	X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE,		&adl_reg_map),
 	X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P,        &tgl_reg_map),
 	{}
Signature · 1 line
2.35.1
author maintainer
#166 lore raw

PATCH 166/231 virtio_mmio: Add missing PM calls to freeze/restore

In reply to Greg Kroah-Hartman

From: Stephan Gerhold <[email protected]>

[ Upstream commit ed7ac37fde33ccd84e4bd2b9363c191f925364c7 ]

Most virtio drivers provide freeze/restore callbacks to finish up device usage before suspend and to reinitialize the virtio device after resume. However, these callbacks are currently only called when using virtio_pci. virtio_mmio does not have any PM ops defined.

This causes problems for example after suspend to disk (hibernation), since the virtio devices might lose their state after the VMM is restarted. Calling virtio_device_freeze()/restore() ensures that the virtio devices are re-initialized correctly.

Fix this by implementing the dev_pm_ops for virtio_mmio, similar to virtio_pci_common.

Message-Id: <[email protected]>

---
 drivers/virtio/virtio_mmio.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
drivers/virtio/virtio_mmio.c +23 -0
index 1dd396d4bebb..7522832529dd 100644
@@ -62,6 +62,7 @@
 #include <linux/list.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/pm.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/virtio.h>
@@ -543,6 +544,25 @@ static const struct virtio_config_ops virtio_mmio_config_ops = {
 	.get_shm_region = vm_get_shm_region,
 };
 
+#ifdef CONFIG_PM_SLEEP
+static int virtio_mmio_freeze(struct device *dev)
+{
+	struct virtio_mmio_device *vm_dev = dev_get_drvdata(dev);
+
+	return virtio_device_freeze(&vm_dev->vdev);
+}
+
+static int virtio_mmio_restore(struct device *dev)
+{
+	struct virtio_mmio_device *vm_dev = dev_get_drvdata(dev);
+
+	return virtio_device_restore(&vm_dev->vdev);
+}
+
+static const struct dev_pm_ops virtio_mmio_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(virtio_mmio_freeze, virtio_mmio_restore)
+};
+#endif
 
 static void virtio_mmio_release_dev(struct device *_d)
 {
@@ -786,6 +806,9 @@ static struct platform_driver virtio_mmio_driver = {
 		.name	= "virtio-mmio",
 		.of_match_table	= virtio_mmio_match,
 		.acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match),
+#ifdef CONFIG_PM_SLEEP
+		.pm	= &virtio_mmio_pm_ops,
+#endif
 	},
 };
 
Signature · 1 line
2.35.1
author maintainer
#167 lore raw

PATCH 167/231 virtio_mmio: Restore guest page size on resume

In reply to Greg Kroah-Hartman

From: Stephan Gerhold <[email protected]>

[ Upstream commit e0c2ce8217955537dd5434baeba061f209797119 ]

Virtio devices might lose their state when the VMM is restarted after a suspend to disk (hibernation) cycle. This means that the guest page size register must be restored for the virtio_mmio legacy interface, since otherwise the virtio queues are not functional.

This is particularly problematic for QEMU that currently still defaults to using the legacy interface for virtio_mmio. Write the guest page size register again in virtio_mmio_restore() to make legacy virtio_mmio devices work correctly after hibernation.

Message-Id: <[email protected]>

---
 drivers/virtio/virtio_mmio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/virtio/virtio_mmio.c +3 -0
index 7522832529dd..fe696aafaed8 100644
@@ -556,6 +556,9 @@ static int virtio_mmio_restore(struct device *dev)
 {
 	struct virtio_mmio_device *vm_dev = dev_get_drvdata(dev);
 
+	if (vm_dev->version == 1)
+		writel(PAGE_SIZE, vm_dev->base + VIRTIO_MMIO_GUEST_PAGE_SIZE);
+
 	return virtio_device_restore(&vm_dev->vdev);
 }
 
Signature · 1 line
2.35.1
author maintainer
#168 lore raw

PATCH 168/231 netfilter: nf_tables: avoid skb access on nf_stolen

In reply to Greg Kroah-Hartman

From: Florian Westphal <[email protected]>

[ Upstream commit e34b9ed96ce3b06c79bf884009b16961ca478f87 ]

When verdict is NF_STOLEN, the skb might have been freed.

When tracing is enabled, this can result in a use-after-free:
1. access to skb->nf_trace
2. access to skb->mark
3. computation of trace id
4. dump of packet payload

To avoid 1, keep a cached copy of skb->nf_trace in the trace state struct.
Refresh this copy whenever verdict is != STOLEN.

Avoid 2 by skipping skb->mark access if verdict is STOLEN.

3 is avoided by precomputing the trace id.

Only dump the packet when verdict is not "STOLEN".

---
 include/net/netfilter/nf_tables.h | 16 ++++++-----
 net/netfilter/nf_tables_core.c    | 24 ++++++++++++++---
 net/netfilter/nf_tables_trace.c   | 44 +++++++++++++++++--------------
 3 files changed, 55 insertions(+), 29 deletions(-)
include/net/netfilter/nf_tables.h +10 -6
index f0c3a1ee197c..64cf655c818c 100644
@@ -1342,24 +1342,28 @@ void nft_unregister_flowtable_type(struct nf_flowtable_type *type);
 /**
  *	struct nft_traceinfo - nft tracing information and state
  *
+ *	@trace: other struct members are initialised
+ *	@nf_trace: copy of skb->nf_trace before rule evaluation
+ *	@type: event type (enum nft_trace_types)
+ *	@skbid: hash of skb to be used as trace id
+ *	@packet_dumped: packet headers sent in a previous traceinfo message
  *	@pkt: pktinfo currently processed
  *	@basechain: base chain currently processed
  *	@chain: chain currently processed
  *	@rule:  rule that was evaluated
  *	@verdict: verdict given by rule
- *	@type: event type (enum nft_trace_types)
- *	@packet_dumped: packet headers sent in a previous traceinfo message
- *	@trace: other struct members are initialised
  */
 struct nft_traceinfo {
+	bool				trace;
+	bool				nf_trace;
+	bool				packet_dumped;
+	enum nft_trace_types		type:8;
+	u32				skbid;
 	const struct nft_pktinfo	*pkt;
 	const struct nft_base_chain	*basechain;
 	const struct nft_chain		*chain;
 	const struct nft_rule_dp	*rule;
 	const struct nft_verdict	*verdict;
-	enum nft_trace_types		type;
-	bool				packet_dumped;
-	bool				trace;
 };
 
 void nft_trace_init(struct nft_traceinfo *info, const struct nft_pktinfo *pkt,
net/netfilter/nf_tables_core.c +21 -3
index 53f40e473855..3ddce24ac76d 100644
@@ -25,9 +25,7 @@ static noinline void __nft_trace_packet(struct nft_traceinfo *info,
 					const struct nft_chain *chain,
 					enum nft_trace_types type)
 {
-	const struct nft_pktinfo *pkt = info->pkt;
-
-	if (!info->trace || !pkt->skb->nf_trace)
+	if (!info->trace || !info->nf_trace)
 		return;
 
 	info->chain = chain;
@@ -42,11 +40,24 @@ static inline void nft_trace_packet(struct nft_traceinfo *info,
 				    enum nft_trace_types type)
 {
 	if (static_branch_unlikely(&nft_trace_enabled)) {
+		const struct nft_pktinfo *pkt = info->pkt;
+
+		info->nf_trace = pkt->skb->nf_trace;
 		info->rule = rule;
 		__nft_trace_packet(info, chain, type);
 	}
 }
 
+static inline void nft_trace_copy_nftrace(struct nft_traceinfo *info)
+{
+	if (static_branch_unlikely(&nft_trace_enabled)) {
+		const struct nft_pktinfo *pkt = info->pkt;
+
+		if (info->trace)
+			info->nf_trace = pkt->skb->nf_trace;
+	}
+}
+
 static void nft_bitwise_fast_eval(const struct nft_expr *expr,
 				  struct nft_regs *regs)
 {
@@ -85,6 +96,7 @@ static noinline void __nft_trace_verdict(struct nft_traceinfo *info,
 					 const struct nft_chain *chain,
 					 const struct nft_regs *regs)
 {
+	const struct nft_pktinfo *pkt = info->pkt;
 	enum nft_trace_types type;
 
 	switch (regs->verdict.code) {
@@ -92,8 +104,13 @@ static noinline void __nft_trace_verdict(struct nft_traceinfo *info,
 	case NFT_RETURN:
 		type = NFT_TRACETYPE_RETURN;
 		break;
+	case NF_STOLEN:
+		type = NFT_TRACETYPE_RULE;
+		/* can't access skb->nf_trace; use copy */
+		break;
 	default:
 		type = NFT_TRACETYPE_RULE;
+		info->nf_trace = pkt->skb->nf_trace;
 		break;
 	}
 
@@ -254,6 +271,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv)
 		switch (regs.verdict.code) {
 		case NFT_BREAK:
 			regs.verdict.code = NFT_CONTINUE;
+			nft_trace_copy_nftrace(&info);
 			continue;
 		case NFT_CONTINUE:
 			nft_trace_packet(&info, chain, rule,
net/netfilter/nf_tables_trace.c +24 -20

91 lines not on this page · raw message

Signature · 1 line
2.35.1
author maintainer
#169 lore raw

PATCH 169/231 netfilter: br_netfilter: do not skip all hooks with 0 priority

In reply to Greg Kroah-Hartman

From: Florian Westphal <[email protected]>

[ Upstream commit c2577862eeb0be94f151f2f1fff662b028061b00 ]

When br_netfilter module is loaded, skbs may be diverted to the ipv4/ipv6 hooks, just like as if we were routing.

Unfortunately, bridge filter hooks with priority 0 may be skipped in this case.

Example:
1. an nftables bridge ruleset is loaded, with a prerouting hook that has priority 0.
2. interface is added to the bridge.
3. no tcp packet is ever seen by the bridge prerouting hook.
4. flush the ruleset
5. load the bridge ruleset again.
6. tcp packets are processed as expected.

After 1) the only registered hook is the bridge prerouting hook, but its not called yet because the bridge hasn't been brought up yet.

After 2), hook order is:
0 br_nf_pre_routing // br_netfilter internal hook 0 chain bridge f prerouting // nftables bridge ruleset

The packet is diverted to br_nf_pre_routing.
If call-iptables is off, the nftables bridge ruleset is called as expected.

But if its enabled, br_nf_hook_thresh() will skip it because it assumes that all 0-priority hooks had been called previously in bridge context.

To avoid this, check for the br_nf_pre_routing hook itself, we need to resume directly after it, even if this hook has a priority of 0.

Unfortunately, this still results in different packet flow. With this fix, the eval order after in 3) is:
1. br_nf_pre_routing
2. ip(6)tables (if enabled)
3. nftables bridge

but after 5 its the much saner:
1. nftables bridge
2. br_nf_pre_routing
3. ip(6)tables (if enabled)

Unfortunately I don't see a solution here:
It would be possible to move br_nf_pre_routing to a higher priority so that it will be called later in the pipeline, but this also impacts ebtables evaluation order, and would still result in this very ordering problem for all nftables-bridge hooks with the same priority as the br_nf_pre_routing one.

Searching back through the git history I don't think this has ever behaved in any other way, hence, no fixes-tag.

---
 net/bridge/br_netfilter_hooks.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
net/bridge/br_netfilter_hooks.c +18 -3
index 4fd882686b04..ff4779036649 100644
@@ -1012,9 +1012,24 @@ int br_nf_hook_thresh(unsigned int hook, struct net *net,
 		return okfn(net, sk, skb);
 
 	ops = nf_hook_entries_get_hook_ops(e);
-	for (i = 0; i < e->num_hook_entries &&
-	      ops[i]->priority <= NF_BR_PRI_BRNF; i++)
-		;
+	for (i = 0; i < e->num_hook_entries; i++) {
+		/* These hooks have already been called */
+		if (ops[i]->priority < NF_BR_PRI_BRNF)
+			continue;
+
+		/* These hooks have not been called yet, run them. */
+		if (ops[i]->priority > NF_BR_PRI_BRNF)
+			break;
+
+		/* take a closer look at NF_BR_PRI_BRNF. */
+		if (ops[i]->hook == br_nf_pre_routing) {
+			/* This hook diverted the skb to this function,
+			 * hooks after this have not been run yet.
+			 */
+			i++;
+			break;
+		}
+	}
 
 	nf_hook_state_init(&state, hook, NFPROTO_BRIDGE, indev, outdev,
 			   sk, net, okfn);
Signature · 1 line
2.35.1
author maintainer
#170 lore raw

PATCH 170/231 scsi: hisi_sas: Limit max hw sectors for v3 HW

In reply to Greg Kroah-Hartman

From: John Garry <[email protected]>

[ Upstream commit fce54ed027577517df1e74b7d54dc2b1bd536887 ]

If the controller is behind an IOMMU then the IOMMU IOVA caching range can affect performance, as discussed in [0].

Limit the max HW sectors to not exceed this limit. We need to hardcode the value until a proper DMA mapping API is available.

[0] https://lore.kernel.org/linux-iommu/[email protected]/

---
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +7 -0
index 7d819fc0395e..eb86afb21aab 100644
@@ -2782,6 +2782,7 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)
 	struct hisi_hba *hisi_hba = shost_priv(shost);
 	struct device *dev = hisi_hba->dev;
 	int ret = sas_slave_configure(sdev);
+	unsigned int max_sectors;
 
 	if (ret)
 		return ret;
@@ -2799,6 +2800,12 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)
 		}
 	}
 
+	/* Set according to IOMMU IOVA caching limit */
+	max_sectors = min_t(size_t, queue_max_hw_sectors(sdev->request_queue),
+			    (PAGE_SIZE * 32) >> SECTOR_SHIFT);
+
+	blk_queue_max_hw_sectors(sdev->request_queue, max_sectors);
+
 	return 0;
 }
 
Signature · 1 line
2.35.1
author maintainer
#171 lore raw

PATCH 171/231 cpufreq: pmac32-cpufreq: Fix refcount leak bug

In reply to Greg Kroah-Hartman

From: Liang He <[email protected]>

[ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ]

In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name().

---
 drivers/cpufreq/pmac32-cpufreq.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/cpufreq/pmac32-cpufreq.c +4 -0
index 4f20c6a9108d..8e41fe9ee870 100644
@@ -470,6 +470,10 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
 	if (slew_done_gpio_np)
 		slew_done_gpio = read_gpio(slew_done_gpio_np);
 
+	of_node_put(volt_gpio_np);
+	of_node_put(freq_gpio_np);
+	of_node_put(slew_done_gpio_np);
+
 	/* If we use the frequency GPIOs, calculate the min/max speeds based
 	 * on the bus frequencies
 	 */
Signature · 1 line
2.35.1
author maintainer
#172 lore raw

PATCH 172/231 platform/x86: thinkpad-acpi: profile capabilities as integer

In reply to Greg Kroah-Hartman

From: Mark Pearson <[email protected]>

[ Upstream commit 42504af775361ca2330a2bfde496a5ebc5655c86 ]

Currently the active mode (PSC/MMC) is stored in an enum and queried throughout the driver.

Other driver changes will enumerate additional submodes that are relevant to be tracked, so instead track PSC/MMC in a single integer variable.

---
 drivers/platform/x86/thinkpad_acpi.c |   45 ++++++++++++++---------------------
 1 file changed, 18 insertions(+), 27 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +18 -27
@@ -10300,21 +10300,15 @@ static struct ibm_struct proxsensor_driv
 #define DYTC_DISABLE_CQL DYTC_SET_COMMAND(DYTC_FUNCTION_CQL, DYTC_MODE_MMC_BALANCE, 0)
 #define DYTC_ENABLE_CQL DYTC_SET_COMMAND(DYTC_FUNCTION_CQL, DYTC_MODE_MMC_BALANCE, 1)
 
-enum dytc_profile_funcmode {
-	DYTC_FUNCMODE_NONE = 0,
-	DYTC_FUNCMODE_MMC,
-	DYTC_FUNCMODE_PSC,
-};
-
-static enum dytc_profile_funcmode dytc_profile_available;
 static enum platform_profile_option dytc_current_profile;
 static atomic_t dytc_ignore_event = ATOMIC_INIT(0);
 static DEFINE_MUTEX(dytc_mutex);
+static int dytc_capabilities;
 static bool dytc_mmc_get_available;
 
 static int convert_dytc_to_profile(int dytcmode, enum platform_profile_option *profile)
 {
-	if (dytc_profile_available == DYTC_FUNCMODE_MMC) {
+	if (dytc_capabilities & BIT(DYTC_FC_MMC)) {
 		switch (dytcmode) {
 		case DYTC_MODE_MMC_LOWPOWER:
 			*profile = PLATFORM_PROFILE_LOW_POWER;
@@ -10331,7 +10325,7 @@ static int convert_dytc_to_profile(int d
 		}
 		return 0;
 	}
-	if (dytc_profile_available == DYTC_FUNCMODE_PSC) {
+	if (dytc_capabilities & BIT(DYTC_FC_PSC)) {
 		switch (dytcmode) {
 		case DYTC_MODE_PSC_LOWPOWER:
 			*profile = PLATFORM_PROFILE_LOW_POWER;
@@ -10353,21 +10347,21 @@ static int convert_profile_to_dytc(enum
 {
 	switch (profile) {
 	case PLATFORM_PROFILE_LOW_POWER:
-		if (dytc_profile_available == DYTC_FUNCMODE_MMC)
+		if (dytc_capabilities & BIT(DYTC_FC_MMC))
 			*perfmode = DYTC_MODE_MMC_LOWPOWER;
-		else if (dytc_profile_available == DYTC_FUNCMODE_PSC)
+		else if (dytc_capabilities & BIT(DYTC_FC_PSC))
 			*perfmode = DYTC_MODE_PSC_LOWPOWER;
 		break;
 	case PLATFORM_PROFILE_BALANCED:
-		if (dytc_profile_available == DYTC_FUNCMODE_MMC)
+		if (dytc_capabilities & BIT(DYTC_FC_MMC))
 			*perfmode = DYTC_MODE_MMC_BALANCE;
-		else if (dytc_profile_available == DYTC_FUNCMODE_PSC)
+		else if (dytc_capabilities & BIT(DYTC_FC_PSC))
 			*perfmode = DYTC_MODE_PSC_BALANCE;
 		break;
 	case PLATFORM_PROFILE_PERFORMANCE:
-		if (dytc_profile_available == DYTC_FUNCMODE_MMC)
+		if (dytc_capabilities & BIT(DYTC_FC_MMC))
 			*perfmode = DYTC_MODE_MMC_PERFORM;
-		else if (dytc_profile_available == DYTC_FUNCMODE_PSC)
+		else if (dytc_capabilities & BIT(DYTC_FC_PSC))
 			*perfmode = DYTC_MODE_PSC_PERFORM;
 		break;
 	default: /* Unknown profile */
@@ -10446,7 +10440,7 @@ static int dytc_profile_set(struct platf
 	if (err)
 		goto unlock;
 
-	if (dytc_profile_available == DYTC_FUNCMODE_MMC) {
+	if (dytc_capabilities & BIT(DYTC_FC_MMC)) {
 		if (profile == PLATFORM_PROFILE_BALANCED) {
 			/*
 			 * To get back to balanced mode we need to issue a reset command.
@@ -10465,7 +10459,7 @@ static int dytc_profile_set(struct platf
 				goto unlock;
 		}
 	}
-	if (dytc_profile_available == DYTC_FUNCMODE_PSC) {
+	if (dytc_capabilities & BIT(DYTC_FC_PSC)) {
 		err = dytc_command(DYTC_SET_COMMAND(DYTC_FUNCTION_PSC, perfmode, 1), &output);
 		if (err)
 			goto unlock;
@@ -10484,12 +10478,12 @@ static void dytc_profile_refresh(void)
 	int perfmode;
 
 	mutex_lock(&dytc_mutex);
-	if (dytc_profile_available == DYTC_FUNCMODE_MMC) {
+	if (dytc_capabilities & BIT(DYTC_FC_MMC)) {
 		if (dytc_mmc_get_available)
 			err = dytc_command(DYTC_CMD_MMC_GET, &output);
 		else
 			err = dytc_cql_command(DYTC_CMD_GET, &output);
-	} else if (dytc_profile_available == DYTC_FUNCMODE_PSC)
+	} else if (dytc_capabilities & BIT(DYTC_FC_PSC))
 		err = dytc_command(DYTC_CMD_GET, &output);
 
 	mutex_unlock(&dytc_mutex);
@@ -10518,7 +10512,6 @@ static int tpacpi_dytc_profile_init(stru
 	set_bit(PLATFORM_PROFILE_BALANCED, dytc_profile.choices);
 	set_bit(PLATFORM_PROFILE_PERFORMANCE, dytc_profile.choices);
 
-	dytc_profile_available = DYTC_FUNCMODE_NONE;
 	err = dytc_command(DYTC_CMD_QUERY, &output);
 	if (err)
 		return err;
@@ -10531,13 +10524,12 @@ static int tpacpi_dytc_profile_init(stru
 		return -ENODEV;
 
 	/* Check what capabilities are supported */
-	err = dytc_command(DYTC_CMD_FUNC_CAP, &output);
+	err = dytc_command(DYTC_CMD_FUNC_CAP, &dytc_capabilities);
 	if (err)
 		return err;
 
-	if (output & BIT(DYTC_FC_MMC)) { /* MMC MODE */
-		dytc_profile_available = DYTC_FUNCMODE_MMC;
-
+	if (dytc_capabilities & BIT(DYTC_FC_MMC)) { /* MMC MODE */
+		pr_debug("MMC is supported\n");
 		/*
 		 * Check if MMC_GET functionality available
 		 * Version > 6 and return success from MMC_GET command
@@ -10548,8 +10540,8 @@ static int tpacpi_dytc_profile_init(stru
 			if (!err && ((output & DYTC_ERR_MASK) == DYTC_ERR_SUCCESS))
 				dytc_mmc_get_available = true;
 		}
-	} else if (output & BIT(DYTC_FC_PSC)) { /* PSC MODE */
-		dytc_profile_available = DYTC_FUNCMODE_PSC;
+	} else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */
+		pr_debug("PSC is supported\n");
 	} else {
 		dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n");
 		return -ENODEV;
@@ -10575,7 +10567,6 @@ static int tpacpi_dytc_profile_init(stru
 
 static void dytc_profile_exit(void)
 {
-	dytc_profile_available = DYTC_FUNCMODE_NONE;
 	platform_profile_remove();
 }
 
author maintainer
#173 lore raw

PATCH 173/231 platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms

In reply to Greg Kroah-Hartman

From: Mark Pearson <[email protected]>

[ Upstream commit bce6243f767f7da88aa4674d5d678f9f156eaba9 ]

PSC platform profile mode is only supported on Linux for AMD platforms.

Some older Intel platforms (e.g T490) are advertising it's capability as Windows uses it - but on Linux we should only be using MMC profile for Intel systems.

Add a check to prevent it being enabled incorrectly.

---
 drivers/platform/x86/thinkpad_acpi.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/platform/x86/thinkpad_acpi.c +5 -0
@@ -10541,6 +10541,11 @@ static int tpacpi_dytc_profile_init(stru
 				dytc_mmc_get_available = true;
 		}
 	} else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */
+		/* Support for this only works on AMD platforms */
+		if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
+			dbg_printk(TPACPI_DBG_INIT, "PSC not support on Intel platforms\n");
+			return -ENODEV;
+		}
 		pr_debug("PSC is supported\n");
 	} else {
 		dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n");
author maintainer
#174 lore raw

PATCH 174/231 platform/x86: hp-wmi: Ignore Sanitization Mode event

In reply to Greg Kroah-Hartman

From: Kai-Heng Feng <[email protected]>

[ Upstream commit 9ab762a84b8094540c18a170e5ddd6488632c456 ]

After system resume the hp-wmi driver may complain:

[ 702.620180] hp_wmi: Unknown event_id - 23 - 0x0

According to HP it means 'Sanitization Mode' and it's harmless to just ignore the event.

---
 drivers/platform/x86/hp-wmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/platform/x86/hp-wmi.c +3 -0
index 0e6ed75c70f3..c63ec1471b84 100644
@@ -89,6 +89,7 @@ enum hp_wmi_event_ids {
 	HPWMI_BACKLIT_KB_BRIGHTNESS	= 0x0D,
 	HPWMI_PEAKSHIFT_PERIOD		= 0x0F,
 	HPWMI_BATTERY_CHARGE_PERIOD	= 0x10,
+	HPWMI_SANITIZATION_MODE		= 0x17,
 };
 
 /*
@@ -846,6 +847,8 @@ static void hp_wmi_notify(u32 value, void *context)
 		break;
 	case HPWMI_BATTERY_CHARGE_PERIOD:
 		break;
+	case HPWMI_SANITIZATION_MODE:
+		break;
 	default:
 		pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data);
 		break;
Signature · 1 line
2.35.1
author maintainer
#175 lore raw

PATCH 175/231 firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer

In reply to Greg Kroah-Hartman

From: Javier Martinez Canillas <[email protected]>

[ Upstream commit 9e121040e54abef9ed5542e5fdfa87911cd96204 ]

This function just returned 0 on success or an errno code on error, but it could be useful for sysfb_init() callers to have a pointer to the device.

---
 drivers/firmware/sysfb.c          |  4 ++--
 drivers/firmware/sysfb_simplefb.c | 16 ++++++++--------
 include/linux/sysfb.h             | 10 +++++-----
 3 files changed, 15 insertions(+), 15 deletions(-)
drivers/firmware/sysfb.c +2 -2
index 2bfbb05f7d89..b032f40a92de 100644
@@ -46,8 +46,8 @@ static __init int sysfb_init(void)
 	/* try to create a simple-framebuffer device */
 	compatible = sysfb_parse_mode(si, &mode);
 	if (compatible) {
-		ret = sysfb_create_simplefb(si, &mode);
-		if (!ret)
+		pd = sysfb_create_simplefb(si, &mode);
+		if (!IS_ERR(pd))
 			return 0;
 	}
 
drivers/firmware/sysfb_simplefb.c +8 -8
index bda8712bfd8c..a353e27f83f5 100644
@@ -57,8 +57,8 @@ __init bool sysfb_parse_mode(const struct screen_info *si,
 	return false;
 }
 
-__init int sysfb_create_simplefb(const struct screen_info *si,
-				 const struct simplefb_platform_data *mode)
+__init struct platform_device *sysfb_create_simplefb(const struct screen_info *si,
+						     const struct simplefb_platform_data *mode)
 {
 	struct platform_device *pd;
 	struct resource res;
@@ -76,7 +76,7 @@ __init int sysfb_create_simplefb(const struct screen_info *si,
 		base |= (u64)si->ext_lfb_base << 32;
 	if (!base || (u64)(resource_size_t)base != base) {
 		printk(KERN_DEBUG "sysfb: inaccessible VRAM base\n");
-		return -EINVAL;
+		return ERR_PTR(-EINVAL);
 	}
 
 	/*
@@ -93,7 +93,7 @@ __init int sysfb_create_simplefb(const struct screen_info *si,
 	length = mode->height * mode->stride;
 	if (length > size) {
 		printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n");
-		return -EINVAL;
+		return ERR_PTR(-EINVAL);
 	}
 	length = PAGE_ALIGN(length);
 
@@ -104,11 +104,11 @@ __init int sysfb_create_simplefb(const struct screen_info *si,
 	res.start = base;
 	res.end = res.start + length - 1;
 	if (res.end <= res.start)
-		return -EINVAL;
+		return ERR_PTR(-EINVAL);
 
 	pd = platform_device_alloc("simple-framebuffer", 0);
 	if (!pd)
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 
 	sysfb_apply_efi_quirks(pd);
 
@@ -124,10 +124,10 @@ __init int sysfb_create_simplefb(const struct screen_info *si,
 	if (ret)
 		goto err_put_device;
 
-	return 0;
+	return pd;
 
 err_put_device:
 	platform_device_put(pd);
 
-	return ret;
+	return ERR_PTR(ret);
 }
include/linux/sysfb.h +5 -5
index b0dcfa26d07b..708152e9037b 100644
@@ -72,8 +72,8 @@ static inline void sysfb_apply_efi_quirks(struct platform_device *pd)
 
 bool sysfb_parse_mode(const struct screen_info *si,
 		      struct simplefb_platform_data *mode);
-int sysfb_create_simplefb(const struct screen_info *si,
-			  const struct simplefb_platform_data *mode);
+struct platform_device *sysfb_create_simplefb(const struct screen_info *si,
+					      const struct simplefb_platform_data *mode);
 
 #else /* CONFIG_SYSFB_SIMPLE */
 
@@ -83,10 +83,10 @@ static inline bool sysfb_parse_mode(const struct screen_info *si,
 	return false;
 }
 
-static inline int sysfb_create_simplefb(const struct screen_info *si,
-					 const struct simplefb_platform_data *mode)
+static inline struct platform_device *sysfb_create_simplefb(const struct screen_info *si,
+							    const struct simplefb_platform_data *mode)
 {
-	return -EINVAL;
+	return ERR_PTR(-EINVAL);
 }
 
 #endif /* CONFIG_SYSFB_SIMPLE */
Signature · 1 line
2.35.1
author maintainer
#176 lore raw

PATCH 176/231 firmware: sysfb: Add sysfb_disable() helper function

In reply to Greg Kroah-Hartman

From: Javier Martinez Canillas <[email protected]>

[ Upstream commit bde376e9de3c0bc55eedc8956b0f114c05531595 ]

This can be used by subsystems to unregister a platform device registered by sysfb and also to disable future platform device registration in sysfb.

---
 .../driver-api/firmware/other_interfaces.rst  |  6 +++
 drivers/firmware/sysfb.c                      | 54 ++++++++++++++++---
 include/linux/sysfb.h                         | 12 +++++
 3 files changed, 66 insertions(+), 6 deletions(-)
Documentation/driver-api/firmware/other_interfaces.rst +6 -0
index b81794e0cfbb..06ac89adaafb 100644
@@ -13,6 +13,12 @@ EDD Interfaces
 .. kernel-doc:: drivers/firmware/edd.c
    :internal:
 
+Generic System Framebuffers Interface
+-------------------------------------
+
+.. kernel-doc:: drivers/firmware/sysfb.c
+   :export:
+
 Intel Stratix10 SoC Service Layer
 ---------------------------------
 Some features of the Intel Stratix10 SoC require a level of privilege
drivers/firmware/sysfb.c +48 -6

86 lines not on this page · raw message

include/linux/sysfb.h +12 -0
index 708152e9037b..8ba8b5be5567 100644
@@ -55,6 +55,18 @@ struct efifb_dmi_info {
 	int flags;
 };
 
+#ifdef CONFIG_SYSFB
+
+void sysfb_disable(void);
+
+#else /* CONFIG_SYSFB */
+
+static inline void sysfb_disable(void)
+{
+}
+
+#endif /* CONFIG_SYSFB */
+
 #ifdef CONFIG_EFI
 
 extern struct efifb_dmi_info efifb_dmi_list[];
Signature · 1 line
2.35.1
author maintainer
#177 lore raw

PATCH 177/231 fbdev: Disable sysfb device registration when removing conflicting FBs

In reply to Greg Kroah-Hartman

From: Javier Martinez Canillas <[email protected]>

[ Upstream commit ee7a69aa38d87a3bbced7b8245c732c05ed0c6ec ]

The platform devices registered by sysfb match with firmware-based DRM or fbdev drivers, that are used to have early graphics using a framebuffer provided by the system firmware.

DRM or fbdev drivers later are probed and remove conflicting framebuffers, leading to these platform devices for generic drivers to be unregistered.

But the current solution has a race, since the sysfb_init() function could be called after a DRM or fbdev driver is probed and request to unregister the devices for drivers with conflicting framebuffes.

To prevent this, disable any future sysfb platform device registration by calling sysfb_disable(), if a driver requests to remove the conflicting framebuffers.

---
 drivers/video/fbdev/core/fbmem.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/video/fbdev/core/fbmem.c +12 -0
@@ -19,6 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/slab.h>
+#include <linux/sysfb.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/vt.h>
@@ -1787,6 +1788,17 @@ int remove_conflicting_framebuffers(stru
 		do_free = true;
 	}
 
+	/*
+	 * If a driver asked to unregister a platform device registered by
+	 * sysfb, then can be assumed that this is a driver for a display
+	 * that is set up by the system firmware and has a generic driver.
+	 *
+	 * Drivers for devices that don't have a generic driver will never
+	 * ask for this, so let's assume that a real driver for the display
+	 * was already probed and prevent sysfb to register devices later.
+	 */
+	sysfb_disable();
+
 	mutex_lock(&registration_lock);
 	do_remove_conflicting_framebuffers(a, name, primary);
 	mutex_unlock(&registration_lock);
author maintainer
#178 lore raw

PATCH 178/231 net: tipc: fix possible refcount leak in tipc_sk_create()

In reply to Greg Kroah-Hartman

From: Hangyu Hua <[email protected]>

[ Upstream commit 00aff3590fc0a73bddd3b743863c14e76fd35c0c ]

Free sk in case tipc_sk_insert() fails.

---
 net/tipc/socket.c | 1 +
 1 file changed, 1 insertion(+)
net/tipc/socket.c +1 -0
index 17f8c523e33b..43509c7e90fc 100644
@@ -502,6 +502,7 @@ static int tipc_sk_create(struct net *net, struct socket *sock,
 	sock_init_data(sock, sk);
 	tipc_set_sk_state(sk, TIPC_OPEN);
 	if (tipc_sk_insert(tsk)) {
+		sk_free(sk);
 		pr_warn("Socket create failed; port number exhausted\n");
 		return -EINVAL;
 	}
Signature · 1 line
2.35.1
author maintainer
#179 lore raw

PATCH 179/231 NFC: nxp-nci: dont print header length mismatch on i2c error

In reply to Greg Kroah-Hartman

From: Michael Walle <[email protected]>

[ Upstream commit 9577fc5fdc8b07b891709af6453545db405e24ad ]

Don't print a misleading header length mismatch error if the i2c call returns an error. Instead just return the error code without any error message.

---
 drivers/nfc/nxp-nci/i2c.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/nfc/nxp-nci/i2c.c +6 -2
@@ -122,7 +122,9 @@ static int nxp_nci_i2c_fw_read(struct nx
 	skb_put_data(*skb, &header, NXP_NCI_FW_HDR_LEN);
 
 	r = i2c_master_recv(client, skb_put(*skb, frame_len), frame_len);
-	if (r != frame_len) {
+	if (r < 0) {
+		goto fw_read_exit_free_skb;
+	} else if (r != frame_len) {
 		nfc_err(&client->dev,
 			"Invalid frame length: %u (expected %zu)\n",
 			r, frame_len);
@@ -166,7 +168,9 @@ static int nxp_nci_i2c_nci_read(struct n
 		return 0;
 
 	r = i2c_master_recv(client, skb_put(*skb, header.plen), header.plen);
-	if (r != header.plen) {
+	if (r < 0) {
+		goto nci_read_exit_free_skb;
+	} else if (r != header.plen) {
 		nfc_err(&client->dev,
 			"Invalid frame payload length: %u (expected %u)\n",
 			r, header.plen);
author maintainer
#180 lore raw

PATCH 180/231 nvme-tcp: always fail a request when sending it failed

In reply to Greg Kroah-Hartman

From: Sagi Grimberg <[email protected]>

[ Upstream commit 41d07df7de841bfbc32725ce21d933ad358f2844 ]

queue stoppage and inflight requests cancellation is fully fenced from io_work and thus failing a request from this context. Hence we don't need to try to guess from the socket retcode if this failure is because the queue is about to be torn down or not.

We are perfectly safe to just fail it, the request will not be cancelled later on.

This solves possible very long shutdown delays when the users issues a 'nvme disconnect-all'

---
 drivers/nvme/host/tcp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/nvme/host/tcp.c +1 -2
index ad3a2bf2f1e9..e44d0570e694 100644
@@ -1180,8 +1180,7 @@ static int nvme_tcp_try_send(struct nvme_tcp_queue *queue)
 	} else if (ret < 0) {
 		dev_err(queue->ctrl->ctrl.device,
 			"failed to send request %d\n", ret);
-		if (ret != -EPIPE && ret != -ECONNRESET)
-			nvme_tcp_fail_request(queue->request);
+		nvme_tcp_fail_request(queue->request);
 		nvme_tcp_done_send_req(queue);
 	}
 	return ret;
Signature · 1 line
2.35.1
author maintainer
#181 lore raw

PATCH 181/231 nvme: fix regression when disconnect a recovering ctrl

In reply to Greg Kroah-Hartman

From: Ruozhu Li <[email protected]>

[ Upstream commit f7f70f4aa09dc43d7455c060143e86a017c30548 ]

We encountered a problem that the disconnect command hangs. After analyzing the log and stack, we found that the triggering process is as follows:
CPU0 CPU1
nvme_rdma_error_recovery_work
nvme_rdma_teardown_io_queues
nvme_do_delete_ctrl nvme_stop_queues
nvme_remove_namespaces
--clear ctrl->namespaces
nvme_start_queues --no ns in ctrl->namespaces
nvme_ns_remove return(because ctrl is deleting)
blk_freeze_queue
blk_mq_freeze_queue_wait
--wait for ns to unquiesce to clean infligt IO, hang forever

This problem was not found in older kernels because we will flush err work in nvme_stop_ctrl before nvme_remove_namespaces.It does not seem to be modified for functional reasons, the patch can be revert to solve the problem.

Revert commit 794a4cb3d2f7 ("nvme: remove the .stop_ctrl callout")

---
 drivers/nvme/host/core.c |  2 ++
 drivers/nvme/host/nvme.h |  1 +
 drivers/nvme/host/rdma.c | 12 +++++++++---
 drivers/nvme/host/tcp.c  | 10 +++++++---
 4 files changed, 19 insertions(+), 6 deletions(-)
drivers/nvme/host/core.c +2 -0
index 0fef31c935de..c9831daafbc6 100644
@@ -4519,6 +4519,8 @@ void nvme_stop_ctrl(struct nvme_ctrl *ctrl)
 	nvme_stop_failfast_work(ctrl);
 	flush_work(&ctrl->async_event_work);
 	cancel_work_sync(&ctrl->fw_act_work);
+	if (ctrl->ops->stop_ctrl)
+		ctrl->ops->stop_ctrl(ctrl);
 }
 EXPORT_SYMBOL_GPL(nvme_stop_ctrl);
 
drivers/nvme/host/nvme.h +1 -0
index a2b53ca63335..337ae1e3ad25 100644
@@ -501,6 +501,7 @@ struct nvme_ctrl_ops {
 	void (*free_ctrl)(struct nvme_ctrl *ctrl);
 	void (*submit_async_event)(struct nvme_ctrl *ctrl);
 	void (*delete_ctrl)(struct nvme_ctrl *ctrl);
+	void (*stop_ctrl)(struct nvme_ctrl *ctrl);
 	int (*get_address)(struct nvme_ctrl *ctrl, char *buf, int size);
 };
 
drivers/nvme/host/rdma.c +9 -3
index d9f19d901313..5aef2b81dbec 100644
@@ -1048,6 +1048,14 @@ static void nvme_rdma_teardown_io_queues(struct nvme_rdma_ctrl *ctrl,
 	}
 }
 
+static void nvme_rdma_stop_ctrl(struct nvme_ctrl *nctrl)
+{
+	struct nvme_rdma_ctrl *ctrl = to_rdma_ctrl(nctrl);
+
+	cancel_work_sync(&ctrl->err_work);
+	cancel_delayed_work_sync(&ctrl->reconnect_work);
+}
+
 static void nvme_rdma_free_ctrl(struct nvme_ctrl *nctrl)
 {
 	struct nvme_rdma_ctrl *ctrl = to_rdma_ctrl(nctrl);
@@ -2255,9 +2263,6 @@ static const struct blk_mq_ops nvme_rdma_admin_mq_ops = {
 
 static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown)
 {
-	cancel_work_sync(&ctrl->err_work);
-	cancel_delayed_work_sync(&ctrl->reconnect_work);
-
 	nvme_rdma_teardown_io_queues(ctrl, shutdown);
 	nvme_stop_admin_queue(&ctrl->ctrl);
 	if (shutdown)
@@ -2307,6 +2312,7 @@ static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {
 	.submit_async_event	= nvme_rdma_submit_async_event,
 	.delete_ctrl		= nvme_rdma_delete_ctrl,
 	.get_address		= nvmf_get_address,
+	.stop_ctrl		= nvme_rdma_stop_ctrl,
 };
 
 /*
drivers/nvme/host/tcp.c +7 -3
index e44d0570e694..1fb4f9b1621e 100644
@@ -2193,9 +2193,6 @@ static void nvme_tcp_error_recovery_work(struct work_struct *work)
 
 static void nvme_tcp_teardown_ctrl(struct nvme_ctrl *ctrl, bool shutdown)
 {
-	cancel_work_sync(&to_tcp_ctrl(ctrl)->err_work);
-	cancel_delayed_work_sync(&to_tcp_ctrl(ctrl)->connect_work);
-
 	nvme_tcp_teardown_io_queues(ctrl, shutdown);
 	nvme_stop_admin_queue(ctrl);
 	if (shutdown)
@@ -2235,6 +2232,12 @@ static void nvme_reset_ctrl_work(struct work_struct *work)
 	nvme_tcp_reconnect_or_remove(ctrl);
 }
 
+static void nvme_tcp_stop_ctrl(struct nvme_ctrl *ctrl)
+{
+	cancel_work_sync(&to_tcp_ctrl(ctrl)->err_work);
+	cancel_delayed_work_sync(&to_tcp_ctrl(ctrl)->connect_work);
+}
+
 static void nvme_tcp_free_ctrl(struct nvme_ctrl *nctrl)
 {
 	struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
@@ -2559,6 +2562,7 @@ static const struct nvme_ctrl_ops nvme_tcp_ctrl_ops = {
 	.submit_async_event	= nvme_tcp_submit_async_event,
 	.delete_ctrl		= nvme_tcp_delete_ctrl,
 	.get_address		= nvmf_get_address,
+	.stop_ctrl		= nvme_tcp_stop_ctrl,
 };
 
 static bool
Signature · 1 line
2.35.1
author maintainer
#182 lore raw

PATCH 182/231 net: sfp: fix memory leak in sfp_probe()

In reply to Greg Kroah-Hartman

From: Jianglei Nie <[email protected]>

[ Upstream commit 0a18d802d65cf662644fd1d369c86d84a5630652 ]

sfp_probe() allocates a memory chunk from sfp with sfp_alloc(). When devm_add_action() fails, sfp is not freed, which leads to a memory leak.

We should use devm_add_action_or_reset() instead of devm_add_action().

---
 drivers/net/phy/sfp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/sfp.c +1 -1
index 9a5d5a10560f..e7b0e12cc75b 100644
@@ -2516,7 +2516,7 @@ static int sfp_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, sfp);
 
-	err = devm_add_action(sfp->dev, sfp_cleanup, sfp);
+	err = devm_add_action_or_reset(sfp->dev, sfp_cleanup, sfp);
 	if (err < 0)
 		return err;
 
Signature · 1 line
2.35.1
author maintainer
#183 lore raw

PATCH 183/231 ASoC: ops: Fix off by one in range control validation

In reply to Greg Kroah-Hartman

From: Mark Brown <[email protected]>

[ Upstream commit 5871321fb4558c55bf9567052b618ff0be6b975e ]

We currently report that range controls accept a range of 0..(max-min) but accept writes in the range 0..(max-min+1). Remove that extra +1.

---
 sound/soc/soc-ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-ops.c +2 -2
index e693070f51fe..d867f449d82d 100644
@@ -526,7 +526,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
 		return -EINVAL;
 	if (mc->platform_max && tmp > mc->platform_max)
 		return -EINVAL;
-	if (tmp > mc->max - mc->min + 1)
+	if (tmp > mc->max - mc->min)
 		return -EINVAL;
 
 	if (invert)
@@ -547,7 +547,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
 			return -EINVAL;
 		if (mc->platform_max && tmp > mc->platform_max)
 			return -EINVAL;
-		if (tmp > mc->max - mc->min + 1)
+		if (tmp > mc->max - mc->min)
 			return -EINVAL;
 
 		if (invert)
Signature · 1 line
2.35.1
author maintainer
#184 lore raw

PATCH 184/231 pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux()

In reply to Greg Kroah-Hartman

From: Haowen Bai <[email protected]>

[ Upstream commit 84a85d3fef2e75b1fe9fc2af6f5267122555a1ed ]

pdesc could be null but still dereference pdesc->name and it will lead to a null pointer access. So we move a null check before dereference.

---
 drivers/pinctrl/aspeed/pinctrl-aspeed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/aspeed/pinctrl-aspeed.c +2 -2
index c94e24aadf92..83d47ff1cea8 100644
@@ -236,11 +236,11 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,
 		const struct aspeed_sig_expr **funcs;
 		const struct aspeed_sig_expr ***prios;
 
-		pr_debug("Muxing pin %s for %s\n", pdesc->name, pfunc->name);
-
 		if (!pdesc)
 			return -EINVAL;
 
+		pr_debug("Muxing pin %s for %s\n", pdesc->name, pfunc->name);
+
 		prios = pdesc->prios;
 
 		if (!prios)
Signature · 1 line
2.35.1
author maintainer
#185 lore raw

PATCH 185/231 ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove

In reply to Greg Kroah-Hartman

From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit ac63716da3070f8cb6baaba3a058a0c7f22aeb5b ]

When binding/unbinding codec drivers, the following warnings are thrown:

[ 107.266879] rt715-sdca sdw:3:025d:0714:01: Unbalanced pm_runtime_enable!
[  306.879700] rt711-sdca sdw:0:025d:0711:01: Unbalanced pm_runtime_enable!

Add a remove callback for all Realtek/Maxim SoundWire codecs and remove this warning.

---
 sound/soc/codecs/max98373-sdw.c   | 12 +++++++++++-
 sound/soc/codecs/rt1308-sdw.c     | 11 +++++++++++
 sound/soc/codecs/rt1316-sdw.c     | 11 +++++++++++
 sound/soc/codecs/rt5682-sdw.c     |  5 ++++-
 sound/soc/codecs/rt700-sdw.c      |  6 +++++-
 sound/soc/codecs/rt711-sdca-sdw.c |  6 +++++-
 sound/soc/codecs/rt711-sdw.c      |  6 +++++-
 sound/soc/codecs/rt715-sdca-sdw.c | 12 ++++++++++++
 sound/soc/codecs/rt715-sdw.c      | 12 ++++++++++++
 9 files changed, 76 insertions(+), 5 deletions(-)
sound/soc/codecs/max98373-sdw.c +11 -1
index f47e956d4f55..97b64477dde6 100644
@@ -862,6 +862,16 @@ static int max98373_sdw_probe(struct sdw_slave *slave,
 	return max98373_init(slave, regmap);
 }
 
+static int max98373_sdw_remove(struct sdw_slave *slave)
+{
+	struct max98373_priv *max98373 = dev_get_drvdata(&slave->dev);
+
+	if (max98373->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
+	return 0;
+}
+
 #if defined(CONFIG_OF)
 static const struct of_device_id max98373_of_match[] = {
 	{ .compatible = "maxim,max98373", },
@@ -893,7 +903,7 @@ static struct sdw_driver max98373_sdw_driver = {
 		.pm = &max98373_pm,
 	},
 	.probe = max98373_sdw_probe,
-	.remove = NULL,
+	.remove = max98373_sdw_remove,
 	.ops = &max98373_slave_ops,
 	.id_table = max98373_id,
 };
sound/soc/codecs/rt1308-sdw.c +11 -0
index 1ef836a68a56..e42a63ee07f4 100644
@@ -690,6 +690,16 @@ static int rt1308_sdw_probe(struct sdw_slave *slave,
 	return 0;
 }
 
+static int rt1308_sdw_remove(struct sdw_slave *slave)
+{
+	struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(&slave->dev);
+
+	if (rt1308->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
+	return 0;
+}
+
 static const struct sdw_device_id rt1308_id[] = {
 	SDW_SLAVE_ENTRY_EXT(0x025d, 0x1308, 0x2, 0, 0),
 	{},
@@ -749,6 +759,7 @@ static struct sdw_driver rt1308_sdw_driver = {
 		.pm = &rt1308_pm,
 	},
 	.probe = rt1308_sdw_probe,
+	.remove = rt1308_sdw_remove,
 	.ops = &rt1308_slave_ops,
 	.id_table = rt1308_id,
 };
sound/soc/codecs/rt1316-sdw.c +11 -0
index c66d7b20cb4d..1e04aa8ab166 100644
@@ -675,6 +675,16 @@ static int rt1316_sdw_probe(struct sdw_slave *slave,
 	return rt1316_sdw_init(&slave->dev, regmap, slave);
 }
 
+static int rt1316_sdw_remove(struct sdw_slave *slave)
+{
+	struct rt1316_sdw_priv *rt1316 = dev_get_drvdata(&slave->dev);
+
+	if (rt1316->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
+	return 0;
+}
+
 static const struct sdw_device_id rt1316_id[] = {
 	SDW_SLAVE_ENTRY_EXT(0x025d, 0x1316, 0x3, 0x1, 0),
 	{},
@@ -734,6 +744,7 @@ static struct sdw_driver rt1316_sdw_driver = {
 		.pm = &rt1316_pm,
 	},
 	.probe = rt1316_sdw_probe,
+	.remove = rt1316_sdw_remove,
 	.ops = &rt1316_slave_ops,
 	.id_table = rt1316_id,
 };
sound/soc/codecs/rt5682-sdw.c +4 -1
index 248257a2e4e0..f04e18c32489 100644
@@ -719,9 +719,12 @@ static int rt5682_sdw_remove(struct sdw_slave *slave)
 {
 	struct rt5682_priv *rt5682 = dev_get_drvdata(&slave->dev);
 
-	if (rt5682 && rt5682->hw_init)
+	if (rt5682->hw_init)
 		cancel_delayed_work_sync(&rt5682->jack_detect_work);
 
+	if (rt5682->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
 	return 0;
 }
 
sound/soc/codecs/rt700-sdw.c +5 -1
index bda594899664..f7439e40ca8b 100644
@@ -13,6 +13,7 @@
 #include <linux/soundwire/sdw_type.h>
 #include <linux/soundwire/sdw_registers.h>
 #include <linux/module.h>
+#include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <sound/soc.h>
 #include "rt700.h"
@@ -463,11 +464,14 @@ static int rt700_sdw_remove(struct sdw_slave *slave)
 {
 	struct rt700_priv *rt700 = dev_get_drvdata(&slave->dev);
 
-	if (rt700 && rt700->hw_init) {
+	if (rt700->hw_init) {
 		cancel_delayed_work_sync(&rt700->jack_detect_work);
 		cancel_delayed_work_sync(&rt700->jack_btn_check_work);
 	}
 
+	if (rt700->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
 	return 0;
 }
 
sound/soc/codecs/rt711-sdca-sdw.c +5 -1
index aaf5af153d3f..c722a2b0041f 100644
@@ -11,6 +11,7 @@
 #include <linux/mod_devicetable.h>
 #include <linux/soundwire/sdw_registers.h>
 #include <linux/module.h>
+#include <linux/pm_runtime.h>
 
 #include "rt711-sdca.h"
 #include "rt711-sdca-sdw.h"
@@ -364,11 +365,14 @@ static int rt711_sdca_sdw_remove(struct sdw_slave *slave)
 {
 	struct rt711_sdca_priv *rt711 = dev_get_drvdata(&slave->dev);
 
-	if (rt711 && rt711->hw_init) {
+	if (rt711->hw_init) {
 		cancel_delayed_work_sync(&rt711->jack_detect_work);
 		cancel_delayed_work_sync(&rt711->jack_btn_check_work);
 	}
 
+	if (rt711->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
 	return 0;
 }
 
sound/soc/codecs/rt711-sdw.c +5 -1
index bda2cc9439c9..f49c94baa37c 100644
@@ -13,6 +13,7 @@
 #include <linux/soundwire/sdw_type.h>
 #include <linux/soundwire/sdw_registers.h>
 #include <linux/module.h>
+#include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <sound/soc.h>
 #include "rt711.h"
@@ -464,12 +465,15 @@ static int rt711_sdw_remove(struct sdw_slave *slave)
 {
 	struct rt711_priv *rt711 = dev_get_drvdata(&slave->dev);
 
-	if (rt711 && rt711->hw_init) {
+	if (rt711->hw_init) {
 		cancel_delayed_work_sync(&rt711->jack_detect_work);
 		cancel_delayed_work_sync(&rt711->jack_btn_check_work);
 		cancel_work_sync(&rt711->calibration_work);
 	}
 
+	if (rt711->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
 	return 0;
 }
 
sound/soc/codecs/rt715-sdca-sdw.c +12 -0
index a5c673f43d82..0f4354eafef2 100644
@@ -13,6 +13,7 @@
 #include <linux/soundwire/sdw_type.h>
 #include <linux/soundwire/sdw_registers.h>
 #include <linux/module.h>
+#include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <sound/soc.h>
 #include "rt715-sdca.h"
@@ -195,6 +196,16 @@ static int rt715_sdca_sdw_probe(struct sdw_slave *slave,
 	return rt715_sdca_init(&slave->dev, mbq_regmap, regmap, slave);
 }
 
+static int rt715_sdca_sdw_remove(struct sdw_slave *slave)
+{
+	struct rt715_sdca_priv *rt715 = dev_get_drvdata(&slave->dev);
+
+	if (rt715->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
+	return 0;
+}
+
 static const struct sdw_device_id rt715_sdca_id[] = {
 	SDW_SLAVE_ENTRY_EXT(0x025d, 0x715, 0x3, 0x1, 0),
 	SDW_SLAVE_ENTRY_EXT(0x025d, 0x714, 0x3, 0x1, 0),
@@ -269,6 +280,7 @@ static struct sdw_driver rt715_sdw_driver = {
 		.pm = &rt715_pm,
 	},
 	.probe = rt715_sdca_sdw_probe,
+	.remove = rt715_sdca_sdw_remove,
 	.ops = &rt715_sdca_slave_ops,
 	.id_table = rt715_sdca_id,
 };
sound/soc/codecs/rt715-sdw.c +12 -0
index a7b21b03c08b..b047bf87a100 100644
@@ -14,6 +14,7 @@
 #include <linux/soundwire/sdw_type.h>
 #include <linux/soundwire/sdw_registers.h>
 #include <linux/module.h>
+#include <linux/pm_runtime.h>
 #include <linux/of.h>
 #include <linux/regmap.h>
 #include <sound/soc.h>
@@ -514,6 +515,16 @@ static int rt715_sdw_probe(struct sdw_slave *slave,
 	return 0;
 }
 
+static int rt715_sdw_remove(struct sdw_slave *slave)
+{
+	struct rt715_priv *rt715 = dev_get_drvdata(&slave->dev);
+
+	if (rt715->first_hw_init)
+		pm_runtime_disable(&slave->dev);
+
+	return 0;
+}
+
 static const struct sdw_device_id rt715_id[] = {
 	SDW_SLAVE_ENTRY_EXT(0x025d, 0x714, 0x2, 0, 0),
 	SDW_SLAVE_ENTRY_EXT(0x025d, 0x715, 0x2, 0, 0),
@@ -575,6 +586,7 @@ static struct sdw_driver rt715_sdw_driver = {
 		   .pm = &rt715_pm,
 		   },
 	.probe = rt715_sdw_probe,
+	.remove = rt715_sdw_remove,
 	.ops = &rt715_slave_ops,
 	.id_table = rt715_id,
 };
Signature · 1 line
2.35.1
author maintainer
#186 lore raw

PATCH 186/231 ASoC: rt711-sdca-sdw: fix calibrate mutex initialization

In reply to Greg Kroah-Hartman

From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit ed0a7fb29c9fd4f53eeb37d1fe2354df7a038047 ]

In codec driver bind/unbind test, the following warning is thrown:

DEBUG_LOCKS_WARN_ON(lock->magic != lock)
...

[  699.182495]  rt711_sdca_jack_init+0x1b/0x1d0 [snd_soc_rt711_sdca]
[  699.182498]  rt711_sdca_set_jack_detect+0x3b/0x90 [snd_soc_rt711_sdca]
[  699.182500]  snd_soc_component_set_jack+0x24/0x50 [snd_soc_core]

A quick check in the code shows that the 'calibrate_mutex' used by this driver are not initialized at probe time. Moving the initialization to the probe removes the issue.

---
 sound/soc/codecs/rt711-sdca-sdw.c |    3 +++
 sound/soc/codecs/rt711-sdca.c     |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/rt711-sdca-sdw.c +3 -0
@@ -373,6 +373,9 @@ static int rt711_sdca_sdw_remove(struct
 	if (rt711->first_hw_init)
 		pm_runtime_disable(&slave->dev);
 
+	mutex_destroy(&rt711->calibrate_mutex);
+	mutex_destroy(&rt711->disable_irq_lock);
+
 	return 0;
 }
 
sound/soc/codecs/rt711-sdca.c +1 -1
@@ -1414,6 +1414,7 @@ int rt711_sdca_init(struct device *dev,
 	rt711->regmap = regmap;
 	rt711->mbq_regmap = mbq_regmap;
 
+	mutex_init(&rt711->calibrate_mutex);
 	mutex_init(&rt711->disable_irq_lock);
 
 	/*
@@ -1552,7 +1553,6 @@ int rt711_sdca_io_init(struct device *de
 			rt711_sdca_jack_detect_handler);
 		INIT_DELAYED_WORK(&rt711->jack_btn_check_work,
 			rt711_sdca_btn_check_handler);
-		mutex_init(&rt711->calibrate_mutex);
 	}
 
 	/* calibration */
author maintainer
#187 lore raw

PATCH 187/231 ASoC: Intel: sof_sdw: handle errors on card registration

In reply to Greg Kroah-Hartman

From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit fe154c4ff376bc31041c6441958a08243df09c99 ]

If the card registration fails, typically because of deferred probes, the device properties added for headset codecs are not removed, which leads to kernel oopses in driver bind/unbind tests.

We already clean-up the device properties when the card is removed, this code can be moved as a helper and called upon card registration errors.

---
 sound/soc/intel/boards/sof_sdw.c | 51 ++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 22 deletions(-)
sound/soc/intel/boards/sof_sdw.c +29 -22
index 1f00679b4240..ad826ad82d51 100644
@@ -1398,6 +1398,33 @@ static struct snd_soc_card card_sof_sdw = {
 	.late_probe = sof_sdw_card_late_probe,
 };
 
+static void mc_dailink_exit_loop(struct snd_soc_card *card)
+{
+	struct snd_soc_dai_link *link;
+	int ret;
+	int i, j;
+
+	for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) {
+		if (!codec_info_list[i].exit)
+			continue;
+		/*
+		 * We don't need to call .exit function if there is no matched
+		 * dai link found.
+		 */
+		for_each_card_prelinks(card, j, link) {
+			if (!strcmp(link->codecs[0].dai_name,
+				    codec_info_list[i].dai_name)) {
+				ret = codec_info_list[i].exit(card, link);
+				if (ret)
+					dev_warn(card->dev,
+						 "codec exit failed %d\n",
+						 ret);
+				break;
+			}
+		}
+	}
+}
+
 static int mc_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = &card_sof_sdw;
@@ -1462,6 +1489,7 @@ static int mc_probe(struct platform_device *pdev)
 	ret = devm_snd_soc_register_card(&pdev->dev, card);
 	if (ret) {
 		dev_err(card->dev, "snd_soc_register_card failed %d\n", ret);
+		mc_dailink_exit_loop(card);
 		return ret;
 	}
 
@@ -1473,29 +1501,8 @@ static int mc_probe(struct platform_device *pdev)
 static int mc_remove(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = platform_get_drvdata(pdev);
-	struct snd_soc_dai_link *link;
-	int ret;
-	int i, j;
 
-	for (i = 0; i < ARRAY_SIZE(codec_info_list); i++) {
-		if (!codec_info_list[i].exit)
-			continue;
-		/*
-		 * We don't need to call .exit function if there is no matched
-		 * dai link found.
-		 */
-		for_each_card_prelinks(card, j, link) {
-			if (!strcmp(link->codecs[0].dai_name,
-				    codec_info_list[i].dai_name)) {
-				ret = codec_info_list[i].exit(card, link);
-				if (ret)
-					dev_warn(&pdev->dev,
-						 "codec exit failed %d\n",
-						 ret);
-				break;
-			}
-		}
-	}
+	mc_dailink_exit_loop(card);
 
 	return 0;
 }
Signature · 1 line
2.35.1
author maintainer
#188 lore raw

PATCH 188/231 ASoC: rt711: fix calibrate mutex initialization

In reply to Greg Kroah-Hartman

From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit 08bb5dc6ce02374169213cea772b1c297eaf32d5 ]

Follow the same flow as rt711-sdca and initialize all mutexes at probe time.

---
 sound/soc/codecs/rt711-sdw.c |    3 +++
 sound/soc/codecs/rt711.c     |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/rt711-sdw.c +3 -0
@@ -474,6 +474,9 @@ static int rt711_sdw_remove(struct sdw_s
 	if (rt711->first_hw_init)
 		pm_runtime_disable(&slave->dev);
 
+	mutex_destroy(&rt711->calibrate_mutex);
+	mutex_destroy(&rt711->disable_irq_lock);
+
 	return 0;
 }
 
sound/soc/codecs/rt711.c +1 -1
@@ -1206,6 +1206,7 @@ int rt711_init(struct device *dev, struc
 	rt711->sdw_regmap = sdw_regmap;
 	rt711->regmap = regmap;
 
+	mutex_init(&rt711->calibrate_mutex);
 	mutex_init(&rt711->disable_irq_lock);
 
 	/*
@@ -1320,7 +1321,6 @@ int rt711_io_init(struct device *dev, st
 			rt711_jack_detect_handler);
 		INIT_DELAYED_WORK(&rt711->jack_btn_check_work,
 			rt711_btn_check_handler);
-		mutex_init(&rt711->calibrate_mutex);
 		INIT_WORK(&rt711->calibration_work, rt711_calibration_work);
 		schedule_work(&rt711->calibration_work);
 	}
author maintainer
#189 lore raw

PATCH 189/231 ASoC: rt7*-sdw: harden jack_detect_handler

In reply to Greg Kroah-Hartman

From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit 0484271ab0ce50649329fa9dc23c50853c5b26a4 ]

Realtek headset codec drivers typically check if the card is instantiated before proceeding with the jack detection.

The rt700, rt711 and rt711-sdca are however missing a check on the card pointer, which can lead to NULL dereferences encountered in driver bind/unbind tests.

---
 sound/soc/codecs/rt700.c      | 2 +-
 sound/soc/codecs/rt711-sdca.c | 2 +-
 sound/soc/codecs/rt711.c      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/rt700.c +1 -1
index 360d61a36c35..b16fbde02986 100644
@@ -162,7 +162,7 @@ static void rt700_jack_detect_handler(struct work_struct *work)
 	if (!rt700->hs_jack)
 		return;
 
-	if (!rt700->component->card->instantiated)
+	if (!rt700->component->card || !rt700->component->card->instantiated)
 		return;
 
 	reg = RT700_VERB_GET_PIN_SENSE | RT700_HP_OUT;
sound/soc/codecs/rt711-sdca.c +1 -1
index 8a0b74d3fa9e..83e4c4e4d1e2 100644
@@ -294,7 +294,7 @@ static void rt711_sdca_jack_detect_handler(struct work_struct *work)
 	if (!rt711->hs_jack)
 		return;
 
-	if (!rt711->component->card->instantiated)
+	if (!rt711->component->card || !rt711->component->card->instantiated)
 		return;
 
 	/* SDW_SCP_SDCA_INT_SDCA_0 is used for jack detection */
sound/soc/codecs/rt711.c +1 -1
index db70d8073c0b..18a0de77c477 100644
@@ -242,7 +242,7 @@ static void rt711_jack_detect_handler(struct work_struct *work)
 	if (!rt711->hs_jack)
 		return;
 
-	if (!rt711->component->card->instantiated)
+	if (!rt711->component->card || !rt711->component->card->instantiated)
 		return;
 
 	if (pm_runtime_status_suspended(rt711->slave->dev.parent)) {
Signature · 1 line
2.35.1
author maintainer
#190 lore raw

PATCH 190/231 ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe

In reply to Greg Kroah-Hartman

From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit ba98d7d8b60ba410aa03834f6aa48fd3b2e68478 ]

The workqueues are initialized in the io_init functions, which isn't quite right. In some tests, this leads to warnings throw from __queue_delayed_work()

WARN_ON_FUNCTION_MISMATCH(timer->function, delayed_work_timer_fn);

Move all the initializations to the probe functions.

---
 sound/soc/codecs/rt700.c      |   12 +++++-------
 sound/soc/codecs/rt711-sdca.c |   10 +++-------
 sound/soc/codecs/rt711.c      |   12 +++++-------
 3 files changed, 13 insertions(+), 21 deletions(-)
sound/soc/codecs/rt700.c +5 -7
@@ -1124,6 +1124,11 @@ int rt700_init(struct device *dev, struc
 
 	mutex_init(&rt700->disable_irq_lock);
 
+	INIT_DELAYED_WORK(&rt700->jack_detect_work,
+			  rt700_jack_detect_handler);
+	INIT_DELAYED_WORK(&rt700->jack_btn_check_work,
+			  rt700_btn_check_handler);
+
 	/*
 	 * Mark hw_init to false
 	 * HW init will be performed when device reports present
@@ -1218,13 +1223,6 @@ int rt700_io_init(struct device *dev, st
 	/* Finish Initial Settings, set power to D3 */
 	regmap_write(rt700->regmap, RT700_SET_AUDIO_POWER_STATE, AC_PWRST_D3);
 
-	if (!rt700->first_hw_init) {
-		INIT_DELAYED_WORK(&rt700->jack_detect_work,
-			rt700_jack_detect_handler);
-		INIT_DELAYED_WORK(&rt700->jack_btn_check_work,
-			rt700_btn_check_handler);
-	}
-
 	/*
 	 * if set_jack callback occurred early than io_init,
 	 * we set up the jack detection function now
sound/soc/codecs/rt711-sdca.c +3 -7
@@ -1417,6 +1417,9 @@ int rt711_sdca_init(struct device *dev,
 	mutex_init(&rt711->calibrate_mutex);
 	mutex_init(&rt711->disable_irq_lock);
 
+	INIT_DELAYED_WORK(&rt711->jack_detect_work, rt711_sdca_jack_detect_handler);
+	INIT_DELAYED_WORK(&rt711->jack_btn_check_work, rt711_sdca_btn_check_handler);
+
 	/*
 	 * Mark hw_init to false
 	 * HW init will be performed when device reports present
@@ -1548,13 +1551,6 @@ int rt711_sdca_io_init(struct device *de
 	rt711_sdca_index_update_bits(rt711, RT711_VENDOR_HDA_CTL,
 		RT711_PUSH_BTN_INT_CTL0, 0x20, 0x00);
 
-	if (!rt711->first_hw_init) {
-		INIT_DELAYED_WORK(&rt711->jack_detect_work,
-			rt711_sdca_jack_detect_handler);
-		INIT_DELAYED_WORK(&rt711->jack_btn_check_work,
-			rt711_sdca_btn_check_handler);
-	}
-
 	/* calibration */
 	ret = rt711_sdca_calibration(rt711);
 	if (ret < 0)
sound/soc/codecs/rt711.c +5 -7
@@ -1209,6 +1209,10 @@ int rt711_init(struct device *dev, struc
 	mutex_init(&rt711->calibrate_mutex);
 	mutex_init(&rt711->disable_irq_lock);
 
+	INIT_DELAYED_WORK(&rt711->jack_detect_work, rt711_jack_detect_handler);
+	INIT_DELAYED_WORK(&rt711->jack_btn_check_work, rt711_btn_check_handler);
+	INIT_WORK(&rt711->calibration_work, rt711_calibration_work);
+
 	/*
 	 * Mark hw_init to false
 	 * HW init will be performed when device reports present
@@ -1316,14 +1320,8 @@ int rt711_io_init(struct device *dev, st
 
 	if (rt711->first_hw_init)
 		rt711_calibration(rt711);
-	else {
-		INIT_DELAYED_WORK(&rt711->jack_detect_work,
-			rt711_jack_detect_handler);
-		INIT_DELAYED_WORK(&rt711->jack_btn_check_work,
-			rt711_btn_check_handler);
-		INIT_WORK(&rt711->calibration_work, rt711_calibration_work);
+	else
 		schedule_work(&rt711->calibration_work);
-	}
 
 	/*
 	 * if set_jack callback occurred early than io_init,
author maintainer
#191 lore raw

PATCH 191/231 ASoC: SOF: Intel: hda-dsp: Expose hda_dsp_core_power_up()

In reply to Greg Kroah-Hartman

From: Peter Ujfalusi <[email protected]>

[ Upstream commit 08f8a93198e300dff9649bbae424cd805d313326 ]

The hda_dsp_core_power_up() needs to be exposed so that it can be used in hda-loader.c to correct the boot flow.
The first step must not unstall the core, it should only power up the core(s).

Add sanity check for the core_mask while exposing it to be safe.

Complements: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence")

---
 sound/soc/sof/intel/hda-dsp.c | 10 +++++++++-
 sound/soc/sof/intel/hda.h     |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)
sound/soc/sof/intel/hda-dsp.c +9 -1
index 8ddde60c56b3..68a8074c956a 100644
@@ -181,12 +181,20 @@ int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask)
  * Power Management.
  */
 
-static int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask)
+int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask)
 {
+	struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
+	const struct sof_intel_dsp_desc *chip = hda->desc;
 	unsigned int cpa;
 	u32 adspcs;
 	int ret;
 
+	/* restrict core_mask to host managed cores mask */
+	core_mask &= chip->host_managed_cores_mask;
+	/* return if core_mask is not valid */
+	if (!core_mask)
+		return 0;
+
 	/* update bits */
 	snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPCS,
 				HDA_DSP_ADSPCS_SPA_MASK(core_mask),
sound/soc/sof/intel/hda.h +1 -0
index 196494ba1245..db066d094afa 100644
@@ -490,6 +490,7 @@ struct sof_intel_hda_stream {
  */
 int hda_dsp_probe(struct snd_sof_dev *sdev);
 int hda_dsp_remove(struct snd_sof_dev *sdev);
+int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask);
 int hda_dsp_core_run(struct snd_sof_dev *sdev, unsigned int core_mask);
 int hda_dsp_enable_core(struct snd_sof_dev *sdev, unsigned int core_mask);
 int hda_dsp_core_reset_power_down(struct snd_sof_dev *sdev,
Signature · 1 line
2.35.1
author maintainer
#192 lore raw

PATCH 192/231 ASoC: SOF: Intel: hda-loader: Make sure that the fw load sequence is followed

In reply to Greg Kroah-Hartman

From: Peter Ujfalusi <[email protected]>

[ Upstream commit c31691e0d126ec5d60d2b6b03f699c11b613b219 ]

The hda_dsp_enable_core() is powering up _and_ unstall the core in one call while the first step of the firmware loading must not unstall the core.
The core can be unstalled only after the set cpb_cfp and the configuration of the IPC register for the ROM_CONTROL message.

Complements: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence")

---
 sound/soc/sof/intel/hda-loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/intel/hda-loader.c +1 -1
index 2ac5d9d0719b..9f624a84182b 100644
@@ -112,7 +112,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
 	int ret;
 
 	/* step 1: power up corex */
-	ret = hda_dsp_enable_core(sdev, chip->host_managed_cores_mask);
+	ret = hda_dsp_core_power_up(sdev, chip->host_managed_cores_mask);
 	if (ret < 0) {
 		if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
 			dev_err(sdev->dev, "error: dsp core 0/1 power up failed\n");
Signature · 1 line
2.35.1
author maintainer
#193 lore raw

PATCH 193/231 ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow

In reply to Greg Kroah-Hartman

From: Peter Ujfalusi <[email protected]>

[ Upstream commit bbfef046c6613404c01aeb9e9928bebb78dd327a ]

Update the comment for the cl_dsp_init() to clarify what is done by the function and use the chip->init_core_mask instead of BIT(0) when unstalling/running the init core.

Complements: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence")

---
 sound/soc/sof/intel/hda-loader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/sof/intel/hda-loader.c +4 -4
index 9f624a84182b..88d23924e1bf 100644
@@ -97,9 +97,9 @@ static struct hdac_ext_stream *cl_stream_prepare(struct snd_sof_dev *sdev, unsig
 }
 
 /*
- * first boot sequence has some extra steps. core 0 waits for power
- * status on core 1, so power up core 1 also momentarily, keep it in
- * reset/stall and then turn it off
+ * first boot sequence has some extra steps.
+ * power on all host managed cores and only unstall/run the boot core to boot the
+ * DSP then turn off all non boot cores (if any) is powered on.
  */
 static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
 {
@@ -127,7 +127,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag)
 			  ((stream_tag - 1) << 9)));
 
 	/* step 3: unset core 0 reset state & unstall/run core 0 */
-	ret = hda_dsp_core_run(sdev, BIT(0));
+	ret = hda_dsp_core_run(sdev, chip->init_core_mask);
 	if (ret < 0) {
 		if (hda->boot_iteration == HDA_FW_BOOT_ATTEMPTS)
 			dev_err(sdev->dev,
Signature · 1 line
2.35.1
author maintainer
#194 lore raw

PATCH 194/231 ASoC: wcd9335: Remove RX channel from old list before adding it to a new one

In reply to Greg Kroah-Hartman

From: Yassine Oudjana <[email protected]>

[ Upstream commit be6dd72edb216f20fc80e426ece9fe9b8aabf033 ]

Currently in slim_rx_mux_put, an RX channel gets added to a new list even if it is already in one. This can mess up links and make either it, the new list head, or both, get linked to the wrong entries. This can cause an entry to link to itself which in turn ends up making list_for_each_entry in other functions loop infinitely. To avoid issues, always remove the RX channel from any list it's in before adding it to a new list.

---
 sound/soc/codecs/wcd9335.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/wcd9335.c +4 -1
index 1e60db4056ad..12be043ee9a3 100644
@@ -1289,9 +1289,12 @@ static int slim_rx_mux_put(struct snd_kcontrol *kc,
 
 	wcd->rx_port_value[port_id] = ucontrol->value.enumerated.item[0];
 
+	/* Remove channel from any list it's in before adding it to a new one */
+	list_del_init(&wcd->rx_chs[port_id].list);
+
 	switch (wcd->rx_port_value[port_id]) {
 	case 0:
-		list_del_init(&wcd->rx_chs[port_id].list);
+		/* Channel already removed from lists. Nothing to do here */
 		break;
 	case 1:
 		list_add_tail(&wcd->rx_chs[port_id].list,
Signature · 1 line
2.35.1
author maintainer
#195 lore raw

PATCH 195/231 ASoC: wcd9335: Fix spurious event generation

In reply to Greg Kroah-Hartman

From: Mark Brown <[email protected]>

[ Upstream commit a7786cbae4b2732815da98efa39df96746b5bd0d ]

The slimbus mux put operation unconditionally reports a change in value which means that spurious events are generated. Fix this by exiting early in that case.

---
 sound/soc/codecs/wcd9335.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/codecs/wcd9335.c +3 -0
index 12be043ee9a3..aa685980a97b 100644
@@ -1287,6 +1287,9 @@ static int slim_rx_mux_put(struct snd_kcontrol *kc,
 	struct snd_soc_dapm_update *update = NULL;
 	u32 port_id = w->shift;
 
+	if (wcd->rx_port_value[port_id] == ucontrol->value.enumerated.item[0])
+		return 0;
+
 	wcd->rx_port_value[port_id] = ucontrol->value.enumerated.item[0];
 
 	/* Remove channel from any list it's in before adding it to a new one */
Signature · 1 line
2.35.1
author maintainer
#196 lore raw

PATCH 196/231 ASoC: wcd938x: Fix event generation for some controls

In reply to Greg Kroah-Hartman

From: Mark Brown <[email protected]>

[ Upstream commit 10e7ff0047921e32b919ecee7be706dd33c107f8 ]

Currently wcd938x_*_put() unconditionally report that the value of the control changed, resulting in spurious events being generated. Return 0 in that case instead as we should. There is still an issue in the compander control which is a bit more complex.

---
 sound/soc/codecs/wcd938x.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
sound/soc/codecs/wcd938x.c +12 -0
index 898b2887fa63..088cfda767cc 100644
@@ -2519,6 +2519,9 @@ static int wcd938x_tx_mode_put(struct snd_kcontrol *kcontrol,
 	struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
 	int path = e->shift_l;
 
+	if (wcd938x->tx_mode[path] == ucontrol->value.enumerated.item[0])
+		return 0;
+
 	wcd938x->tx_mode[path] = ucontrol->value.enumerated.item[0];
 
 	return 1;
@@ -2541,6 +2544,9 @@ static int wcd938x_rx_hph_mode_put(struct snd_kcontrol *kcontrol,
 	struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
 	struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
 
+	if (wcd938x->hph_mode == ucontrol->value.enumerated.item[0])
+		return 0;
+
 	wcd938x->hph_mode = ucontrol->value.enumerated.item[0];
 
 	return 1;
@@ -2632,6 +2638,9 @@ static int wcd938x_ldoh_put(struct snd_kcontrol *kcontrol,
 	struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
 	struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
 
+	if (wcd938x->ldoh == ucontrol->value.integer.value[0])
+		return 0;
+
 	wcd938x->ldoh = ucontrol->value.integer.value[0];
 
 	return 1;
@@ -2654,6 +2663,9 @@ static int wcd938x_bcs_put(struct snd_kcontrol *kcontrol,
 	struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
 	struct wcd938x_priv *wcd938x = snd_soc_component_get_drvdata(component);
 
+	if (wcd938x->bcs_dis == ucontrol->value.integer.value[0])
+		return 0;
+
 	wcd938x->bcs_dis = ucontrol->value.integer.value[0];
 
 	return 1;
Signature · 1 line
2.35.1
author maintainer
#197 lore raw

PATCH 197/231 ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem

In reply to Greg Kroah-Hartman

From: Hans de Goede <[email protected]>

[ Upstream commit 4e07479eab8a044cc9542414ccb4aeb8eb033bde ]

The "wlf,spkvdd-ena" GPIO needed by the bytcr_wm5102 driver is made available through a gpio-lookup table.

This gpio-lookup table is registered by drivers/mfd/arizona-spi.c, which may get probed after the bytcr_wm5102 driver.

If the gpio-lookup table has not registered yet then the gpiod_get() will return -ENOENT. Treat -ENOENT as -EPROBE_DEFER to still keep things working in this case.

---
 sound/soc/intel/boards/bytcr_wm5102.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
sound/soc/intel/boards/bytcr_wm5102.c +11 -2
index 8d8e96e3cd2d..f6d0cef1b28c 100644
@@ -421,8 +421,17 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)
 	priv->spkvdd_en_gpio = gpiod_get(codec_dev, "wlf,spkvdd-ena", GPIOD_OUT_LOW);
 	put_device(codec_dev);
 
-	if (IS_ERR(priv->spkvdd_en_gpio))
-		return dev_err_probe(dev, PTR_ERR(priv->spkvdd_en_gpio), "getting spkvdd-GPIO\n");
+	if (IS_ERR(priv->spkvdd_en_gpio)) {
+		ret = PTR_ERR(priv->spkvdd_en_gpio);
+		/*
+		 * The spkvdd gpio-lookup is registered by: drivers/mfd/arizona-spi.c,
+		 * so -ENOENT means that arizona-spi hasn't probed yet.
+		 */
+		if (ret == -ENOENT)
+			ret = -EPROBE_DEFER;
+
+		return dev_err_probe(dev, ret, "getting spkvdd-GPIO\n");
+	}
 
 	/* override platform name, if required */
 	byt_wm5102_card.dev = dev;
Signature · 1 line
2.35.1
author maintainer
#198 lore raw

PATCH 198/231 ASoC: wm_adsp: Fix event for preloader

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit 9896c029f0df628c6cb108253d09b1d61f1d4a88 ]

The preloader controls on ADSP should return a value of 1 if the preloader value was changed, update to correct this.

---
 sound/soc/codecs/wm_adsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm_adsp.c +1 -1
index 9cfd4f18493f..d3ecff3bdef2 100644
@@ -997,7 +997,7 @@ int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol,
 		snd_soc_dapm_sync(dapm);
 	}
 
-	return 0;
+	return 1;
 }
 EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put);
 
Signature · 1 line
2.35.1
author maintainer
#199 lore raw

PATCH 199/231 ASoC: wm5110: Fix DRE control

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit 0bc0ae9a5938d512fd5d44f11c9c04892dcf4961 ]

The DRE controls on wm5110 should return a value of 1 if the DRE state is actually changed, update to fix this.

---
 sound/soc/codecs/wm5110.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
sound/soc/codecs/wm5110.c +6 -2
index 4973ba1ed779..4ab7a672f8de 100644
@@ -413,6 +413,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
 	unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift;
 	unsigned int lold, rold;
 	unsigned int lena, rena;
+	bool change = false;
 	int ret;
 
 	snd_soc_dapm_mutex_lock(dapm);
@@ -440,8 +441,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
 		goto err;
 	}
 
-	ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE,
-				 mask, lnew | rnew);
+	ret = regmap_update_bits_check(arizona->regmap, ARIZONA_DRE_ENABLE,
+				       mask, lnew | rnew, &change);
 	if (ret) {
 		dev_err(arizona->dev, "Failed to set DRE: %d\n", ret);
 		goto err;
@@ -454,6 +455,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
 	if (!rnew && rold)
 		wm5110_clear_pga_volume(arizona, mc->rshift);
 
+	if (change)
+		ret = 1;
+
 err:
 	snd_soc_dapm_mutex_unlock(dapm);
 
Signature · 1 line
2.35.1
author maintainer
#200 lore raw

PATCH 200/231 ASoC: cs35l41: Correct some control names

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit c6a5f22f9b4fd5f21414be690ce34046d9712f05 ]

Various boolean controls on cs35l41 are missing the required "Switch" in the name, add these.

---
 sound/soc/codecs/cs35l41.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
sound/soc/codecs/cs35l41.c +6 -6
index 6b784a62df0c..20c76a53a508 100644
@@ -392,7 +392,7 @@ static const struct snd_kcontrol_new cs35l41_aud_controls[] = {
 	SOC_SINGLE("HW Noise Gate Enable", CS35L41_NG_CFG, 8, 63, 0),
 	SOC_SINGLE("HW Noise Gate Delay", CS35L41_NG_CFG, 4, 7, 0),
 	SOC_SINGLE("HW Noise Gate Threshold", CS35L41_NG_CFG, 0, 7, 0),
-	SOC_SINGLE("Aux Noise Gate CH1 Enable",
+	SOC_SINGLE("Aux Noise Gate CH1 Switch",
 		   CS35L41_MIXER_NGATE_CH1_CFG, 16, 1, 0),
 	SOC_SINGLE("Aux Noise Gate CH1 Entry Delay",
 		   CS35L41_MIXER_NGATE_CH1_CFG, 8, 15, 0),
@@ -400,15 +400,15 @@ static const struct snd_kcontrol_new cs35l41_aud_controls[] = {
 		   CS35L41_MIXER_NGATE_CH1_CFG, 0, 7, 0),
 	SOC_SINGLE("Aux Noise Gate CH2 Entry Delay",
 		   CS35L41_MIXER_NGATE_CH2_CFG, 8, 15, 0),
-	SOC_SINGLE("Aux Noise Gate CH2 Enable",
+	SOC_SINGLE("Aux Noise Gate CH2 Switch",
 		   CS35L41_MIXER_NGATE_CH2_CFG, 16, 1, 0),
 	SOC_SINGLE("Aux Noise Gate CH2 Threshold",
 		   CS35L41_MIXER_NGATE_CH2_CFG, 0, 7, 0),
-	SOC_SINGLE("SCLK Force", CS35L41_SP_FORMAT, CS35L41_SCLK_FRC_SHIFT, 1, 0),
-	SOC_SINGLE("LRCLK Force", CS35L41_SP_FORMAT, CS35L41_LRCLK_FRC_SHIFT, 1, 0),
-	SOC_SINGLE("Invert Class D", CS35L41_AMP_DIG_VOL_CTRL,
+	SOC_SINGLE("SCLK Force Switch", CS35L41_SP_FORMAT, CS35L41_SCLK_FRC_SHIFT, 1, 0),
+	SOC_SINGLE("LRCLK Force Switch", CS35L41_SP_FORMAT, CS35L41_LRCLK_FRC_SHIFT, 1, 0),
+	SOC_SINGLE("Invert Class D Switch", CS35L41_AMP_DIG_VOL_CTRL,
 		   CS35L41_AMP_INV_PCM_SHIFT, 1, 0),
-	SOC_SINGLE("Amp Gain ZC", CS35L41_AMP_GAIN_CTRL,
+	SOC_SINGLE("Amp Gain ZC Switch", CS35L41_AMP_GAIN_CTRL,
 		   CS35L41_AMP_GAIN_ZC_SHIFT, 1, 0),
 	WM_ADSP2_PRELOAD_SWITCH("DSP1", 1),
 	WM_ADSP_FW_CONTROL("DSP1", 0),
Signature · 1 line
2.35.1
author maintainer
#201 lore raw

PATCH 201/231 ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error

In reply to Greg Kroah-Hartman

From: Shuming Fan <[email protected]>

[ Upstream commit 1df793d479bef546569fc2e409ff8bb3f0fb8e99 ]

The initial settings will be written before the codec probe function.
But, the rt711->component doesn't be assigned yet.
If IO error happened during initial settings operations, it will cause the kernel panic. This patch changed component->dev to slave->dev to fix this issue.

---
 sound/soc/codecs/rt711-sdca.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/rt711-sdca.c +2 -2
index dfe3c9299ebd..5ad53bbc8528 100644
@@ -34,7 +34,7 @@ static int rt711_sdca_index_write(struct rt711_sdca_priv *rt711,
 
 	ret = regmap_write(regmap, addr, value);
 	if (ret < 0)
-		dev_err(rt711->component->dev,
+		dev_err(&rt711->slave->dev,
 			"Failed to set private value: %06x <= %04x ret=%d\n",
 			addr, value, ret);
 
@@ -50,7 +50,7 @@ static int rt711_sdca_index_read(struct rt711_sdca_priv *rt711,
 
 	ret = regmap_read(regmap, addr, value);
 	if (ret < 0)
-		dev_err(rt711->component->dev,
+		dev_err(&rt711->slave->dev,
 			"Failed to get private value: %06x => %04x ret=%d\n",
 			addr, *value, ret);
 
Signature · 1 line
2.35.1
author maintainer
#202 lore raw

PATCH 202/231 ASoC: dapm: Initialise kcontrol data for mux/demux controls

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit 11d7a12f7f50baa5af9090b131c9b03af59503e7 ]

DAPM keeps a copy of the current value of mux/demux controls, however this value is only initialised in the case of autodisable controls. This leads to false notification events when first modifying a DAPM kcontrol that has a non-zero default.

Autodisable controls are left as they are, since they already initialise the value, and there would be more work required to support autodisable muxes where the first option isn't disabled and/or that isn't the default.

Technically this issue could affect mixer/switch elements as well, although not on any of the devices I am currently running. There is also a little more work to do to address the issue there due to that side supporting stereo controls, so that has not been tackled in this patch.

---
 sound/soc/soc-dapm.c | 5 +++++
 1 file changed, 5 insertions(+)
sound/soc/soc-dapm.c +5 -0
index 869c76506b66..a8e842e02cdc 100644
@@ -62,6 +62,8 @@ struct snd_soc_dapm_widget *
 snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
 			 const struct snd_soc_dapm_widget *widget);
 
+static unsigned int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg);
+
 /* dapm power sequences - make this per codec in the future */
 static int dapm_up_seq[] = {
 	[snd_soc_dapm_pre] = 1,
@@ -442,6 +444,9 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
 
 			snd_soc_dapm_add_path(widget->dapm, data->widget,
 					      widget, NULL, NULL);
+		} else if (e->reg != SND_SOC_NOPM) {
+			data->value = soc_dapm_read(widget->dapm, e->reg) &
+				      (e->mask << e->shift_l);
 		}
 		break;
 	default:
Signature · 1 line
2.35.1
author maintainer
#203 lore raw

PATCH 203/231 ASoC: cs35l41: Add ASP TX3/4 source to register patch

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit 46b0d050c8c7df6dfb2c376aaa149bf2cfc5ca3e ]

The mixer controls for ASP TX3/4 are set to values that are not included in their enumeration control. This will cause spurious event notifications when the controls are first changed, as the register value changes whilst the actual visible enumeration value does not. Use the register patch to set them to a known value, zero, which equates to zero fill, thereby avoiding the spurious notifications.

---
 sound/soc/codecs/cs35l41-lib.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
sound/soc/codecs/cs35l41-lib.c +8 -2
index 17cf782f39af..538b5c4d3abf 100644
@@ -36,8 +36,8 @@ static const struct reg_default cs35l41_reg[] = {
 	{ CS35L41_DAC_PCM1_SRC,			0x00000008 },
 	{ CS35L41_ASP_TX1_SRC,			0x00000018 },
 	{ CS35L41_ASP_TX2_SRC,			0x00000019 },
-	{ CS35L41_ASP_TX3_SRC,			0x00000020 },
-	{ CS35L41_ASP_TX4_SRC,			0x00000021 },
+	{ CS35L41_ASP_TX3_SRC,			0x00000000 },
+	{ CS35L41_ASP_TX4_SRC,			0x00000000 },
 	{ CS35L41_DSP1_RX1_SRC,			0x00000008 },
 	{ CS35L41_DSP1_RX2_SRC,			0x00000009 },
 	{ CS35L41_DSP1_RX3_SRC,			0x00000018 },
@@ -643,6 +643,8 @@ static const struct reg_sequence cs35l41_reva0_errata_patch[] = {
 	{ CS35L41_DSP1_XM_ACCEL_PL0_PRI, 0x00000000 },
 	{ CS35L41_PWR_CTRL2,		 0x00000000 },
 	{ CS35L41_AMP_GAIN_CTRL,	 0x00000000 },
+	{ CS35L41_ASP_TX3_SRC,		 0x00000000 },
+	{ CS35L41_ASP_TX4_SRC,		 0x00000000 },
 };
 
 static const struct reg_sequence cs35l41_revb0_errata_patch[] = {
@@ -654,6 +656,8 @@ static const struct reg_sequence cs35l41_revb0_errata_patch[] = {
 	{ CS35L41_DSP1_XM_ACCEL_PL0_PRI, 0x00000000 },
 	{ CS35L41_PWR_CTRL2,		 0x00000000 },
 	{ CS35L41_AMP_GAIN_CTRL,	 0x00000000 },
+	{ CS35L41_ASP_TX3_SRC,		 0x00000000 },
+	{ CS35L41_ASP_TX4_SRC,		 0x00000000 },
 };
 
 static const struct reg_sequence cs35l41_revb2_errata_patch[] = {
@@ -665,6 +669,8 @@ static const struct reg_sequence cs35l41_revb2_errata_patch[] = {
 	{ CS35L41_DSP1_XM_ACCEL_PL0_PRI, 0x00000000 },
 	{ CS35L41_PWR_CTRL2,		 0x00000000 },
 	{ CS35L41_AMP_GAIN_CTRL,	 0x00000000 },
+	{ CS35L41_ASP_TX3_SRC,		 0x00000000 },
+	{ CS35L41_ASP_TX4_SRC,		 0x00000000 },
 };
 
 static const struct cs35l41_otp_map_element_t cs35l41_otp_map_map[] = {
Signature · 1 line
2.35.1
author maintainer
#204 lore raw

PATCH 204/231 ASoC: cs47l15: Fix event generation for low power mux control

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit 7f103af4a10f375b9b346b4d0b730f6a66b8c451 ]

cs47l15_in1_adc_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed.

---
 sound/soc/codecs/cs47l15.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/cs47l15.c +4 -1
index 391fd7da331f..1c7d52bef893 100644
@@ -122,6 +122,9 @@ static int cs47l15_in1_adc_put(struct snd_kcontrol *kcontrol,
 		snd_soc_kcontrol_component(kcontrol);
 	struct cs47l15 *cs47l15 = snd_soc_component_get_drvdata(component);
 
+	if (!!ucontrol->value.integer.value[0] == cs47l15->in1_lp_mode)
+		return 0;
+
 	switch (ucontrol->value.integer.value[0]) {
 	case 0:
 		/* Set IN1 to normal mode */
@@ -150,7 +153,7 @@ static int cs47l15_in1_adc_put(struct snd_kcontrol *kcontrol,
 		break;
 	}
 
-	return 0;
+	return 1;
 }
 
 static const struct snd_kcontrol_new cs47l15_snd_controls[] = {
Signature · 1 line
2.35.1
author maintainer
#205 lore raw

PATCH 205/231 ASoC: madera: Fix event generation for OUT1 demux

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit e3cabbef3db8269207a6b8808f510137669f8deb ]

madera_out1_demux_put returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed.

---
 sound/soc/codecs/madera.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
sound/soc/codecs/madera.c +7 -1
index 272041c6236a..8095a87117cf 100644
@@ -618,7 +618,13 @@ int madera_out1_demux_put(struct snd_kcontrol *kcontrol,
 end:
 	snd_soc_dapm_mutex_unlock(dapm);
 
-	return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
+	ret = snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
+	if (ret < 0) {
+		dev_err(madera->dev, "Failed to update demux power state: %d\n", ret);
+		return ret;
+	}
+
+	return change;
 }
 EXPORT_SYMBOL_GPL(madera_out1_demux_put);
 
Signature · 1 line
2.35.1
author maintainer
#206 lore raw

PATCH 206/231 ASoC: madera: Fix event generation for rate controls

In reply to Greg Kroah-Hartman

From: Charles Keepax <[email protected]>

[ Upstream commit 980555e95f7cabdc9c80a07107622b097ba23703 ]

madera_adsp_rate_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed.

---
 sound/soc/codecs/madera.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/madera.c +3 -3
index 8095a87117cf..b9f19fbd2911 100644
@@ -899,7 +899,7 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,
 	struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
 	const int adsp_num = e->shift_l;
 	const unsigned int item = ucontrol->value.enumerated.item[0];
-	int ret;
+	int ret = 0;
 
 	if (item >= e->items)
 		return -EINVAL;
@@ -916,10 +916,10 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,
 			 "Cannot change '%s' while in use by active audio paths\n",
 			 kcontrol->id.name);
 		ret = -EBUSY;
-	} else {
+	} else if (priv->adsp_rate_cache[adsp_num] != e->values[item]) {
 		/* Volatile register so defer until the codec is powered up */
 		priv->adsp_rate_cache[adsp_num] = e->values[item];
-		ret = 0;
+		ret = 1;
 	}
 
 	mutex_unlock(&priv->rate_lock);
Signature · 1 line
2.35.1
author maintainer
#207 lore raw

PATCH 207/231 irqchip: or1k-pic: Undefine mask_ack for level triggered hardware

In reply to Greg Kroah-Hartman

From: Stafford Horne <[email protected]>

[ Upstream commit 8520501346ed8d1c4a6dfa751cb57328a9c843f1 ]

The mask_ack operation clears the interrupt by writing to the PICSR register. This we don't want for level triggered interrupt because it does not actually clear the interrupt on the source hardware.

This was causing issues in qemu with multi core setups where interrupts would continue to fire even though they had been cleared in PICSR.

Just remove the mask_ack operation.

---
 drivers/irqchip/irq-or1k-pic.c | 1 -
 1 file changed, 1 deletion(-)
drivers/irqchip/irq-or1k-pic.c +0 -1
index 49b47e787644..f289ccd95291 100644
@@ -66,7 +66,6 @@ static struct or1k_pic_dev or1k_pic_level = {
 		.name = "or1k-PIC-level",
 		.irq_unmask = or1k_pic_unmask,
 		.irq_mask = or1k_pic_mask,
-		.irq_mask_ack = or1k_pic_mask_ack,
 	},
 	.handle = handle_level_irq,
 	.flags = IRQ_LEVEL | IRQ_NOPROBE,
Signature · 1 line
2.35.1
author maintainer
#208 lore raw

PATCH 208/231 pinctrl: imx: Add the zero base flag for imx93

In reply to Greg Kroah-Hartman

From: Jacky Bai <[email protected]>

[ Upstream commit fbc24ebc65507feb9728dc38197f90486148dda0 ]

On i.MX93, the pin mux reg offset is from 0x0, so need to add the 'ZERO_OFFSET_VALID' flag to make sure the pin at mux offset 0 can be found.

---
 drivers/pinctrl/freescale/pinctrl-imx93.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/freescale/pinctrl-imx93.c +1 -0
index c0630f69e995..417e41b37a6f 100644
@@ -239,6 +239,7 @@ static const struct pinctrl_pin_desc imx93_pinctrl_pads[] = {
 static const struct imx_pinctrl_soc_info imx93_pinctrl_info = {
 	.pins = imx93_pinctrl_pads,
 	.npins = ARRAY_SIZE(imx93_pinctrl_pads),
+	.flags = ZERO_OFFSET_VALID,
 	.gpr_compatible = "fsl,imx93-iomuxc-gpr",
 };
 
Signature · 1 line
2.35.1
author maintainer
#209 lore raw

PATCH 209/231 x86: Clear .brk area at early boot

In reply to Greg Kroah-Hartman

From: Juergen Gross <[email protected]>

[ Upstream commit 38fa5479b41376dc9d7f57e71c83514285a25ca0 ]

The .brk section has the same properties as .bss: it is an alloc-only section and should be cleared before being used.

Not doing so is especially a problem for Xen PV guests, as the hypervisor will validate page tables (check for writable page tables and hypervisor private bits) before accepting them to be used.

Make sure .brk is initially zero by letting clear_bss() clear the brk area, too.

---
 arch/x86/kernel/head64.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/kernel/head64.c +2 -0
index 2e10a33778cf..92eae95f1a0b 100644
@@ -425,6 +425,8 @@ void __init clear_bss(void)
 {
 	memset(__bss_start, 0,
 	       (unsigned long) __bss_stop - (unsigned long) __bss_start);
+	memset(__brk_base, 0,
+	       (unsigned long) __brk_limit - (unsigned long) __brk_base);
 }
 
 static unsigned long get_cmd_line_ptr(void)
Signature · 1 line
2.35.1
author maintainer
#210 lore raw

PATCH 210/231 soc: ixp4xx/npe: Fix unused match warning

In reply to Greg Kroah-Hartman

From: Linus Walleij <[email protected]>

[ Upstream commit 620f83b8326ce9706b1118334f0257ae028ce045 ]

The kernel test robot found this inconsistency:

  drivers/soc/ixp4xx/ixp4xx-npe.c:737:34: warning:
  'ixp4xx_npe_of_match' defined but not used [-Wunused-const-variable=]
     737 | static const struct of_device_id ixp4xx_npe_of_match[] = {

This is because the match is enclosed in the of_match_ptr() which compiles into NULL when OF is disabled and this is unnecessary.

Fix it by dropping of_match_ptr() around the match.

---
 drivers/soc/ixp4xx/ixp4xx-npe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/ixp4xx/ixp4xx-npe.c +1 -1
index 613935cb6a48..58240e320c13 100644
@@ -758,7 +758,7 @@ static const struct of_device_id ixp4xx_npe_of_match[] = {
 static struct platform_driver ixp4xx_npe_driver = {
 	.driver = {
 		.name           = "ixp4xx-npe",
-		.of_match_table = of_match_ptr(ixp4xx_npe_of_match),
+		.of_match_table = ixp4xx_npe_of_match,
 	},
 	.probe = ixp4xx_npe_probe,
 	.remove = ixp4xx_npe_remove,
Signature · 1 line
2.35.1
author maintainer
#211 lore raw

PATCH 211/231 ARM: dts: stm32: use the correct clock source for CEC on stm32mp151

In reply to Greg Kroah-Hartman

From: Gabriel Fernandez <[email protected]>

[ Upstream commit 78ece8cce1ba0c3f3e5a7c6c1b914b3794f04c44 ]

The peripheral clock of CEC is not LSE but CEC.

---
 arch/arm/boot/dts/stm32mp151.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/stm32mp151.dtsi +1 -1
index 9c2bbf115f4c..de4d651f9575 100644
@@ -565,7 +565,7 @@
 			compatible = "st,stm32-cec";
 			reg = <0x40016000 0x400>;
 			interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&rcc CEC_K>, <&clk_lse>;
+			clocks = <&rcc CEC_K>, <&rcc CEC>;
 			clock-names = "cec", "hdmi-cec";
 			status = "disabled";
 		};
Signature · 1 line
2.35.1
author maintainer
#212 lore raw

PATCH 212/231 Revert "can: xilinx_can: Limit CANFD brp to 2"

In reply to Greg Kroah-Hartman

From: Srinivas Neeli <[email protected]>

[ Upstream commit c6da4590fe819dfe28a4f8037a8dc1e056542fb4 ]

This reverts commit 05ca14fdb6fe65614e0652d03e44b02748d25af7.

On early silicon engineering samples observed bit shrinking issue when we use brp as 1. Hence updated brp_min as 2. As in production silicon this issue is fixed, so reverting the patch.

---
 drivers/net/can/xilinx_can.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/xilinx_can.c +2 -2
index 43f0c6a064ba..75b4db4d050b 100644
@@ -259,7 +259,7 @@ static const struct can_bittiming_const xcan_bittiming_const_canfd2 = {
 	.tseg2_min = 1,
 	.tseg2_max = 128,
 	.sjw_max = 128,
-	.brp_min = 2,
+	.brp_min = 1,
 	.brp_max = 256,
 	.brp_inc = 1,
 };
@@ -272,7 +272,7 @@ static const struct can_bittiming_const xcan_data_bittiming_const_canfd2 = {
 	.tseg2_min = 1,
 	.tseg2_max = 16,
 	.sjw_max = 16,
-	.brp_min = 2,
+	.brp_min = 1,
 	.brp_max = 256,
 	.brp_inc = 1,
 };
Signature · 1 line
2.35.1
author maintainer
#213 lore raw

PATCH 213/231 ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices

In reply to Greg Kroah-Hartman

From: John Veness <[email protected]>

[ Upstream commit 6e2c9105e0b743c92a157389d40f00b81bdd09fe ]

Treat the claimed 96kHz 1ch in the descriptors as 48kHz 2ch, so that the audio stream doesn't sound mono. Also fix initial stream alignment, so that left and right channels are in the correct order.

---
 sound/usb/quirks-table.h |   48 +++++++++++++++++++++++++++++++++++++++++++++++
 sound/usb/quirks.c       |    3 ++
 2 files changed, 51 insertions(+)
sound/usb/quirks-table.h +48 -0
@@ -3803,6 +3803,54 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 },
 
 /*
+ * MacroSilicon MS2100/MS2106 based AV capture cards
+ *
+ * These claim 96kHz 1ch in the descriptors, but are actually 48kHz 2ch.
+ * They also need QUIRK_FLAG_ALIGN_TRANSFER, which makes one wonder if
+ * they pretend to be 96kHz mono as a workaround for stereo being broken
+ * by that...
+ *
+ * They also have an issue with initial stream alignment that causes the
+ * channels to be swapped and out of phase, which is dealt with in quirks.c.
+ */
+{
+	USB_AUDIO_DEVICE(0x534d, 0x0021),
+	.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+		.vendor_name = "MacroSilicon",
+		.product_name = "MS210x",
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = &(const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 2,
+				.type = QUIRK_AUDIO_STANDARD_MIXER,
+			},
+			{
+				.ifnum = 3,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S16_LE,
+					.channels = 2,
+					.iface = 3,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.attributes = 0,
+					.endpoint = 0x82,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						USB_ENDPOINT_SYNC_ASYNC,
+					.rates = SNDRV_PCM_RATE_CONTINUOUS,
+					.rate_min = 48000,
+					.rate_max = 48000,
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+
+/*
  * MacroSilicon MS2109 based HDMI capture cards
  *
  * These claim 96kHz 1ch in the descriptors, but are actually 48kHz 2ch.
sound/usb/quirks.c +3 -0
@@ -1478,6 +1478,7 @@ void snd_usb_set_format_quirk(struct snd
 	case USB_ID(0x041e, 0x3f19): /* E-Mu 0204 USB */
 		set_format_emu_quirk(subs, fmt);
 		break;
+	case USB_ID(0x534d, 0x0021): /* MacroSilicon MS2100/MS2106 */
 	case USB_ID(0x534d, 0x2109): /* MacroSilicon MS2109 */
 		subs->stream_offset_adj = 2;
 		break;
@@ -1908,6 +1909,8 @@ static const struct usb_audio_quirk_flag
 		   QUIRK_FLAG_IGNORE_CTL_ERROR),
 	DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */
 		   QUIRK_FLAG_GET_SAMPLE_RATE),
+	DEVICE_FLG(0x534d, 0x0021, /* MacroSilicon MS2100/MS2106 */
+		   QUIRK_FLAG_ALIGN_TRANSFER),
 	DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */
 		   QUIRK_FLAG_ALIGN_TRANSFER),
 	DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */
author maintainer
#214 lore raw

PATCH 214/231 ALSA: usb-audio: Add quirk for Fiero SC-01

In reply to Greg Kroah-Hartman

From: Egor Vorontsov <[email protected]>

[ Upstream commit 4fb7c24f69c48fdc02ea7858dbd5a60ff08bf7e5 ]

Fiero SC-01 is a USB sound card with two mono inputs and a single stereo output. The inputs are composed into a single stereo stream.

The device uses a vendor-provided driver on Windows and does not work at all without it. The driver mostly provides ASIO functionality, but also alters the way the sound card is queried for sample rates and clocks.

ALSA queries those failing with an EPIPE (same as Windows 10 does). Presumably, the vendor-provided driver does not query it at all, simply matching by VID:PID. Thus, I consider this a buggy firmware and adhere to a set of fixed endpoint quirks instead.

The soundcard has an internal clock. Implicit feedback mode is required for the playback.

I have updated my device to v1.1.0 from a Windows 10 VM using a vendor- provided binary prior to the development, hoping for it to just begin working. The device provides no obvious way to downgrade the firmware, and regardless, there's no binary available for v1.0.0 anyway.

Thus, I will be getting another unit to extend the patch with support for that. Expected to be a simple copy-paste of the existing one, though.

There were no previous reports of that device in context of Linux anywhere. Other issues have been reported though, but that's out of the scope.

---
 sound/usb/quirks-table.h |   68 +++++++++++++++++++++++++++++++++++++++++++++++
 sound/usb/quirks.c       |    2 +
 2 files changed, 70 insertions(+)
sound/usb/quirks-table.h +68 -0
@@ -4167,6 +4167,74 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 		}
 	}
 },
+{
+	/*
+	 * Fiero SC-01 (firmware v1.1.0)
+	 */
+	USB_DEVICE(0x2b53, 0x0031),
+	.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+		.vendor_name = "Fiero",
+		.product_name = "SC-01",
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = &(const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			/* Playback */
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 2,
+					.fmt_bits = 24,
+					.iface = 1,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x01,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						   USB_ENDPOINT_SYNC_ASYNC,
+					.rates = SNDRV_PCM_RATE_48000 |
+						 SNDRV_PCM_RATE_96000,
+					.rate_min = 48000,
+					.rate_max = 96000,
+					.nr_rates = 2,
+					.rate_table = (unsigned int[]) { 48000, 96000 },
+					.clock = 0x29
+				}
+			},
+			/* Capture */
+			{
+				.ifnum = 2,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 2,
+					.fmt_bits = 24,
+					.iface = 2,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x82,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						   USB_ENDPOINT_SYNC_ASYNC |
+						   USB_ENDPOINT_USAGE_IMPLICIT_FB,
+					.rates = SNDRV_PCM_RATE_48000 |
+						 SNDRV_PCM_RATE_96000,
+					.rate_min = 48000,
+					.rate_max = 96000,
+					.nr_rates = 2,
+					.rate_table = (unsigned int[]) { 48000, 96000 },
+					.clock = 0x29
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
 
 #undef USB_DEVICE_VENDOR_SPEC
 #undef USB_AUDIO_DEVICE
sound/usb/quirks.c +2 -0
@@ -1915,6 +1915,8 @@ static const struct usb_audio_quirk_flag
 		   QUIRK_FLAG_ALIGN_TRANSFER),
 	DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */
 		   QUIRK_FLAG_GET_SAMPLE_RATE),
+	DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */
+		   QUIRK_FLAG_GENERIC_IMPLICIT_FB),
 
 	/* Vendor matches */
 	VENDOR_FLG(0x045e, /* MS Lifecam */
author maintainer
#215 lore raw

PATCH 215/231 ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0)

In reply to Greg Kroah-Hartman

From: Egor Vorontsov <[email protected]>

[ Upstream commit 2307a0e1ca0b5c1337b37ac6302f96e017ebac3c ]

The patch applies the same quirks used for SC-01 at firmware v1.1.0 to the ones running v1.0.0, with respect to hard-coded sample rates.

I got two more units and successfully tested the patch series with both firmwares.

The support is now complete (not accounting ASIO).

---
 sound/usb/quirks-table.h |  132 +++++++++++++++++++++++++++++++++++++++++++++++
 sound/usb/quirks.c       |    4 +
 2 files changed, 136 insertions(+)
sound/usb/quirks-table.h +132 -0
@@ -4169,6 +4169,138 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 },
 {
 	/*
+	 * Fiero SC-01 (firmware v1.0.0 @ 48 kHz)
+	 */
+	USB_DEVICE(0x2b53, 0x0023),
+	.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+		.vendor_name = "Fiero",
+		.product_name = "SC-01",
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = &(const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			/* Playback */
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 2,
+					.fmt_bits = 24,
+					.iface = 1,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x01,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						   USB_ENDPOINT_SYNC_ASYNC,
+					.rates = SNDRV_PCM_RATE_48000,
+					.rate_min = 48000,
+					.rate_max = 48000,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 48000 },
+					.clock = 0x29
+				}
+			},
+			/* Capture */
+			{
+				.ifnum = 2,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 2,
+					.fmt_bits = 24,
+					.iface = 2,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x82,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						   USB_ENDPOINT_SYNC_ASYNC |
+						   USB_ENDPOINT_USAGE_IMPLICIT_FB,
+					.rates = SNDRV_PCM_RATE_48000,
+					.rate_min = 48000,
+					.rate_max = 48000,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 48000 },
+					.clock = 0x29
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+{
+	/*
+	 * Fiero SC-01 (firmware v1.0.0 @ 96 kHz)
+	 */
+	USB_DEVICE(0x2b53, 0x0024),
+	.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
+		.vendor_name = "Fiero",
+		.product_name = "SC-01",
+		.ifnum = QUIRK_ANY_INTERFACE,
+		.type = QUIRK_COMPOSITE,
+		.data = &(const struct snd_usb_audio_quirk[]) {
+			{
+				.ifnum = 0,
+				.type = QUIRK_AUDIO_STANDARD_INTERFACE
+			},
+			/* Playback */
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 2,
+					.fmt_bits = 24,
+					.iface = 1,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x01,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						   USB_ENDPOINT_SYNC_ASYNC,
+					.rates = SNDRV_PCM_RATE_96000,
+					.rate_min = 96000,
+					.rate_max = 96000,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 96000 },
+					.clock = 0x29
+				}
+			},
+			/* Capture */
+			{
+				.ifnum = 2,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S32_LE,
+					.channels = 2,
+					.fmt_bits = 24,
+					.iface = 2,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.endpoint = 0x82,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						   USB_ENDPOINT_SYNC_ASYNC |
+						   USB_ENDPOINT_USAGE_IMPLICIT_FB,
+					.rates = SNDRV_PCM_RATE_96000,
+					.rate_min = 96000,
+					.rate_max = 96000,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) { 96000 },
+					.clock = 0x29
+				}
+			},
+			{
+				.ifnum = -1
+			}
+		}
+	}
+},
+{
+	/*
 	 * Fiero SC-01 (firmware v1.1.0)
 	 */
 	USB_DEVICE(0x2b53, 0x0031),
sound/usb/quirks.c +4 -0
@@ -1915,6 +1915,10 @@ static const struct usb_audio_quirk_flag
 		   QUIRK_FLAG_ALIGN_TRANSFER),
 	DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */
 		   QUIRK_FLAG_GET_SAMPLE_RATE),
+	DEVICE_FLG(0x2b53, 0x0023, /* Fiero SC-01 (firmware v1.0.0 @ 48 kHz) */
+		   QUIRK_FLAG_GENERIC_IMPLICIT_FB),
+	DEVICE_FLG(0x2b53, 0x0024, /* Fiero SC-01 (firmware v1.0.0 @ 96 kHz) */
+		   QUIRK_FLAG_GENERIC_IMPLICIT_FB),
 	DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */
 		   QUIRK_FLAG_GENERIC_IMPLICIT_FB),
 
author maintainer
#216 lore raw

PATCH 216/231 nvme-pci: phison e16 has bogus namespace ids

In reply to Greg Kroah-Hartman

From: Keith Busch <[email protected]>

[ Upstream commit 73029c9b23cf1213e5f54c2b59efce08665199e7 ]

Add the quirk.

---
 drivers/nvme/host/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +2 -1
index fe829377c7c2..ab575fdd8015 100644
@@ -3432,7 +3432,8 @@ static const struct pci_device_id nvme_id_table[] = {
 				NVME_QUIRK_DISABLE_WRITE_ZEROES|
 				NVME_QUIRK_IGNORE_DEV_SUBNQN, },
 	{ PCI_DEVICE(0x1987, 0x5016),	/* Phison E16 */
-		.driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
+		.driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN |
+				NVME_QUIRK_BOGUS_NID, },
 	{ PCI_DEVICE(0x1b4b, 0x1092),	/* Lexar 256 GB SSD */
 		.driver_data = NVME_QUIRK_NO_NS_DESC_LIST |
 				NVME_QUIRK_IGNORE_DEV_SUBNQN, },
Signature · 1 line
2.35.1
author maintainer
#217 lore raw

PATCH 217/231 nvme: use struct group for generic command dwords

In reply to Greg Kroah-Hartman

From: Keith Busch <[email protected]>

[ Upstream commit 5c629dc9609dc43492a7bc8060cc6120875bf096 ]

This will allow the trace event to know the full size of the data intended to be copied and silence read overflow checks.

---
 drivers/nvme/host/trace.h | 2 +-
 include/linux/nvme.h      | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/nvme/host/trace.h +1 -1
index b5f85259461a..37c7f4c89f92 100644
@@ -69,7 +69,7 @@ TRACE_EVENT(nvme_setup_cmd,
 		__entry->metadata = !!blk_integrity_rq(req);
 		__entry->fctype = cmd->fabrics.fctype;
 		__assign_disk_name(__entry->disk, req->q->disk);
-		memcpy(__entry->cdw10, &cmd->common.cdw10,
+		memcpy(__entry->cdw10, &cmd->common.cdws,
 			sizeof(__entry->cdw10));
 	    ),
 	    TP_printk("nvme%d: %sqid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%x, cmd=(%s %s)",
include/linux/nvme.h +2 -0
index f626a445d1a8..99b1b56f0cd3 100644
@@ -867,12 +867,14 @@ struct nvme_common_command {
 	__le32			cdw2[2];
 	__le64			metadata;
 	union nvme_data_ptr	dptr;
+	struct_group(cdws,
 	__le32			cdw10;
 	__le32			cdw11;
 	__le32			cdw12;
 	__le32			cdw13;
 	__le32			cdw14;
 	__le32			cdw15;
+	);
 };
 
 struct nvme_rw_command {
Signature · 1 line
2.35.1
author maintainer
#218 lore raw

PATCH 218/231 wireguard: selftests: set fake real time in init

In reply to Greg Kroah-Hartman

From: Jason A. Donenfeld <[email protected]>

[ Upstream commit 829be057dbc1e71383b8d7de8edb31dcf07b4aa0 ]

Not all platforms have an RTC, and rather than trying to force one into each, it's much easier to just set a fixed time. This is necessary because WireGuard's latest handshakes parameter is returned in wallclock time, and if the system time isn't set, and the system is really fast, then this returns 0, which trips the test.

Turning this on requires setting CONFIG_COMPAT_32BIT_TIME=y, as musl doesn't support settimeofday without it.

---
 .../testing/selftests/wireguard/qemu/arch/arm.config  |  1 +
 .../selftests/wireguard/qemu/arch/armeb.config        |  1 +
 .../testing/selftests/wireguard/qemu/arch/i686.config |  1 +
 .../testing/selftests/wireguard/qemu/arch/m68k.config |  1 +
 .../testing/selftests/wireguard/qemu/arch/mips.config |  1 +
 .../selftests/wireguard/qemu/arch/mipsel.config       |  1 +
 .../selftests/wireguard/qemu/arch/powerpc.config      |  1 +
 tools/testing/selftests/wireguard/qemu/init.c         | 11 +++++++++++
 8 files changed, 18 insertions(+)
tools/testing/selftests/wireguard/qemu/arch/arm.config +1 -0
index fc7959bef9c2..0579c66be83e 100644
@@ -7,6 +7,7 @@ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
 CONFIG_VIRTIO_MENU=y
 CONFIG_VIRTIO_MMIO=y
 CONFIG_VIRTIO_CONSOLE=y
+CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1 panic_on_warn=1"
 CONFIG_FRAME_WARN=1024
tools/testing/selftests/wireguard/qemu/arch/armeb.config +1 -0
index f3066be81c19..2a3307bbe534 100644
@@ -7,6 +7,7 @@ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
 CONFIG_VIRTIO_MENU=y
 CONFIG_VIRTIO_MMIO=y
 CONFIG_VIRTIO_CONSOLE=y
+CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="console=ttyAMA0 wg.success=vport0p1 panic_on_warn=1"
 CONFIG_CPU_BIG_ENDIAN=y
tools/testing/selftests/wireguard/qemu/arch/i686.config +1 -0
index 6d90892a85a2..cd864b9be6fb 100644
@@ -1,6 +1,7 @@
 CONFIG_ACPI=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
 CONFIG_FRAME_WARN=1024
tools/testing/selftests/wireguard/qemu/arch/m68k.config +1 -0
index 82c925e49beb..9639bfe06074 100644
@@ -5,5 +5,6 @@ CONFIG_MAC=y
 CONFIG_SERIAL_PMACZILOG=y
 CONFIG_SERIAL_PMACZILOG_TTYS=y
 CONFIG_SERIAL_PMACZILOG_CONSOLE=y
+CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
 CONFIG_FRAME_WARN=1024
tools/testing/selftests/wireguard/qemu/arch/mips.config +1 -0
index d7ec63c17b30..2a84402353ab 100644
@@ -6,6 +6,7 @@ CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_SYSCON=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
 CONFIG_FRAME_WARN=1024
tools/testing/selftests/wireguard/qemu/arch/mipsel.config +1 -0
index 18a498293737..56146a101e7e 100644
@@ -7,6 +7,7 @@ CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_SYSCON=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
 CONFIG_FRAME_WARN=1024
tools/testing/selftests/wireguard/qemu/arch/powerpc.config +1 -0
index 5e04882e8e35..174a9ffe2a36 100644
@@ -4,6 +4,7 @@ CONFIG_PPC_85xx=y
 CONFIG_PHYS_64BIT=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_MATH_EMULATION=y
 CONFIG_CMDLINE_BOOL=y
 CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1 panic_on_warn=1"
tools/testing/selftests/wireguard/qemu/init.c +11 -0
index 2a0f48fac925..542c34b00eb0 100644
@@ -11,6 +11,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
 #include <fcntl.h>
+#include <time.h>
 #include <sys/wait.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
@@ -67,6 +68,15 @@ static void seed_rng(void)
 	close(fd);
 }
 
+static void set_time(void)
+{
+	if (time(NULL))
+		return;
+	pretty_message("[+] Setting fake time...");
+	if (stime(&(time_t){1433512680}) < 0)
+		panic("settimeofday()");
+}
+
 static void mount_filesystems(void)
 {
 	pretty_message("[+] Mounting filesystems...");
@@ -256,6 +266,7 @@ int main(int argc, char *argv[])
 	print_banner();
 	mount_filesystems();
 	seed_rng();
+	set_time();
 	kmod_selftests();
 	enable_logging();
 	clear_leaks();
Signature · 1 line
2.35.1
author maintainer
#219 lore raw

PATCH 219/231 wireguard: selftests: always call kernel makefile

In reply to Greg Kroah-Hartman

From: Jason A. Donenfeld <[email protected]>

[ Upstream commit 1a087eec257154e26a81a7a0a15380d7a2431765 ]

These selftests are used for much more extensive changes than just the wireguard source files. So always call the kernel's build file, which will do something or nothing after checking the whole tree, per usual.

---
 tools/testing/selftests/wireguard/qemu/Makefile |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/testing/selftests/wireguard/qemu/Makefile +2 -3
@@ -19,8 +19,6 @@ endif
 MIRROR := https://download.wireguard.com/qemu-test/distfiles/
 
 KERNEL_BUILD_PATH := $(BUILD_PATH)/kernel$(if $(findstring yes,$(DEBUG_KERNEL)),-debug)
-rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
-WIREGUARD_SOURCES := $(call rwildcard,$(KERNEL_PATH)/drivers/net/wireguard/,*)
 
 default: qemu
 
@@ -324,8 +322,9 @@ $(KERNEL_BUILD_PATH)/.config: $(TOOLCHAI
 	cd $(KERNEL_BUILD_PATH) && ARCH=$(KERNEL_ARCH) $(KERNEL_PATH)/scripts/kconfig/merge_config.sh -n $(KERNEL_BUILD_PATH)/.config $(KERNEL_BUILD_PATH)/minimal.config
 	$(if $(findstring yes,$(DEBUG_KERNEL)),cp debug.config $(KERNEL_BUILD_PATH) && cd $(KERNEL_BUILD_PATH) && ARCH=$(KERNEL_ARCH) $(KERNEL_PATH)/scripts/kconfig/merge_config.sh -n $(KERNEL_BUILD_PATH)/.config debug.config,)
 
-$(KERNEL_BZIMAGE): $(TOOLCHAIN_PATH)/.installed $(KERNEL_BUILD_PATH)/.config $(BUILD_PATH)/init-cpio-spec.txt $(IPERF_PATH)/src/iperf3 $(IPUTILS_PATH)/ping $(BASH_PATH)/bash $(IPROUTE2_PATH)/misc/ss $(IPROUTE2_PATH)/ip/ip $(IPTABLES_PATH)/iptables/xtables-legacy-multi $(NMAP_PATH)/ncat/ncat $(WIREGUARD_TOOLS_PATH)/src/wg $(BUILD_PATH)/init ../netns.sh $(WIREGUARD_SOURCES)
+$(KERNEL_BZIMAGE): $(TOOLCHAIN_PATH)/.installed $(KERNEL_BUILD_PATH)/.config $(BUILD_PATH)/init-cpio-spec.txt $(IPERF_PATH)/src/iperf3 $(IPUTILS_PATH)/ping $(BASH_PATH)/bash $(IPROUTE2_PATH)/misc/ss $(IPROUTE2_PATH)/ip/ip $(IPTABLES_PATH)/iptables/xtables-legacy-multi $(NMAP_PATH)/ncat/ncat $(WIREGUARD_TOOLS_PATH)/src/wg $(BUILD_PATH)/init
 	$(MAKE) -C $(KERNEL_PATH) O=$(KERNEL_BUILD_PATH) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(CROSS_COMPILE)
+.PHONY: $(KERNEL_BZIMAGE)
 
 $(TOOLCHAIN_PATH)/$(CHOST)/include/linux/.installed: | $(KERNEL_BUILD_PATH)/.config $(TOOLCHAIN_PATH)/.installed
 	rm -rf $(TOOLCHAIN_PATH)/$(CHOST)/include/linux
author maintainer
#220 lore raw

PATCH 220/231 signal handling: dont use BUG_ON() for debugging

In reply to Greg Kroah-Hartman

From: Linus Torvalds <[email protected]>

[ Upstream commit a382f8fee42ca10c9bfce0d2352d4153f931f5dc ]

These are indeed "should not happen" situations, but it turns out recent changes made the 'task_is_stopped_or_trace()' case trigger (fix for that exists, is pending more testing), and the BUG_ON() makes it unnecessarily hard to actually debug for no good reason.

It's been that way for a long time, but let's make it clear: BUG_ON() is not good for debugging, and should never be used in situations where you could just say "this shouldn't happen, but we can continue".

Use WARN_ON_ONCE() instead to make sure it gets logged, and then just continue running. Instead of making the system basically unusuable because you crashed the machine while potentially holding some very core locks (eg this function is commonly called while holding 'tasklist_lock' for writing).

---
 kernel/signal.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/signal.c +4 -4
@@ -2031,12 +2031,12 @@ bool do_notify_parent(struct task_struct
 	bool autoreap = false;
 	u64 utime, stime;
 
-	BUG_ON(sig == -1);
+	WARN_ON_ONCE(sig == -1);
 
- 	/* do_notify_parent_cldstop should have been called instead.  */
- 	BUG_ON(task_is_stopped_or_traced(tsk));
+	/* do_notify_parent_cldstop should have been called instead.  */
+	WARN_ON_ONCE(task_is_stopped_or_traced(tsk));
 
-	BUG_ON(!tsk->ptrace &&
+	WARN_ON_ONCE(!tsk->ptrace &&
 	       (tsk->group_leader != tsk || !thread_group_empty(tsk)));
 
 	/* Wake up all pidfd waiters */
author maintainer
#221 lore raw

PATCH 221/231 ACPI: video: Fix acpi_video_handles_brightness_key_presses()

In reply to Greg Kroah-Hartman

From: Hans de Goede <[email protected]>

[ Upstream commit 5ad26161a371e4aa2d2553286f0cac580987a493 ]

Commit 3a0cf7ab8df3 ("ACPI: video: Change how we determine if brightness key-presses are handled") made acpi_video_handles_brightness_key_presses() report false when none of the ACPI Video Devices support backlight control.

But it turns out that at least on a Dell Inspiron N4010 there is no ACPI backlight control, yet brightness hotkeys are still reported through the ACPI Video Bus; and since acpi_video_handles_brightness_key_presses() now returns false, brightness keypresses are now reported twice.

To fix this rename the has_backlight flag to may_report_brightness_keys and also set it the first time a brightness key press event is received.

Depending on the delivery of the other ACPI (WMI) event vs the ACPI Video Bus event this means that the first brightness key press might still get reported twice, but all further keypresses will be filtered as before.

Note that this relies on other drivers reporting brightness key events calling acpi_video_handles_brightness_key_presses() when delivering the events (rather then once during driver probe). This is already required and documented in include/acpi/video.h:

/*
* Note: The value returned by acpi_video_handles_brightness_key_presses()
* may change over time and should not be cached.
*/

---
 drivers/acpi/acpi_video.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/acpi/acpi_video.c +7 -4
@@ -73,7 +73,7 @@ module_param(device_id_scheme, bool, 044
 static int only_lcd = -1;
 module_param(only_lcd, int, 0444);
 
-static bool has_backlight;
+static bool may_report_brightness_keys;
 static int register_count;
 static DEFINE_MUTEX(register_count_mutex);
 static DEFINE_MUTEX(video_list_lock);
@@ -1224,7 +1224,7 @@ acpi_video_bus_get_one_device(struct acp
 	acpi_video_device_find_cap(data);
 
 	if (data->cap._BCM && data->cap._BCL)
-		has_backlight = true;
+		may_report_brightness_keys = true;
 
 	mutex_lock(&video->device_list_lock);
 	list_add_tail(&data->entry, &video->video_device_list);
@@ -1693,6 +1693,9 @@ static void acpi_video_device_notify(acp
 		break;
 	}
 
+	if (keycode)
+		may_report_brightness_keys = true;
+
 	acpi_notifier_call_chain(device, event, 0);
 
 	if (keycode && (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS)) {
@@ -2254,7 +2257,7 @@ void acpi_video_unregister(void)
 	if (register_count) {
 		acpi_bus_unregister_driver(&acpi_video_bus);
 		register_count = 0;
-		has_backlight = false;
+		may_report_brightness_keys = false;
 	}
 	mutex_unlock(&register_count_mutex);
 }
@@ -2276,7 +2279,7 @@ void acpi_video_unregister_backlight(voi
 
 bool acpi_video_handles_brightness_key_presses(void)
 {
-	return has_backlight &&
+	return may_report_brightness_keys &&
 	       (report_key_events & REPORT_BRIGHTNESS_KEY_EVENTS);
 }
 EXPORT_SYMBOL(acpi_video_handles_brightness_key_presses);
author maintainer
#222 lore raw

PATCH 222/231 vt: fix memory overlapping when deleting chars in the buffer

In reply to Greg Kroah-Hartman

From: Yangxi Xiang <[email protected]>

commit 39cdb68c64d84e71a4a717000b6e5de208ee60cc upstream.

A memory overlapping copy occurs when deleting a long line. This memory overlapping copy can cause data corruption when scr_memcpyw is optimized to memcpy because memcpy does not ensure its behavior if the destination buffer overlaps with the source buffer. The line buffer is not always broken, because the memcpy utilizes the hardware acceleration, whose result is not deterministic.

Fix this problem by using replacing the scr_memcpyw with scr_memmovew.

Fixes 81732c3b2fed ("tty vt: Fix line garbage in virtual console on command line edition")
Cc stable <[email protected]>
---
 drivers/tty/vt/vt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/vt/vt.c +1 -1
@@ -855,7 +855,7 @@ static void delete_char(struct vc_data *
 	unsigned short *p = (unsigned short *) vc->vc_pos;
 
 	vc_uniscr_delete(vc, nr);
-	scr_memcpyw(p, p + nr, (vc->vc_cols - vc->state.x - nr) * 2);
+	scr_memmovew(p, p + nr, (vc->vc_cols - vc->state.x - nr) * 2);
 	scr_memsetw(p + vc->vc_cols - vc->state.x - nr, vc->vc_video_erase_char,
 			nr * 2);
 	vc->vc_need_wrap = 0;
author maintainer
#223 lore raw

PATCH 223/231 s390/ap: fix error handling in __verify_queue_reservations()

In reply to Greg Kroah-Hartman

From: Tony Krowiak <[email protected]>

commit 2f23256c0ea20627c91ea2d468cda945f68c3395 upstream.

The AP bus's __verify_queue_reservations function increments the ref count for the device driver passed in as a parameter, but fails to decrement it before returning control to the caller. This will prevents any subsequent removal of the module.

Fixes 4f8206b88286 ("s390/ap: driver callback to indicate resource in use")
[[email protected] fixed description, added Fixes and Link]
---
 drivers/s390/crypto/ap_bus.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/crypto/ap_bus.c +1 -1
@@ -1410,7 +1410,7 @@ static int __verify_queue_reservations(s
 	if (ap_drv->in_use) {
 		rc = ap_drv->in_use(ap_perms.apm, newaqm);
 		if (rc)
-			return -EBUSY;
+			rc = -EBUSY;
 	}
 
 	/* release the driver's module */
author maintainer
#224 lore raw

PATCH 224/231 ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory

In reply to Greg Kroah-Hartman

From: Mario Limonciello <[email protected]>

commit fbd74d16890b9f5d08ea69b5282b123c894f8860 upstream.

When commit 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported") was introduced, we found collateral damage that a number of AMD systems that supported CPPC but didn't advertise support in _OSC stopped having a functional amd-pstate driver. The _OSC was only enforced on Intel systems at that time.

This was fixed for the MSR based designs by commit 8b356e536e69f ("ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported") but some shared memory based designs also support CPPC but haven't advertised support in the _OSC. Add support for those designs as well by hardcoding the list of systems.

Fixes 72f2ecb7ece7 ("ACPI: bus: Set CPPC _OSC bits for all and when CPPC_LIB is supported")
Fixes 8b356e536e69f ("ACPI: CPPC: Don't require _OSC if X86_FEATURE_CPPC is supported")
Cc 5.18+ <[email protected]> # 5.18+
---
 arch/x86/kernel/acpi/cppc.c |    6 ++++++
 1 file changed, 6 insertions(+)
arch/x86/kernel/acpi/cppc.c +6 -0
@@ -16,6 +16,12 @@ bool cpc_supported_by_cpu(void)
 	switch (boot_cpu_data.x86_vendor) {
 	case X86_VENDOR_AMD:
 	case X86_VENDOR_HYGON:
+		if (boot_cpu_data.x86 == 0x19 && ((boot_cpu_data.x86_model <= 0x0f) ||
+		    (boot_cpu_data.x86_model >= 0x20 && boot_cpu_data.x86_model <= 0x2f)))
+			return true;
+		else if (boot_cpu_data.x86 == 0x17 &&
+			 boot_cpu_data.x86_model >= 0x70 && boot_cpu_data.x86_model <= 0x7f)
+			return true;
 		return boot_cpu_has(X86_FEATURE_CPPC);
 	}
 	return false;
author maintainer
#225 lore raw

PATCH 225/231 serial: 8250: fix return error code in serial8250_request_std_resource()

In reply to Greg Kroah-Hartman

From: Yi Yang <[email protected]>

commit 6e690d54cfa802f939cefbd2fa2c91bd0b8bd1b6 upstream.

If port->mapbase = NULL in serial8250_request_std_resource() , it need return a error code instead of 0. If uart_set_info() fail to request new regions by serial8250_request_std_resource() but the return value of serial8250_request_std_resource() is 0, The system incorrectly considers that the resource application is successful and does not attempt to restore the old setting. A null pointer reference is triggered when the port resource is later invoked.

---
 drivers/tty/serial/8250/8250_port.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_port.c +3 -1
@@ -2971,8 +2971,10 @@ static int serial8250_request_std_resour
 	case UPIO_MEM32BE:
 	case UPIO_MEM16:
 	case UPIO_MEM:
-		if (!port->mapbase)
+		if (!port->mapbase) {
+			ret = -EINVAL;
 			break;
+		}
 
 		if (!request_mem_region(port->mapbase, size, "serial")) {
 			ret = -EBUSY;
author maintainer
#226 lore raw

PATCH 226/231 power: supply: core: Fix boundary conditions in interpolation

In reply to Greg Kroah-Hartman

From: Dorian Rudolph <[email protected]>

commit 093d27bb6f2d1963f927ef59c9a2d37059175426 upstream.

The functions power_supply_temp2resist_simple and power_supply_ocv2cap_simple handle boundary conditions incorrectly.
The change was introduced in a4585ba2050f460f749bbaf2b67bd56c41e30283 ("power: supply: core: Use library interpolation").
There are two issues: First, the lines "high = i - 1" and "high = i" in ocv2cap have the wrong order compared to temp2resist. As a consequence, ocv2cap sets high=-1 if ocv>table[0].ocv, which causes an out-of-bounds read. Second, the logic of temp2resist is also not correct.
Consider the case table[] = {{20, 100}, {10, 80}, {0, 60}}.
For temp=5, we expect a resistance of 70% by interpolation. However, temp2resist sets high=low=2 and returns 60.

Fixes a4585ba2050f ("power: supply: core: Use library interpolation")
---
 drivers/power/supply/power_supply_core.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/power/supply/power_supply_core.c +12 -12
@@ -846,17 +846,17 @@ int power_supply_temp2resist_simple(stru
 {
 	int i, high, low;
 
-	/* Break loop at table_len - 1 because that is the highest index */
-	for (i = 0; i < table_len - 1; i++)
+	for (i = 0; i < table_len; i++)
 		if (temp > table[i].temp)
 			break;
 
 	/* The library function will deal with high == low */
-	if ((i == 0) || (i == (table_len - 1)))
-		high = i;
+	if (i == 0)
+		high = low = i;
+	else if (i == table_len)
+		high = low = i - 1;
 	else
-		high = i - 1;
-	low = i;
+		high = (low = i) - 1;
 
 	return fixp_linear_interpolate(table[low].temp,
 				       table[low].resistance,
@@ -958,17 +958,17 @@ int power_supply_ocv2cap_simple(struct p
 {
 	int i, high, low;
 
-	/* Break loop at table_len - 1 because that is the highest index */
-	for (i = 0; i < table_len - 1; i++)
+	for (i = 0; i < table_len; i++)
 		if (ocv > table[i].ocv)
 			break;
 
 	/* The library function will deal with high == low */
-	if ((i == 0) || (i == (table_len - 1)))
-		high = i - 1;
+	if (i == 0)
+		high = low = i;
+	else if (i == table_len)
+		high = low = i - 1;
 	else
-		high = i; /* i.e. i == 0 */
-	low = i;
+		high = (low = i) - 1;
 
 	return fixp_linear_interpolate(table[low].ocv,
 				       table[low].capacity,
author maintainer
#227 lore raw

PATCH 227/231 serial: stm32: Clear prev values before setting RTS delays

In reply to Greg Kroah-Hartman

From: Ilpo Järvinen <[email protected]>

commit 5c5f44e36217de5ead789ff25da71c31c2331c96 upstream.

The code lacks clearing of previous DEAT/DEDT values. Thus, changing values on the fly results in garbage delays tending towards the maximum value as more and more bits are ORed together. (Leaving RS485 mode would have cleared the old values though).

Fixes 1bcda09d2910 ("serial: stm32: add support for RS485 hardware control mode")
Cc stable <[email protected]>
---
 drivers/tty/serial/stm32-usart.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/tty/serial/stm32-usart.c +2 -0
@@ -71,6 +71,8 @@ static void stm32_usart_config_reg_rs485
 	*cr3 |= USART_CR3_DEM;
 	over8 = *cr1 & USART_CR1_OVER8;
 
+	*cr1 &= ~(USART_CR1_DEDT_MASK | USART_CR1_DEAT_MASK);
+
 	if (over8)
 		rs485_deat_dedt = delay_ADE * baud * 8;
 	else
author maintainer
#228 lore raw

PATCH 228/231 serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle

In reply to Greg Kroah-Hartman

From: Ilpo Järvinen <[email protected]>

commit 211565b100993c90b53bf40851eacaefc830cfe0 upstream.

The driver must provide throttle and unthrottle in uart_ops when it sets UPSTAT_AUTORTS. Add them using existing stop_rx & enable_interrupts functions.

Fixes 2a76fa283098 (serial: pl011: Adopt generic flag to store auto RTS status)
Cc stable <[email protected]>
Cc Lukas Wunner <[email protected]>
---
 drivers/tty/serial/amba-pl011.c |   23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/tty/serial/amba-pl011.c +21 -2
@@ -1339,6 +1339,15 @@ static void pl011_stop_rx(struct uart_po
 	pl011_dma_rx_stop(uap);
 }
 
+static void pl011_throttle_rx(struct uart_port *port)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&port->lock, flags);
+	pl011_stop_rx(port);
+	spin_unlock_irqrestore(&port->lock, flags);
+}
+
 static void pl011_enable_ms(struct uart_port *port)
 {
 	struct uart_amba_port *uap =
@@ -1760,9 +1769,10 @@ static int pl011_allocate_irq(struct uar
  */
 static void pl011_enable_interrupts(struct uart_amba_port *uap)
 {
+	unsigned long flags;
 	unsigned int i;
 
-	spin_lock_irq(&uap->port.lock);
+	spin_lock_irqsave(&uap->port.lock, flags);
 
 	/* Clear out any spuriously appearing RX interrupts */
 	pl011_write(UART011_RTIS | UART011_RXIS, uap, REG_ICR);
@@ -1784,7 +1794,14 @@ static void pl011_enable_interrupts(stru
 	if (!pl011_dma_rx_running(uap))
 		uap->im |= UART011_RXIM;
 	pl011_write(uap->im, uap, REG_IMSC);
-	spin_unlock_irq(&uap->port.lock);
+	spin_unlock_irqrestore(&uap->port.lock, flags);
+}
+
+static void pl011_unthrottle_rx(struct uart_port *port)
+{
+	struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port);
+
+	pl011_enable_interrupts(uap);
 }
 
 static int pl011_startup(struct uart_port *port)
@@ -2211,6 +2228,8 @@ static const struct uart_ops amba_pl011_
 	.stop_tx	= pl011_stop_tx,
 	.start_tx	= pl011_start_tx,
 	.stop_rx	= pl011_stop_rx,
+	.throttle	= pl011_throttle_rx,
+	.unthrottle	= pl011_unthrottle_rx,
 	.enable_ms	= pl011_enable_ms,
 	.break_ctl	= pl011_break_ctl,
 	.startup	= pl011_startup,
author maintainer
#229 lore raw

PATCH 229/231 serial: 8250: Fix PM usage_count for console handover

In reply to Greg Kroah-Hartman

From: Ilpo Järvinen <[email protected]>

commit f9b11229b79c0fb2100b5bb4628a101b1d37fbf6 upstream.

When console is enabled, univ8250_console_setup() calls serial8250_console_setup() before .dev is set to uart_port. Therefore, it will not call pm_runtime_get_sync(). Later, when the actual driver is going to take over univ8250_console_exit() is called. As .dev is already set, serial8250_console_exit() makes pm_runtime_put_sync() call with usage count being zero triggering PM usage count warning (extra debug for univ8250_console_setup(), univ8250_console_exit(), and serial8250_register_ports()):

[    0.068987] univ8250_console_setup ttyS0 nodev
[    0.499670] printk: console [ttyS0] enabled
[    0.717955] printk: console [ttyS0] printing thread started
[    1.960163] serial8250_register_ports assigned dev for ttyS0
[    1.976830] printk: console [ttyS0] disabled
[    1.976888] printk: console [ttyS0] printing thread stopped
[    1.977073] univ8250_console_exit ttyS0 usage:0
[    1.977075] serial8250 serial8250: Runtime PM usage count underflow!
[    1.977429] dw-apb-uart.6: ttyS0 at MMIO 0x4010006000 (irq = 33, base_baud = 115200) is a 16550A
[    1.977812] univ8250_console_setup ttyS0 usage:2
[    1.978167] printk: console [ttyS0] printing thread started
[    1.978203] printk: console [ttyS0] enabled

To fix the issue, call pm_runtime_get_sync() in serial8250_register_ports() as soon as .dev is set for an uart_port if it has console enabled.

This problem became apparent only recently because 82586a721595 ("PM:
runtime: Avoid device usage count underflows") added the warning printout. I confirmed this problem also occurs with v5.18 (w/o the warning printout, obviously).

Fixes bedb404e91bb ("serial: 8250_port: Don't use power management for kernel console")
Cc stable <[email protected]>
---
 drivers/tty/serial/8250/8250_core.c |    4 ++++
 drivers/tty/serial/serial_core.c    |    5 -----
 include/linux/serial_core.h         |    5 +++++
 3 files changed, 9 insertions(+), 5 deletions(-)
drivers/tty/serial/8250/8250_core.c +4 -0
@@ -23,6 +23,7 @@
 #include <linux/sysrq.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/tty.h>
 #include <linux/ratelimit.h>
 #include <linux/tty_flip.h>
@@ -560,6 +561,9 @@ serial8250_register_ports(struct uart_dr
 
 		up->port.dev = dev;
 
+		if (uart_console_enabled(&up->port))
+			pm_runtime_get_sync(up->port.dev);
+
 		serial8250_apply_quirks(up);
 		uart_add_one_port(drv, &up->port);
 	}
drivers/tty/serial/serial_core.c +0 -5
@@ -1904,11 +1904,6 @@ static int uart_proc_show(struct seq_fil
 }
 #endif
 
-static inline bool uart_console_enabled(struct uart_port *port)
-{
-	return uart_console(port) && (port->cons->flags & CON_ENABLED);
-}
-
 static void uart_port_spin_lock_init(struct uart_port *port)
 {
 	spin_lock_init(&port->lock);
include/linux/serial_core.h +5 -0
@@ -388,6 +388,11 @@ static const bool earlycon_acpi_spcr_ena
 static inline int setup_earlycon(char *buf) { return 0; }
 #endif
 
+static inline bool uart_console_enabled(struct uart_port *port)
+{
+	return uart_console(port) && (port->cons->flags & CON_ENABLED);
+}
+
 struct uart_port *uart_get_console(struct uart_port *ports, int nr,
 				   struct console *c);
 int uart_parse_earlycon(char *p, unsigned char *iotype, resource_size_t *addr,
author maintainer
#230 lore raw

PATCH 230/231 serial: mvebu-uart: correctly report configured baudrate value

In reply to Greg Kroah-Hartman

From: Pali Rohár <[email protected]>

commit 4f532c1e25319e42996ec18a1f473fd50c8e575d upstream.

Functions tty_termios_encode_baud_rate() and uart_update_timeout() should be called with the baudrate value which was set to hardware. Linux then report exact values via ioctl(TCGETS2) to userspace.

Change mvebu_uart_baud_rate_set() function to return baudrate value which was set to hardware and propagate this value to above mentioned functions.

With this change userspace would see precise value in termios c_ospeed field.

Fixes 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate")
Cc stable <[email protected]>
---
 drivers/tty/serial/mvebu-uart.c |   25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/tty/serial/mvebu-uart.c +13 -12
@@ -470,14 +470,14 @@ static void mvebu_uart_shutdown(struct u
 	}
 }
 
-static int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned int baud)
+static unsigned int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned int baud)
 {
 	unsigned int d_divisor, m_divisor;
 	unsigned long flags;
 	u32 brdv, osamp;
 
 	if (!port->uartclk)
-		return -EOPNOTSUPP;
+		return 0;
 
 	/*
 	 * The baudrate is derived from the UART clock thanks to divisors:
@@ -548,7 +548,7 @@ static int mvebu_uart_baud_rate_set(stru
 			(m_divisor << 16) | (m_divisor << 24);
 	writel(osamp, port->membase + UART_OSAMP);
 
-	return 0;
+	return DIV_ROUND_CLOSEST(port->uartclk, d_divisor * m_divisor);
 }
 
 static void mvebu_uart_set_termios(struct uart_port *port,
@@ -587,15 +587,11 @@ static void mvebu_uart_set_termios(struc
 	max_baud = port->uartclk / 80;
 
 	baud = uart_get_baud_rate(port, termios, old, min_baud, max_baud);
-	if (mvebu_uart_baud_rate_set(port, baud)) {
-		/* No clock available, baudrate cannot be changed */
-		if (old)
-			baud = uart_get_baud_rate(port, old, NULL,
-						  min_baud, max_baud);
-	} else {
-		tty_termios_encode_baud_rate(termios, baud, baud);
-		uart_update_timeout(port, termios->c_cflag, baud);
-	}
+	baud = mvebu_uart_baud_rate_set(port, baud);
+
+	/* In case baudrate cannot be changed, report previous old value */
+	if (baud == 0 && old)
+		baud = tty_termios_baud_rate(old);
 
 	/* Only the following flag changes are supported */
 	if (old) {
@@ -606,6 +602,11 @@ static void mvebu_uart_set_termios(struc
 		termios->c_cflag |= CS8;
 	}
 
+	if (baud != 0) {
+		tty_termios_encode_baud_rate(termios, baud, baud);
+		uart_update_timeout(port, termios->c_cflag, baud);
+	}
+
 	spin_unlock_irqrestore(&port->lock, flags);
 }
 
author maintainer
#231 lore raw

PATCH 231/231 x86/pat: Fix x86_has_pat_wp()

In reply to Greg Kroah-Hartman

From: Juergen Gross <[email protected]>

commit 230ec83d4299b30c51a1c133b4f2a669972cc08a upstream.

x86_has_pat_wp() is using a wrong test, as it relies on the normal PAT configuration used by the kernel. In case the PAT MSR has been setup by another entity (e.g. Xen hypervisor) it might return false even if the PAT configuration is allowing WP mappings. This due to the fact that when running as Xen PV guest the PAT MSR is setup by the hypervisor and cannot be changed by the guest. This results in the WP related entry to be at a different position when running as Xen PV guest compared to the bare metal or fully virtualized case.

The correct way to test for WP support is:

1. Get the PTE protection bits needed to select WP mode by reading __cachemode2pte_tbl[_PAGE_CACHE_MODE_WP] (depending on the PAT MSR setting this might return protection bits for a stronger mode, e.g. UC-)
2. Translate those bits back into the real cache mode selected by those PTE bits by reading __pte2cachemode_tbl[__pte2cm_idx(prot)]
3. Test for the cache mode to be _PAGE_CACHE_MODE_WP

Fixes f88a68facd9a ("x86/mm: Extend early_memremap() support with additional attrs")
Cc <[email protected]> # 4.14
---
 arch/x86/mm/init.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
arch/x86/mm/init.c +12 -2
@@ -77,10 +77,20 @@ static uint8_t __pte2cachemode_tbl[8] =
 	[__pte2cm_idx(_PAGE_PWT | _PAGE_PCD | _PAGE_PAT)] = _PAGE_CACHE_MODE_UC,
 };
 
-/* Check that the write-protect PAT entry is set for write-protect */
+/*
+ * Check that the write-protect PAT entry is set for write-protect.
+ * To do this without making assumptions how PAT has been set up (Xen has
+ * another layout than the kernel), translate the _PAGE_CACHE_MODE_WP cache
+ * mode via the __cachemode2pte_tbl[] into protection bits (those protection
+ * bits will select a cache mode of WP or better), and then translate the
+ * protection bits back into the cache mode using __pte2cm_idx() and the
+ * __pte2cachemode_tbl[] array. This will return the really used cache mode.
+ */
 bool x86_has_pat_wp(void)
 {
-	return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == _PAGE_CACHE_MODE_WP;
+	uint16_t prot = __cachemode2pte_tbl[_PAGE_CACHE_MODE_WP];
+
+	return __pte2cachemode_tbl[__pte2cm_idx(prot)] == _PAGE_CACHE_MODE_WP;
 }
 
 enum page_cache_mode pgprot2cachemode(pgprot_t pgprot)
#232 lore raw
In reply to Greg Kroah-Hartman
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.13-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

There are two regression found

1)
Build regression on i386 with clang-13 and clang-14, I do not see this build error on mainline.

2) Too many build warnings x86 with gcc-11
I do not see these build warnings on mainline,

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by i915_scatterlist.c

              gpu/drm/i915/i915_scatterlist.o:(i915_rsgt_from_mm_node) in archive drivers/built-in.a

make[1]: *** [/builds/linux/Makefile:1162: vmlinux] Error 1

steps to reproduce:
--------------------------
tuxmake --runtime podman --target-arch i386 --toolchain clang-14 --kconfig https://builds.tuxbuild.com/2CA3gjUTE2s74Bzp3G7q2hBxj1t/config
LLVM=1 LLVM_IAS=1
[1] https://builds.tuxbuild.com/2CA3gjUTE2s74Bzp3G7q2hBxj1t/

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

Build link: https://builds.tuxbuild.com/2CA3fVEQKJXLNNGgHvoEmFEjyPq/

make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
init/calibrate.o: warning: objtool: calibrate_delay_is_known()+0xc:
'naked' return found in RETPOLINE build
init/initramfs.o: warning: objtool: wait_for_initramfs()+0x23: 'naked' return found in RETPOLINE build
init/main.o: warning: objtool: __traceiter_initcall_level()+0x3a:
'naked' return found in RETPOLINE build arch/x86/entry/vdso/vma.o: warning: objtool: vdso_mremap()+0x49:
'naked' return found in RETPOLINE build arch/x86/events/amd/core.o: warning: objtool:
amd_pmu_event_map()+0x1e: 'naked' return found in RETPOLINE build init/do_mounts.o: warning: objtool: match_dev_by_label()+0x2d: 'naked' return found in RETPOLINE build arch/x86/events/amd/iommu.o: warning: objtool:
perf_iommu_event_init()+0x57: 'naked' return found in RETPOLINE build arch/x86/events/amd/ibs.o: warning: objtool: perf_ibs_init()+0x136:
'naked' return found in RETPOLINE build certs/system_keyring.o: warning: objtool:
restrict_link_by_builtin_trusted()+0x16: 'naked' return found in REild kernel/locking/mutex.o: warning: objtool: __mutex_init()+0x2b: 'naked' return found in RETPOLINE build

steps to reproduce:
tuxmake --runtime podman --target-arch x86_64 --toolchain gcc-11 --kconfig https://builds.tuxbuild.com/2CA3fVEQKJXLNNGgHvoEmFEjyPq/config

--
Linaro LKFT
https://lkft.linaro.org

author maintainer
#233 lore raw
Quoted 54 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
        https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.13-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

There are two regression found

1)
Build regression on i386 with clang-13 and clang-14, I do not see this build error on mainline.

2) Too many build warnings x86 with gcc-11
I do not see these build warnings on mainline,

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by i915_scatterlist.c

              gpu/drm/i915/i915_scatterlist.o:(i915_rsgt_from_mm_node) in archive drivers/built-in.a

make[1]: *** [/builds/linux/Makefile:1162: vmlinux] Error 1

steps to reproduce:
--------------------------
tuxmake --runtime podman --target-arch i386 --toolchain clang-14 --kconfig https://builds.tuxbuild.com/2CA3gjUTE2s74Bzp3G7q2hBxj1t/config
LLVM=1 LLVM_IAS=1
[1] https://builds.tuxbuild.com/2CA3gjUTE2s74Bzp3G7q2hBxj1t/

Quoted 4 lines

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

Build link: https://builds.tuxbuild.com/2CA3fVEQKJXLNNGgHvoEmFEjyPq/

Very odd, can you do bisect to track down the offending commits?

My local building test system is not working for unrelated issues (local heat wave), and my cloud test systems are broken for some other unknown reason, so I can't test this myself.

thanks,

greg k-h

#234 lore raw
In reply to Naresh Kamboju
Quoted 10 lines · Naresh Kamboju

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3

Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix 32b build").

Quoted 2 lines

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

..

Quoted 1 line

'naked' return found in RETPOLINE build

Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?

Your build does magic things with 'scripts/kconfig/merge_config.sh', and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a compiler that doesn't actually support it, or something like that?

Linus

#235 lore raw

Hi Linus,

Quoted 20 lines · Linus Torvalds
Quoted 10 lines · Naresh Kamboju

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3

Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix 32b build").

Quoted 2 lines

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

Quoted 8 lines

..

Quoted 1 line

'naked' return found in RETPOLINE build

Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?

Your build does magic things with 'scripts/kconfig/merge_config.sh', and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a compiler that doesn't actually support it, or something like that?

I see the diff of the defconfig file from the previous release.

The new config is causing a lot of warnings.
init/calibrate.o: warning: objtool: calibrate_delay_is_known()+0x2:
'naked' return found in RETPOLINE build

Following configs have been deleted in new defconfig CONFIG_RETHUNK=y CONFIG_CC_HAS_RETURN_THUNK=y CONFIG_SPECULATION_MITIGATIONS=y CONFIG_CPU_UNRET_ENTRY=y CONFIG_CPU_IBPB_ENTRY=y CONFIG_CPU_IBRS_ENTRY=y

warning-config 2022-07-19 17:37:17.000000000 +0530 renamed from good-config 2022-07-13 02:22:04.000000000 +0530 +7 -13
@@ -1,15 +1,15 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86_64 5.18.12-rc1 Kernel Configuration
+# Linux/x86_64 5.18.13-rc1 Kernel Configuration
 #
 CONFIG_CC_VERSION_TEXT="x86_64-linux-gnu-gcc (Debian 11.3.0-3) 11.3.0"
 CONFIG_CC_IS_GCC=y
 CONFIG_GCC_VERSION=110300
 CONFIG_CLANG_VERSION=0
 CONFIG_AS_IS_GNU=y
-CONFIG_AS_VERSION=23800
+CONFIG_AS_VERSION=23850
 CONFIG_LD_IS_BFD=y
-CONFIG_LD_VERSION=23800
+CONFIG_LD_VERSION=23850
 CONFIG_LLD_VERSION=0
 CONFIG_CC_CAN_LINK=y
 CONFIG_CC_CAN_LINK_STATIC=y
@@ -317,6 +317,9 @@
 # CONFIG_X86_X2APIC is not set
 CONFIG_X86_MPPARSE=y
 # CONFIG_GOLDFISH is not set
+CONFIG_RETPOLINE=y
+CONFIG_CC_HAS_SLS=y
+# CONFIG_SLS is not set
 # CONFIG_X86_CPU_RESCTRL is not set
 CONFIG_X86_EXTENDED_PLATFORM=y
 # CONFIG_X86_VSMP is not set
@@ -467,16 +470,6 @@
 CONFIG_HAVE_LIVEPATCH=y
 # end of Processor type and features
 
-CONFIG_CC_HAS_SLS=y
-CONFIG_CC_HAS_RETURN_THUNK=y
-CONFIG_SPECULATION_MITIGATIONS=y
-CONFIG_PAGE_TABLE_ISOLATION=y
-CONFIG_RETPOLINE=y
-CONFIG_RETHUNK=y
-CONFIG_CPU_UNRET_ENTRY=y
-CONFIG_CPU_IBPB_ENTRY=y
-CONFIG_CPU_IBRS_ENTRY=y
-# CONFIG_SLS is not set
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 
@@ -4318,6 +4311,7 @@
 CONFIG_SECURITY_WRITABLE_HOOKS=y
 # CONFIG_SECURITYFS is not set
 CONFIG_SECURITY_NETWORK=y
+CONFIG_PAGE_TABLE_ISOLATION=y
 # CONFIG_SECURITY_NETWORK_XFRM is not set
 # CONFIG_SECURITY_PATH is not set
 # CONFIG_INTEL_TXT is not set

--
Linaro LKFT
https://lkft.linaro.org

#236 lore raw
In reply to Linus Torvalds
Quoted 14 lines · Linus Torvalds
Quoted 10 lines · Naresh Kamboju

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3

Quoted 3 lines

Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix 32b build").

Daniel, tested with extra commits as suggested by you and i386 build pass.

     ced7866db39f ("drm/i915/ttm: fix 32b build")

- Naresh

#237 lore raw
In reply to Linus Torvalds
Quoted 19 lines · Linus Torvalds
Quoted 10 lines · Naresh Kamboju

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3

Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix 32b build").

Quoted 2 lines

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

Quoted 8 lines

..

Quoted 1 line

'naked' return found in RETPOLINE build

Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?

Your build does magic things with 'scripts/kconfig/merge_config.sh', and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a compiler that doesn't actually support it, or something like that?

I am seeing these 'naked' return found in RETPOLINE build on the standard fedora 36 toolchain as well. No cross compiling, nothing fancy. These were not seen with mainline, or with the 5.18.12-rc1 retbleed patches.

Justin

#238 lore raw

[ Adding PeterZ and Jiri to the participants. ]

Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

That said, 3131ef39fb03 should have fixed a completely different issue on 32-bit, not the "naked ret" thing.

PeterZ, Jiri, any ideas? Limited quoting below, see thread at

https://lore.kernel.org/all/CA+G9fYsJBBbEXowA-3kxDNqcfbtcqmxBrEnJSkCnLUsMzNfJZw@mail.gmail.com/

for more details.

Linus

Quoted 23 lines · Justin Forbes
Quoted 6 lines · Linus Torvalds
Quoted 4 lines · Naresh Kamboju

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

Quoted 8 lines

..

Quoted 1 line

'naked' return found in RETPOLINE build

Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?

Your build does magic things with 'scripts/kconfig/merge_config.sh', and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a compiler that doesn't actually support it, or something like that?

I am seeing these 'naked' return found in RETPOLINE build on the standard fedora 36 toolchain as well. No cross compiling, nothing fancy. These were not seen with mainline, or with the 5.18.12-rc1 retbleed patches.

Justin

#239 lore raw
Quoted 5 lines · Linus Torvalds

[ Adding PeterZ and Jiri to the participants. ]

Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

It should be noted that the build doesn't fail, it just warns. I am guessing the 32bit failure is what promoted someone to look at the logs to begin with and notice the warn initially. I just verified that it exists in our builds of 5.18.13-rc1, but not on mainline builds. I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline validation") should be followed up with at least commit f43b9876e857c ("x86/retbleed: Add fine grained Kconfig knobs")

Justin

Quoted 35 lines

That said, 3131ef39fb03 should have fixed a completely different issue on 32-bit, not the "naked ret" thing.

PeterZ, Jiri, any ideas? Limited quoting below, see thread at

https://lore.kernel.org/all/CA+G9fYsJBBbEXowA-3kxDNqcfbtcqmxBrEnJSkCnLUsMzNfJZw@mail.gmail.com/

for more details.

Linus

Quoted 23 lines · Justin Forbes
Quoted 6 lines · Linus Torvalds
Quoted 4 lines · Naresh Kamboju

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

Quoted 8 lines

..

Quoted 1 line

'naked' return found in RETPOLINE build

Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?

Your build does magic things with 'scripts/kconfig/merge_config.sh', and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a compiler that doesn't actually support it, or something like that?

I am seeing these 'naked' return found in RETPOLINE build on the standard fedora 36 toolchain as well. No cross compiling, nothing fancy. These were not seen with mainline, or with the 5.18.12-rc1 retbleed patches.

Justin

#240 lore raw
Quoted 7 lines · Justin Forbes
Quoted 5 lines · Linus Torvalds

[ Adding PeterZ and Jiri to the participants. ]

Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

Quoted 7 lines

It should be noted that the build doesn't fail, it just warns. I am guessing the 32bit failure is what promoted someone to look at the logs to begin with and notice the warn initially. I just verified that it exists in our builds of 5.18.13-rc1, but not on mainline builds. I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline validation") should be followed up with at least commit f43b9876e857c ("x86/retbleed: Add fine grained Kconfig knobs")

Still updateing the stable repro to see what the actual code looks like, but that warning seems to suggest the -mfunction-return=thunk-extern compiler argument went missing.

For all the files objtool complains about, does the V=1 build output show that option?

#241 lore raw
Quoted 16 lines · Peter Zijlstra
Quoted 7 lines · Justin Forbes
Quoted 5 lines · Linus Torvalds

[ Adding PeterZ and Jiri to the participants. ]

Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

Quoted 7 lines

It should be noted that the build doesn't fail, it just warns. I am guessing the 32bit failure is what promoted someone to look at the logs to begin with and notice the warn initially. I just verified that it exists in our builds of 5.18.13-rc1, but not on mainline builds. I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline validation") should be followed up with at least commit f43b9876e857c ("x86/retbleed: Add fine grained Kconfig knobs")

Quoted 6 lines

Still updateing the stable repro to see what the actual code looks like, but that warning seems to suggest the -mfunction-return=thunk-extern compiler argument went missing.

For all the files objtool complains about, does the V=1 build output show that option?

Ok, I'm now looking at stable-rc/linux-5.18.y which reports itself as:

VERSION = 5
PATCHLEVEL = 18
SUBLEVEL = 13
EXTRAVERSION = -rc1

and I'm most terribly confused... it has the objtool patch to validate return thunks, *however*, I'm not seeing any actual retbleed mitigations *anywhere*.

How, what, why!?

#242 lore raw
Quoted 31 lines · Peter Zijlstra
Quoted 16 lines · Peter Zijlstra
Quoted 7 lines · Justin Forbes
Quoted 5 lines · Linus Torvalds

[ Adding PeterZ and Jiri to the participants. ]

Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

Quoted 7 lines

It should be noted that the build doesn't fail, it just warns. I am guessing the 32bit failure is what promoted someone to look at the logs to begin with and notice the warn initially. I just verified that it exists in our builds of 5.18.13-rc1, but not on mainline builds. I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline validation") should be followed up with at least commit f43b9876e857c ("x86/retbleed: Add fine grained Kconfig knobs")

Quoted 6 lines

Still updateing the stable repro to see what the actual code looks like, but that warning seems to suggest the -mfunction-return=thunk-extern compiler argument went missing.

For all the files objtool complains about, does the V=1 build output show that option?

Ok, I'm now looking at stable-rc/linux-5.18.y which reports itself as:

VERSION = 5
PATCHLEVEL = 18
SUBLEVEL = 13
EXTRAVERSION = -rc1

Quoted 5 lines

and I'm most terribly confused... it has the objtool patch to validate return thunks, *however*, I'm not seeing any actual retbleed mitigations *anywhere*.

How, what, why!?

They were all put aside until all this gets resolved. You can find them in the stable-queue tree:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git

in retbleed-5.18/.

regards,

Signature · 2 lines
js
suse labs
#243 lore raw
Quoted 36 lines · Jiri Slaby
Quoted 35 lines · Peter Zijlstra
Quoted 16 lines · Peter Zijlstra
Quoted 7 lines · Justin Forbes
Quoted 5 lines · Linus Torvalds

[ Adding PeterZ and Jiri to the participants. ]

Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

Quoted 7 lines

It should be noted that the build doesn't fail, it just warns. I am guessing the 32bit failure is what promoted someone to look at the logs to begin with and notice the warn initially. I just verified that it exists in our builds of 5.18.13-rc1, but not on mainline builds. I am gueesing it is because commit 9bb2ec608a20 ("objtool: Update Retpoline validation") should be followed up with at least commit f43b9876e857c ("x86/retbleed: Add fine grained Kconfig knobs")

Quoted 6 lines

Still updateing the stable repro to see what the actual code looks like, but that warning seems to suggest the -mfunction-return=thunk-extern compiler argument went missing.

For all the files objtool complains about, does the V=1 build output show that option?

Ok, I'm now looking at stable-rc/linux-5.18.y which reports itself as:

VERSION = 5
PATCHLEVEL = 18
SUBLEVEL = 13
EXTRAVERSION = -rc1

and I'm most terribly confused... it has the objtool patch to validate return thunks, *however*, I'm not seeing any actual retbleed mitigations *anywhere*.

Quoted 6 lines
Quoted 1 line

How, what, why!?

They were all put aside until all this gets resolved. You can find them in the stable-queue tree:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git

in retbleed-5.18/.

Ah, apparently not all, as you noted above. But this is obviously a mistake:
https://lore.kernel.org/all/[email protected]/

Quoted 1 line

regards,--

Signature · 2 lines
js
suse labs
#244 lore raw
In reply to Linus Torvalds
Quoted 8 lines · Linus Torvalds

[ Adding PeterZ and Jiri to the participants. ]

Looks like 5.18.13 added that commit 9bb2ec608a20 ("objtool: Update Retpoline validation") but I don't see 3131ef39fb03 ("x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit") in that list.

That said, 3131ef39fb03 should have fixed a completely different issue on 32-bit, not the "naked ret" thing.

Right. After applying 3131ef39fb03 on the top of 5.18.12 (or 5.18.13-rc1 too), I'm fine:
https://build.opensuse.org/public/build/Kernel:stable/standard/i586/kernel-pae/_log

I.e. no warnings at all, the kernel compiles and runs fine -- tested in qemu only. It's gcc12 as can be seen in the log above.

Config:
https://github.com/openSUSE/kernel-source/blob/stable/config/i386/pae

It says:
CONFIG_CC_HAS_SLS=y
CONFIG_CC_HAS_RETURN_THUNK=y
CONFIG_SPECULATION_MITIGATIONS=y
CONFIG_PAGE_TABLE_ISOLATION=y
CONFIG_RETPOLINE=y
CONFIG_RETHUNK=y
CONFIG_CPU_UNRET_ENTRY=y
CONFIG_CPU_IBPB_ENTRY=y
CONFIG_CPU_IBRS_ENTRY=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y

Patches:
https://github.com/openSUSE/kernel-source/tree/stable/patches.suse

Apart from others, it contains:
3131ef39fb03 x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit
bb06650634d3 KVM: VMX: Convert launched argument to flags
bea7e31a5cac KVM: VMX: Fix IBRS handling after vmexit
8bd200d23ec4 KVM: VMX: Flatten __vmx_vcpu_run()
07853adc29a0 KVM: VMX: Prevent RSB underflow before vmenter
fc02735b14ff KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS
bf5835bcdb96 intel_idle: Disable IBRS during long idle
a09a6e2399ba objtool: Add entry UNRET validation
8faea26e6111 objtool: Re-add UNWIND_HINT_{SAVE_RESTORE}
951ddecf4356 objtool: Treat .text.__x86.* as noinstr
9bb2ec608a20 objtool: Update Retpoline validation
a149180fbcf3 x86: Add magic AMD return-thunk
15e67227c49a x86: Undo return-thunk damage
aa3d480315ba x86: Use return-thunk in asm code
d77cfe594ad5 x86/bpf: Use alternative RET encoding
7fbf47c7ce50 x86/bugs: Add AMD retbleed= boot parameter
f54d45372c6a x86/bugs: Add Cannon lake to RETBleed affected CPU list
3ebc17006888 x86/bugs: Add retbleed=ibpb
0fe4aeea9c01 x86/bugs: Do IBPB fallback check only once
2259da159fbe x86/bugs: Do not enable IBPB-on-entry when IBPB is not supported e8ec1b6e08a2 x86/bugs: Enable STIBP for JMP2RET
caa0ff24d5d0 x86/bugs: Keep a per-CPU IA32_SPEC_CTRL value
c779bc1a9002 x86/bugs: Optimize SPEC_CTRL MSR writes
bcf163150cd3 x86/bugs: Remove apostrophe typo
6b80b59b3555 x86/bugs: Report AMD retbleed vulnerability
6ad0ad2bf8a6 x86/bugs: Report Intel retbleed vulnerability
166115c08a9b x86/bugs: Split spectre_v2_select_mitigation() and spectre_v2_user_select_mitigation() 7a05bc95ed1c x86/common: Stamp out the stepping madness
d7caac991fee x86/cpu/amd: Add Spectral Chicken
26aae8ccbc19 x86/cpu/amd: Enumerate BTC_NO
a883d624aed4 x86/cpufeatures: Move RETPOLINE flags to word 11
2dbb887e875b x86/entry: Add kernel IBRS implementation
7c81c0c9210c x86/entry: Avoid very early RET
64cbd0acb582 x86/entry: Don't call error_entry() for XENPV
2c08b9b38f5b x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry ee774dac0da1 x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()
d16e0b266720 x86/entry: Remove UNTRAIN_RET from native_irq_return_ldt
1b331eeea7b8 x86/entry: Remove skip_r11rcx
520a7e80c96d x86/entry: Switch the stack after error_entry() returns
1f001e9da6bb x86/ftrace: Use alternative RET encoding
697977d8415d x86/kexec: Disable RET on kexec
af2e140f3420 x86/kvm: Fix SETcc emulation for return thunks
84e7051c0bc1 x86/kvm: fix FASTOP_SIZE when return thunks are enabled
742ab6df974a x86/kvm/vmx: Make noinstr clean
a1e2c031ec39 x86/mm: Simplify RESERVE_BRK()
d9e9d2300681 x86,objtool: Create .return_sites
f43b9876e857 x86/retbleed: Add fine grained Kconfig knobs
369ae6ffc41a x86/retpoline: Cleanup some #ifdefery
00e1533325fd x86/retpoline: Swizzle retpoline thunk
0b53c374b9ef x86/retpoline: Use -mfunction-return
0ee9073000e8 x86/sev: Avoid using __x86_return_thunk
7c693f54c873 x86/speculation: Add spectre_v2=ibrs option to support Kernel IBRS 4ad3278df6fe x86/speculation: Disable RRSBA behavior
9756bba28470 x86/speculation: Fill RSB on vmexit for IBRS
b2620facef48 x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n
56aa4d221f1e x86/speculation: Fix SPEC_CTRL write on SMT state change
e6aa13622ea8 x86/speculation: Fix firmware entry SPEC_CTRL handling
acac5e98ef8d x86/speculation: Remove x86_spec_ctrl_mask
bbb69e8bee1b x86/speculation: Use cached host SPEC_CTRL value for guest entry/exit c27c753ea6fd x86/static_call: Serialize __static_call_fixup() properly
ee88d363d156 x86,static_call: Use alternative RET encoding
0aca53c6b522 x86/traps: Use pt_regs directly in fixup_bad_iret()
15583e514eb1 x86/vsyscall_emu/64: Don't use RET in vsyscall emulation
d147553b64ba x86/xen: Add UNTRAIN_RET
b75b7f8ef114 x86/xen: Rename SYS* entry points

Series file:
https://github.com/openSUSE/kernel-source/blob/stable/series.conf

Quoted 32 lines

PeterZ, Jiri, any ideas? Limited quoting below, see thread at

https://lore.kernel.org/all/CA+G9fYsJBBbEXowA-3kxDNqcfbtcqmxBrEnJSkCnLUsMzNfJZw@mail.gmail.com/

for more details.

Linus

Quoted 23 lines · Justin Forbes
Quoted 6 lines · Linus Torvalds
Quoted 4 lines · Naresh Kamboju

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

Quoted 8 lines

..

Quoted 1 line

'naked' return found in RETPOLINE build

Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?

Your build does magic things with 'scripts/kconfig/merge_config.sh', and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a compiler that doesn't actually support it, or something like that?

I am seeing these 'naked' return found in RETPOLINE build on the standard fedora 36 toolchain as well. No cross compiling, nothing fancy. These were not seen with mainline, or with the 5.18.12-rc1 retbleed patches.

Justin

regards,

Signature · 2 lines
js
suse labs
#245 lore raw
Quoted 20 lines · Jiri Slaby

Config:
https://github.com/openSUSE/kernel-source/blob/stable/config/i386/pae

It says:
CONFIG_CC_HAS_SLS=y
CONFIG_CC_HAS_RETURN_THUNK=y
CONFIG_SPECULATION_MITIGATIONS=y
CONFIG_PAGE_TABLE_ISOLATION=y
CONFIG_RETPOLINE=y
CONFIG_RETHUNK=y
CONFIG_CPU_UNRET_ENTRY=y
CONFIG_CPU_IBPB_ENTRY=y
CONFIG_CPU_IBRS_ENTRY=y
CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y

Patches:
https://github.com/openSUSE/kernel-source/tree/stable/patches.suse

Apart from others, it contains:
3131ef39fb03 x86/asm/32: Fix ANNOTATE_UNRET_SAFE use on 32-bit

...

Quoted 1 line

b75b7f8ef114 x86/xen: Rename SYS* entry points

Thinking about it, that's likely the reason I'm not seeing any failures -- I still carry all the retbleed patches on the top of stable. So while 5.18.12-rc1 (the retbleed one) had them and added the above configs, later 5.18.12-rc/-final (only rawnand fixup), or 5.18.13-rc1 do not -- the configs are gone.

regards,

Signature · 1 line
js
#246 lore raw
Quoted 2 lines · Jiri Slaby

Thinking about it, that's likely the reason I'm not seeing any failures -- I still carry all the retbleed patches on the top of stable. So while

Confirmed. So I assume this gets fixed once the rest of retbleed patches is dropped from 5.18.13-rc1.

regards,

Signature · 1 line
js
author maintainer
#247 lore raw
Quoted 6 lines · Jiri Slaby
Quoted 2 lines · Jiri Slaby

Thinking about it, that's likely the reason I'm not seeing any failures -- I still carry all the retbleed patches on the top of stable. So while

Confirmed. So I assume this gets fixed once the rest of retbleed patches is dropped from 5.18.13-rc1.

Yes, let me fix this all up, sorry for the mess...

author maintainer
#248 lore raw
In reply to Justin Forbes
Quoted 25 lines · Justin Forbes
Quoted 24 lines · Linus Torvalds
Quoted 10 lines · Naresh Kamboju

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3

Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix 32b build").

Quoted 2 lines

2. Large number of build warnings on x86 with gcc-11, I do not see these build warnings on mainline,

..

Quoted 1 line

'naked' return found in RETPOLINE build

Hmm. Does your cross-compiler support '-mfunction-return=thunk-extern'?

Quoted 8 lines
Quoted 3 lines

Your build does magic things with 'scripts/kconfig/merge_config.sh', and I'm wondering if you perhaps end up enabling CONFIG_RETHUNK with a compiler that doesn't actually support it, or something like that?

I am seeing these 'naked' return found in RETPOLINE build on the standard fedora 36 toolchain as well. No cross compiling, nothing fancy. These were not seen with mainline, or with the 5.18.12-rc1 retbleed patches.

Ok, I think we have a few of the retbleed patches in here that shouldn't be in there yet. Let me flush them out and then put out a new -rc tomorrow with this all fixed up. Sasha and I got things crossed, I'll blame the heat here in Europe and me attempting to take a few days off...

thanks,

greg k-h

author maintainer
#249 lore raw
In reply to Linus Torvalds
Quoted 13 lines · Linus Torvalds
Quoted 10 lines · Naresh Kamboju

Details log:
------------
1. i386 build failures with clang-13 and clang-14
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1 ARCH=i386 CROSS_COMPILE=i686-linux-gnu- 'HOSTCC=sccache clang' 'CC=sccache clang'
ld.lld: error: undefined symbol: __udivdi3

Quoted 3 lines

Looks like the one introduced by aff1e0b09b54 ("drm/i915/ttm: fix sg_table construction"), and fixed by ced7866db39f ("drm/i915/ttm: fix 32b build").

Thanks, I've queued this one up now in the -rc3 update.

greg k-h

Tested-by on the v1 series
#250 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.13-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels and built tested with BMIPS_GENERIC (bmips_stb_defconfig):

Signature · 1 line
Florian
Tested-by on the v1 series
#251 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.13-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

Built and booted successfully on RISC-V RV64 (HiFive Unmatched).

#252 lore raw
In reply to Greg Kroah-Hartman
Quoted 8 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.

Build results:

	total: 154 pass: 151 fail: 3
Failed builds:
	i386:defconfig
	i386:allyesconfig
	i386:allmodconfig
Qemu test results:
	total: 489 pass: 461 fail: 28
Failed tests:
	<all i386>

The problem has already been reported, so I don't need to elaborate further.

Guenter

maintainer Tested-by on the v1 series
#253 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.13-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

All tests passing for Tegra ...

Test results for stable-v5.18:

    10 builds:	10 pass, 0 fail
    28 boots:	28 pass, 0 fail
    120 tests:	120 pass, 0 fail

Linux version: 5.18.13-rc1-ga04b1a5cb7d2
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,

                tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
                tegra20-ventana, tegra210-p2371-2180,
                tegra210-p3450-0000, tegra30-cardhu-a04

Jon

Tested-by on the v1 series
#254 lore raw
In reply to Greg Kroah-Hartman
Quoted 5 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Successfully cross-compiled for arm64 (bcm2711_defconfig, GCC 10.2.0) and powerpc (ps3_defconfig, GCC 12.1.0).

Signature · 1 line
An old man doll... just what I always wanted! - Clara
Tested-by Sudip Mukherjee on the v1 series
#255 lore raw
In reply to Greg Kroah-Hartman

Hi Greg,

Quoted 7 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Responses should be made by Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.

Build test (gcc version 12.1.1 20220706):
mips: 59 configs -> no failure
arm: 99 configs -> no failure
arm64: 3 configs -> no failure
x86_64: 4 configs -> no failure
alpha allmodconfig -> no failure
csky allmodconfig -> no failure
powerpc allmodconfig -> no failure
riscv allmodconfig -> no failure
s390 allmodconfig -> no failure
xtensa allmodconfig -> no failure

Boot test:
x86_64: Booted on my test laptop. No regression.
x86_64: Booted on qemu. No regression. [1]
arm64: Booted on rpi4b (4GB model). No regression. [2]
mips: Booted on ci20 board. No regression. [3]

[1]. https://openqa.qa.codethink.co.uk/tests/1523
[2]. https://openqa.qa.codethink.co.uk/tests/1532
[3]. https://openqa.qa.codethink.co.uk/tests/1534

Note: seen lots of build warning as reported by others.

--
Regards
Sudip

#256 lore raw
In reply to Greg Kroah-Hartman

Greg Kroah-Hartman:

Quoted 4 lines

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Hi Greg,

I noticed that there are several patches in the list which are also part of your retbleed-5.18 queue. If I am not mistaken, these are:

[PATCH 5.18 145/231] x86/kvm: Fix SETcc emulation for return thunks [PATCH 5.18 146/231] x86/sev: Avoid using __x86_return_thunk [PATCH 5.18 147/231] x86/bugs: Report AMD retbleed vulnerability [PATCH 5.18 148/231] objtool: Update Retpoline validation [PATCH 5.18 149/231] x86/xen: Rename SYS* entry points [PATCH 5.18 150/231] x86/cpu/amd: Add Spectral Chicken

I'm wondering if this is intended or if it would be better to release a stable kernel with all the retbleed patches later because of the problems that came up with these patches so far. I'm just a user, so I can't say anything about the technical side, and I don't know how the patches were selected.

Thanks,
Viktor

Quoted 999 lines

Responses should be made by Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

	https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.18.13-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.18.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>

    Linux 5.18.13-rc1

Juergen Gross <[email protected]>

    x86/pat: Fix x86_has_pat_wp()

Pali Rohár <[email protected]>
serial: mvebu-uart: correctly report configured baudrate value

Ilpo Järvinen <[email protected]>
serial: 8250: Fix PM usage_count for console handover

Ilpo Järvinen <[email protected]>
serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle

Ilpo Järvinen <[email protected]>
serial: stm32: Clear prev values before setting RTS delays

Dorian Rudolph <[email protected]>
power: supply: core: Fix boundary conditions in interpolation

Yi Yang <[email protected]>
serial: 8250: fix return error code in serial8250_request_std_resource()

Mario Limonciello <[email protected]>
ACPI: CPPC: Fix enabling CPPC on AMD systems with shared memory

Tony Krowiak <[email protected]>
s390/ap: fix error handling in __verify_queue_reservations()

Yangxi Xiang <[email protected]>
vt: fix memory overlapping when deleting chars in the buffer

Hans de Goede <[email protected]>
ACPI: video: Fix acpi_video_handles_brightness_key_presses()

Linus Torvalds <[email protected]>
signal handling: don't use BUG_ON() for debugging

Jason A. Donenfeld <[email protected]>
wireguard: selftests: always call kernel makefile

Jason A. Donenfeld <[email protected]>
wireguard: selftests: set fake real time in init

Keith Busch <[email protected]>
nvme: use struct group for generic command dwords

Keith Busch <[email protected]>
nvme-pci: phison e16 has bogus namespace ids

Egor Vorontsov <[email protected]>
ALSA: usb-audio: Add quirk for Fiero SC-01 (fw v1.0.0)

Egor Vorontsov <[email protected]>
ALSA: usb-audio: Add quirk for Fiero SC-01

John Veness <[email protected]>
ALSA: usb-audio: Add quirks for MacroSilicon MS2100/MS2106 devices

Srinivas Neeli <[email protected]>
Revert "can: xilinx_can: Limit CANFD brp to 2"

Gabriel Fernandez <[email protected]>
ARM: dts: stm32: use the correct clock source for CEC on stm32mp151

Linus Walleij <[email protected]>
soc: ixp4xx/npe: Fix unused match warning

Juergen Gross <[email protected]>
x86: Clear .brk area at early boot

Jacky Bai <[email protected]>
pinctrl: imx: Add the zero base flag for imx93

Stafford Horne <[email protected]>
irqchip: or1k-pic: Undefine mask_ack for level triggered hardware

Charles Keepax <[email protected]>
ASoC: madera: Fix event generation for rate controls

Charles Keepax <[email protected]>
ASoC: madera: Fix event generation for OUT1 demux

Charles Keepax <[email protected]>
ASoC: cs47l15: Fix event generation for low power mux control

Charles Keepax <[email protected]>
ASoC: cs35l41: Add ASP TX3/4 source to register patch

Charles Keepax <[email protected]>
ASoC: dapm: Initialise kcontrol data for mux/demux controls

Shuming Fan <[email protected]>
ASoC: rt711-sdca: fix kernel NULL pointer dereference when IO error

Charles Keepax <[email protected]>
ASoC: cs35l41: Correct some control names

Charles Keepax <[email protected]>
ASoC: wm5110: Fix DRE control

Charles Keepax <[email protected]>
ASoC: wm_adsp: Fix event for preloader

Hans de Goede <[email protected]>
ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem

Mark Brown <[email protected]>
ASoC: wcd938x: Fix event generation for some controls

Mark Brown <[email protected]>
ASoC: wcd9335: Fix spurious event generation

Yassine Oudjana <[email protected]>
ASoC: wcd9335: Remove RX channel from old list before adding it to a new one

Peter Ujfalusi <[email protected]>
ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow

Peter Ujfalusi <[email protected]>
ASoC: SOF: Intel: hda-loader: Make sure that the fw load sequence is followed

Peter Ujfalusi <[email protected]>
ASoC: SOF: Intel: hda-dsp: Expose hda_dsp_core_power_up()

Pierre-Louis Bossart <[email protected]>
ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe

Pierre-Louis Bossart <[email protected]>
ASoC: rt7*-sdw: harden jack_detect_handler

Pierre-Louis Bossart <[email protected]>
ASoC: rt711: fix calibrate mutex initialization

Pierre-Louis Bossart <[email protected]>
ASoC: Intel: sof_sdw: handle errors on card registration

Pierre-Louis Bossart <[email protected]>
ASoC: rt711-sdca-sdw: fix calibrate mutex initialization

Pierre-Louis Bossart <[email protected]>
ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove

Haowen Bai <[email protected]>
pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux()

Mark Brown <[email protected]>
ASoC: ops: Fix off by one in range control validation

Jianglei Nie <[email protected]>
net: sfp: fix memory leak in sfp_probe()

Ruozhu Li <[email protected]>
nvme: fix regression when disconnect a recovering ctrl

Sagi Grimberg <[email protected]>
nvme-tcp: always fail a request when sending it failed

Michael Walle <[email protected]>
NFC: nxp-nci: don't print header length mismatch on i2c error

Hangyu Hua <[email protected]>
net: tipc: fix possible refcount leak in tipc_sk_create()

Javier Martinez Canillas <[email protected]>
fbdev: Disable sysfb device registration when removing conflicting FBs

Javier Martinez Canillas <[email protected]>
firmware: sysfb: Add sysfb_disable() helper function

Javier Martinez Canillas <[email protected]>
firmware: sysfb: Make sysfb_create_simplefb() return a pdev pointer

Kai-Heng Feng <[email protected]>
platform/x86: hp-wmi: Ignore Sanitization Mode event

Mark Pearson <[email protected]>
platform/x86: thinkpad_acpi: do not use PSC mode on Intel platforms

Mark Pearson <[email protected]>
platform/x86: thinkpad-acpi: profile capabilities as integer

Liang He <[email protected]>
cpufreq: pmac32-cpufreq: Fix refcount leak bug

John Garry <[email protected]>
scsi: hisi_sas: Limit max hw sectors for v3 HW

Florian Westphal <[email protected]>
netfilter: br_netfilter: do not skip all hooks with 0 priority

Florian Westphal <[email protected]>
netfilter: nf_tables: avoid skb access on nf_stolen

Stephan Gerhold <[email protected]>
virtio_mmio: Restore guest page size on resume

Stephan Gerhold <[email protected]>
virtio_mmio: Add missing PM calls to freeze/restore

Gayatri Kammela <[email protected]>
platform/x86: intel/pmc: Add Alder Lake N support to PMC core driver

Parav Pandit <[email protected]>
vduse: Tie vduse mgmtdev and its device

Eli Cohen <[email protected]>
vdpa/mlx5: Initialize CVQ vringh only once

Nathan Lynch <[email protected]>
powerpc/xive/spapr: correct bitmap allocation size

Namjae Jeon <[email protected]>
ksmbd: use SOCK_NONBLOCK type for kernel_accept()

Israel Rukshin <[email protected]>
nvme: fix block device naming collision

Bjorn Andersson <[email protected]>
scsi: ufs: core: Drop loglevel of WriteBoost message

Ming Lei <[email protected]>
scsi: megaraid: Clear READ queue map's nr_queues

Vasily Gorbik <[email protected]>
s390/nospec: build expoline.o for modules_prepare target

Jiri Slaby <[email protected]>
tty: use new tty_insert_flip_string_and_push_buffer() in pty_write()

Jiri Slaby <[email protected]>
tty: extract tty_flip_buffer_commit() from tty_flip_buffer_push()

Marc Kleine-Budde <[email protected]>
tee: tee_get_drvdata(): fix description of return value

Bryan O'Donoghue <[email protected]>
ASoC: dt-bindings: Fix description for msm8916

Linus Walleij <[email protected]>
ARM: 9212/1: domain: Modify Kconfig help text

Linus Walleij <[email protected]>

    ARM: 9211/1: domain: drop modify_domain()

Peter Zijlstra <[email protected]>
x86/cpu/amd: Add Spectral Chicken

Peter Zijlstra <[email protected]>
x86/xen: Rename SYS* entry points

Peter Zijlstra <[email protected]>
objtool: Update Retpoline validation

Alexandre Chartre <[email protected]>
x86/bugs: Report AMD retbleed vulnerability

Kim Phillips <[email protected]>

    x86/sev: Avoid using __x86_return_thunk

Peter Zijlstra <[email protected]>
x86/kvm: Fix SETcc emulation for return thunks

Muchun Song <[email protected]>
mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE

Tariq Toukan <[email protected]>
net/tls: Check for errors in tls_device_init

Vitaly Kuznetsov <[email protected]>
KVM: x86: Fully initialize 'struct kvm_lapic_irq' in kvm_pv_kick_cpu_op()

Chia-Lin Kao (AceLan) <[email protected]>
net: atlantic: remove aq_nic_deinit() when resume

Chia-Lin Kao (AceLan) <[email protected]>
net: atlantic: remove deep parameter on suspend/resume functions

Íñigo Huguet <[email protected]>
sfc: fix kernel panic when creating VF

Andrea Mayer <[email protected]>
seg6: bpf: fix skb checksum in bpf_push_seg6_encap()

Andrea Mayer <[email protected]>
seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors

Andrea Mayer <[email protected]>
seg6: fix skb checksum evaluation in SRH encapsulation/insertion

Xiubo Li <[email protected]>
netfs: do not unlock and put the folio twice

Íñigo Huguet <[email protected]>
sfc: fix use after free when disabling sriov

Steve French <[email protected]>
smb3: workaround negprot bug in some Samba servers

Michel Dänzer <[email protected]>
drm/amd/display: Ensure valid event timestamp for cursor-only commits

Yefim Barashkin <[email protected]>
drm/amd/pm: Prevent divide by zero

Mario Kleiner <[email protected]>
drm/amd/display: Only use depth 36 bpp linebuffers on DCN display engines.

Prike Liang <[email protected]>
drm/amdkfd: correct the MEC atomic support firmware checking for GC 10.3.7

Fangzhi Zuo <[email protected]>
drm/amd/display: Ignore First MST Sideband Message Return Error

Jianglei Nie <[email protected]>
ima: Fix potential memory leak in ima_init_crypto()

Coiby Xu <[email protected]>
ima: force signature verification when CONFIG_KEXEC_SIG is configured

Dan Carpenter <[email protected]>
net: stmmac: fix leaks in probe

Liang He <[email protected]>
net: ftgmac100: Hold reference returned by of_get_child_by_name()

Kuniyuki Iwashima <[email protected]>
nexthop: Fix data-races around nexthop_compat_mode.

Kuniyuki Iwashima <[email protected]>
ipv4: Fix data-races around sysctl_ip_dynaddr.

Kuniyuki Iwashima <[email protected]>
tcp: Fix a data-race around sysctl_tcp_ecn_fallback.

Kuniyuki Iwashima <[email protected]>
tcp: Fix data-races around sysctl_tcp_ecn.

Kuniyuki Iwashima <[email protected]>

    raw: Fix a data-race around sysctl_raw_l3mdev_accept.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_ratemask.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_ratelimit.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_errors_use_inbound_ifaddr.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_ignore_bogus_error_responses.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_echo_ignore_broadcasts.

Kuniyuki Iwashima <[email protected]>
icmp: Fix data-races around sysctl_icmp_echo_enable_probe.

Kuniyuki Iwashima <[email protected]>
icmp: Fix a data-race around sysctl_icmp_echo_ignore_all.

Kuniyuki Iwashima <[email protected]>
tcp: Fix a data-race around sysctl_max_tw_buckets.

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data-races in proc_dointvec_ms_jiffies().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data-races in proc_dou8vec_minmax().

Pavan Chebbi <[email protected]>
bnxt_en: Fix bnxt_refclk_read()

Vikas Gupta <[email protected]>
bnxt_en: fix livepatch query

Michael Chan <[email protected]>
bnxt_en: Fix bnxt_reinit_after_abort() code path

Kashyap Desai <[email protected]>
bnxt_en: reclaim max resources if sriov enable fails

Andrzej Hajda <[email protected]>
drm/i915/selftests: fix subtraction overflow bug

Chris Wilson <[email protected]>
drm/i915/gt: Serialize TLB invalidates with GT resets

Chris Wilson <[email protected]>
drm/i915/gt: Serialize GRDOM access between multiple engine resets

Matthew Auld <[email protected]>
drm/i915/ttm: fix sg_table construction

Dan Carpenter <[email protected]>
drm/i915/selftests: fix a couple IS_ERR() vs NULL tests

Douglas Anderson <[email protected]>
tracing: Fix sleeping while atomic in kdb ftdump

Paul M Stillwell Jr <[email protected]>
ice: change devlink code to read NVM in blocks

Paul M Stillwell Jr <[email protected]>
ice: handle E822 generic device ID in PLDM header

Yevhen Orlov <[email protected]>
net: marvell: prestera: fix missed deinit sequence

Jeff Layton <[email protected]>
lockd: fix nlm_close_files

Jeff Layton <[email protected]>
lockd: set fl_owner when unlocking files

Chuck Lever <[email protected]>
NFSD: Decode NFSv4 birth time attribute

Paolo Abeni <[email protected]>
mptcp: fix subflow traversal at disconnect time

Demi Marie Obenour <[email protected]>
xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE

Dan Carpenter <[email protected]>
drm/i915/gvt: IS_ERR() vs NULL bug in intel_gvt_update_reg_whitelist()

Anup Patel <[email protected]>
RISC-V: KVM: Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests()

Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: replace BUG_ON by element length check

Eric Dumazet <[email protected]>
vlan: fix memory leak in vlan_newlink()

Baowen Zheng <[email protected]>
nfp: fix issue of skb segments exceeds descriptor limitation

Pablo Neira Ayuso <[email protected]>
netfilter: nf_log: incorrect offset to network header

William Zhang <[email protected]>
arm64: dts: broadcom: bcm4908: Fix cpu node for smp boot

William Zhang <[email protected]>
arm64: dts: broadcom: bcm4908: Fix timer node for BCM4906 SoC

Michal Suchanek <[email protected]>
ARM: dts: sunxi: Fix SPI NOR campatible on Orange Pi Zero

Ryan Wanner <[email protected]>
ARM: dts: at91: sama5d2: Fix typo in i2s1 node

Kuniyuki Iwashima <[email protected]>
ipv4: Fix a data-race around sysctl_fib_sync_mem.

Kuniyuki Iwashima <[email protected]>
icmp: Fix data-races around sysctl.

Kuniyuki Iwashima <[email protected]>
cipso: Fix data-races around sysctl.

Kuniyuki Iwashima <[email protected]>
net: Fix data-races around sysctl_mem.

Kuniyuki Iwashima <[email protected]>
inetpeer: Fix data-races around sysctl.

Kuniyuki Iwashima <[email protected]>
tcp: Fix a data-race around sysctl_tcp_max_orphans.

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_dointvec_jiffies().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_doulongvec_minmax().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_douintvec_minmax().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_dointvec_minmax().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_douintvec().

Kuniyuki Iwashima <[email protected]>
sysctl: Fix data races in proc_dointvec().

Pavel Skripkin <[email protected]>
net: ocelot: fix wrong time_after usage

Siddharth Vadapalli <[email protected]>
net: ethernet: ti: am65-cpsw: Fix devlink port register sequence

Jon Hunter <[email protected]>
net: stmmac: dwc-qos: Disable split header for Tegra194

Florian Westphal <[email protected]>
netfilter: conntrack: fix crash due to confirmed bit load reordering

Florian Westphal <[email protected]>
netfilter: conntrack: remove the percpu dying list

Florian Westphal <[email protected]>
netfilter: conntrack: include ecache dying list in dumps

Florian Westphal <[email protected]>
netfilter: ecache: use dedicated list for event redelivery

Florian Westphal <[email protected]>
netfilter: conntrack: split inner loop of list dumping to own function

Florian Westphal <[email protected]>
netfilter: ecache: move to separate structure

Peter Ujfalusi <[email protected]>
ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array

Peter Ujfalusi <[email protected]>
ASoC: Intel: Skylake: Correct the ssp rate discovery in skl_get_ssp_clks()

Hector Martin <[email protected]>
ASoC: tas2764: Fix amp gain register offset & default

Hector Martin <[email protected]>
ASoC: tas2764: Correct playback volume range

Martin Povišer <[email protected]>
ASoC: tas2764: Fix and extend FSYNC polarity handling

Martin Povišer <[email protected]>
ASoC: tas2764: Add post reset delays

Francesco Dolcini <[email protected]>
ASoC: sgtl5000: Fix noise on shutdown/remove

Huaxin Lu <[email protected]>
ima: Fix a potential integer overflow in ima_appraise_measurement

Daniele Ceraolo Spurio <[email protected]>
drm/i915/guc: ADL-N should use the same GuC FW as ADL-S

Hangyu Hua <[email protected]>
drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()

Alex Deucher <[email protected]>
drm/amdgpu/display: disable prefer_shadow for generic fb helpers

Alex Deucher <[email protected]>
drm/amdgpu: keep fbdev buffers pinned during suspend

Maxim Mikityanskiy <[email protected]>
net/mlx5e: Ring the TX doorbell on DMA errors

Gal Pressman <[email protected]>
net/mlx5e: Fix capability check for updating vnic env counters

Roi Dayan <[email protected]>
net/mlx5e: CT: Use own workqueue instead of mlx5e priv

Paul Blakey <[email protected]>
net/mlx5e: Fix enabling sriov while tc nic rules are offloaded

Tariq Toukan <[email protected]>
net/mlx5e: kTLS, Fix build time constant test in RX

Tariq Toukan <[email protected]>
net/mlx5e: kTLS, Fix build time constant test in TX

Zhen Lei <[email protected]>
ARM: 9210/1: Mark the FDT_FIXED sections as shareable

Ard Biesheuvel <[email protected]>
ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle

Cristian Ciocaltea <[email protected]>
spi: amd: Limit max transfer and message size

Conor Dooley <[email protected]>
riscv: dts: microchip: hook up the mpfs' l2cache

Kris Bahnsen <[email protected]>
ARM: dts: imx6qdl-ts7970: Fix ngpio typo and count

Sean Anderson <[email protected]>
arm64: dts: ls1028a: Update SFP node to include clock

Serge Semin <[email protected]>
reset: Fix devm bulk optional exclusive control getter

Xiu Jianfeng <[email protected]>
Revert "evm: Fix memleak in init_desc"

Geert Uytterhoeven <[email protected]>
sh: convert nommu io{re,un}map() to static inline functions

Ryusuke Konishi <[email protected]>
nilfs2: fix incorrect masking of permission flags for symlinks

Dave Chinner <[email protected]>
fs/remap: constrain dedupe of EOF blocks

Dmitry Osipenko <[email protected]>
drm/panfrost: Fix shrinker list corruption by madvise IOCTL

Dmitry Osipenko <[email protected]>
drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error

Christoph Hellwig <[email protected]>
btrfs: zoned: fix a leaked bioc in read_zone_info

Filipe Manana <[email protected]>
btrfs: return -EAGAIN for NOWAIT dio reads/writes on compressed and inline extents

Tejun Heo <[email protected]>
cgroup: Use separate src/dst nodes when preloading css_sets for migration

Felix Fietkau <[email protected]>
wifi: mac80211: fix queue selection for mesh/OCB interfaces

Ard Biesheuvel <[email protected]>
ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction

Dmitry Osipenko <[email protected]>
ARM: 9213/1: Print message about disabled Spectre workarounds only once

Nicolas Dichtel <[email protected]>
ip: fix dflt addr selection for connected nexthop

Steven Rostedt (Google) <[email protected]>
net: sock: tracing: Fix sock_exceed_buf_limit not to dereference stale pointer

Zheng Yejian <[email protected]>
tracing/histograms: Fix memory leak problem

Baolin Wang <[email protected]>
mm/damon: use set_huge_pte_at() to make huge pte old

Gowans, James <[email protected]>
mm: split huge PUD on wp_huge_pud fallback

Muchun Song <[email protected]>
mm: sparsemem: fix missing higher order allocation splitting

Axel Rasmussen <[email protected]>
mm: userfaultfd: fix UFFDIO_CONTINUE on fallocated shmem pages

Oleg Nesterov <[email protected]>
fix race between exit_itimers() and /proc/pid/timers

Juergen Gross <[email protected]>
xen/netback: avoid entering xenvif_rx_next_skb() with an empty rx queue

Meng Tang <[email protected]>
ALSA: hda/realtek - Enable the headset-mic on a Xiaomi's laptop

Meng Tang <[email protected]>
ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc221

Jeremy Szu <[email protected]>
ALSA: hda/realtek: fix mute/micmute LEDs for HP machines

Meng Tang <[email protected]>
ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671

Meng Tang <[email protected]>
ALSA: hda/realtek: Fix headset mic for Acer SF313-51

Meng Tang <[email protected]>
ALSA: hda/conexant: Apply quirk for another HP ProDesk 600 G3 model

Meng Tang <[email protected]>
ALSA: hda - Add fixup for Dell Latitidue E5430

Juergen Gross <[email protected]>
x86/xen: Use clear_bss() for Xen PV guests

Chanho Park <[email protected]>
tty: serial: samsung_tty: set dma burst_size to 1

Bartosz Golaszewski <[email protected]>
gpio: sim: fix the chip_name configfs item

Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Fix event pending check

Linyu Yuan <[email protected]>
usb: typec: add missing uevent when partner support PD

Lucien Buchmann <[email protected]>
USB: serial: ftdi_sio: add Belimo device ids

-------------

Diffstat:

 .../devicetree/bindings/sound/qcom,lpass-cpu.yaml  |   8 +-
 .../driver-api/firmware/other_interfaces.rst       |   6 +
 Documentation/filesystems/netfs_library.rst        |   8 +-
 Documentation/networking/ip-sysctl.rst             |   4 +-
 Makefile                                           |   4 +-
 arch/arm/boot/dts/imx6qdl-ts7970.dtsi              |   2 +-
 arch/arm/boot/dts/sama5d2.dtsi                     |   2 +-
 arch/arm/boot/dts/stm32mp151.dtsi                  |   2 +-
 arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts  |   2 +-
 arch/arm/include/asm/domain.h                      |  13 --
 arch/arm/include/asm/mach/map.h                    |   1 +
 arch/arm/include/asm/ptrace.h                      |  26 +++
 arch/arm/mm/Kconfig                                |   6 +-
 arch/arm/mm/alignment.c                            |   3 +
 arch/arm/mm/mmu.c                                  |  15 +-
 arch/arm/mm/proc-v7-bugs.c                         |   9 +-
 arch/arm/probes/decode.h                           |  26 +--
 arch/arm64/boot/dts/broadcom/bcm4908/bcm4906.dtsi  |   8 +
 arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi  |   2 +
 arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi     |   5 +-
 arch/powerpc/sysdev/xive/spapr.c                   |   5 +-
 arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi  |   4 +
 arch/riscv/kvm/vcpu.c                              |   2 +
 arch/s390/Makefile                                 |   8 +-
 arch/s390/lib/Makefile                             |   3 +-
 arch/s390/lib/expoline/Makefile                    |   3 +
 arch/s390/lib/{ => expoline}/expoline.S            |   0
 arch/sh/include/asm/io.h                           |   8 +-
 arch/x86/include/asm/cpufeatures.h                 |   1 +
 arch/x86/include/asm/msr-index.h                   |   3 +
 arch/x86/include/asm/nospec-branch.h               |   6 +
 arch/x86/include/asm/setup.h                       |   3 +
 arch/x86/kernel/acpi/cppc.c                        |   6 +
 arch/x86/kernel/cpu/amd.c                          |  23 +-
 arch/x86/kernel/cpu/bugs.c                         |  13 ++
 arch/x86/kernel/cpu/common.c                       |  19 ++
 arch/x86/kernel/cpu/cpu.h                          |   2 +
 arch/x86/kernel/cpu/hygon.c                        |   6 +
 arch/x86/kernel/head64.c                           |   4 +-
 arch/x86/kvm/emulate.c                             |  28 +--
 arch/x86/kvm/x86.c                                 |  18 +-
 arch/x86/mm/init.c                                 |  14 +-
 arch/x86/mm/mem_encrypt_boot.S                     |  10 +-
 arch/x86/xen/enlighten_pv.c                        |   8 +-
 arch/x86/xen/setup.c                               |   6 +-
 arch/x86/xen/xen-asm.S                             |  20 +-
 arch/x86/xen/xen-head.S                            |  11 +-
 arch/x86/xen/xen-ops.h                             |   6 +-
 drivers/acpi/acpi_video.c                          |  11 +-
 drivers/base/cpu.c                                 |   8 +
 drivers/cpufreq/pmac32-cpufreq.c                   |   4 +
 drivers/firmware/sysfb.c                           |  58 ++++-
 drivers/firmware/sysfb_simplefb.c                  |  16 +-
 drivers/gpio/gpio-sim.c                            |  16 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c        |  25 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c           |   3 +-
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c             |   3 +-
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c             |   3 +-
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c              |   3 +-
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c              |   3 +-
 drivers/gpu/drm/amd/amdkfd/kfd_device.c            |   2 +
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  85 ++++++-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |   8 +
 .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c    |  17 ++
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  11 +-
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c     |   2 +
 drivers/gpu/drm/i915/display/intel_dp_mst.c        |   1 +
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c            |  11 +-
 drivers/gpu/drm/i915/gt/intel_gt.c                 |  15 +-
 drivers/gpu/drm/i915/gt/intel_reset.c              |  37 ++-
 drivers/gpu/drm/i915/gt/selftest_lrc.c             |   8 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c           |   9 +
 drivers/gpu/drm/i915/gvt/cmd_parser.c              |   6 +-
 drivers/gpu/drm/i915/i915_scatterlist.c            |  19 +-
 drivers/gpu/drm/i915/i915_scatterlist.h            |   6 +-
 drivers/gpu/drm/i915/intel_region_ttm.c            |  10 +-
 drivers/gpu/drm/i915/intel_region_ttm.h            |   3 +-
 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c      |   2 +-
 .../gpu/drm/i915/selftests/intel_memory_region.c   |  21 +-
 drivers/gpu/drm/i915/selftests/mock_region.c       |   3 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c            |   4 +-
 drivers/gpu/drm/panfrost/panfrost_mmu.c            |   2 +-
 drivers/irqchip/irq-or1k-pic.c                     |   1 -
 drivers/net/can/xilinx_can.c                       |   4 +-
 .../net/ethernet/aquantia/atlantic/aq_pci_func.c   |  23 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |   5 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt.h          |   1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c  |   8 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c      |  13 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c    |   7 +-
 .../chelsio/inline_crypto/chtls/chtls_cm.c         |   2 +-
 drivers/net/ethernet/faraday/ftgmac100.c           |  15 +-
 drivers/net/ethernet/intel/ice/ice_devids.h        |   1 +
 drivers/net/ethernet/intel/ice/ice_devlink.c       |  59 +++--
 drivers/net/ethernet/intel/ice/ice_fw_update.c     |  96 +++++++-
 drivers/net/ethernet/intel/ice/ice_main.c          |   1 +
 .../ethernet/marvell/prestera/prestera_router.c    |   1 +
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c |  20 +-
 .../ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c |   3 +-
 .../ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c |   3 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_stats.c |   2 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c    |  39 +++-
 .../net/ethernet/mellanox/mlx5/core/esw/legacy.c   |   5 +-
 drivers/net/ethernet/mscc/ocelot_fdma.c            |  17 +-
 drivers/net/ethernet/netronome/nfp/nfdk/dp.c       |  33 ++-
 drivers/net/ethernet/sfc/ef10.c                    |   3 +
 drivers/net/ethernet/sfc/ef10_sriov.c              |  10 +-
 .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c    |   1 +
 .../net/ethernet/stmicro/stmmac/dwmac-ingenic.c    |   6 +-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c           |  17 +-
 drivers/net/phy/sfp.c                              |   2 +-
 drivers/net/xen-netback/rx.c                       |   1 +
 drivers/nfc/nxp-nci/i2c.c                          |   8 +-
 drivers/nvme/host/core.c                           |   8 +-
 drivers/nvme/host/nvme.h                           |   1 +
 drivers/nvme/host/pci.c                            |   3 +-
 drivers/nvme/host/rdma.c                           |  12 +-
 drivers/nvme/host/tcp.c                            |  13 +-
 drivers/nvme/host/trace.h                          |   2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed.c            |   4 +-
 drivers/pinctrl/freescale/pinctrl-imx93.c          |   1 +
 drivers/platform/x86/hp-wmi.c                      |   3 +
 drivers/platform/x86/intel/pmc/core.c              |   1 +
 drivers/platform/x86/thinkpad_acpi.c               |  50 ++---
 drivers/power/supply/power_supply_core.c           |  24 +-
 drivers/s390/crypto/ap_bus.c                       |   2 +-
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c             |   7 +
 drivers/scsi/megaraid/megaraid_sas_base.c          |   3 +
 drivers/scsi/ufs/ufshcd.c                          |   2 +-
 drivers/soc/ixp4xx/ixp4xx-npe.c                    |   2 +-
 drivers/spi/spi-amd.c                              |   8 +
 drivers/tee/tee_core.c                             |   2 +-
 drivers/tty/pty.c                                  |  14 +-
 drivers/tty/serial/8250/8250_core.c                |   4 +
 drivers/tty/serial/8250/8250_port.c                |   4 +-
 drivers/tty/serial/amba-pl011.c                    |  23 +-
 drivers/tty/serial/mvebu-uart.c                    |  25 ++-
 drivers/tty/serial/samsung_tty.c                   |   5 +-
 drivers/tty/serial/serial_core.c                   |   5 -
 drivers/tty/serial/stm32-usart.c                   |   2 +
 drivers/tty/tty.h                                  |   3 +
 drivers/tty/tty_buffer.c                           |  46 +++-
 drivers/tty/vt/vt.c                                |   2 +-
 drivers/usb/dwc3/gadget.c                          |   4 +-
 drivers/usb/serial/ftdi_sio.c                      |   3 +
 drivers/usb/serial/ftdi_sio_ids.h                  |   6 +
 drivers/usb/typec/class.c                          |   1 +
 drivers/vdpa/mlx5/net/mlx5_vnet.c                  |  31 ++-
 drivers/vdpa/vdpa_user/vduse_dev.c                 |  60 +++--
 drivers/video/fbdev/core/fbmem.c                   |  12 +
 drivers/virtio/virtio_mmio.c                       |  26 +++
 drivers/xen/gntdev.c                               |   6 +-
 fs/afs/file.c                                      |   2 +-
 fs/btrfs/inode.c                                   |  14 +-
 fs/btrfs/zoned.c                                   |  13 +-
 fs/ceph/addr.c                                     |  11 +-
 fs/cifs/smb2pdu.c                                  |  13 +-
 fs/exec.c                                          |   2 +-
 fs/ksmbd/transport_tcp.c                           |   2 +-
 fs/lockd/svcsubs.c                                 |  14 +-
 fs/netfs/buffered_read.c                           |  17 +-
 fs/nfsd/nfs4xdr.c                                  |   9 +
 fs/nfsd/nfsd.h                                     |   3 +-
 fs/nilfs2/nilfs.h                                  |   3 +
 fs/remap_range.c                                   |   3 +-
 include/linux/cgroup-defs.h                        |   3 +-
 include/linux/cpu.h                                |   2 +
 include/linux/kexec.h                              |   6 +
 include/linux/netfs.h                              |   2 +-
 include/linux/nvme.h                               |   2 +
 include/linux/reset.h                              |   2 +-
 include/linux/sched/task.h                         |   2 +-
 include/linux/serial_core.h                        |   5 +
 include/linux/sysfb.h                              |  22 +-
 include/net/netfilter/nf_conntrack.h               |   9 +-
 include/net/netfilter/nf_conntrack_ecache.h        |   4 +-
 include/net/netfilter/nf_tables.h                  |  30 ++-
 include/net/netns/conntrack.h                      |   1 -
 include/net/raw.h                                  |   2 +-
 include/net/sock.h                                 |   2 +-
 include/net/tls.h                                  |   4 +-
 include/trace/events/sock.h                        |   6 +-
 kernel/cgroup/cgroup.c                             |  37 +--
 kernel/exit.c                                      |   2 +-
 kernel/kexec_file.c                                |  11 +-
 kernel/signal.c                                    |   8 +-
 kernel/sysctl.c                                    |  57 ++---
 kernel/time/posix-timers.c                         |  19 +-
 kernel/trace/trace.c                               |  11 +-
 kernel/trace/trace_events_hist.c                   |   2 +
 mm/damon/vaddr.c                                   |   3 +-
 mm/memory.c                                        |  27 +--
 mm/sparse-vmemmap.c                                |   8 +
 mm/userfaultfd.c                                   |   5 +-
 net/8021q/vlan_netlink.c                           |  10 +-
 net/bridge/br_netfilter_hooks.c                    |  21 +-
 net/core/filter.c                                  |   1 -
 net/ipv4/af_inet.c                                 |   4 +-
 net/ipv4/cipso_ipv4.c                              |  12 +-
 net/ipv4/fib_semantics.c                           |   4 +-
 net/ipv4/fib_trie.c                                |   2 +-
 net/ipv4/icmp.c                                    |  20 +-
 net/ipv4/inet_timewait_sock.c                      |   3 +-
 net/ipv4/inetpeer.c                                |  12 +-
 net/ipv4/nexthop.c                                 |   5 +-
 net/ipv4/syncookies.c                              |   2 +-
 net/ipv4/sysctl_net_ipv4.c                         |  12 +
 net/ipv4/tcp.c                                     |   3 +-
 net/ipv4/tcp_input.c                               |   2 +-
 net/ipv4/tcp_output.c                              |   4 +-
 net/ipv6/icmp.c                                    |   2 +-
 net/ipv6/route.c                                   |   2 +-
 net/ipv6/seg6_iptunnel.c                           |   5 +-
 net/ipv6/seg6_local.c                              |   2 -
 net/mac80211/wme.c                                 |   4 +-
 net/mptcp/protocol.c                               |   4 +-
 net/netfilter/nf_conntrack_core.c                  |  86 ++++---
 net/netfilter/nf_conntrack_ecache.c                | 139 ++++++------
 net/netfilter/nf_conntrack_netlink.c               | 125 ++++++++---
 net/netfilter/nf_conntrack_standalone.c            |   3 +
 net/netfilter/nf_log_syslog.c                      |   8 +-
 net/netfilter/nf_tables_api.c                      |  72 ++++--
 net/netfilter/nf_tables_core.c                     |  24 +-
 net/netfilter/nf_tables_trace.c                    |  44 ++--
 net/tipc/socket.c                                  |   1 +
 net/tls/tls_device.c                               |   4 +-
 net/tls/tls_main.c                                 |   7 +-
 security/integrity/evm/evm_crypto.c                |   7 +-
 security/integrity/ima/ima_appraise.c              |   3 +-
 security/integrity/ima/ima_crypto.c                |   1 +
 security/integrity/ima/ima_efi.c                   |   2 +
 sound/pci/hda/patch_conexant.c                     |   1 +
 sound/pci/hda/patch_realtek.c                      |  20 ++
 sound/soc/codecs/cs35l41-lib.c                     |  10 +-
 sound/soc/codecs/cs35l41.c                         |  12 +-
 sound/soc/codecs/cs47l15.c                         |   5 +-
 sound/soc/codecs/madera.c                          |  14 +-
 sound/soc/codecs/max98373-sdw.c                    |  12 +-
 sound/soc/codecs/rt1308-sdw.c                      |  11 +
 sound/soc/codecs/rt1316-sdw.c                      |  11 +
 sound/soc/codecs/rt5682-sdw.c                      |   5 +-
 sound/soc/codecs/rt700-sdw.c                       |   6 +-
 sound/soc/codecs/rt700.c                           |  14 +-
 sound/soc/codecs/rt711-sdca-sdw.c                  |   9 +-
 sound/soc/codecs/rt711-sdca.c                      |  18 +-
 sound/soc/codecs/rt711-sdw.c                       |   9 +-
 sound/soc/codecs/rt711.c                           |  16 +-
 sound/soc/codecs/rt715-sdca-sdw.c                  |  12 +
 sound/soc/codecs/rt715-sdw.c                       |  12 +
 sound/soc/codecs/sgtl5000.c                        |   9 +
 sound/soc/codecs/sgtl5000.h                        |   1 +
 sound/soc/codecs/tas2764.c                         |  46 ++--
 sound/soc/codecs/tas2764.h                         |   6 +-
 sound/soc/codecs/wcd9335.c                         |   8 +-
 sound/soc/codecs/wcd938x.c                         |  12 +
 sound/soc/codecs/wm5110.c                          |   8 +-
 sound/soc/codecs/wm_adsp.c                         |   2 +-
 sound/soc/intel/boards/bytcr_wm5102.c              |  13 +-
 sound/soc/intel/boards/sof_sdw.c                   |  51 +++--
 sound/soc/intel/skylake/skl-nhlt.c                 |  40 ++--
 sound/soc/soc-dapm.c                               |   5 +
 sound/soc/soc-ops.c                                |   4 +-
 sound/soc/sof/intel/hda-dsp.c                      |  10 +-
 sound/soc/sof/intel/hda-loader.c                   |  10 +-
 sound/soc/sof/intel/hda.h                          |   1 +
 sound/usb/quirks-table.h                           | 248 +++++++++++++++++++++
 sound/usb/quirks.c                                 |   9 +
 tools/objtool/check.c                              |  19 +-
 tools/testing/selftests/wireguard/qemu/Makefile    |   5 +-
 .../selftests/wireguard/qemu/arch/arm.config       |   1 +
 .../selftests/wireguard/qemu/arch/armeb.config     |   1 +
 .../selftests/wireguard/qemu/arch/i686.config      |   1 +
 .../selftests/wireguard/qemu/arch/m68k.config      |   1 +
 .../selftests/wireguard/qemu/arch/mips.config      |   1 +
 .../selftests/wireguard/qemu/arch/mipsel.config    |   1 +
 .../selftests/wireguard/qemu/arch/powerpc.config   |   1 +
 tools/testing/selftests/wireguard/qemu/init.c      |  11 +
 277 files changed, 2493 insertions(+), 955 deletions(-)
author maintainer
#257 lore raw
Quoted 18 lines · Viktor Jägersküpper

Greg Kroah-Hartman:

Quoted 4 lines

This is the start of the stable review cycle for the 5.18.13 release. There are 231 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.

Hi Greg,

I noticed that there are several patches in the list which are also part of your retbleed-5.18 queue. If I am not mistaken, these are:

[PATCH 5.18 145/231] x86/kvm: Fix SETcc emulation for return thunks [PATCH 5.18 146/231] x86/sev: Avoid using __x86_return_thunk [PATCH 5.18 147/231] x86/bugs: Report AMD retbleed vulnerability [PATCH 5.18 148/231] objtool: Update Retpoline validation [PATCH 5.18 149/231] x86/xen: Rename SYS* entry points [PATCH 5.18 150/231] x86/cpu/amd: Add Spectral Chicken

Quoted 4 lines

I'm wondering if this is intended or if it would be better to release a stable kernel with all the retbleed patches later because of the problems that came up with these patches so far. I'm just a user, so I can't say anything about the technical side, and I don't know how the patches were selected.

Yes, sorry, I need to drop those and then add them only as part of the retbleed stuff.

thanks,

greg k-h