From: Sasha Levin Date: Sat, 28 Dec 2024 14:19:53 +0000 (-0500) Subject: Fixes for 5.4 X-Git-Tag: v6.1.123~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7958be91da15583052a4e5d5ed4334004b9f6ee1;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/platform-x86-asus-nb-wmi-ignore-unknown-event-0xcf.patch b/queue-5.4/platform-x86-asus-nb-wmi-ignore-unknown-event-0xcf.patch new file mode 100644 index 00000000000..5edeeaed3e5 --- /dev/null +++ b/queue-5.4/platform-x86-asus-nb-wmi-ignore-unknown-event-0xcf.patch @@ -0,0 +1,70 @@ +From afb29736fd462646962127871b4b8b5a0bc2afdd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 23 Nov 2024 23:47:00 +0100 +Subject: platform/x86: asus-nb-wmi: Ignore unknown event 0xCF +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Armin Wolf + +[ Upstream commit e9fba20c29e27dc99e55e1c550573a114561bf8c ] + +On the Asus X541UAK an unknown event 0xCF is emited when the charger +is plugged in. This is caused by the following AML code: + + If (ACPS ()) + { + ACPF = One + Local0 = 0x58 + If (ATKP) + { + ^^^^ATKD.IANE (0xCF) + } + } + Else + { + ACPF = Zero + Local0 = 0x57 + } + + Notify (AC0, 0x80) // Status Change + If (ATKP) + { + ^^^^ATKD.IANE (Local0) + } + + Sleep (0x64) + PNOT () + Sleep (0x0A) + NBAT (0x80) + +Ignore the 0xCF event to silence the unknown event warning. + +Reported-by: Pau Espin Pedrol +Closes: https://lore.kernel.org/platform-driver-x86/54d4860b-ec9c-4992-acf6-db3f90388293@espeweb.net +Signed-off-by: Armin Wolf +Reviewed-by: Hans de Goede +Link: https://lore.kernel.org/r/20241123224700.18530-1-W_Armin@gmx.de +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/asus-nb-wmi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c +index 78d357de2f04..18d963916b7f 100644 +--- a/drivers/platform/x86/asus-nb-wmi.c ++++ b/drivers/platform/x86/asus-nb-wmi.c +@@ -585,6 +585,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = { + { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, + { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, + { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ ++ { KE_IGNORE, 0xCF, }, /* AC mode */ + { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */ + { KE_END, 0}, + }; +-- +2.39.5 + diff --git a/queue-5.4/regmap-use-correct-format-specifier-for-logging-rang.patch b/queue-5.4/regmap-use-correct-format-specifier-for-logging-rang.patch new file mode 100644 index 00000000000..c93b5b39199 --- /dev/null +++ b/queue-5.4/regmap-use-correct-format-specifier-for-logging-rang.patch @@ -0,0 +1,43 @@ +From 4334bc1eebd3194cbef9fb293bf6fa28826eedf2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 27 Nov 2024 13:35:06 +0000 +Subject: regmap: Use correct format specifier for logging range errors + +From: Mark Brown + +[ Upstream commit 3f1aa0c533d9dd8a835caf9a6824449c463ee7e2 ] + +The register addresses are unsigned ints so we should use %u not %d to +log them. + +Signed-off-by: Mark Brown +Link: https://patch.msgid.link/20241127-regmap-test-high-addr-v1-1-74a48a9e0dc5@kernel.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/base/regmap/regmap.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c +index c83e3dcac6df..c453c24afeb8 100644 +--- a/drivers/base/regmap/regmap.c ++++ b/drivers/base/regmap/regmap.c +@@ -1075,13 +1075,13 @@ struct regmap *__regmap_init(struct device *dev, + + /* Sanity check */ + if (range_cfg->range_max < range_cfg->range_min) { +- dev_err(map->dev, "Invalid range %d: %d < %d\n", i, ++ dev_err(map->dev, "Invalid range %d: %u < %u\n", i, + range_cfg->range_max, range_cfg->range_min); + goto err_range; + } + + if (range_cfg->range_max > map->max_register) { +- dev_err(map->dev, "Invalid range %d: %d > %d\n", i, ++ dev_err(map->dev, "Invalid range %d: %u > %u\n", i, + range_cfg->range_max, map->max_register); + goto err_range; + } +-- +2.39.5 + diff --git a/queue-5.4/scsi-megaraid_sas-fix-for-a-potential-deadlock.patch b/queue-5.4/scsi-megaraid_sas-fix-for-a-potential-deadlock.patch new file mode 100644 index 00000000000..b87f0aa350f --- /dev/null +++ b/queue-5.4/scsi-megaraid_sas-fix-for-a-potential-deadlock.patch @@ -0,0 +1,48 @@ +From 1e6457deacce90c3ad58c29639264b0ea17e06b1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 23 Sep 2024 19:48:33 +0200 +Subject: scsi: megaraid_sas: Fix for a potential deadlock + +From: Tomas Henzl + +[ Upstream commit 50740f4dc78b41dec7c8e39772619d5ba841ddd7 ] + +This fixes a 'possible circular locking dependency detected' warning + CPU0 CPU1 + ---- ---- + lock(&instance->reset_mutex); + lock(&shost->scan_mutex); + lock(&instance->reset_mutex); + lock(&shost->scan_mutex); + +Fix this by temporarily releasing the reset_mutex. + +Signed-off-by: Tomas Henzl +Link: https://lore.kernel.org/r/20240923174833.45345-1-thenzl@redhat.com +Acked-by: Chandrakanth Patil +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/megaraid/megaraid_sas_base.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c +index 603c99fcb74e..7f2d12c5dc4b 100644 +--- a/drivers/scsi/megaraid/megaraid_sas_base.c ++++ b/drivers/scsi/megaraid/megaraid_sas_base.c +@@ -8802,8 +8802,11 @@ megasas_aen_polling(struct work_struct *work) + (ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL), + (ld_target_id - MEGASAS_MAX_DEV_PER_CHANNEL), + 0); +- if (sdev1) ++ if (sdev1) { ++ mutex_unlock(&instance->reset_mutex); + megasas_remove_scsi_device(sdev1); ++ mutex_lock(&instance->reset_mutex); ++ } + + event_type = SCAN_VD_CHANNEL; + break; +-- +2.39.5 + diff --git a/queue-5.4/scsi-mpt3sas-diag-reset-when-doorbell-in-use-bit-is-.patch b/queue-5.4/scsi-mpt3sas-diag-reset-when-doorbell-in-use-bit-is-.patch new file mode 100644 index 00000000000..2818561a20c --- /dev/null +++ b/queue-5.4/scsi-mpt3sas-diag-reset-when-doorbell-in-use-bit-is-.patch @@ -0,0 +1,53 @@ +From 69d27288dd96eb48dcad2cdf1ff76a7d7d07eadc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 10 Nov 2024 23:03:40 +0530 +Subject: scsi: mpt3sas: Diag-Reset when Doorbell-In-Use bit is set during + driver load time + +From: Ranjan Kumar + +[ Upstream commit 3f5eb062e8aa335643181c480e6c590c6cedfd22 ] + +Issue a Diag-Reset when the "Doorbell-In-Use" bit is set during the +driver load/initialization. + +Signed-off-by: Ranjan Kumar +Link: https://lore.kernel.org/r/20241110173341.11595-2-ranjan.kumar@broadcom.com +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/mpt3sas/mpt3sas_base.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c +index 1bc23e8ee748..69023ddceb59 100644 +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -5695,11 +5695,12 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, + int i; + u8 failed; + __le32 *mfp; ++ int ret_val; + + /* make sure doorbell is not in use */ + if ((ioc->base_readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_USED)) { + ioc_err(ioc, "doorbell is in use (line=%d)\n", __LINE__); +- return -EFAULT; ++ goto doorbell_diag_reset; + } + + /* clear pending doorbell interrupts from previous state changes */ +@@ -5789,6 +5790,10 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, + le32_to_cpu(mfp[i])); + } + return 0; ++ ++doorbell_diag_reset: ++ ret_val = _base_diag_reset(ioc); ++ return ret_val; + } + + /** +-- +2.39.5 + diff --git a/queue-5.4/scsi-qla1280-fix-hw-revision-numbering-for-isp1020-1.patch b/queue-5.4/scsi-qla1280-fix-hw-revision-numbering-for-isp1020-1.patch new file mode 100644 index 00000000000..a669fcb3e72 --- /dev/null +++ b/queue-5.4/scsi-qla1280-fix-hw-revision-numbering-for-isp1020-1.patch @@ -0,0 +1,49 @@ +From 5dd7536b8915d96386f860478a086fca9c4f8de9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 13 Nov 2024 23:51:49 +0100 +Subject: scsi: qla1280: Fix hw revision numbering for ISP1020/1040 + +From: Magnus Lindholm + +[ Upstream commit c064de86d2a3909222d5996c5047f64c7a8f791b ] + +Fix the hardware revision numbering for Qlogic ISP1020/1040 boards. HWMASK +suggests that the revision number only needs four bits, this is consistent +with how NetBSD does things in their ISP driver. Verified on a IPS1040B +which is seen as rev 5 not as BIT_4. + +Signed-off-by: Magnus Lindholm +Link: https://lore.kernel.org/r/20241113225636.2276-1-linmag7@gmail.com +Reviewed-by: Christoph Hellwig +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qla1280.h | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/scsi/qla1280.h b/drivers/scsi/qla1280.h +index a1a8aefc7cc3..9d4c997c3c82 100644 +--- a/drivers/scsi/qla1280.h ++++ b/drivers/scsi/qla1280.h +@@ -117,12 +117,12 @@ struct device_reg { + uint16_t id_h; /* ID high */ + uint16_t cfg_0; /* Configuration 0 */ + #define ISP_CFG0_HWMSK 0x000f /* Hardware revision mask */ +-#define ISP_CFG0_1020 BIT_0 /* ISP1020 */ +-#define ISP_CFG0_1020A BIT_1 /* ISP1020A */ +-#define ISP_CFG0_1040 BIT_2 /* ISP1040 */ +-#define ISP_CFG0_1040A BIT_3 /* ISP1040A */ +-#define ISP_CFG0_1040B BIT_4 /* ISP1040B */ +-#define ISP_CFG0_1040C BIT_5 /* ISP1040C */ ++#define ISP_CFG0_1020 1 /* ISP1020 */ ++#define ISP_CFG0_1020A 2 /* ISP1020A */ ++#define ISP_CFG0_1040 3 /* ISP1040 */ ++#define ISP_CFG0_1040A 4 /* ISP1040A */ ++#define ISP_CFG0_1040B 5 /* ISP1040B */ ++#define ISP_CFG0_1040C 6 /* ISP1040C */ + uint16_t cfg_1; /* Configuration 1 */ + #define ISP_CFG1_F128 BIT_6 /* 128-byte FIFO threshold */ + #define ISP_CFG1_F64 BIT_4|BIT_5 /* 128-byte FIFO threshold */ +-- +2.39.5 + diff --git a/queue-5.4/series b/queue-5.4/series index 920defb2e4e..1561d52cb6d 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -41,3 +41,10 @@ phy-core-fix-that-api-devm_phy_destroy-fails-to-destroy-the-phy.patch dmaengine-mv_xor-fix-child-node-refcount-handling-in-early-exit.patch dmaengine-at_xdmac-avoid-null_prt_deref-in-at_xdmac_prep_dma_memset.patch mtd-rawnand-fix-double-free-in-atmel_pmecc_create_user.patch +tracing-kprobe-make-trace_kprobe-s-module-callback-c.patch +scsi-qla1280-fix-hw-revision-numbering-for-isp1020-1.patch +scsi-megaraid_sas-fix-for-a-potential-deadlock.patch +regmap-use-correct-format-specifier-for-logging-rang.patch +platform-x86-asus-nb-wmi-ignore-unknown-event-0xcf.patch +scsi-mpt3sas-diag-reset-when-doorbell-in-use-bit-is-.patch +virtio-blk-don-t-keep-queue-frozen-during-system-sus.patch diff --git a/queue-5.4/tracing-kprobe-make-trace_kprobe-s-module-callback-c.patch b/queue-5.4/tracing-kprobe-make-trace_kprobe-s-module-callback-c.patch new file mode 100644 index 00000000000..ac367fa91b9 --- /dev/null +++ b/queue-5.4/tracing-kprobe-make-trace_kprobe-s-module-callback-c.patch @@ -0,0 +1,41 @@ +From 25ef6dd7c5241975d0b7f05fe650159792ce101b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 11 Dec 2024 09:10:55 +0900 +Subject: tracing/kprobe: Make trace_kprobe's module callback called after + jump_label update + +From: Masami Hiramatsu (Google) + +[ Upstream commit d685d55dfc86b1a4bdcec77c3c1f8a83f181264e ] + +Make sure the trace_kprobe's module notifer callback function is called +after jump_label's callback is called. Since the trace_kprobe's callback +eventually checks jump_label address during registering new kprobe on +the loading module, jump_label must be updated before this registration +happens. + +Link: https://lore.kernel.org/all/173387585556.995044.3157941002975446119.stgit@devnote2/ + +Fixes: 614243181050 ("tracing/kprobes: Support module init function probing") +Signed-off-by: Masami Hiramatsu (Google) +Signed-off-by: Sasha Levin +--- + kernel/trace/trace_kprobe.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c +index c966638fb62c..56d22752a52e 100644 +--- a/kernel/trace/trace_kprobe.c ++++ b/kernel/trace/trace_kprobe.c +@@ -703,7 +703,7 @@ static int trace_kprobe_module_callback(struct notifier_block *nb, + + static struct notifier_block trace_kprobe_module_nb = { + .notifier_call = trace_kprobe_module_callback, +- .priority = 1 /* Invoked after kprobe module callback */ ++ .priority = 2 /* Invoked after kprobe and jump_label module callback */ + }; + + /* Convert certain expected symbols into '_' when generating event names */ +-- +2.39.5 + diff --git a/queue-5.4/virtio-blk-don-t-keep-queue-frozen-during-system-sus.patch b/queue-5.4/virtio-blk-don-t-keep-queue-frozen-during-system-sus.patch new file mode 100644 index 00000000000..ade6e2da1c2 --- /dev/null +++ b/queue-5.4/virtio-blk-don-t-keep-queue-frozen-during-system-sus.patch @@ -0,0 +1,72 @@ +From 1b075d4fb776f9bc8a64bb26218fe7addb82d4ee Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 12 Nov 2024 20:58:21 +0800 +Subject: virtio-blk: don't keep queue frozen during system suspend + +From: Ming Lei + +[ Upstream commit 7678abee0867e6b7fb89aa40f6e9f575f755fb37 ] + +Commit 4ce6e2db00de ("virtio-blk: Ensure no requests in virtqueues before +deleting vqs.") replaces queue quiesce with queue freeze in virtio-blk's +PM callbacks. And the motivation is to drain inflight IOs before suspending. + +block layer's queue freeze looks very handy, but it is also easy to cause +deadlock, such as, any attempt to call into bio_queue_enter() may run into +deadlock if the queue is frozen in current context. There are all kinds +of ->suspend() called in suspend context, so keeping queue frozen in the +whole suspend context isn't one good idea. And Marek reported lockdep +warning[1] caused by virtio-blk's freeze queue in virtblk_freeze(). + +[1] https://lore.kernel.org/linux-block/ca16370e-d646-4eee-b9cc-87277c89c43c@samsung.com/ + +Given the motivation is to drain in-flight IOs, it can be done by calling +freeze & unfreeze, meantime restore to previous behavior by keeping queue +quiesced during suspend. + +Cc: Yi Sun +Cc: Michael S. Tsirkin +Cc: Jason Wang +Cc: Stefan Hajnoczi +Cc: virtualization@lists.linux.dev +Reported-by: Marek Szyprowski +Signed-off-by: Ming Lei +Acked-by: Stefan Hajnoczi +Link: https://lore.kernel.org/r/20241112125821.1475793-1-ming.lei@redhat.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/block/virtio_blk.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c +index 3afc07b59477..b1c5bcae9b31 100644 +--- a/drivers/block/virtio_blk.c ++++ b/drivers/block/virtio_blk.c +@@ -1062,9 +1062,12 @@ static void virtblk_remove(struct virtio_device *vdev) + static int virtblk_freeze(struct virtio_device *vdev) + { + struct virtio_blk *vblk = vdev->priv; ++ struct request_queue *q = vblk->disk->queue; + + /* Ensure no requests in virtqueues before deleting vqs. */ +- blk_mq_freeze_queue(vblk->disk->queue); ++ blk_mq_freeze_queue(q); ++ blk_mq_quiesce_queue_nowait(q); ++ blk_mq_unfreeze_queue(q); + + /* Ensure we don't receive any more interrupts */ + vdev->config->reset(vdev); +@@ -1088,8 +1091,8 @@ static int virtblk_restore(struct virtio_device *vdev) + return ret; + + virtio_device_ready(vdev); ++ blk_mq_unquiesce_queue(vblk->disk->queue); + +- blk_mq_unfreeze_queue(vblk->disk->queue); + return 0; + } + #endif +-- +2.39.5 +