public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.4 1/6] nvme-fc: go straight to connecting state when initializing
@ 2025-02-11  1:33 Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 2/6] hrtimers: Mark is_migration_base() with __always_inline Sasha Levin
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sasha Levin @ 2025-02-11  1:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Daniel Wagner, Sagi Grimberg, Hannes Reinecke, Christoph Hellwig,
	Keith Busch, Sasha Levin, james.smart, linux-nvme

From: Daniel Wagner <wagi@kernel.org>

[ Upstream commit d3d380eded7ee5fc2fc53b3b0e72365ded025c4a ]

The initial controller initialization mimiks the reconnect loop
behavior by switching from NEW to RESETTING and then to CONNECTING.

The transition from NEW to CONNECTING is a valid transition, so there is
no point entering the RESETTING state. TCP and RDMA also transition
directly to CONNECTING state.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/host/fc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 0d2c22cf12a08..f3c0bff714eba 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -3164,8 +3164,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts,
 	list_add_tail(&ctrl->ctrl_list, &rport->ctrl_list);
 	spin_unlock_irqrestore(&rport->lock, flags);
 
-	if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RESETTING) ||
-	    !nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
+	if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
 		dev_err(ctrl->ctrl.device,
 			"NVME-FC{%d}: failed to init ctrl state\n", ctrl->cnum);
 		goto fail_ctrl;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 5.4 2/6] hrtimers: Mark is_migration_base() with __always_inline
  2025-02-11  1:33 [PATCH AUTOSEL 5.4 1/6] nvme-fc: go straight to connecting state when initializing Sasha Levin
@ 2025-02-11  1:33 ` Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 3/6] powercap: call put_device() on an error path in powercap_register_control_type() Sasha Levin
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2025-02-11  1:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Andy Shevchenko, Thomas Gleixner, Sasha Levin, anna-maria,
	frederic, nathan, llvm

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

[ Upstream commit 27af31e44949fa85550176520ef7086a0d00fd7b ]

When is_migration_base() is unused, it prevents kernel builds
with clang, `make W=1` and CONFIG_WERROR=y:

kernel/time/hrtimer.c:156:20: error: unused function 'is_migration_base' [-Werror,-Wunused-function]
  156 | static inline bool is_migration_base(struct hrtimer_clock_base *base)
      |                    ^~~~~~~~~~~~~~~~~

Fix this by marking it with __always_inline.

[ tglx: Use __always_inline instead of __maybe_unused and move it into the
  	usage sites conditional ]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250116160745.243358-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/time/hrtimer.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 539bc80787eeb..69713fa32437b 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -140,11 +140,6 @@ static struct hrtimer_cpu_base migration_cpu_base = {
 
 #define migration_base	migration_cpu_base.clock_base[0]
 
-static inline bool is_migration_base(struct hrtimer_clock_base *base)
-{
-	return base == &migration_base;
-}
-
 /*
  * We are using hashed locking: holding per_cpu(hrtimer_bases)[n].lock
  * means that all timers which are tied to this base via timer->base are
@@ -269,11 +264,6 @@ switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base,
 
 #else /* CONFIG_SMP */
 
-static inline bool is_migration_base(struct hrtimer_clock_base *base)
-{
-	return false;
-}
-
 static inline struct hrtimer_clock_base *
 lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
 {
@@ -1276,6 +1266,18 @@ static void hrtimer_sync_wait_running(struct hrtimer_cpu_base *cpu_base,
 	}
 }
 
+#ifdef CONFIG_SMP
+static __always_inline bool is_migration_base(struct hrtimer_clock_base *base)
+{
+	return base == &migration_base;
+}
+#else
+static __always_inline bool is_migration_base(struct hrtimer_clock_base *base)
+{
+	return false;
+}
+#endif
+
 /*
  * This function is called on PREEMPT_RT kernels when the fast path
  * deletion of a timer failed because the timer callback function was
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 5.4 3/6] powercap: call put_device() on an error path in powercap_register_control_type()
  2025-02-11  1:33 [PATCH AUTOSEL 5.4 1/6] nvme-fc: go straight to connecting state when initializing Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 2/6] hrtimers: Mark is_migration_base() with __always_inline Sasha Levin
@ 2025-02-11  1:33 ` Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 4/6] iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic() Sasha Levin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2025-02-11  1:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Joe Hattori, Rafael J . Wysocki, Sasha Levin, rafael, linux-pm

From: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>

[ Upstream commit 93c66fbc280747ea700bd6199633d661e3c819b3 ]

powercap_register_control_type() calls device_register(), but does not
release the refcount of the device when it fails.

Call put_device() before returning an error to balance the refcount.

Since the kfree(control_type) will be done by powercap_release(), remove
the lines in powercap_register_control_type() before returning the error.

This bug was found by an experimental verifier that I am developing.

Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://patch.msgid.link/20250110010554.1583411-1-joe@pf.is.s.u-tokyo.ac.jp
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/powercap/powercap_sys.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c
index 7a3109a538813..fe5d05da7ce7a 100644
--- a/drivers/powercap/powercap_sys.c
+++ b/drivers/powercap/powercap_sys.c
@@ -627,8 +627,7 @@ struct powercap_control_type *powercap_register_control_type(
 	dev_set_name(&control_type->dev, "%s", name);
 	result = device_register(&control_type->dev);
 	if (result) {
-		if (control_type->allocated)
-			kfree(control_type);
+		put_device(&control_type->dev);
 		return ERR_PTR(result);
 	}
 	idr_init(&control_type->idr);
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 5.4 4/6] iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic()
  2025-02-11  1:33 [PATCH AUTOSEL 5.4 1/6] nvme-fc: go straight to connecting state when initializing Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 2/6] hrtimers: Mark is_migration_base() with __always_inline Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 3/6] powercap: call put_device() on an error path in powercap_register_control_type() Sasha Levin
@ 2025-02-11  1:33 ` Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 5/6] scsi: qla1280: Fix kernel oops when debug level > 2 Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 6/6] ACPI: resource: IRQ override for Eluktronics MECH-17 Sasha Levin
  4 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2025-02-11  1:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Chengen Du, Konrad Rzeszutek Wilk, Sasha Levin, pjones, konrad

From: Chengen Du <chengen.du@canonical.com>

[ Upstream commit 07e0d99a2f701123ad3104c0f1a1e66bce74d6e5 ]

When performing an iSCSI boot using IPv6, iscsistart still reads the
/sys/firmware/ibft/ethernetX/subnet-mask entry. Since the IPv6 prefix
length is 64, this causes the shift exponent to become negative,
triggering a UBSAN warning. As the concept of a subnet mask does not
apply to IPv6, the value is set to ~0 to suppress the warning message.

Signed-off-by: Chengen Du <chengen.du@canonical.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/firmware/iscsi_ibft.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 7e12cbdf957cc..daf42b5319e89 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -311,7 +311,10 @@ static ssize_t ibft_attr_show_nic(void *data, int type, char *buf)
 		str += sprintf_ipaddr(str, nic->ip_addr);
 		break;
 	case ISCSI_BOOT_ETH_SUBNET_MASK:
-		val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
+		if (nic->subnet_mask_prefix > 32)
+			val = cpu_to_be32(~0);
+		else
+			val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
 		str += sprintf(str, "%pI4", &val);
 		break;
 	case ISCSI_BOOT_ETH_PREFIX_LEN:
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 5.4 5/6] scsi: qla1280: Fix kernel oops when debug level > 2
  2025-02-11  1:33 [PATCH AUTOSEL 5.4 1/6] nvme-fc: go straight to connecting state when initializing Sasha Levin
                   ` (2 preceding siblings ...)
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 4/6] iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic() Sasha Levin
@ 2025-02-11  1:33 ` Sasha Levin
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 6/6] ACPI: resource: IRQ override for Eluktronics MECH-17 Sasha Levin
  4 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2025-02-11  1:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Magnus Lindholm, Martin K . Petersen, Sasha Levin, mdr,
	James.Bottomley, linux-scsi

From: Magnus Lindholm <linmag7@gmail.com>

[ Upstream commit 5233e3235dec3065ccc632729675575dbe3c6b8a ]

A null dereference or oops exception will eventually occur when qla1280.c
driver is compiled with DEBUG_QLA1280 enabled and ql_debug_level > 2.  I
think its clear from the code that the intention here is sg_dma_len(s) not
length of sg_next(s) when printing the debug info.

Signed-off-by: Magnus Lindholm <linmag7@gmail.com>
Link: https://lore.kernel.org/r/20250125095033.26188-1-linmag7@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/qla1280.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 832af42130467..a13db27b04ede 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -2871,7 +2871,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 			dprintk(3, "S/G Segment phys_addr=%x %x, len=0x%x\n",
 				cpu_to_le32(upper_32_bits(dma_handle)),
 				cpu_to_le32(lower_32_bits(dma_handle)),
-				cpu_to_le32(sg_dma_len(sg_next(s))));
+				cpu_to_le32(sg_dma_len(s)));
 			remseg--;
 		}
 		dprintk(5, "qla1280_64bit_start_scsi: Scatter/gather "
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 5.4 6/6] ACPI: resource: IRQ override for Eluktronics MECH-17
  2025-02-11  1:33 [PATCH AUTOSEL 5.4 1/6] nvme-fc: go straight to connecting state when initializing Sasha Levin
                   ` (3 preceding siblings ...)
  2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 5/6] scsi: qla1280: Fix kernel oops when debug level > 2 Sasha Levin
@ 2025-02-11  1:33 ` Sasha Levin
  4 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2025-02-11  1:33 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Gannon Kolding, Rafael J . Wysocki, Sasha Levin, rafael,
	linux-acpi

From: Gannon Kolding <gannon.kolding@gmail.com>

[ Upstream commit 607ab6f85f4194b644ea95ac5fe660ef575db3b4 ]

The Eluktronics MECH-17 (GM7RG7N) needs IRQ overriding for the
keyboard to work.

Adding a DMI_MATCH entry for this laptop model makes the internal
keyboard function normally.

Signed-off-by: Gannon Kolding <gannon.kolding@gmail.com>
Link: https://patch.msgid.link/20250127093902.328361-1-gannon.kolding@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/resource.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 2750518a5d5e1..11264bb4061e7 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -482,6 +482,12 @@ static const struct dmi_system_id asus_laptop[] = {
 			DMI_MATCH(DMI_BOARD_NAME, "RP-15"),
 		},
 	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Eluktronics Inc."),
+			DMI_MATCH(DMI_BOARD_NAME, "MECH-17"),
+		},
+	},
 	{
 		/* TongFang GM6XGxX/TUXEDO Stellaris 16 Gen5 AMD */
 		.matches = {
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-11  1:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-11  1:33 [PATCH AUTOSEL 5.4 1/6] nvme-fc: go straight to connecting state when initializing Sasha Levin
2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 2/6] hrtimers: Mark is_migration_base() with __always_inline Sasha Levin
2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 3/6] powercap: call put_device() on an error path in powercap_register_control_type() Sasha Levin
2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 4/6] iscsi_ibft: Fix UBSAN shift-out-of-bounds warning in ibft_attr_show_nic() Sasha Levin
2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 5/6] scsi: qla1280: Fix kernel oops when debug level > 2 Sasha Levin
2025-02-11  1:33 ` [PATCH AUTOSEL 5.4 6/6] ACPI: resource: IRQ override for Eluktronics MECH-17 Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox