--- /dev/null
+From 1cd0302be5645420f73090aee26fa787287e1096 Mon Sep 17 00:00:00 2001
+From: Simon Trimmer <simont@opensource.cirrus.com>
+Date: Fri, 28 Jul 2023 12:13:45 +0100
+Subject: ACPI: scan: Create platform device for CS35L56
+
+From: Simon Trimmer <simont@opensource.cirrus.com>
+
+commit 1cd0302be5645420f73090aee26fa787287e1096 upstream.
+
+The ACPI device CSC3556 is a Cirrus Logic CS35L56 mono amplifier which
+is used in multiples, and can be connected either to I2C or SPI.
+
+There will be multiple instances under the same Device() node. Add it
+to ignore_serial_bus_ids and handle it in the serial-multi-instantiate
+driver.
+
+There can be a 5th I2cSerialBusV2, but this is an alias address and doesn't
+represent a real device. Ignore this by having a dummy 5th entry in the
+serial-multi-instantiate instance list with the name of a non-existent
+driver, on the same pattern as done for bsg2150.
+
+Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
+Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
+Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Link: https://lore.kernel.org/r/20230728111345.7224-1-rf@opensource.cirrus.com
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/acpi/scan.c | 1 +
+ drivers/platform/x86/serial-multi-instantiate.c | 14 ++++++++++++++
+ 2 files changed, 15 insertions(+)
+
+--- a/drivers/acpi/scan.c
++++ b/drivers/acpi/scan.c
+@@ -1712,6 +1712,7 @@ static bool acpi_device_enumeration_by_p
+ {"BSG1160", },
+ {"BSG2150", },
+ {"CSC3551", },
++ {"CSC3556", },
+ {"INT33FE", },
+ {"INT3515", },
+ /* Non-conforming _HID for Cirrus Logic already released */
+--- a/drivers/platform/x86/serial-multi-instantiate.c
++++ b/drivers/platform/x86/serial-multi-instantiate.c
+@@ -329,6 +329,19 @@ static const struct smi_node cs35l41_hda
+ .bus_type = SMI_AUTO_DETECT,
+ };
+
++static const struct smi_node cs35l56_hda = {
++ .instances = {
++ { "cs35l56-hda", IRQ_RESOURCE_AUTO, 0 },
++ { "cs35l56-hda", IRQ_RESOURCE_AUTO, 0 },
++ { "cs35l56-hda", IRQ_RESOURCE_AUTO, 0 },
++ { "cs35l56-hda", IRQ_RESOURCE_AUTO, 0 },
++ /* a 5th entry is an alias address, not a real device */
++ { "cs35l56-hda_dummy_dev" },
++ {}
++ },
++ .bus_type = SMI_AUTO_DETECT,
++};
++
+ /*
+ * Note new device-ids must also be added to ignore_serial_bus_ids in
+ * drivers/acpi/scan.c: acpi_device_enumeration_by_parent().
+@@ -337,6 +350,7 @@ static const struct acpi_device_id smi_a
+ { "BSG1160", (unsigned long)&bsg1160_data },
+ { "BSG2150", (unsigned long)&bsg2150_data },
+ { "CSC3551", (unsigned long)&cs35l41_hda },
++ { "CSC3556", (unsigned long)&cs35l56_hda },
+ { "INT3515", (unsigned long)&int3515_data },
+ /* Non-conforming _HID for Cirrus Logic already released */
+ { "CLSA0100", (unsigned long)&cs35l41_hda },
--- /dev/null
+From 6ccbd7fd474674654019a20177c943359469103a Mon Sep 17 00:00:00 2001
+From: Masahiro Yamada <masahiroy@kernel.org>
+Date: Sat, 29 Jul 2023 16:42:23 +0900
+Subject: alpha: remove __init annotation from exported page_is_ram()
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+commit 6ccbd7fd474674654019a20177c943359469103a upstream.
+
+EXPORT_SYMBOL and __init is a bad combination because the .init.text
+section is freed up after the initialization.
+
+Commit c5a130325f13 ("ACPI/APEI: Add parameter check before error
+injection") exported page_is_ram(), hence the __init annotation should
+be removed.
+
+This fixes the modpost warning in ARCH=alpha builds:
+
+ WARNING: modpost: vmlinux: page_is_ram: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL.
+
+Fixes: c5a130325f13 ("ACPI/APEI: Add parameter check before error injection")
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/alpha/kernel/setup.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/arch/alpha/kernel/setup.c
++++ b/arch/alpha/kernel/setup.c
+@@ -385,8 +385,7 @@ setup_memory(void *kernel_end)
+ #endif /* CONFIG_BLK_DEV_INITRD */
+ }
+
+-int __init
+-page_is_ram(unsigned long pfn)
++int page_is_ram(unsigned long pfn)
+ {
+ struct memclust_struct * cluster;
+ struct memdesc_struct * memdesc;
--- /dev/null
+From d66a8aab7dc36c975bbaa6aa74cf7445878e7c69 Mon Sep 17 00:00:00 2001
+From: Vadim Pasternak <vadimp@nvidia.com>
+Date: Sun, 13 Aug 2023 08:37:35 +0000
+Subject: platform: mellanox: Change register offset addresses
+
+From: Vadim Pasternak <vadimp@nvidia.com>
+
+commit d66a8aab7dc36c975bbaa6aa74cf7445878e7c69 upstream.
+
+Move debug register offsets to different location due to hardware changes.
+
+Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
+Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
+Reviewed-by: Michael Shych <michaelsh@nvidia.com>
+Link: https://lore.kernel.org/r/20230813083735.39090-5-vadimp@nvidia.com
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/mlx-platform.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
+index 240bc3174caf..7d33977d9c60 100644
+--- a/drivers/platform/x86/mlx-platform.c
++++ b/drivers/platform/x86/mlx-platform.c
+@@ -62,10 +62,6 @@
+ #define MLXPLAT_CPLD_LPC_REG_PWM_CONTROL_OFFSET 0x37
+ #define MLXPLAT_CPLD_LPC_REG_AGGR_OFFSET 0x3a
+ #define MLXPLAT_CPLD_LPC_REG_AGGR_MASK_OFFSET 0x3b
+-#define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET 0x3c
+-#define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0x3d
+-#define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0x3e
+-#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0x3f
+ #define MLXPLAT_CPLD_LPC_REG_AGGRLO_OFFSET 0x40
+ #define MLXPLAT_CPLD_LPC_REG_AGGRLO_MASK_OFFSET 0x41
+ #define MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET 0x42
+@@ -126,6 +122,10 @@
+ #define MLXPLAT_CPLD_LPC_REG_LC_SD_EVENT_OFFSET 0xaa
+ #define MLXPLAT_CPLD_LPC_REG_LC_SD_MASK_OFFSET 0xab
+ #define MLXPLAT_CPLD_LPC_REG_LC_PWR_ON 0xb2
++#define MLXPLAT_CPLD_LPC_REG_DBG1_OFFSET 0xb6
++#define MLXPLAT_CPLD_LPC_REG_DBG2_OFFSET 0xb7
++#define MLXPLAT_CPLD_LPC_REG_DBG3_OFFSET 0xb8
++#define MLXPLAT_CPLD_LPC_REG_DBG4_OFFSET 0xb9
+ #define MLXPLAT_CPLD_LPC_REG_GP4_RO_OFFSET 0xc2
+ #define MLXPLAT_CPLD_LPC_REG_SPI_CHNL_SELECT 0xc3
+ #define MLXPLAT_CPLD_LPC_REG_WD_CLEAR_OFFSET 0xc7
+--
+2.41.0
+
--- /dev/null
+From 8e3938cff0191c810b2abd827313c090fe09d166 Mon Sep 17 00:00:00 2001
+From: Vadim Pasternak <vadimp@nvidia.com>
+Date: Sun, 13 Aug 2023 08:37:32 +0000
+Subject: platform: mellanox: Fix order in exit flow
+
+From: Vadim Pasternak <vadimp@nvidia.com>
+
+commit 8e3938cff0191c810b2abd827313c090fe09d166 upstream.
+
+Fix exit flow order: call mlxplat_post_exit() after
+mlxplat_i2c_main_exit() in order to unregister main i2c driver before
+to "mlxplat" driver.
+
+Fixes: 0170f616f496 ("platform: mellanox: Split initialization procedure")
+Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
+Reviewed-by: Michael Shych <michaelsh@nvidia.com>
+Link: https://lore.kernel.org/r/20230813083735.39090-2-vadimp@nvidia.com
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/mlx-platform.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/platform/x86/mlx-platform.c
++++ b/drivers/platform/x86/mlx-platform.c
+@@ -6238,8 +6238,6 @@ static void mlxplat_i2c_mux_topolgy_exit
+ if (priv->pdev_mux[i])
+ platform_device_unregister(priv->pdev_mux[i]);
+ }
+-
+- mlxplat_post_exit();
+ }
+
+ static int mlxplat_i2c_main_complition_notify(void *handle, int id)
+@@ -6369,6 +6367,7 @@ static void __exit mlxplat_exit(void)
+ pm_power_off = NULL;
+ mlxplat_pre_exit(priv);
+ mlxplat_i2c_main_exit(priv);
++ mlxplat_post_exit();
+ }
+ module_exit(mlxplat_exit);
+
--- /dev/null
+From 3c91d7e8c64f75c63da3565d16d5780320bd5d76 Mon Sep 17 00:00:00 2001
+From: Vadim Pasternak <vadimp@nvidia.com>
+Date: Sun, 13 Aug 2023 08:37:33 +0000
+Subject: platform: mellanox: mlx-platform: Fix signals polarity and latch mask
+
+From: Vadim Pasternak <vadimp@nvidia.com>
+
+commit 3c91d7e8c64f75c63da3565d16d5780320bd5d76 upstream.
+
+Change polarity of chassis health and power signals and fix latch reset
+mask for L1 switch.
+
+Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
+Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
+Reviewed-by: Michael Shych <michaelsh@nvidia.com>
+Link: https://lore.kernel.org/r/20230813083735.39090-3-vadimp@nvidia.com
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/mlx-platform.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
+index 5fb3348023a7..69256af04f05 100644
+--- a/drivers/platform/x86/mlx-platform.c
++++ b/drivers/platform/x86/mlx-platform.c
+@@ -237,7 +237,7 @@
+ #define MLXPLAT_CPLD_GWP_MASK GENMASK(0, 0)
+ #define MLXPLAT_CPLD_EROT_MASK GENMASK(1, 0)
+ #define MLXPLAT_CPLD_PWR_BUTTON_MASK BIT(0)
+-#define MLXPLAT_CPLD_LATCH_RST_MASK BIT(5)
++#define MLXPLAT_CPLD_LATCH_RST_MASK BIT(6)
+ #define MLXPLAT_CPLD_THERMAL1_PDB_MASK BIT(3)
+ #define MLXPLAT_CPLD_THERMAL2_PDB_MASK BIT(4)
+ #define MLXPLAT_CPLD_INTRUSION_MASK BIT(6)
+@@ -2475,7 +2475,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_l1_switch_events_items[] = {
+ .reg = MLXPLAT_CPLD_LPC_REG_PWRB_OFFSET,
+ .mask = MLXPLAT_CPLD_PWR_BUTTON_MASK,
+ .count = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_pwr_events_items_data),
+- .inversed = 0,
++ .inversed = 1,
+ .health = false,
+ },
+ {
+@@ -2484,7 +2484,7 @@ static struct mlxreg_core_item mlxplat_mlxcpld_l1_switch_events_items[] = {
+ .reg = MLXPLAT_CPLD_LPC_REG_BRD_OFFSET,
+ .mask = MLXPLAT_CPLD_L1_CHA_HEALTH_MASK,
+ .count = ARRAY_SIZE(mlxplat_mlxcpld_l1_switch_health_events_items_data),
+- .inversed = 0,
++ .inversed = 1,
+ .health = false,
+ .ind = 8,
+ },
+@@ -3677,7 +3677,7 @@ static struct mlxreg_core_data mlxplat_mlxcpld_default_ng_regs_io_data[] = {
+ {
+ .label = "latch_reset",
+ .reg = MLXPLAT_CPLD_LPC_REG_GP1_OFFSET,
+- .mask = GENMASK(7, 0) & ~BIT(5),
++ .mask = GENMASK(7, 0) & ~BIT(6),
+ .mode = 0200,
+ },
+ {
+--
+2.41.0
+
--- /dev/null
+From 9f8ccdb5088bd03062d9ad9c0f6abf600cbed8e8 Mon Sep 17 00:00:00 2001
+From: Vadim Pasternak <vadimp@nvidia.com>
+Date: Sun, 13 Aug 2023 08:37:34 +0000
+Subject: platform: mellanox: mlx-platform: Modify graceful shutdown callback and power down mask
+
+From: Vadim Pasternak <vadimp@nvidia.com>
+
+commit 9f8ccdb5088bd03062d9ad9c0f6abf600cbed8e8 upstream.
+
+Use kernel_power_off() instead of kernel_halt() to pass through
+machine_power_off() -> pm_power_off(), otherwise axillary power does
+not go off.
+
+Change "power down" bitmask.
+
+Fixes: dd635e33b5c9 ("platform: mellanox: Introduce support of new Nvidia L1 switch")
+Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
+Reviewed-by: Michael Shych <michaelsh@nvidia.com>
+Link: https://lore.kernel.org/r/20230813083735.39090-4-vadimp@nvidia.com
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/mlx-platform.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/platform/x86/mlx-platform.c
++++ b/drivers/platform/x86/mlx-platform.c
+@@ -222,7 +222,7 @@
+ MLXPLAT_CPLD_AGGR_MASK_LC_SDWN)
+ #define MLXPLAT_CPLD_LOW_AGGR_MASK_LOW 0xc1
+ #define MLXPLAT_CPLD_LOW_AGGR_MASK_ASIC2 BIT(2)
+-#define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT BIT(4)
++#define MLXPLAT_CPLD_LOW_AGGR_MASK_PWR_BUT GENMASK(5, 4)
+ #define MLXPLAT_CPLD_LOW_AGGR_MASK_I2C BIT(6)
+ #define MLXPLAT_CPLD_PSU_MASK GENMASK(1, 0)
+ #define MLXPLAT_CPLD_PWR_MASK GENMASK(1, 0)
+@@ -2356,7 +2356,7 @@ mlxplat_mlxcpld_l1_switch_pwr_events_han
+ u8 action)
+ {
+ dev_info(&mlxplat_dev->dev, "System shutdown due to short press of power button");
+- kernel_halt();
++ kernel_power_off();
+ return 0;
+ }
+
--- /dev/null
+From 2b6aa6610dc9690f79d305ca938abfb799a4f766 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Sat, 12 Aug 2023 16:48:18 +0200
+Subject: platform/x86: lenovo-ymc: Only bind on machines with a convertible DMI chassis-type
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 2b6aa6610dc9690f79d305ca938abfb799a4f766 upstream.
+
+The lenovo-ymc driver is causing the keyboard + touchpad to stop working
+on some regular laptop models such as the Lenovo ThinkBook 13s G2 ITL 20V9.
+
+The problem is that there are YMC WMI GUID methods in the ACPI tables
+of these laptops, despite them not being Yogas and lenovo-ymc loading
+causes libinput to see a SW_TABLET_MODE switch with state 1.
+
+This in turn causes libinput to ignore events from the builtin keyboard
+and touchpad, since it filters those out for a Yoga in tablet mode.
+
+Similar issues with false-positive SW_TABLET_MODE=1 reporting have
+been seen with the intel-hid driver.
+
+Copy the intel-hid driver approach to fix this and only bind to the WMI
+device on machines where the DMI chassis-type indicates the machine
+is a convertible.
+
+Add a 'force' module parameter to allow overriding the chassis-type check
+so that users can easily test if the YMC interface works on models which
+report an unexpected chassis-type.
+
+Fixes: e82882cdd241 ("platform/x86: Add driver for Yoga Tablet Mode switch")
+Link: https://bugzilla.redhat.com/show_bug.cgi?id=2229373
+Cc: André Apitzsch <git@apitzsch.eu>
+Cc: stable@vger.kernel.org
+Tested-by: Andrew Kallmeyer <kallmeyeras@gmail.com>
+Tested-by: Gergő Köteles <soyer@irl.hu>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20230812144818.383230-1-hdegoede@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/lenovo-ymc.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/drivers/platform/x86/lenovo-ymc.c b/drivers/platform/x86/lenovo-ymc.c
+index 41676188b373..f360370d5002 100644
+--- a/drivers/platform/x86/lenovo-ymc.c
++++ b/drivers/platform/x86/lenovo-ymc.c
+@@ -24,6 +24,10 @@ static bool ec_trigger __read_mostly;
+ module_param(ec_trigger, bool, 0444);
+ MODULE_PARM_DESC(ec_trigger, "Enable EC triggering work-around to force emitting tablet mode events");
+
++static bool force;
++module_param(force, bool, 0444);
++MODULE_PARM_DESC(force, "Force loading on boards without a convertible DMI chassis-type");
++
+ static const struct dmi_system_id ec_trigger_quirk_dmi_table[] = {
+ {
+ /* Lenovo Yoga 7 14ARB7 */
+@@ -35,6 +39,20 @@ static const struct dmi_system_id ec_trigger_quirk_dmi_table[] = {
+ { }
+ };
+
++static const struct dmi_system_id allowed_chasis_types_dmi_table[] = {
++ {
++ .matches = {
++ DMI_EXACT_MATCH(DMI_CHASSIS_TYPE, "31" /* Convertible */),
++ },
++ },
++ {
++ .matches = {
++ DMI_EXACT_MATCH(DMI_CHASSIS_TYPE, "32" /* Detachable */),
++ },
++ },
++ { }
++};
++
+ struct lenovo_ymc_private {
+ struct input_dev *input_dev;
+ struct acpi_device *ec_acpi_dev;
+@@ -111,6 +129,13 @@ static int lenovo_ymc_probe(struct wmi_device *wdev, const void *ctx)
+ struct input_dev *input_dev;
+ int err;
+
++ if (!dmi_check_system(allowed_chasis_types_dmi_table)) {
++ if (force)
++ dev_info(&wdev->dev, "Force loading Lenovo YMC support\n");
++ else
++ return -ENODEV;
++ }
++
+ ec_trigger |= dmi_check_system(ec_trigger_quirk_dmi_table);
+
+ priv = devm_kzalloc(&wdev->dev, sizeof(*priv), GFP_KERNEL);
+--
+2.41.0
+
--- /dev/null
+From 5a66d59b5ff537ddae84a1f175c3f8eb1140a562 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Sat, 5 Aug 2023 10:10:10 +0200
+Subject: platform/x86: msi-ec: Fix the build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Jean Delvare <jdelvare@suse.de>
+
+commit 5a66d59b5ff537ddae84a1f175c3f8eb1140a562 upstream.
+
+The msi-ec driver fails to build for me (gcc 7.5):
+
+ CC [M] drivers/platform/x86/msi-ec.o
+drivers/platform/x86/msi-ec.c:72:6: error: initializer element is not constant
+ { SM_ECO_NAME, 0xc2 },
+ ^~~~~~~~~~~
+drivers/platform/x86/msi-ec.c:72:6: note: (near initialization for ‘CONF0.shift_mode.modes[0].name’)
+drivers/platform/x86/msi-ec.c:73:6: error: initializer element is not constant
+ { SM_COMFORT_NAME, 0xc1 },
+ ^~~~~~~~~~~~~~~
+drivers/platform/x86/msi-ec.c:73:6: note: (near initialization for ‘CONF0.shift_mode.modes[1].name’)
+drivers/platform/x86/msi-ec.c:74:6: error: initializer element is not constant
+ { SM_SPORT_NAME, 0xc0 },
+ ^~~~~~~~~~~~~
+drivers/platform/x86/msi-ec.c:74:6: note: (near initialization for ‘CONF0.shift_mode.modes[2].name’)
+(...)
+
+Don't try to be smart, just use defines for the constant strings. The
+compiler will recognize it's the same string and will store it only
+once in the data section anyway.
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Fixes: 392cacf2aa10 ("platform/x86: Add new msi-ec driver")
+Cc: stable@vger.kernel.org
+Cc: Nikita Kravets <teackot@gmail.com>
+Cc: Hans de Goede <hdegoede@redhat.com>
+Cc: Mark Gross <markgross@kernel.org>
+Link: https://lore.kernel.org/r/20230805101010.54d49e91@endymion.delvare
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/msi-ec.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/drivers/platform/x86/msi-ec.c
++++ b/drivers/platform/x86/msi-ec.c
+@@ -27,15 +27,15 @@
+ #include <linux/seq_file.h>
+ #include <linux/string.h>
+
+-static const char *const SM_ECO_NAME = "eco";
+-static const char *const SM_COMFORT_NAME = "comfort";
+-static const char *const SM_SPORT_NAME = "sport";
+-static const char *const SM_TURBO_NAME = "turbo";
++#define SM_ECO_NAME "eco"
++#define SM_COMFORT_NAME "comfort"
++#define SM_SPORT_NAME "sport"
++#define SM_TURBO_NAME "turbo"
+
+-static const char *const FM_AUTO_NAME = "auto";
+-static const char *const FM_SILENT_NAME = "silent";
+-static const char *const FM_BASIC_NAME = "basic";
+-static const char *const FM_ADVANCED_NAME = "advanced";
++#define FM_AUTO_NAME "auto"
++#define FM_SILENT_NAME "silent"
++#define FM_BASIC_NAME "basic"
++#define FM_ADVANCED_NAME "advanced"
+
+ static const char * const ALLOWED_FW_0[] __initconst = {
+ "14C1EMS1.012",
--- /dev/null
+From 676b7c5ecab36274442887ceadd6dee8248a244f Mon Sep 17 00:00:00 2001
+From: David Xu <xuwd1@hotmail.com>
+Date: Thu, 13 Jul 2023 21:35:28 +0800
+Subject: platform/x86: serial-multi-instantiate: Auto detect IRQ resource for CSC3551
+
+From: David Xu <xuwd1@hotmail.com>
+
+commit 676b7c5ecab36274442887ceadd6dee8248a244f upstream.
+
+The current code assumes that the CSC3551(multiple cs35l41) always have
+its interrupt pin connected to GPIO thus the IRQ can be acquired with
+acpi_dev_gpio_irq_get. However on some newer laptop models this is no
+longer the case as they have the CSC3551's interrupt pin connected to
+APIC. This causes smi_i2c_probe to fail on these machines.
+
+To support these machines, a new macro IRQ_RESOURCE_AUTO was introduced
+for cs35l41 smi_node, and smi_get_irq function was modified so it tries
+to get GPIO irq resource first and if failed, tries to get
+APIC irq resource for cs35l41.
+
+This patch affects only the cs35l41's probing and brings no negative
+influence on machines that indeed have the cs35l41's interrupt pin
+connected to GPIO.
+
+Signed-off-by: David Xu <xuwd1@hotmail.com>
+Link: https://lore.kernel.org/r/SY4P282MB18350CD8288687B87FFD2243E037A@SY4P282MB1835.AUSP282.PROD.OUTLOOK.COM
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/serial-multi-instantiate.c | 21 +++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
+
+--- a/drivers/platform/x86/serial-multi-instantiate.c
++++ b/drivers/platform/x86/serial-multi-instantiate.c
+@@ -21,6 +21,7 @@
+ #define IRQ_RESOURCE_NONE 0
+ #define IRQ_RESOURCE_GPIO 1
+ #define IRQ_RESOURCE_APIC 2
++#define IRQ_RESOURCE_AUTO 3
+
+ enum smi_bus_type {
+ SMI_I2C,
+@@ -52,6 +53,18 @@ static int smi_get_irq(struct platform_d
+ int ret;
+
+ switch (inst->flags & IRQ_RESOURCE_TYPE) {
++ case IRQ_RESOURCE_AUTO:
++ ret = acpi_dev_gpio_irq_get(adev, inst->irq_idx);
++ if (ret > 0) {
++ dev_dbg(&pdev->dev, "Using gpio irq\n");
++ break;
++ }
++ ret = platform_get_irq(pdev, inst->irq_idx);
++ if (ret > 0) {
++ dev_dbg(&pdev->dev, "Using platform irq\n");
++ break;
++ }
++ break;
+ case IRQ_RESOURCE_GPIO:
+ ret = acpi_dev_gpio_irq_get(adev, inst->irq_idx);
+ break;
+@@ -307,10 +320,10 @@ static const struct smi_node int3515_dat
+
+ static const struct smi_node cs35l41_hda = {
+ .instances = {
+- { "cs35l41-hda", IRQ_RESOURCE_GPIO, 0 },
+- { "cs35l41-hda", IRQ_RESOURCE_GPIO, 0 },
+- { "cs35l41-hda", IRQ_RESOURCE_GPIO, 0 },
+- { "cs35l41-hda", IRQ_RESOURCE_GPIO, 0 },
++ { "cs35l41-hda", IRQ_RESOURCE_AUTO, 0 },
++ { "cs35l41-hda", IRQ_RESOURCE_AUTO, 0 },
++ { "cs35l41-hda", IRQ_RESOURCE_AUTO, 0 },
++ { "cs35l41-hda", IRQ_RESOURCE_AUTO, 0 },
+ {}
+ },
+ .bus_type = SMI_AUTO_DETECT,
--- /dev/null
+From 8366d1f1249a0d0bba41d0bd1298d63e5d34c7f7 Mon Sep 17 00:00:00 2001
+From: Alexandra Diupina <adiupina@astralinux.ru>
+Date: Fri, 28 Jul 2023 15:35:21 +0300
+Subject: scsi: 53c700: Check that command slot is not NULL
+
+From: Alexandra Diupina <adiupina@astralinux.ru>
+
+commit 8366d1f1249a0d0bba41d0bd1298d63e5d34c7f7 upstream.
+
+Add a check for the command slot value to avoid dereferencing a NULL
+pointer.
+
+Found by Linux Verification Center (linuxtesting.org) with SVACE.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Co-developed-by: Vladimir Telezhnikov <vtelezhnikov@astralinux.ru>
+Signed-off-by: Vladimir Telezhnikov <vtelezhnikov@astralinux.ru>
+Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
+Link: https://lore.kernel.org/r/20230728123521.18293-1-adiupina@astralinux.ru
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/53c700.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/scsi/53c700.c
++++ b/drivers/scsi/53c700.c
+@@ -1598,7 +1598,7 @@ NCR_700_intr(int irq, void *dev_id)
+ printk("scsi%d (%d:%d) PHASE MISMATCH IN SEND MESSAGE %d remain, return %p[%04x], phase %s\n", host->host_no, pun, lun, count, (void *)temp, temp - hostdata->pScript, sbcl_to_string(NCR_700_readb(host, SBCL_REG)));
+ #endif
+ resume_offset = hostdata->pScript + Ent_SendMessagePhaseMismatch;
+- } else if(dsp >= to32bit(&slot->pSG[0].ins) &&
++ } else if (slot && dsp >= to32bit(&slot->pSG[0].ins) &&
+ dsp <= to32bit(&slot->pSG[NCR_700_SG_SEGMENTS].ins)) {
+ int data_transfer = NCR_700_readl(host, DBC_REG) & 0xffffff;
+ int SGcount = (dsp - to32bit(&slot->pSG[0].ins))/sizeof(struct NCR_700_SG_List);
--- /dev/null
+From 9426d3cef5000824e5f24f80ed5f42fb935f2488 Mon Sep 17 00:00:00 2001
+From: Tony Battersby <tonyb@cybernetics.com>
+Date: Mon, 24 Jul 2023 14:25:40 -0400
+Subject: scsi: core: Fix legacy /proc parsing buffer overflow
+
+From: Tony Battersby <tonyb@cybernetics.com>
+
+commit 9426d3cef5000824e5f24f80ed5f42fb935f2488 upstream.
+
+(lightly modified commit message mostly by Linus Torvalds)
+
+The parsing code for /proc/scsi/scsi is disgusting and broken. We should
+have just used 'sscanf()' or something simple like that, but the logic may
+actually predate our kernel sscanf library routine for all I know. It
+certainly predates both git and BK histories.
+
+And we can't change it to be something sane like that now, because the
+string matching at the start is done case-insensitively, and the separator
+parsing between numbers isn't done at all, so *any* separator will work,
+including a possible terminating NUL character.
+
+This interface is root-only, and entirely for legacy use, so there is
+absolutely no point in trying to tighten up the parsing. Because any
+separator has traditionally worked, it's entirely possible that people have
+used random characters rather than the suggested space.
+
+So don't bother to try to pretty it up, and let's just make a minimal patch
+that can be back-ported and we can forget about this whole sorry thing for
+another two decades.
+
+Just make it at least not read past the end of the supplied data.
+
+Link: https://lore.kernel.org/linux-scsi/b570f5fe-cb7c-863a-6ed9-f6774c219b88@cybernetics.com/
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Martin K Petersen <martin.petersen@oracle.com>
+Cc: James Bottomley <jejb@linux.ibm.com>
+Cc: Willy Tarreau <w@1wt.eu>
+Cc: stable@kernel.org
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
+Signed-off-by: Martin K Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/scsi_proc.c | 30 +++++++++++++++++-------------
+ 1 file changed, 17 insertions(+), 13 deletions(-)
+
+--- a/drivers/scsi/scsi_proc.c
++++ b/drivers/scsi/scsi_proc.c
+@@ -406,7 +406,7 @@ static ssize_t proc_scsi_write(struct fi
+ size_t length, loff_t *ppos)
+ {
+ int host, channel, id, lun;
+- char *buffer, *p;
++ char *buffer, *end, *p;
+ int err;
+
+ if (!buf || length > PAGE_SIZE)
+@@ -421,10 +421,14 @@ static ssize_t proc_scsi_write(struct fi
+ goto out;
+
+ err = -EINVAL;
+- if (length < PAGE_SIZE)
+- buffer[length] = '\0';
+- else if (buffer[PAGE_SIZE-1])
+- goto out;
++ if (length < PAGE_SIZE) {
++ end = buffer + length;
++ *end = '\0';
++ } else {
++ end = buffer + PAGE_SIZE - 1;
++ if (*end)
++ goto out;
++ }
+
+ /*
+ * Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
+@@ -433,10 +437,10 @@ static ssize_t proc_scsi_write(struct fi
+ if (!strncmp("scsi add-single-device", buffer, 22)) {
+ p = buffer + 23;
+
+- host = simple_strtoul(p, &p, 0);
+- channel = simple_strtoul(p + 1, &p, 0);
+- id = simple_strtoul(p + 1, &p, 0);
+- lun = simple_strtoul(p + 1, &p, 0);
++ host = (p < end) ? simple_strtoul(p, &p, 0) : 0;
++ channel = (p + 1 < end) ? simple_strtoul(p + 1, &p, 0) : 0;
++ id = (p + 1 < end) ? simple_strtoul(p + 1, &p, 0) : 0;
++ lun = (p + 1 < end) ? simple_strtoul(p + 1, &p, 0) : 0;
+
+ err = scsi_add_single_device(host, channel, id, lun);
+
+@@ -447,10 +451,10 @@ static ssize_t proc_scsi_write(struct fi
+ } else if (!strncmp("scsi remove-single-device", buffer, 25)) {
+ p = buffer + 26;
+
+- host = simple_strtoul(p, &p, 0);
+- channel = simple_strtoul(p + 1, &p, 0);
+- id = simple_strtoul(p + 1, &p, 0);
+- lun = simple_strtoul(p + 1, &p, 0);
++ host = (p < end) ? simple_strtoul(p, &p, 0) : 0;
++ channel = (p + 1 < end) ? simple_strtoul(p + 1, &p, 0) : 0;
++ id = (p + 1 < end) ? simple_strtoul(p + 1, &p, 0) : 0;
++ lun = (p + 1 < end) ? simple_strtoul(p + 1, &p, 0) : 0;
+
+ err = scsi_remove_single_device(host, channel, id, lun);
+ }
--- /dev/null
+From 04b5b5cb0136ce970333a9c6cec7e46adba1ea3a Mon Sep 17 00:00:00 2001
+From: Zhu Wang <wangzhu9@huawei.com>
+Date: Thu, 3 Aug 2023 10:02:30 +0800
+Subject: scsi: core: Fix possible memory leak if device_add() fails
+
+From: Zhu Wang <wangzhu9@huawei.com>
+
+commit 04b5b5cb0136ce970333a9c6cec7e46adba1ea3a upstream.
+
+If device_add() returns error, the name allocated by dev_set_name() needs
+be freed. As the comment of device_add() says, put_device() should be used
+to decrease the reference count in the error path. So fix this by calling
+put_device(), then the name can be freed in kobject_cleanp().
+
+Fixes: ee959b00c335 ("SCSI: convert struct class_device to struct device")
+Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
+Link: https://lore.kernel.org/r/20230803020230.226903-1-wangzhu9@huawei.com
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/raid_class.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/scsi/raid_class.c
++++ b/drivers/scsi/raid_class.c
+@@ -248,6 +248,7 @@ int raid_component_add(struct raid_templ
+ return 0;
+
+ err_out:
++ put_device(&rc->dev);
+ list_del(&rc->node);
+ rd->component_count--;
+ put_device(component_dev);
--- /dev/null
+From 5a43b07a87835660f91d88a4db11abfea8c523b7 Mon Sep 17 00:00:00 2001
+From: Karan Tilak Kumar <kartilak@cisco.com>
+Date: Thu, 27 Jul 2023 12:39:19 -0700
+Subject: scsi: fnic: Replace return codes in fnic_clean_pending_aborts()
+
+From: Karan Tilak Kumar <kartilak@cisco.com>
+
+commit 5a43b07a87835660f91d88a4db11abfea8c523b7 upstream.
+
+fnic_clean_pending_aborts() was returning a non-zero value irrespective of
+failure or success. This caused the caller of this function to assume that
+the device reset had failed, even though it would succeed in most cases. As
+a consequence, a successful device reset would escalate to host reset.
+
+Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
+Tested-by: Karan Tilak Kumar <kartilak@cisco.com>
+Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
+Link: https://lore.kernel.org/r/20230727193919.2519-1-kartilak@cisco.com
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/fnic/fnic.h | 2 +-
+ drivers/scsi/fnic/fnic_scsi.c | 6 ++++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/scsi/fnic/fnic.h
++++ b/drivers/scsi/fnic/fnic.h
+@@ -27,7 +27,7 @@
+
+ #define DRV_NAME "fnic"
+ #define DRV_DESCRIPTION "Cisco FCoE HBA Driver"
+-#define DRV_VERSION "1.6.0.54"
++#define DRV_VERSION "1.6.0.55"
+ #define PFX DRV_NAME ": "
+ #define DFX DRV_NAME "%d: "
+
+--- a/drivers/scsi/fnic/fnic_scsi.c
++++ b/drivers/scsi/fnic/fnic_scsi.c
+@@ -2139,7 +2139,7 @@ static int fnic_clean_pending_aborts(str
+ bool new_sc)
+
+ {
+- int ret = SUCCESS;
++ int ret = 0;
+ struct fnic_pending_aborts_iter_data iter_data = {
+ .fnic = fnic,
+ .lun_dev = lr_sc->device,
+@@ -2159,9 +2159,11 @@ static int fnic_clean_pending_aborts(str
+
+ /* walk again to check, if IOs are still pending in fw */
+ if (fnic_is_abts_pending(fnic, lr_sc))
+- ret = FAILED;
++ ret = 1;
+
+ clean_pending_aborts_end:
++ FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
++ "%s: exit status: %d\n", __func__, ret);
+ return ret;
+ }
+
--- /dev/null
+From ef222f551e7c4e2008fc442ffc9edcd1a7fd8f63 Mon Sep 17 00:00:00 2001
+From: Nilesh Javali <njavali@marvell.com>
+Date: Mon, 7 Aug 2023 15:07:24 +0530
+Subject: scsi: qedf: Fix firmware halt over suspend and resume
+
+From: Nilesh Javali <njavali@marvell.com>
+
+commit ef222f551e7c4e2008fc442ffc9edcd1a7fd8f63 upstream.
+
+While performing certain power-off sequences, PCI drivers are called to
+suspend and resume their underlying devices through PCI PM (power
+management) interface. However the hardware does not support PCI PM
+suspend/resume operations so system wide suspend/resume leads to bad MFW
+(management firmware) state which causes various follow-up errors in driver
+when communicating with the device/firmware.
+
+To fix this driver implements PCI PM suspend handler to indicate
+unsupported operation to the PCI subsystem explicitly, thus avoiding system
+to go into suspended/standby mode.
+
+Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.")
+Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
+Signed-off-by: Nilesh Javali <njavali@marvell.com>
+Link: https://lore.kernel.org/r/20230807093725.46829-1-njavali@marvell.com
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/qedf/qedf_main.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+--- a/drivers/scsi/qedf/qedf_main.c
++++ b/drivers/scsi/qedf/qedf_main.c
+@@ -31,6 +31,7 @@ static void qedf_remove(struct pci_dev *
+ static void qedf_shutdown(struct pci_dev *pdev);
+ static void qedf_schedule_recovery_handler(void *dev);
+ static void qedf_recovery_handler(struct work_struct *work);
++static int qedf_suspend(struct pci_dev *pdev, pm_message_t state);
+
+ /*
+ * Driver module parameters.
+@@ -3271,6 +3272,7 @@ static struct pci_driver qedf_pci_driver
+ .probe = qedf_probe,
+ .remove = qedf_remove,
+ .shutdown = qedf_shutdown,
++ .suspend = qedf_suspend,
+ };
+
+ static int __qedf_probe(struct pci_dev *pdev, int mode)
+@@ -4000,6 +4002,22 @@ static void qedf_shutdown(struct pci_dev
+ __qedf_remove(pdev, QEDF_MODE_NORMAL);
+ }
+
++static int qedf_suspend(struct pci_dev *pdev, pm_message_t state)
++{
++ struct qedf_ctx *qedf;
++
++ if (!pdev) {
++ QEDF_ERR(NULL, "pdev is NULL.\n");
++ return -ENODEV;
++ }
++
++ qedf = pci_get_drvdata(pdev);
++
++ QEDF_ERR(&qedf->dbg_ctx, "%s: Device does not support suspend operation\n", __func__);
++
++ return -EPERM;
++}
++
+ /*
+ * Recovery handler code
+ */
--- /dev/null
+From 1516ee035df32115197cd93ae3619dba7b020986 Mon Sep 17 00:00:00 2001
+From: Nilesh Javali <njavali@marvell.com>
+Date: Mon, 7 Aug 2023 15:07:25 +0530
+Subject: scsi: qedi: Fix firmware halt over suspend and resume
+
+From: Nilesh Javali <njavali@marvell.com>
+
+commit 1516ee035df32115197cd93ae3619dba7b020986 upstream.
+
+While performing certain power-off sequences, PCI drivers are called to
+suspend and resume their underlying devices through PCI PM (power
+management) interface. However the hardware does not support PCI PM
+suspend/resume operations so system wide suspend/resume leads to bad MFW
+(management firmware) state which causes various follow-up errors in driver
+when communicating with the device/firmware.
+
+To fix this driver implements PCI PM suspend handler to indicate
+unsupported operation to the PCI subsystem explicitly, thus avoiding system
+to go into suspended/standby mode.
+
+Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.")
+Signed-off-by: Nilesh Javali <njavali@marvell.com>
+Link: https://lore.kernel.org/r/20230807093725.46829-2-njavali@marvell.com
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/qedi/qedi_main.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+--- a/drivers/scsi/qedi/qedi_main.c
++++ b/drivers/scsi/qedi/qedi_main.c
+@@ -69,6 +69,7 @@ static struct nvm_iscsi_block *qedi_get_
+ static void qedi_recovery_handler(struct work_struct *work);
+ static void qedi_schedule_hw_err_handler(void *dev,
+ enum qed_hw_err_type err_type);
++static int qedi_suspend(struct pci_dev *pdev, pm_message_t state);
+
+ static int qedi_iscsi_event_cb(void *context, u8 fw_event_code, void *fw_handle)
+ {
+@@ -2510,6 +2511,22 @@ static void qedi_shutdown(struct pci_dev
+ __qedi_remove(pdev, QEDI_MODE_SHUTDOWN);
+ }
+
++static int qedi_suspend(struct pci_dev *pdev, pm_message_t state)
++{
++ struct qedi_ctx *qedi;
++
++ if (!pdev) {
++ QEDI_ERR(NULL, "pdev is NULL.\n");
++ return -ENODEV;
++ }
++
++ qedi = pci_get_drvdata(pdev);
++
++ QEDI_ERR(&qedi->dbg_ctx, "%s: Device does not support suspend operation\n", __func__);
++
++ return -EPERM;
++}
++
+ static int __qedi_probe(struct pci_dev *pdev, int mode)
+ {
+ struct qedi_ctx *qedi;
+@@ -2868,6 +2885,7 @@ static struct pci_driver qedi_pci_driver
+ .remove = qedi_remove,
+ .shutdown = qedi_shutdown,
+ .err_handler = &qedi_err_handler,
++ .suspend = qedi_suspend,
+ };
+
+ static int __init qedi_init(void)
--- /dev/null
+From 41320b18a0e0dfb236dba4edb9be12dba1878156 Mon Sep 17 00:00:00 2001
+From: Zhu Wang <wangzhu9@huawei.com>
+Date: Tue, 1 Aug 2023 19:14:21 +0800
+Subject: scsi: snic: Fix possible memory leak if device_add() fails
+
+From: Zhu Wang <wangzhu9@huawei.com>
+
+commit 41320b18a0e0dfb236dba4edb9be12dba1878156 upstream.
+
+If device_add() returns error, the name allocated by dev_set_name() needs
+be freed. As the comment of device_add() says, put_device() should be used
+to give up the reference in the error path. So fix this by calling
+put_device(), then the name can be freed in kobject_cleanp().
+
+Fixes: c8806b6c9e82 ("snic: driver for Cisco SCSI HBA")
+Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
+Acked-by: Narsimhulu Musini <nmusini@cisco.com>
+Link: https://lore.kernel.org/r/20230801111421.63651-1-wangzhu9@huawei.com
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/snic/snic_disc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/scsi/snic/snic_disc.c
++++ b/drivers/scsi/snic/snic_disc.c
+@@ -303,6 +303,7 @@ snic_tgt_create(struct snic *snic, struc
+ "Snic Tgt: device_add, with err = %d\n",
+ ret);
+
++ put_device(&tgt->dev);
+ put_device(&snic->shost->shost_gendev);
+ spin_lock_irqsave(snic->shost->host_lock, flags);
+ list_del(&tgt->list);
--- /dev/null
+From 175544ad48cbf56affeef2a679c6a4d4fb1e2881 Mon Sep 17 00:00:00 2001
+From: Michael Kelley <mikelley@microsoft.com>
+Date: Fri, 28 Jul 2023 21:59:24 -0700
+Subject: scsi: storvsc: Fix handling of virtual Fibre Channel timeouts
+
+From: Michael Kelley <mikelley@microsoft.com>
+
+commit 175544ad48cbf56affeef2a679c6a4d4fb1e2881 upstream.
+
+Hyper-V provides the ability to connect Fibre Channel LUNs to the host
+system and present them in a guest VM as a SCSI device. I/O to the vFC
+device is handled by the storvsc driver. The storvsc driver includes a
+partial integration with the FC transport implemented in the generic
+portion of the Linux SCSI subsystem so that FC attributes can be displayed
+in /sys. However, the partial integration means that some aspects of vFC
+don't work properly. Unfortunately, a full and correct integration isn't
+practical because of limitations in what Hyper-V provides to the guest.
+
+In particular, in the context of Hyper-V storvsc, the FC transport timeout
+function fc_eh_timed_out() causes a kernel panic because it can't find the
+rport and dereferences a NULL pointer. The original patch that added the
+call from storvsc_eh_timed_out() to fc_eh_timed_out() is faulty in this
+regard.
+
+In many cases a timeout is due to a transient condition, so the situation
+can be improved by just continuing to wait like with other I/O requests
+issued by storvsc, and avoiding the guaranteed panic. For a permanent
+failure, continuing to wait may result in a hung thread instead of a panic,
+which again may be better.
+
+So fix the panic by removing the storvsc call to fc_eh_timed_out(). This
+allows storvsc to keep waiting for a response. The change has been tested
+by users who experienced a panic in fc_eh_timed_out() due to transient
+timeouts, and it solves their problem.
+
+In the future we may want to deprecate the vFC functionality in storvsc
+since it can't be fully fixed. But it has current users for whom it is
+working well enough, so it should probably stay for a while longer.
+
+Fixes: 3930d7309807 ("scsi: storvsc: use default I/O timeout handler for FC devices")
+Cc: stable@vger.kernel.org
+Signed-off-by: Michael Kelley <mikelley@microsoft.com>
+Link: https://lore.kernel.org/r/1690606764-79669-1-git-send-email-mikelley@microsoft.com
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/storvsc_drv.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/drivers/scsi/storvsc_drv.c
++++ b/drivers/scsi/storvsc_drv.c
+@@ -1672,10 +1672,6 @@ static int storvsc_host_reset_handler(st
+ */
+ static enum scsi_timeout_action storvsc_eh_timed_out(struct scsi_cmnd *scmnd)
+ {
+-#if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
+- if (scmnd->device->host->transportt == fc_transport_template)
+- return fc_eh_timed_out(scmnd);
+-#endif
+ return SCSI_EH_RESET_TIMER;
+ }
+
--- /dev/null
+From b6d128f89a85771433a004e8656090ccbe1fb969 Mon Sep 17 00:00:00 2001
+From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Date: Thu, 3 Aug 2023 17:18:12 +0900
+Subject: scsi: ufs: renesas: Fix private allocation
+
+From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+
+commit b6d128f89a85771433a004e8656090ccbe1fb969 upstream.
+
+Should use devm_kzalloc() for struct ufs_renesas_priv because the
+.initialized should be false as default.
+
+Fixes: d69520288efd ("scsi: ufs: ufs-renesas: Add support for Renesas R-Car UFS controller")
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Link: https://lore.kernel.org/r/20230803081812.1446282-1-yoshihiro.shimoda.uh@renesas.com
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/ufs/host/ufs-renesas.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/ufs/host/ufs-renesas.c
++++ b/drivers/ufs/host/ufs-renesas.c
+@@ -359,7 +359,7 @@ static int ufs_renesas_init(struct ufs_h
+ {
+ struct ufs_renesas_priv *priv;
+
+- priv = devm_kmalloc(hba->dev, sizeof(*priv), GFP_KERNEL);
++ priv = devm_kzalloc(hba->dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+ ufshcd_set_variant(hba, priv);
btrfs-exit-gracefully-if-reloc-roots-don-t-match.patch
btrfs-reject-invalid-reloc-tree-root-keys-with-stack-dump.patch
btrfs-set-cache_block_group_error-if-we-find-an-error.patch
+scsi-core-fix-legacy-proc-parsing-buffer-overflow.patch
+scsi-storvsc-fix-handling-of-virtual-fibre-channel-timeouts.patch
+scsi-ufs-renesas-fix-private-allocation.patch
+scsi-53c700-check-that-command-slot-is-not-null.patch
+scsi-snic-fix-possible-memory-leak-if-device_add-fails.patch
+scsi-core-fix-possible-memory-leak-if-device_add-fails.patch
+scsi-fnic-replace-return-codes-in-fnic_clean_pending_aborts.patch
+scsi-qedi-fix-firmware-halt-over-suspend-and-resume.patch
+scsi-qedf-fix-firmware-halt-over-suspend-and-resume.patch
+platform-x86-msi-ec-fix-the-build.patch
+platform-x86-lenovo-ymc-only-bind-on-machines-with-a-convertible-dmi-chassis-type.patch
+platform-mellanox-change-register-offset-addresses.patch
+platform-mellanox-mlx-platform-fix-signals-polarity-and-latch-mask.patch
+platform-mellanox-mlx-platform-modify-graceful-shutdown-callback-and-power-down-mask.patch
+platform-mellanox-fix-order-in-exit-flow.patch
+platform-x86-serial-multi-instantiate-auto-detect-irq-resource-for-csc3551.patch
+acpi-scan-create-platform-device-for-cs35l56.patch
+alpha-remove-__init-annotation-from-exported-page_is_ram.patch