From 9682ffccbf72a13947d9eb6c4a071f0a1ad60ad1 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 12 Sep 2024 08:20:58 -0400 Subject: [PATCH] Fixes for 6.1 Signed-off-by: Sasha Levin --- ...pdate-target-inode-s-ctime-on-unlink.patch | 43 ++++ ...ix-error-return-if-missing-firmware-.patch | 40 ++++ ...ation-quirks-add-quirk-for-ayn-loki-.patch | 42 ++++ ...-quirks-add-quirk-for-ayn-loki-.patch-7342 | 44 ++++ ...d-multitouch-add-support-for-gt7868q.patch | 95 ++++++++ ...ratelimit-the-spi_sync-error-message.patch | 40 ++++ ...fujitsu-lifebook-e756-to-i8042-quirk.patch | 44 ++++ ...enable-smbus-for-hp-elitebook-840-g2.patch | 38 +++ ...-override-fsids-for-share-path-check.patch | 224 ++++++++++++++++++ ...d-override-fsids-for-smb2_query_info.patch | 56 +++++ ...t-use-ip_hdrlen-instead-of-bit-shift.patch | 50 ++++ ...tesse-repair-vsc73xx-autonegotiation.patch | 76 ++++++ ...ssary-rescanning-of-the-per-server-d.patch | 84 +++++++ ...ng-of-layout-segments-in-layoutretur.patch | 65 +++++ ...-aggregator_registry-add-support-for.patch | 50 ++++ ...gator_registry-add-support-for.patch-22640 | 43 ++++ ...oot-warning-with-hugepages-and-confi.patch | 85 +++++++ ...merge_config-config-files-add-a-trai.patch | 48 ++++ queue-6.1/series | 20 ++ ...server-fix-return-value-of-smb2_open.patch | 38 +++ ...x-carrier-detection-in-modes-1-and-4.patch | 80 +++++++ 21 files changed, 1305 insertions(+) create mode 100644 queue-6.1/btrfs-update-target-inode-s-ctime-on-unlink.patch create mode 100644 queue-6.1/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch create mode 100644 queue-6.1/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch create mode 100644 queue-6.1/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch-7342 create mode 100644 queue-6.1/hid-multitouch-add-support-for-gt7868q.patch create mode 100644 queue-6.1/input-ads7846-ratelimit-the-spi_sync-error-message.patch create mode 100644 queue-6.1/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch create mode 100644 queue-6.1/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch create mode 100644 queue-6.1/ksmbd-override-fsids-for-share-path-check.patch create mode 100644 queue-6.1/ksmbd-override-fsids-for-smb2_query_info.patch create mode 100644 queue-6.1/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch create mode 100644 queue-6.1/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch create mode 100644 queue-6.1/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch create mode 100644 queue-6.1/nfsv4-fix-clearing-of-layout-segments-in-layoutretur.patch create mode 100644 queue-6.1/platform-surface-aggregator_registry-add-support-for.patch create mode 100644 queue-6.1/platform-surface-aggregator_registry-add-support-for.patch-22640 create mode 100644 queue-6.1/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch create mode 100644 queue-6.1/scripts-kconfig-merge_config-config-files-add-a-trai.patch create mode 100644 queue-6.1/series create mode 100644 queue-6.1/smb-server-fix-return-value-of-smb2_open.patch create mode 100644 queue-6.1/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch diff --git a/queue-6.1/btrfs-update-target-inode-s-ctime-on-unlink.patch b/queue-6.1/btrfs-update-target-inode-s-ctime-on-unlink.patch new file mode 100644 index 00000000000..649d379dabe --- /dev/null +++ b/queue-6.1/btrfs-update-target-inode-s-ctime-on-unlink.patch @@ -0,0 +1,43 @@ +From 20eb9ca642195bff2ee9caf0418d6c7a5bfc79fb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Aug 2024 12:30:52 -0400 +Subject: btrfs: update target inode's ctime on unlink + +From: Jeff Layton + +[ Upstream commit 3bc2ac2f8f0b78a13140fc72022771efe0c9b778 ] + +Unlink changes the link count on the target inode. POSIX mandates that +the ctime must also change when this occurs. + +According to https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html: + +"Upon successful completion, unlink() shall mark for update the last data + modification and last file status change timestamps of the parent + directory. Also, if the file's link count is not 0, the last file status + change timestamp of the file shall be marked for update." + +Signed-off-by: Jeff Layton +Reviewed-by: David Sterba +[ add link to the opengroup docs ] +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/inode.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c +index e5017b2ade57..894887640c43 100644 +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -4379,6 +4379,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, + + btrfs_i_size_write(dir, dir->vfs_inode.i_size - name->len * 2); + inode_inc_iversion(&inode->vfs_inode); ++ inode_set_ctime_current(&inode->vfs_inode); + inode_inc_iversion(&dir->vfs_inode); + inode->vfs_inode.i_ctime = current_time(&inode->vfs_inode); + dir->vfs_inode.i_mtime = inode->vfs_inode.i_ctime; +-- +2.43.0 + diff --git a/queue-6.1/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch b/queue-6.1/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch new file mode 100644 index 00000000000..9182efe9667 --- /dev/null +++ b/queue-6.1/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch @@ -0,0 +1,40 @@ +From a83d45079e6d3596885e9d4ebf083d28e2f4b340 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Jul 2024 09:06:30 -0700 +Subject: drm/msm/adreno: Fix error return if missing firmware-name + +From: Rob Clark + +[ Upstream commit 624ab9cde26a9f150b4fd268b0f3dae3184dc40c ] + +-ENODEV is used to signify that there is no zap shader for the platform, +and the CPU can directly take the GPU out of secure mode. We want to +use this return code when there is no zap-shader node. But not when +there is, but without a firmware-name property. This case we want to +treat as-if the needed fw is not found. + +Signed-off-by: Rob Clark +Reviewed-by: Dmitry Baryshkov +Reviewed-by: Akhil P Oommen +Patchwork: https://patchwork.freedesktop.org/patch/604564/ +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c +index dfd4eec21785..c4ad70eb1d92 100644 +--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c ++++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c +@@ -99,7 +99,7 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname, + * was a bad idea, and is only provided for backwards + * compatibility for older targets. + */ +- return -ENODEV; ++ return -ENOENT; + } + + if (IS_ERR(fw)) { +-- +2.43.0 + diff --git a/queue-6.1/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch b/queue-6.1/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch new file mode 100644 index 00000000000..d4411736fdb --- /dev/null +++ b/queue-6.1/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch @@ -0,0 +1,42 @@ +From 6440b7c9f716eba2de044320dd29ac2e98c332d0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 14:47:30 +0200 +Subject: drm: panel-orientation-quirks: Add quirk for Ayn Loki Zero + +From: Bouke Sybren Haarsma + +[ Upstream commit b86aa4140f6a8f01f35bfb05af60e01a55b48803 ] + +Add quirk orientation for the Ayn Loki Zero. + +This also has been tested/used by the JELOS team. + +Signed-off-by: Bouke Sybren Haarsma +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Link: https://patchwork.freedesktop.org/patch/msgid/20240728124731.168452-2-boukehaarsma23@gmail.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c +index 039da0d1a613..79ccf4959df4 100644 +--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c ++++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c +@@ -208,6 +208,12 @@ static const struct dmi_system_id orientation_data[] = { + DMI_MATCH(DMI_BOARD_NAME, "KUN"), + }, + .driver_data = (void *)&lcd1600x2560_rightside_up, ++ }, { /* AYN Loki Zero */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ayn"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Loki Zero"), ++ }, ++ .driver_data = (void *)&lcd1080x1920_leftside_up, + }, { /* Chuwi HiBook (CWI514) */ + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"), +-- +2.43.0 + diff --git a/queue-6.1/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch-7342 b/queue-6.1/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch-7342 new file mode 100644 index 00000000000..dd24f333f9e --- /dev/null +++ b/queue-6.1/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch-7342 @@ -0,0 +1,44 @@ +From e0bfca021636a8b99ba727fedb101f9438d29379 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 14:47:31 +0200 +Subject: drm: panel-orientation-quirks: Add quirk for Ayn Loki Max + +From: Bouke Sybren Haarsma + +[ Upstream commit 2c71c8459c8ca66bd8f597effaac892ee8448a9f ] + +Add quirk orientation for Ayn Loki Max model. + +This has been tested by JELOS team that uses their +own patched kernel for a while now and confirmed by +users in the ChimeraOS discord servers. + +Signed-off-by: Bouke Sybren Haarsma +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Link: https://patchwork.freedesktop.org/patch/msgid/20240728124731.168452-3-boukehaarsma23@gmail.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/drm_panel_orientation_quirks.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c +index 79ccf4959df4..5b2506c65e95 100644 +--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c ++++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c +@@ -208,6 +208,12 @@ static const struct dmi_system_id orientation_data[] = { + DMI_MATCH(DMI_BOARD_NAME, "KUN"), + }, + .driver_data = (void *)&lcd1600x2560_rightside_up, ++ }, { /* AYN Loki Max */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ayn"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Loki Max"), ++ }, ++ .driver_data = (void *)&lcd1080x1920_leftside_up, + }, { /* AYN Loki Zero */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ayn"), +-- +2.43.0 + diff --git a/queue-6.1/hid-multitouch-add-support-for-gt7868q.patch b/queue-6.1/hid-multitouch-add-support-for-gt7868q.patch new file mode 100644 index 00000000000..850d035d700 --- /dev/null +++ b/queue-6.1/hid-multitouch-add-support-for-gt7868q.patch @@ -0,0 +1,95 @@ +From 63db67cfb1f08145dd47446bb2f0dbdf9af35897 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Jul 2024 23:27:57 +0100 +Subject: HID: multitouch: Add support for GT7868Q + +From: Dmitry Savin + +[ Upstream commit c8000deb68365b461b324d68c7ea89d730f0bb85 ] + +GT7868Q has incorrect data in the report and needs a fixup. +The change enables haptic touchpad on Lenovo ThinkBook 13x Gen 4 +and has been tested on the device. + +Signed-off-by: Dmitry Savin +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/hid-ids.h | 2 ++ + drivers/hid/hid-multitouch.c | 33 +++++++++++++++++++++++++++++++++ + 2 files changed, 35 insertions(+) + +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h +index 1395270a30cb..3359a24ca241 100644 +--- a/drivers/hid/hid-ids.h ++++ b/drivers/hid/hid-ids.h +@@ -506,6 +506,8 @@ + #define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_E100 0xe100 + + #define I2C_VENDOR_ID_GOODIX 0x27c6 ++#define I2C_DEVICE_ID_GOODIX_01E8 0x01e8 ++#define I2C_DEVICE_ID_GOODIX_01E9 0x01e9 + #define I2C_DEVICE_ID_GOODIX_01F0 0x01f0 + + #define USB_VENDOR_ID_GOODTOUCH 0x1aad +diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c +index 17efe6e2a1a4..8ef41d6e71d4 100644 +--- a/drivers/hid/hid-multitouch.c ++++ b/drivers/hid/hid-multitouch.c +@@ -1442,6 +1442,30 @@ static int mt_event(struct hid_device *hid, struct hid_field *field, + return 0; + } + ++static __u8 *mt_report_fixup(struct hid_device *hdev, __u8 *rdesc, ++ unsigned int *size) ++{ ++ if (hdev->vendor == I2C_VENDOR_ID_GOODIX && ++ (hdev->product == I2C_DEVICE_ID_GOODIX_01E8 || ++ hdev->product == I2C_DEVICE_ID_GOODIX_01E9)) { ++ if (rdesc[607] == 0x15) { ++ rdesc[607] = 0x25; ++ dev_info( ++ &hdev->dev, ++ "GT7868Q report descriptor fixup is applied.\n"); ++ } else { ++ dev_info( ++ &hdev->dev, ++ "The byte is not expected for fixing the report descriptor. \ ++It's possible that the touchpad firmware is not suitable for applying the fix. \ ++got: %x\n", ++ rdesc[607]); ++ } ++ } ++ ++ return rdesc; ++} ++ + static void mt_report(struct hid_device *hid, struct hid_report *report) + { + struct mt_device *td = hid_get_drvdata(hid); +@@ -2038,6 +2062,14 @@ static const struct hid_device_id mt_devices[] = { + MT_BT_DEVICE(USB_VENDOR_ID_FRUCTEL, + USB_DEVICE_ID_GAMETEL_MT_MODE) }, + ++ /* Goodix GT7868Q devices */ ++ { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU, ++ HID_DEVICE(BUS_I2C, HID_GROUP_ANY, I2C_VENDOR_ID_GOODIX, ++ I2C_DEVICE_ID_GOODIX_01E8) }, ++ { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU, ++ HID_DEVICE(BUS_I2C, HID_GROUP_ANY, I2C_VENDOR_ID_GOODIX, ++ I2C_DEVICE_ID_GOODIX_01E8) }, ++ + /* GoodTouch panels */ + { .driver_data = MT_CLS_NSMU, + MT_USB_DEVICE(USB_VENDOR_ID_GOODTOUCH, +@@ -2273,6 +2305,7 @@ static struct hid_driver mt_driver = { + .feature_mapping = mt_feature_mapping, + .usage_table = mt_grabbed_usages, + .event = mt_event, ++ .report_fixup = mt_report_fixup, + .report = mt_report, + #ifdef CONFIG_PM + .suspend = mt_suspend, +-- +2.43.0 + diff --git a/queue-6.1/input-ads7846-ratelimit-the-spi_sync-error-message.patch b/queue-6.1/input-ads7846-ratelimit-the-spi_sync-error-message.patch new file mode 100644 index 00000000000..b6988767e8c --- /dev/null +++ b/queue-6.1/input-ads7846-ratelimit-the-spi_sync-error-message.patch @@ -0,0 +1,40 @@ +From cb7a6b923f816bde9033b7be469c8a1057a5b336 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jul 2024 23:18:57 +0200 +Subject: Input: ads7846 - ratelimit the spi_sync error message + +From: Marek Vasut + +[ Upstream commit ccbfea78adf75d3d9e87aa739dab83254f5333fa ] + +In case the touch controller is not connected, this message keeps scrolling +on the console indefinitelly. Ratelimit it to avoid filling kernel logs. + +" +ads7846 spi2.1: spi_sync --> -22 +" + +Signed-off-by: Marek Vasut +Link: https://lore.kernel.org/r/20240708211913.171243-1-marex@denx.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/touchscreen/ads7846.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c +index bed68a68f330..1f206c75c6cf 100644 +--- a/drivers/input/touchscreen/ads7846.c ++++ b/drivers/input/touchscreen/ads7846.c +@@ -810,7 +810,7 @@ static void ads7846_read_state(struct ads7846 *ts) + m = &ts->msg[msg_idx]; + error = spi_sync(ts->spi, m); + if (error) { +- dev_err(&ts->spi->dev, "spi_sync --> %d\n", error); ++ dev_err_ratelimited(&ts->spi->dev, "spi_sync --> %d\n", error); + packet->ignore = true; + return; + } +-- +2.43.0 + diff --git a/queue-6.1/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch b/queue-6.1/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch new file mode 100644 index 00000000000..65368733e40 --- /dev/null +++ b/queue-6.1/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch @@ -0,0 +1,44 @@ +From fdc3996bffeb8e8db74e3f6cc79bf0af65e5a057 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Aug 2024 12:06:19 +0200 +Subject: Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table + +From: Takashi Iwai + +[ Upstream commit 7ce7c2283fa6843ab3c2adfeb83dcc504a107858 ] + +Yet another quirk entry for Fujitsu laptop. Lifebook E756 requires +i8041.nomux for keeping the touchpad working after suspend/resume. + +Link: https://bugzilla.suse.com/show_bug.cgi?id=1229056 +Signed-off-by: Takashi Iwai +Link: https://lore.kernel.org/r/20240814100630.2048-1-tiwai@suse.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/serio/i8042-acpipnpio.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/input/serio/i8042-acpipnpio.h b/drivers/input/serio/i8042-acpipnpio.h +index e9eb9554dd7b..bad238f69a7a 100644 +--- a/drivers/input/serio/i8042-acpipnpio.h ++++ b/drivers/input/serio/i8042-acpipnpio.h +@@ -627,6 +627,15 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { + }, + .driver_data = (void *)(SERIO_QUIRK_NOMUX) + }, ++ { ++ /* Fujitsu Lifebook E756 */ ++ /* https://bugzilla.suse.com/show_bug.cgi?id=1229056 */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E756"), ++ }, ++ .driver_data = (void *)(SERIO_QUIRK_NOMUX) ++ }, + { + /* Fujitsu Lifebook E5411 */ + .matches = { +-- +2.43.0 + diff --git a/queue-6.1/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch b/queue-6.1/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch new file mode 100644 index 00000000000..93347efe19e --- /dev/null +++ b/queue-6.1/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch @@ -0,0 +1,38 @@ +From e3a8268105c79a4c06cac6f7be7c191b68718544 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Jul 2024 21:33:30 -0700 +Subject: Input: synaptics - enable SMBus for HP Elitebook 840 G2 + +From: Jonathan Denose + +[ Upstream commit da897484557b34a54fabb81f6c223c19a69e546d ] + +The kernel reports that the touchpad for this device can support a +different bus. + +With SMBus enabled the touchpad movement is smoother and three-finger +gestures are recognized. + +Signed-off-by: Jonathan Denose +Link: https://lore.kernel.org/r/20240719180612.1.Ib652dd808c274076f32cd7fc6c1160d2cf71753b@changeid +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/mouse/synaptics.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c +index b6749af46262..d8c90a23a101 100644 +--- a/drivers/input/mouse/synaptics.c ++++ b/drivers/input/mouse/synaptics.c +@@ -189,6 +189,7 @@ static const char * const smbus_pnp_ids[] = { + "LEN2054", /* E480 */ + "LEN2055", /* E580 */ + "LEN2068", /* T14 Gen 1 */ ++ "SYN3015", /* HP EliteBook 840 G2 */ + "SYN3052", /* HP EliteBook 840 G4 */ + "SYN3221", /* HP 15-ay000 */ + "SYN323d", /* HP Spectre X360 13-w013dx */ +-- +2.43.0 + diff --git a/queue-6.1/ksmbd-override-fsids-for-share-path-check.patch b/queue-6.1/ksmbd-override-fsids-for-share-path-check.patch new file mode 100644 index 00000000000..a1bded58f20 --- /dev/null +++ b/queue-6.1/ksmbd-override-fsids-for-share-path-check.patch @@ -0,0 +1,224 @@ +From e6013ebc825acdf2e8e1993890628dd052545b80 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Aug 2024 08:56:18 +0900 +Subject: ksmbd: override fsids for share path check + +From: Namjae Jeon + +[ Upstream commit a018c1b636e79b60149b41151ded7c2606d8606e ] + +Sangsoo reported that a DAC denial error occurred when accessing +files through the ksmbd thread. This patch override fsids for share +path check. + +Reported-by: Sangsoo Lee +Signed-off-by: Namjae Jeon +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/server/mgmt/share_config.c | 15 ++++++++++++--- + fs/smb/server/mgmt/share_config.h | 4 +++- + fs/smb/server/mgmt/tree_connect.c | 9 +++++---- + fs/smb/server/mgmt/tree_connect.h | 4 ++-- + fs/smb/server/smb2pdu.c | 2 +- + fs/smb/server/smb_common.c | 9 +++++++-- + fs/smb/server/smb_common.h | 2 ++ + 7 files changed, 32 insertions(+), 13 deletions(-) + +diff --git a/fs/smb/server/mgmt/share_config.c b/fs/smb/server/mgmt/share_config.c +index e0a6b758094f..d8d03070ae44 100644 +--- a/fs/smb/server/mgmt/share_config.c ++++ b/fs/smb/server/mgmt/share_config.c +@@ -15,6 +15,7 @@ + #include "share_config.h" + #include "user_config.h" + #include "user_session.h" ++#include "../connection.h" + #include "../transport_ipc.h" + #include "../misc.h" + +@@ -120,12 +121,13 @@ static int parse_veto_list(struct ksmbd_share_config *share, + return 0; + } + +-static struct ksmbd_share_config *share_config_request(struct unicode_map *um, ++static struct ksmbd_share_config *share_config_request(struct ksmbd_work *work, + const char *name) + { + struct ksmbd_share_config_response *resp; + struct ksmbd_share_config *share = NULL; + struct ksmbd_share_config *lookup; ++ struct unicode_map *um = work->conn->um; + int ret; + + resp = ksmbd_ipc_share_config_request(name); +@@ -181,7 +183,14 @@ static struct ksmbd_share_config *share_config_request(struct unicode_map *um, + KSMBD_SHARE_CONFIG_VETO_LIST(resp), + resp->veto_list_sz); + if (!ret && share->path) { ++ if (__ksmbd_override_fsids(work, share)) { ++ kill_share(share); ++ share = NULL; ++ goto out; ++ } ++ + ret = kern_path(share->path, 0, &share->vfs_path); ++ ksmbd_revert_fsids(work); + if (ret) { + ksmbd_debug(SMB, "failed to access '%s'\n", + share->path); +@@ -214,7 +223,7 @@ static struct ksmbd_share_config *share_config_request(struct unicode_map *um, + return share; + } + +-struct ksmbd_share_config *ksmbd_share_config_get(struct unicode_map *um, ++struct ksmbd_share_config *ksmbd_share_config_get(struct ksmbd_work *work, + const char *name) + { + struct ksmbd_share_config *share; +@@ -227,7 +236,7 @@ struct ksmbd_share_config *ksmbd_share_config_get(struct unicode_map *um, + + if (share) + return share; +- return share_config_request(um, name); ++ return share_config_request(work, name); + } + + bool ksmbd_share_veto_filename(struct ksmbd_share_config *share, +diff --git a/fs/smb/server/mgmt/share_config.h b/fs/smb/server/mgmt/share_config.h +index 5f591751b923..d4ac2dd4de20 100644 +--- a/fs/smb/server/mgmt/share_config.h ++++ b/fs/smb/server/mgmt/share_config.h +@@ -11,6 +11,8 @@ + #include + #include + ++struct ksmbd_work; ++ + struct ksmbd_share_config { + char *name; + char *path; +@@ -68,7 +70,7 @@ static inline void ksmbd_share_config_put(struct ksmbd_share_config *share) + __ksmbd_share_config_put(share); + } + +-struct ksmbd_share_config *ksmbd_share_config_get(struct unicode_map *um, ++struct ksmbd_share_config *ksmbd_share_config_get(struct ksmbd_work *work, + const char *name); + bool ksmbd_share_veto_filename(struct ksmbd_share_config *share, + const char *filename); +diff --git a/fs/smb/server/mgmt/tree_connect.c b/fs/smb/server/mgmt/tree_connect.c +index d2c81a8a11dd..94a52a75014a 100644 +--- a/fs/smb/server/mgmt/tree_connect.c ++++ b/fs/smb/server/mgmt/tree_connect.c +@@ -16,17 +16,18 @@ + #include "user_session.h" + + struct ksmbd_tree_conn_status +-ksmbd_tree_conn_connect(struct ksmbd_conn *conn, struct ksmbd_session *sess, +- const char *share_name) ++ksmbd_tree_conn_connect(struct ksmbd_work *work, const char *share_name) + { + struct ksmbd_tree_conn_status status = {-ENOENT, NULL}; + struct ksmbd_tree_connect_response *resp = NULL; + struct ksmbd_share_config *sc; + struct ksmbd_tree_connect *tree_conn = NULL; + struct sockaddr *peer_addr; ++ struct ksmbd_conn *conn = work->conn; ++ struct ksmbd_session *sess = work->sess; + int ret; + +- sc = ksmbd_share_config_get(conn->um, share_name); ++ sc = ksmbd_share_config_get(work, share_name); + if (!sc) + return status; + +@@ -61,7 +62,7 @@ ksmbd_tree_conn_connect(struct ksmbd_conn *conn, struct ksmbd_session *sess, + struct ksmbd_share_config *new_sc; + + ksmbd_share_config_del(sc); +- new_sc = ksmbd_share_config_get(conn->um, share_name); ++ new_sc = ksmbd_share_config_get(work, share_name); + if (!new_sc) { + pr_err("Failed to update stale share config\n"); + status.ret = -ESTALE; +diff --git a/fs/smb/server/mgmt/tree_connect.h b/fs/smb/server/mgmt/tree_connect.h +index 6377a70b811c..a42cdd051041 100644 +--- a/fs/smb/server/mgmt/tree_connect.h ++++ b/fs/smb/server/mgmt/tree_connect.h +@@ -13,6 +13,7 @@ + struct ksmbd_share_config; + struct ksmbd_user; + struct ksmbd_conn; ++struct ksmbd_work; + + enum { + TREE_NEW = 0, +@@ -50,8 +51,7 @@ static inline int test_tree_conn_flag(struct ksmbd_tree_connect *tree_conn, + struct ksmbd_session; + + struct ksmbd_tree_conn_status +-ksmbd_tree_conn_connect(struct ksmbd_conn *conn, struct ksmbd_session *sess, +- const char *share_name); ++ksmbd_tree_conn_connect(struct ksmbd_work *work, const char *share_name); + void ksmbd_tree_connect_put(struct ksmbd_tree_connect *tcon); + + int ksmbd_tree_conn_disconnect(struct ksmbd_session *sess, +diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c +index 898622b52b48..386f1f039883 100644 +--- a/fs/smb/server/smb2pdu.c ++++ b/fs/smb/server/smb2pdu.c +@@ -1975,7 +1975,7 @@ int smb2_tree_connect(struct ksmbd_work *work) + ksmbd_debug(SMB, "tree connect request for tree %s treename %s\n", + name, treename); + +- status = ksmbd_tree_conn_connect(conn, sess, name); ++ status = ksmbd_tree_conn_connect(work, name); + if (status.ret == KSMBD_TREE_CONN_STATUS_OK) + rsp->hdr.Id.SyncId.TreeId = cpu_to_le32(status.tree_conn->id); + else +diff --git a/fs/smb/server/smb_common.c b/fs/smb/server/smb_common.c +index e90a1e8c1951..bdcdc0fc9cad 100644 +--- a/fs/smb/server/smb_common.c ++++ b/fs/smb/server/smb_common.c +@@ -729,10 +729,10 @@ bool is_asterisk(char *p) + return p && p[0] == '*'; + } + +-int ksmbd_override_fsids(struct ksmbd_work *work) ++int __ksmbd_override_fsids(struct ksmbd_work *work, ++ struct ksmbd_share_config *share) + { + struct ksmbd_session *sess = work->sess; +- struct ksmbd_share_config *share = work->tcon->share_conf; + struct cred *cred; + struct group_info *gi; + unsigned int uid; +@@ -772,6 +772,11 @@ int ksmbd_override_fsids(struct ksmbd_work *work) + return 0; + } + ++int ksmbd_override_fsids(struct ksmbd_work *work) ++{ ++ return __ksmbd_override_fsids(work, work->tcon->share_conf); ++} ++ + void ksmbd_revert_fsids(struct ksmbd_work *work) + { + const struct cred *cred; +diff --git a/fs/smb/server/smb_common.h b/fs/smb/server/smb_common.h +index f1092519c0c2..4a3148b0167f 100644 +--- a/fs/smb/server/smb_common.h ++++ b/fs/smb/server/smb_common.h +@@ -447,6 +447,8 @@ int ksmbd_extract_shortname(struct ksmbd_conn *conn, + int ksmbd_smb_negotiate_common(struct ksmbd_work *work, unsigned int command); + + int ksmbd_smb_check_shared_mode(struct file *filp, struct ksmbd_file *curr_fp); ++int __ksmbd_override_fsids(struct ksmbd_work *work, ++ struct ksmbd_share_config *share); + int ksmbd_override_fsids(struct ksmbd_work *work); + void ksmbd_revert_fsids(struct ksmbd_work *work); + +-- +2.43.0 + diff --git a/queue-6.1/ksmbd-override-fsids-for-smb2_query_info.patch b/queue-6.1/ksmbd-override-fsids-for-smb2_query_info.patch new file mode 100644 index 00000000000..9034db13710 --- /dev/null +++ b/queue-6.1/ksmbd-override-fsids-for-smb2_query_info.patch @@ -0,0 +1,56 @@ +From 21172283c3e226194e5f1cedb308cac1a07c2a60 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Aug 2024 08:57:03 +0900 +Subject: ksmbd: override fsids for smb2_query_info() + +From: Namjae Jeon + +[ Upstream commit f6bd41280a44dcc2e0a25ed72617d25f586974a7 ] + +Sangsoo reported that a DAC denial error occurred when accessing +files through the ksmbd thread. This patch override fsids for +smb2_query_info(). + +Reported-by: Sangsoo Lee +Signed-off-by: Namjae Jeon +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/server/smb2pdu.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c +index 386f1f039883..808c62d7ff3e 100644 +--- a/fs/smb/server/smb2pdu.c ++++ b/fs/smb/server/smb2pdu.c +@@ -5326,6 +5326,11 @@ int smb2_query_info(struct ksmbd_work *work) + + ksmbd_debug(SMB, "GOT query info request\n"); + ++ if (ksmbd_override_fsids(work)) { ++ rc = -ENOMEM; ++ goto err_out; ++ } ++ + switch (req->InfoType) { + case SMB2_O_INFO_FILE: + ksmbd_debug(SMB, "GOT SMB2_O_INFO_FILE\n"); +@@ -5344,6 +5349,7 @@ int smb2_query_info(struct ksmbd_work *work) + req->InfoType); + rc = -EOPNOTSUPP; + } ++ ksmbd_revert_fsids(work); + + if (!rc) { + rsp->StructureSize = cpu_to_le16(9); +@@ -5353,6 +5359,7 @@ int smb2_query_info(struct ksmbd_work *work) + le32_to_cpu(rsp->OutputBufferLength)); + } + ++err_out: + if (rc < 0) { + if (rc == -EACCES) + rsp->hdr.Status = STATUS_ACCESS_DENIED; +-- +2.43.0 + diff --git a/queue-6.1/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch b/queue-6.1/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch new file mode 100644 index 00000000000..378294f5aff --- /dev/null +++ b/queue-6.1/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch @@ -0,0 +1,50 @@ +From 2697c6d7338b4941d89c6efed9a08744d770ff50 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Aug 2024 19:07:21 +0900 +Subject: net: ethernet: use ip_hdrlen() instead of bit shift + +From: Moon Yeounsu + +[ Upstream commit 9a039eeb71a42c8b13408a1976e300f3898e1be0 ] + +`ip_hdr(skb)->ihl << 2` is the same as `ip_hdrlen(skb)` +Therefore, we should use a well-defined function not a bit shift +to find the header length. + +It also compresses two lines to a single line. + +Signed-off-by: Moon Yeounsu +Reviewed-by: Christophe JAILLET +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/jme.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c +index 1732ec3c3dbd..a718207988f2 100644 +--- a/drivers/net/ethernet/jme.c ++++ b/drivers/net/ethernet/jme.c +@@ -946,15 +946,13 @@ jme_udpsum(struct sk_buff *skb) + if (skb->protocol != htons(ETH_P_IP)) + return csum; + skb_set_network_header(skb, ETH_HLEN); +- if ((ip_hdr(skb)->protocol != IPPROTO_UDP) || +- (skb->len < (ETH_HLEN + +- (ip_hdr(skb)->ihl << 2) + +- sizeof(struct udphdr)))) { ++ ++ if (ip_hdr(skb)->protocol != IPPROTO_UDP || ++ skb->len < (ETH_HLEN + ip_hdrlen(skb) + sizeof(struct udphdr))) { + skb_reset_network_header(skb); + return csum; + } +- skb_set_transport_header(skb, +- ETH_HLEN + (ip_hdr(skb)->ihl << 2)); ++ skb_set_transport_header(skb, ETH_HLEN + ip_hdrlen(skb)); + csum = udp_hdr(skb)->check; + skb_reset_transport_header(skb); + skb_reset_network_header(skb); +-- +2.43.0 + diff --git a/queue-6.1/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch b/queue-6.1/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch new file mode 100644 index 00000000000..7ad81fdffe1 --- /dev/null +++ b/queue-6.1/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch @@ -0,0 +1,76 @@ +From 26e8476b7e8f1c614d369464c9a52bae7aa59c2c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Aug 2024 21:38:06 +0200 +Subject: net: phy: vitesse: repair vsc73xx autonegotiation + +From: Pawel Dembicki + +[ Upstream commit de7a670f8defe4ed2115552ad23dea0f432f7be4 ] + +When the vsc73xx mdio bus work properly, the generic autonegotiation +configuration works well. + +Reviewed-by: Linus Walleij +Signed-off-by: Pawel Dembicki +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/phy/vitesse.c | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c +index 897b979ec03c..3b5fcaf0dd36 100644 +--- a/drivers/net/phy/vitesse.c ++++ b/drivers/net/phy/vitesse.c +@@ -237,16 +237,6 @@ static int vsc739x_config_init(struct phy_device *phydev) + return 0; + } + +-static int vsc73xx_config_aneg(struct phy_device *phydev) +-{ +- /* The VSC73xx switches does not like to be instructed to +- * do autonegotiation in any way, it prefers that you just go +- * with the power-on/reset defaults. Writing some registers will +- * just make autonegotiation permanently fail. +- */ +- return 0; +-} +- + /* This adds a skew for both TX and RX clocks, so the skew should only be + * applied to "rgmii-id" interfaces. It may not work as expected + * on "rgmii-txid", "rgmii-rxid" or "rgmii" interfaces. +@@ -444,7 +434,6 @@ static struct phy_driver vsc82xx_driver[] = { + .phy_id_mask = 0x000ffff0, + /* PHY_GBIT_FEATURES */ + .config_init = vsc738x_config_init, +- .config_aneg = vsc73xx_config_aneg, + .read_page = vsc73xx_read_page, + .write_page = vsc73xx_write_page, + }, { +@@ -453,7 +442,6 @@ static struct phy_driver vsc82xx_driver[] = { + .phy_id_mask = 0x000ffff0, + /* PHY_GBIT_FEATURES */ + .config_init = vsc738x_config_init, +- .config_aneg = vsc73xx_config_aneg, + .read_page = vsc73xx_read_page, + .write_page = vsc73xx_write_page, + }, { +@@ -462,7 +450,6 @@ static struct phy_driver vsc82xx_driver[] = { + .phy_id_mask = 0x000ffff0, + /* PHY_GBIT_FEATURES */ + .config_init = vsc739x_config_init, +- .config_aneg = vsc73xx_config_aneg, + .read_page = vsc73xx_read_page, + .write_page = vsc73xx_write_page, + }, { +@@ -471,7 +458,6 @@ static struct phy_driver vsc82xx_driver[] = { + .phy_id_mask = 0x000ffff0, + /* PHY_GBIT_FEATURES */ + .config_init = vsc739x_config_init, +- .config_aneg = vsc73xx_config_aneg, + .read_page = vsc73xx_read_page, + .write_page = vsc73xx_write_page, + }, { +-- +2.43.0 + diff --git a/queue-6.1/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch b/queue-6.1/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch new file mode 100644 index 00000000000..b459d7501c5 --- /dev/null +++ b/queue-6.1/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch @@ -0,0 +1,84 @@ +From 9043aef2d9a67a4bdcb555573c7c958d33482840 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Aug 2024 14:05:02 -0400 +Subject: NFS: Avoid unnecessary rescanning of the per-server delegation list + +From: Trond Myklebust + +[ Upstream commit f92214e4c312f6ea9d78650cc6291d200f17abb6 ] + +If the call to nfs_delegation_grab_inode() fails, we will not have +dropped any locks that require us to rescan the list. + +Signed-off-by: Trond Myklebust +Reviewed-by: Jeff Layton +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + fs/nfs/delegation.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c +index ead8a0e06abf..2ba4d221bf9d 100644 +--- a/fs/nfs/delegation.c ++++ b/fs/nfs/delegation.c +@@ -627,6 +627,9 @@ static int nfs_server_return_marked_delegations(struct nfs_server *server, + prev = delegation; + continue; + } ++ inode = nfs_delegation_grab_inode(delegation); ++ if (inode == NULL) ++ continue; + + if (prev) { + struct inode *tmp = nfs_delegation_grab_inode(prev); +@@ -637,12 +640,6 @@ static int nfs_server_return_marked_delegations(struct nfs_server *server, + } + } + +- inode = nfs_delegation_grab_inode(delegation); +- if (inode == NULL) { +- rcu_read_unlock(); +- iput(to_put); +- goto restart; +- } + delegation = nfs_start_delegation_return_locked(NFS_I(inode)); + rcu_read_unlock(); + +@@ -1164,7 +1161,6 @@ static int nfs_server_reap_unclaimed_delegations(struct nfs_server *server, + struct inode *inode; + restart: + rcu_read_lock(); +-restart_locked: + list_for_each_entry_rcu(delegation, &server->delegations, super_list) { + if (test_bit(NFS_DELEGATION_INODE_FREEING, + &delegation->flags) || +@@ -1175,7 +1171,7 @@ static int nfs_server_reap_unclaimed_delegations(struct nfs_server *server, + continue; + inode = nfs_delegation_grab_inode(delegation); + if (inode == NULL) +- goto restart_locked; ++ continue; + delegation = nfs_start_delegation_return_locked(NFS_I(inode)); + rcu_read_unlock(); + if (delegation != NULL) { +@@ -1296,7 +1292,6 @@ static int nfs_server_reap_expired_delegations(struct nfs_server *server, + nfs4_stateid stateid; + restart: + rcu_read_lock(); +-restart_locked: + list_for_each_entry_rcu(delegation, &server->delegations, super_list) { + if (test_bit(NFS_DELEGATION_INODE_FREEING, + &delegation->flags) || +@@ -1307,7 +1302,7 @@ static int nfs_server_reap_expired_delegations(struct nfs_server *server, + continue; + inode = nfs_delegation_grab_inode(delegation); + if (inode == NULL) +- goto restart_locked; ++ continue; + spin_lock(&delegation->lock); + cred = get_cred_rcu(delegation->cred); + nfs4_stateid_copy(&stateid, &delegation->stateid); +-- +2.43.0 + diff --git a/queue-6.1/nfsv4-fix-clearing-of-layout-segments-in-layoutretur.patch b/queue-6.1/nfsv4-fix-clearing-of-layout-segments-in-layoutretur.patch new file mode 100644 index 00000000000..00483261de4 --- /dev/null +++ b/queue-6.1/nfsv4-fix-clearing-of-layout-segments-in-layoutretur.patch @@ -0,0 +1,65 @@ +From b357ec63cbcdc028e7565d3649ee93f2e3d5b6bd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Aug 2024 14:05:01 -0400 +Subject: NFSv4: Fix clearing of layout segments in layoutreturn + +From: Trond Myklebust + +[ Upstream commit d72b7963115bea971a28eaa2cb76722c023f9fdf ] + +Make sure that we clear the layout segments in cases where we see a +fatal error, and also in the case where the layout is invalid. + +Signed-off-by: Trond Myklebust +Reviewed-by: Jeff Layton +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + fs/nfs/nfs4proc.c | 9 ++++++--- + fs/nfs/pnfs.c | 5 ++--- + 2 files changed, 8 insertions(+), 6 deletions(-) + +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c +index 467e9439eded..1e97de7c8c20 100644 +--- a/fs/nfs/nfs4proc.c ++++ b/fs/nfs/nfs4proc.c +@@ -9850,13 +9850,16 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata) + fallthrough; + default: + task->tk_status = 0; ++ lrp->res.lrs_present = 0; + fallthrough; + case 0: + break; + case -NFS4ERR_DELAY: +- if (nfs4_async_handle_error(task, server, NULL, NULL) != -EAGAIN) +- break; +- goto out_restart; ++ if (nfs4_async_handle_error(task, server, NULL, NULL) == ++ -EAGAIN) ++ goto out_restart; ++ lrp->res.lrs_present = 0; ++ break; + } + return; + out_restart: +diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c +index 8c1f47ca5dc5..c96d2e76156e 100644 +--- a/fs/nfs/pnfs.c ++++ b/fs/nfs/pnfs.c +@@ -1172,10 +1172,9 @@ void pnfs_layoutreturn_free_lsegs(struct pnfs_layout_hdr *lo, + LIST_HEAD(freeme); + + spin_lock(&inode->i_lock); +- if (!pnfs_layout_is_valid(lo) || +- !nfs4_stateid_match_other(&lo->plh_stateid, arg_stateid)) ++ if (!nfs4_stateid_match_other(&lo->plh_stateid, arg_stateid)) + goto out_unlock; +- if (stateid) { ++ if (stateid && pnfs_layout_is_valid(lo)) { + u32 seq = be32_to_cpu(arg_stateid->seqid); + + pnfs_mark_matching_lsegs_invalid(lo, &freeme, range, seq); +-- +2.43.0 + diff --git a/queue-6.1/platform-surface-aggregator_registry-add-support-for.patch b/queue-6.1/platform-surface-aggregator_registry-add-support-for.patch new file mode 100644 index 00000000000..4ad1a1e01d6 --- /dev/null +++ b/queue-6.1/platform-surface-aggregator_registry-add-support-for.patch @@ -0,0 +1,50 @@ +From 57f05ed074159d039c21851bb61b7fcc98110867 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Aug 2024 15:19:44 +0200 +Subject: platform/surface: aggregator_registry: Add Support for Surface Pro 10 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Maximilian Luz + +[ Upstream commit 9c8e022567bbec53bee8ae75c44b3d6cd2080d42 ] + +Add SAM client device nodes for the Surface Pro 10. It seems to use the +same SAM client devices as the Surface Pro 9, so re-use its node group. + +Signed-off-by: Maximilian Luz +Link: https://lore.kernel.org/r/20240811131948.261806-2-luzmaximilian@gmail.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/surface/surface_aggregator_registry.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c +index 023f126121d7..6882f32d239d 100644 +--- a/drivers/platform/surface/surface_aggregator_registry.c ++++ b/drivers/platform/surface/surface_aggregator_registry.c +@@ -298,7 +298,7 @@ static const struct software_node *ssam_node_group_sp8[] = { + NULL, + }; + +-/* Devices for Surface Pro 9 */ ++/* Devices for Surface Pro 9 and 10 */ + static const struct software_node *ssam_node_group_sp9[] = { + &ssam_node_root, + &ssam_node_hub_kip, +@@ -337,6 +337,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = { + /* Surface Pro 9 */ + { "MSHW0343", (unsigned long)ssam_node_group_sp9 }, + ++ /* Surface Pro 10 */ ++ { "MSHW0510", (unsigned long)ssam_node_group_sp9 }, ++ + /* Surface Book 2 */ + { "MSHW0107", (unsigned long)ssam_node_group_gen5 }, + +-- +2.43.0 + diff --git a/queue-6.1/platform-surface-aggregator_registry-add-support-for.patch-22640 b/queue-6.1/platform-surface-aggregator_registry-add-support-for.patch-22640 new file mode 100644 index 00000000000..34c4efcd1a4 --- /dev/null +++ b/queue-6.1/platform-surface-aggregator_registry-add-support-for.patch-22640 @@ -0,0 +1,43 @@ +From b47b58634b46d033058d133ff657fe6d545bcac0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 11 Aug 2024 15:19:45 +0200 +Subject: platform/surface: aggregator_registry: Add support for Surface Laptop + Go 3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Maximilian Luz + +[ Upstream commit ed235163c3f02329d5e37ed4485bbc39ed2568d4 ] + +Add SAM client device nodes for the Surface Laptop Go 3. It seems to use +the same SAM client devices as the Surface Laptop Go 1 and 2, so re-use +their node group. + +Signed-off-by: Maximilian Luz +Link: https://lore.kernel.org/r/20240811131948.261806-3-luzmaximilian@gmail.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/surface/surface_aggregator_registry.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c +index 6882f32d239d..fafb0bb49f7f 100644 +--- a/drivers/platform/surface/surface_aggregator_registry.c ++++ b/drivers/platform/surface/surface_aggregator_registry.c +@@ -370,6 +370,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = { + /* Surface Laptop Go 2 */ + { "MSHW0290", (unsigned long)ssam_node_group_slg1 }, + ++ /* Surface Laptop Go 3 */ ++ { "MSHW0440", (unsigned long)ssam_node_group_slg1 }, ++ + /* Surface Laptop Studio */ + { "MSHW0123", (unsigned long)ssam_node_group_sls }, + +-- +2.43.0 + diff --git a/queue-6.1/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch b/queue-6.1/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch new file mode 100644 index 00000000000..12883cb2d72 --- /dev/null +++ b/queue-6.1/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch @@ -0,0 +1,85 @@ +From 87a78878d175577b8a51043027cc5234a4ee7160 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Aug 2024 09:05:08 +0200 +Subject: powerpc/mm: Fix boot warning with hugepages and CONFIG_DEBUG_VIRTUAL + +From: Christophe Leroy + +[ Upstream commit e7e846dc6c73fbc94ae8b4ec20d05627646416f2 ] + +Booting with CONFIG_DEBUG_VIRTUAL leads to following warning when +passing hugepage reservation on command line: + + Kernel command line: hugepagesz=1g hugepages=1 hugepagesz=64m hugepages=1 hugepagesz=256m hugepages=1 noreboot + HugeTLB: allocating 1 of page size 1.00 GiB failed. Only allocated 0 hugepages. + ------------[ cut here ]------------ + WARNING: CPU: 0 PID: 0 at arch/powerpc/include/asm/io.h:948 __alloc_bootmem_huge_page+0xd4/0x284 + Modules linked in: + CPU: 0 PID: 0 Comm: swapper Not tainted 6.10.0-rc6-00396-g6b0e82791bd0-dirty #936 + Hardware name: MPC8544DS e500v2 0x80210030 MPC8544 DS + NIP: c1020240 LR: c10201d0 CTR: 00000000 + REGS: c13fdd30 TRAP: 0700 Not tainted (6.10.0-rc6-00396-g6b0e82791bd0-dirty) + MSR: 00021000 CR: 44084288 XER: 20000000 + + GPR00: c10201d0 c13fde20 c130b560 e8000000 e8001000 00000000 00000000 c1420000 + GPR08: 00000000 00028001 00000000 00000004 44084282 01066ac0 c0eb7c9c efffe149 + GPR16: c0fc4228 0000005f ffffffff c0eb7d0c c0eb7cc0 c0eb7ce0 ffffffff 00000000 + GPR24: c1441cec efffe153 e8001000 c14240c0 00000000 c1441d64 00000000 e8000000 + NIP [c1020240] __alloc_bootmem_huge_page+0xd4/0x284 + LR [c10201d0] __alloc_bootmem_huge_page+0x64/0x284 + Call Trace: + [c13fde20] [c10201d0] __alloc_bootmem_huge_page+0x64/0x284 (unreliable) + [c13fde50] [c10207b8] hugetlb_hstate_alloc_pages+0x8c/0x3e8 + [c13fdeb0] [c1021384] hugepages_setup+0x240/0x2cc + [c13fdef0] [c1000574] unknown_bootoption+0xfc/0x280 + [c13fdf30] [c0078904] parse_args+0x200/0x4c4 + [c13fdfa0] [c1000d9c] start_kernel+0x238/0x7d0 + [c13fdff0] [c0000434] set_ivor+0x12c/0x168 + Code: 554aa33e 7c042840 3ce0c142 80a7427c 5109a016 50caa016 7c9a2378 7fdcf378 4180000c 7c052040 41810160 7c095040 <0fe00000> 38c00000 40800108 3c60c0eb + ---[ end trace 0000000000000000 ]--- + +This is due to virt_addr_valid() using high_memory before it is set. + +high_memory is set in mem_init() using max_low_pfn, but max_low_pfn +is available long before, it is set in mem_topology_setup(). So just +like commit daa9ada2093e ("powerpc/mm: Fix boot crash with FLATMEM") +moved the setting of max_mapnr immediately after the call to +mem_topology_setup(), the same can be done for high_memory. + +Signed-off-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://msgid.link/62b69c4baad067093f39e7e60df0fe27a86b8d2a.1723100702.git.christophe.leroy@csgroup.eu +Signed-off-by: Sasha Levin +--- + arch/powerpc/kernel/setup-common.c | 1 + + arch/powerpc/mm/mem.c | 2 -- + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c +index 59b4ac57bfaf..56f6b958926d 100644 +--- a/arch/powerpc/kernel/setup-common.c ++++ b/arch/powerpc/kernel/setup-common.c +@@ -948,6 +948,7 @@ void __init setup_arch(char **cmdline_p) + mem_topology_setup(); + /* Set max_mapnr before paging_init() */ + set_max_mapnr(max_pfn); ++ high_memory = (void *)__va(max_low_pfn * PAGE_SIZE); + + /* + * Release secondary cpus out of their spinloops at 0x60 now that +diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c +index c7599b173709..40f4a31f001c 100644 +--- a/arch/powerpc/mm/mem.c ++++ b/arch/powerpc/mm/mem.c +@@ -287,8 +287,6 @@ void __init mem_init(void) + swiotlb_init(ppc_swiotlb_enable, ppc_swiotlb_flags); + #endif + +- high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); +- + kasan_late_init(); + + memblock_free_all(); +-- +2.43.0 + diff --git a/queue-6.1/scripts-kconfig-merge_config-config-files-add-a-trai.patch b/queue-6.1/scripts-kconfig-merge_config-config-files-add-a-trai.patch new file mode 100644 index 00000000000..46d20710778 --- /dev/null +++ b/queue-6.1/scripts-kconfig-merge_config-config-files-add-a-trai.patch @@ -0,0 +1,48 @@ +From dd2748e090649db357c446905cada19bec1b1ffb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Aug 2024 11:22:34 +0200 +Subject: scripts: kconfig: merge_config: config files: add a trailing newline + +From: Anders Roxell + +[ Upstream commit 33330bcf031818e60a816db0cfd3add9eecc3b28 ] + +When merging files without trailing newlines at the end of the file, two +config fragments end up at the same row if file1.config doens't have a +trailing newline at the end of the file. + +file1.config "CONFIG_1=y" +file2.config "CONFIG_2=y" +./scripts/kconfig/merge_config.sh -m .config file1.config file2.config + +This will generate a .config looking like this. +cat .config +... +CONFIG_1=yCONFIG_2=y" + +Making sure so we add a newline at the end of every config file that is +passed into the script. + +Signed-off-by: Anders Roxell +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + scripts/kconfig/merge_config.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh +index e5b46980c22a..72da3b8d6f30 100755 +--- a/scripts/kconfig/merge_config.sh ++++ b/scripts/kconfig/merge_config.sh +@@ -160,6 +160,8 @@ for ORIG_MERGE_FILE in $MERGE_LIST ; do + sed -i "/$CFG[ =]/d" $MERGE_FILE + fi + done ++ # In case the previous file lacks a new line at the end ++ echo >> $TMP_FILE + cat $MERGE_FILE >> $TMP_FILE + done + +-- +2.43.0 + diff --git a/queue-6.1/series b/queue-6.1/series new file mode 100644 index 00000000000..3d6629cc518 --- /dev/null +++ b/queue-6.1/series @@ -0,0 +1,20 @@ +ksmbd-override-fsids-for-share-path-check.patch +ksmbd-override-fsids-for-smb2_query_info.patch +usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch +net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch +drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch +drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch-7342 +net-phy-vitesse-repair-vsc73xx-autonegotiation.patch +powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch +btrfs-update-target-inode-s-ctime-on-unlink.patch +input-ads7846-ratelimit-the-spi_sync-error-message.patch +input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch +hid-multitouch-add-support-for-gt7868q.patch +scripts-kconfig-merge_config-config-files-add-a-trai.patch +platform-surface-aggregator_registry-add-support-for.patch +platform-surface-aggregator_registry-add-support-for.patch-22640 +drm-msm-adreno-fix-error-return-if-missing-firmware-.patch +input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch +smb-server-fix-return-value-of-smb2_open.patch +nfsv4-fix-clearing-of-layout-segments-in-layoutretur.patch +nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch diff --git a/queue-6.1/smb-server-fix-return-value-of-smb2_open.patch b/queue-6.1/smb-server-fix-return-value-of-smb2_open.patch new file mode 100644 index 00000000000..236cc4dc057 --- /dev/null +++ b/queue-6.1/smb-server-fix-return-value-of-smb2_open.patch @@ -0,0 +1,38 @@ +From c42d3f59986c4e90aa5f07c649ba5e36914317ac Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Aug 2024 08:20:50 +0000 +Subject: smb/server: fix return value of smb2_open() + +From: ChenXiaoSong + +[ Upstream commit 2186a116538a715b20e15f84fdd3545e5fe0a39b ] + +In most error cases, error code is not returned in smb2_open(), +__process_request() will not print error message. + +Fix this by returning the correct value at the end of smb2_open(). + +Signed-off-by: ChenXiaoSong +Acked-by: Namjae Jeon +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/smb/server/smb2pdu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c +index 808c62d7ff3e..dc8f1e7ce2fa 100644 +--- a/fs/smb/server/smb2pdu.c ++++ b/fs/smb/server/smb2pdu.c +@@ -3482,7 +3482,7 @@ int smb2_open(struct ksmbd_work *work) + kfree(name); + kfree(lc); + +- return 0; ++ return rc; + } + + static int readdir_info_level_struct_sz(int info_level) +-- +2.43.0 + diff --git a/queue-6.1/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch b/queue-6.1/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch new file mode 100644 index 00000000000..414b392de2a --- /dev/null +++ b/queue-6.1/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch @@ -0,0 +1,80 @@ +From cb03232b386a096efc91a1886110b5827749bad6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Aug 2024 19:28:09 +0200 +Subject: usbnet: ipheth: fix carrier detection in modes 1 and 4 + +From: Foster Snowhill + +[ Upstream commit 67927a1b255d883881be9467508e0af9a5e0be9d ] + +Apart from the standard "configurations", "interfaces" and "alternate +interface settings" in USB, iOS devices also have a notion of +"modes". In different modes, the device exposes a different set of +available configurations. + +Depending on the iOS version, and depending on the current mode, the +length and contents of the carrier state control message differs: + +* 1 byte (seen on iOS 4.2.1, 8.4): + * 03: carrier off (mode 0) + * 04: carrier on (mode 0) +* 3 bytes (seen on iOS 10.3.4, 15.7.6): + * 03 03 03: carrier off (mode 0) + * 04 04 03: carrier on (mode 0) +* 4 bytes (seen on iOS 16.5, 17.6): + * 03 03 03 00: carrier off (mode 0) + * 04 03 03 00: carrier off (mode 1) + * 06 03 03 00: carrier off (mode 4) + * 04 04 03 04: carrier on (mode 0 and 1) + * 06 04 03 04: carrier on (mode 4) + +Before this change, the driver always used the first byte of the +response to determine carrier state. + +From this larger sample, the first byte seems to indicate the number of +available USB configurations in the current mode (with the exception of +the default mode 0), and in some cases (namely mode 1 and 4) does not +correlate with the carrier state. + +Previous logic erroneously counted `04 03 03 00` as "carrier on" and +`06 04 03 04` as "carrier off" on iOS versions that support mode 1 and +mode 4 respectively. + +Only modes 0, 1 and 4 expose the USB Ethernet interfaces necessary for +the ipheth driver. + +Check the second byte of the control message where possible, and fall +back to checking the first byte on older iOS versions. + +Signed-off-by: Foster Snowhill +Tested-by: Georgi Valkov +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/usb/ipheth.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c +index 13381d87eeb0..17844c07305c 100644 +--- a/drivers/net/usb/ipheth.c ++++ b/drivers/net/usb/ipheth.c +@@ -253,13 +253,14 @@ static int ipheth_carrier_set(struct ipheth_device *dev) + 0x02, /* index */ + dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE, + IPHETH_CTRL_TIMEOUT); +- if (retval < 0) { ++ if (retval <= 0) { + dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n", + __func__, retval); + return retval; + } + +- if (dev->ctrl_buf[0] == IPHETH_CARRIER_ON) { ++ if ((retval == 1 && dev->ctrl_buf[0] == IPHETH_CARRIER_ON) || ++ (retval >= 2 && dev->ctrl_buf[1] == IPHETH_CARRIER_ON)) { + netif_carrier_on(dev->net); + if (dev->tx_urb->status != -EINPROGRESS) + netif_wake_queue(dev->net); +-- +2.43.0 + -- 2.47.3