]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.6
authorSasha Levin <sashal@kernel.org>
Thu, 12 Sep 2024 12:20:58 +0000 (08:20 -0400)
committerSasha Levin <sashal@kernel.org>
Thu, 12 Sep 2024 12:20:58 +0000 (08:20 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
36 files changed:
queue-6.6/btrfs-update-target-inode-s-ctime-on-unlink.patch [new file with mode: 0644]
queue-6.6/device-property-add-cleanup.h-based-fwnode_handle_pu.patch [new file with mode: 0644]
queue-6.6/device-property-introduce-device_for_each_child_node.patch [new file with mode: 0644]
queue-6.6/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch [new file with mode: 0644]
queue-6.6/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch [new file with mode: 0644]
queue-6.6/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch-27866 [new file with mode: 0644]
queue-6.6/hid-multitouch-add-support-for-gt7868q.patch [new file with mode: 0644]
queue-6.6/iio-adc-ad7124-fix-dt-configuration-parsing.patch [new file with mode: 0644]
queue-6.6/iio-adc-ad7124-switch-from-of-specific-to-fwnode-bas.patch [new file with mode: 0644]
queue-6.6/input-ads7846-ratelimit-the-spi_sync-error-message.patch [new file with mode: 0644]
queue-6.6/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch [new file with mode: 0644]
queue-6.6/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch [new file with mode: 0644]
queue-6.6/ksmbd-override-fsids-for-share-path-check.patch [new file with mode: 0644]
queue-6.6/ksmbd-override-fsids-for-smb2_query_info.patch [new file with mode: 0644]
queue-6.6/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch [new file with mode: 0644]
queue-6.6/net-hns3-use-correct-release-function-during-uniniti.patch [new file with mode: 0644]
queue-6.6/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch [new file with mode: 0644]
queue-6.6/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch [new file with mode: 0644]
queue-6.6/nfsv4-fix-clearing-of-layout-segments-in-layoutretur.patch [new file with mode: 0644]
queue-6.6/nvmem-core-add-nvmem_dev_size-helper.patch [new file with mode: 0644]
queue-6.6/nvmem-u-boot-env-error-if-nvmem-device-is-too-small.patch [new file with mode: 0644]
queue-6.6/nvmem-u-boot-env-improve-coding-style.patch [new file with mode: 0644]
queue-6.6/nvmem-u-boot-env-use-nvmem-device-helpers.patch [new file with mode: 0644]
queue-6.6/nvmem-u-boot-env-use-nvmem_add_one_cell-nvmem-subsys.patch [new file with mode: 0644]
queue-6.6/platform-surface-aggregator_registry-add-support-for.patch [new file with mode: 0644]
queue-6.6/platform-surface-aggregator_registry-add-support-for.patch-10885 [new file with mode: 0644]
queue-6.6/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch [new file with mode: 0644]
queue-6.6/s390-mm-prevent-lowcore-vs-identity-mapping-overlap.patch [new file with mode: 0644]
queue-6.6/scripts-kconfig-merge_config-config-files-add-a-trai.patch [new file with mode: 0644]
queue-6.6/series [new file with mode: 0644]
queue-6.6/smb-server-fix-return-value-of-smb2_open.patch [new file with mode: 0644]
queue-6.6/usbnet-ipheth-do-not-stop-rx-on-failing-rx-callback.patch [new file with mode: 0644]
queue-6.6/usbnet-ipheth-drop-rx-urbs-with-no-payload.patch [new file with mode: 0644]
queue-6.6/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch [new file with mode: 0644]
queue-6.6/usbnet-ipheth-remove-extraneous-rx-urb-length-check.patch [new file with mode: 0644]
queue-6.6/wifi-mt76-mt7921-fix-null-pointer-access-in-mt7921_i.patch [new file with mode: 0644]

diff --git a/queue-6.6/btrfs-update-target-inode-s-ctime-on-unlink.patch b/queue-6.6/btrfs-update-target-inode-s-ctime-on-unlink.patch
new file mode 100644 (file)
index 0000000..f8f774f
--- /dev/null
@@ -0,0 +1,43 @@
+From be85be27496715ea66fe44d2077b0a82544f6c53 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 12 Aug 2024 12:30:52 -0400
+Subject: btrfs: update target inode's ctime on unlink
+
+From: Jeff Layton <jlayton@kernel.org>
+
+[ 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 <jlayton@kernel.org>
+Reviewed-by: David Sterba <dsterba@suse.com>
+[ add link to the opengroup docs ]
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/btrfs/inode.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
+index a42238211887..ee04185d8e0f 100644
+--- a/fs/btrfs/inode.c
++++ b/fs/btrfs/inode.c
+@@ -4148,6 +4148,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_set_ctime_current(&inode->vfs_inode);
+       dir->vfs_inode.i_mtime = inode_set_ctime_current(&dir->vfs_inode);
+-- 
+2.43.0
+
diff --git a/queue-6.6/device-property-add-cleanup.h-based-fwnode_handle_pu.patch b/queue-6.6/device-property-add-cleanup.h-based-fwnode_handle_pu.patch
new file mode 100644 (file)
index 0000000..08dab7e
--- /dev/null
@@ -0,0 +1,50 @@
+From 42fccf3c9b24c30a401557af4a2a29f9db2bfabc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 17 Feb 2024 16:42:36 +0000
+Subject: device property: Add cleanup.h based fwnode_handle_put() scope based
+ cleanup.
+
+From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+
+[ Upstream commit 59ed5e2d505bf5f9b4af64d0021cd0c96aec1f7c ]
+
+Useful where the fwnode_handle was obtained from a call such as
+fwnode_find_reference() as it will safely do nothing if IS_ERR() is true
+and will automatically release the reference on the variable leaving
+scope.
+
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
+Link: https://lore.kernel.org/r/20240217164249.921878-3-jic23@kernel.org
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Stable-dep-of: 61cbfb5368dd ("iio: adc: ad7124: fix DT configuration parsing")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/property.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/linux/property.h b/include/linux/property.h
+index 1684fca930f7..909416c701b8 100644
+--- a/include/linux/property.h
++++ b/include/linux/property.h
+@@ -11,6 +11,7 @@
+ #define _LINUX_PROPERTY_H_
+ #include <linux/bits.h>
++#include <linux/cleanup.h>
+ #include <linux/fwnode.h>
+ #include <linux/stddef.h>
+ #include <linux/types.h>
+@@ -175,6 +176,8 @@ struct fwnode_handle *device_get_named_child_node(const struct device *dev,
+ struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode);
+ void fwnode_handle_put(struct fwnode_handle *fwnode);
++DEFINE_FREE(fwnode_handle, struct fwnode_handle *, fwnode_handle_put(_T))
++
+ int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index);
+ int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name);
+-- 
+2.43.0
+
diff --git a/queue-6.6/device-property-introduce-device_for_each_child_node.patch b/queue-6.6/device-property-introduce-device_for_each_child_node.patch
new file mode 100644 (file)
index 0000000..f4476a8
--- /dev/null
@@ -0,0 +1,51 @@
+From 3b50555c434bca551d8c84cc358de5728808e287 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 17 Feb 2024 16:42:38 +0000
+Subject: device property: Introduce device_for_each_child_node_scoped()
+
+From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+
+[ Upstream commit 365130fd47af6d4317aa16a407874b699ab8d8cb ]
+
+Similar to recently propose for_each_child_of_node_scoped() this
+new version of the loop macro instantiates a new local
+struct fwnode_handle * that uses the __free(fwnode_handle) auto
+cleanup handling so that if a reference to a node is held on early
+exit from the loop the reference will be released. If the loop
+runs to completion, the child pointer will be NULL and no action will
+be taken.
+
+The reason this is useful is that it removes the need for
+fwnode_handle_put() on early loop exits.  If there is a need
+to retain the reference, then return_ptr(child) or no_free_ptr(child)
+may be used to safely disable the auto cleanup.
+
+Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
+Link: https://lore.kernel.org/r/20240217164249.921878-5-jic23@kernel.org
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Stable-dep-of: 61cbfb5368dd ("iio: adc: ad7124: fix DT configuration parsing")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/property.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/include/linux/property.h b/include/linux/property.h
+index 909416c701b8..d32b8052e086 100644
+--- a/include/linux/property.h
++++ b/include/linux/property.h
+@@ -168,6 +168,11 @@ struct fwnode_handle *device_get_next_child_node(const struct device *dev,
+       for (child = device_get_next_child_node(dev, NULL); child;      \
+            child = device_get_next_child_node(dev, child))
++#define device_for_each_child_node_scoped(dev, child)                 \
++      for (struct fwnode_handle *child __free(fwnode_handle) =        \
++              device_get_next_child_node(dev, NULL);                  \
++           child; child = device_get_next_child_node(dev, child))
++
+ struct fwnode_handle *fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
+                                                 const char *childname);
+ struct fwnode_handle *device_get_named_child_node(const struct device *dev,
+-- 
+2.43.0
+
diff --git a/queue-6.6/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch b/queue-6.6/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch
new file mode 100644 (file)
index 0000000..3204d1d
--- /dev/null
@@ -0,0 +1,40 @@
+From 4c9bdbad8d9698f6ad1ef7d43f743e9bb3317f34 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 16 Jul 2024 09:06:30 -0700
+Subject: drm/msm/adreno: Fix error return if missing firmware-name
+
+From: Rob Clark <robdclark@chromium.org>
+
+[ 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 <robdclark@chromium.org>
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
+Patchwork: https://patchwork.freedesktop.org/patch/604564/
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 8090dde03280..96deaf85c0cd 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.6/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch b/queue-6.6/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch
new file mode 100644 (file)
index 0000000..7137d3d
--- /dev/null
@@ -0,0 +1,42 @@
+From a9d7b574a6d17cdb2d682aad1a4177aa5cdc0cb8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 28 Jul 2024 14:47:30 +0200
+Subject: drm: panel-orientation-quirks: Add quirk for Ayn Loki Zero
+
+From: Bouke Sybren Haarsma <boukehaarsma23@gmail.com>
+
+[ 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 <boukehaarsma23@gmail.com>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240728124731.168452-2-boukehaarsma23@gmail.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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.6/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch-27866 b/queue-6.6/drm-panel-orientation-quirks-add-quirk-for-ayn-loki-.patch-27866
new file mode 100644 (file)
index 0000000..67b23f0
--- /dev/null
@@ -0,0 +1,44 @@
+From b9dedf4034d245dbba0c16d42f798ebff4e178ee Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 28 Jul 2024 14:47:31 +0200
+Subject: drm: panel-orientation-quirks: Add quirk for Ayn Loki Max
+
+From: Bouke Sybren Haarsma <boukehaarsma23@gmail.com>
+
+[ 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 <boukehaarsma23@gmail.com>
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240728124731.168452-3-boukehaarsma23@gmail.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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.6/hid-multitouch-add-support-for-gt7868q.patch b/queue-6.6/hid-multitouch-add-support-for-gt7868q.patch
new file mode 100644 (file)
index 0000000..d06dbde
--- /dev/null
@@ -0,0 +1,95 @@
+From 6ddc5235ee0db4ecc1f9b10dc6f39fca08ae96f3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 16 Jul 2024 23:27:57 +0100
+Subject: HID: multitouch: Add support for GT7868Q
+
+From: Dmitry Savin <envelsavinds@gmail.com>
+
+[ 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 <envelsavinds@gmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 4246348ca16e..a5987fafbedd 100644
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -515,6 +515,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.6/iio-adc-ad7124-fix-dt-configuration-parsing.patch b/queue-6.6/iio-adc-ad7124-fix-dt-configuration-parsing.patch
new file mode 100644 (file)
index 0000000..85b857e
--- /dev/null
@@ -0,0 +1,52 @@
+From c9a32234bf305fa783268dda70a8d42eaaa6e7db Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 6 Aug 2024 11:51:33 +0300
+Subject: iio: adc: ad7124: fix DT configuration parsing
+
+From: Dumitru Ceclan <mitrutzceclan@gmail.com>
+
+[ Upstream commit 61cbfb5368dd50ed0d65ce21d305aa923581db2b ]
+
+The cfg pointer is set before reading the channel number that the
+configuration should point to. This causes configurations to be shifted
+by one channel.
+For example setting bipolar to the first channel defined in the DT will
+cause bipolar mode to be active on the second defined channel.
+
+Fix by moving the cfg pointer setting after reading the channel number.
+
+Fixes: 7b8d045e497a ("iio: adc: ad7124: allow more than 8 channels")
+Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
+Reviewed-by: Nuno Sa <nuno.sa@analog.com>
+Link: https://patch.msgid.link/20240806085133.114547-1-dumitru.ceclan@analog.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iio/adc/ad7124.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c
+index bd323c6bd756..d2fe0269b6d3 100644
+--- a/drivers/iio/adc/ad7124.c
++++ b/drivers/iio/adc/ad7124.c
+@@ -842,8 +842,6 @@ static int ad7124_parse_channel_config(struct iio_dev *indio_dev,
+       st->channels = channels;
+       device_for_each_child_node_scoped(dev, child) {
+-              cfg = &st->channels[channel].cfg;
+-
+               ret = fwnode_property_read_u32(child, "reg", &channel);
+               if (ret)
+                       return ret;
+@@ -861,6 +859,7 @@ static int ad7124_parse_channel_config(struct iio_dev *indio_dev,
+               st->channels[channel].ain = AD7124_CHANNEL_AINP(ain[0]) |
+                                                 AD7124_CHANNEL_AINM(ain[1]);
++              cfg = &st->channels[channel].cfg;
+               cfg->bipolar = fwnode_property_read_bool(child, "bipolar");
+               ret = fwnode_property_read_u32(child, "adi,reference-select", &tmp);
+-- 
+2.43.0
+
diff --git a/queue-6.6/iio-adc-ad7124-switch-from-of-specific-to-fwnode-bas.patch b/queue-6.6/iio-adc-ad7124-switch-from-of-specific-to-fwnode-bas.patch
new file mode 100644 (file)
index 0000000..0123ef0
--- /dev/null
@@ -0,0 +1,158 @@
+From f8b7e1b3c17d78e7c5eb557bdd1d0692ab9077f5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 18 Feb 2024 17:27:26 +0000
+Subject: iio: adc: ad7124: Switch from of specific to fwnode based property
+ handling
+
+From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+
+[ Upstream commit a6eaf02b82744b424b9b2c74847282deb2c6f77b ]
+
+Using the generic firmware data access functions from property.h
+provides a number of advantages:
+ 1) Works with different firmware types.
+ 2) Doesn't provide a 'bad' example for new IIO drivers.
+ 3) Lets us use the new _scoped() loops with automatic reference count
+    cleanup for fwnode_handle
+
+Cc: Lars-Peter Clausen <lars@metafoo.de>
+Cc: Michael Hennerich <Michael.Hennerich@analog.com>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20240218172731.1023367-4-jic23@kernel.org
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Stable-dep-of: 61cbfb5368dd ("iio: adc: ad7124: fix DT configuration parsing")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iio/adc/ad7124.c | 55 +++++++++++++++++-----------------------
+ 1 file changed, 23 insertions(+), 32 deletions(-)
+
+diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c
+index 2976c62b58c0..bd323c6bd756 100644
+--- a/drivers/iio/adc/ad7124.c
++++ b/drivers/iio/adc/ad7124.c
+@@ -14,7 +14,8 @@
+ #include <linux/kernel.h>
+ #include <linux/kfifo.h>
+ #include <linux/module.h>
+-#include <linux/of.h>
++#include <linux/mod_devicetable.h>
++#include <linux/property.h>
+ #include <linux/regulator/consumer.h>
+ #include <linux/spi/spi.h>
+@@ -812,22 +813,19 @@ static int ad7124_check_chip_id(struct ad7124_state *st)
+       return 0;
+ }
+-static int ad7124_of_parse_channel_config(struct iio_dev *indio_dev,
+-                                        struct device_node *np)
++static int ad7124_parse_channel_config(struct iio_dev *indio_dev,
++                                     struct device *dev)
+ {
+       struct ad7124_state *st = iio_priv(indio_dev);
+       struct ad7124_channel_config *cfg;
+       struct ad7124_channel *channels;
+-      struct device_node *child;
+       struct iio_chan_spec *chan;
+       unsigned int ain[2], channel = 0, tmp;
+       int ret;
+-      st->num_channels = of_get_available_child_count(np);
+-      if (!st->num_channels) {
+-              dev_err(indio_dev->dev.parent, "no channel children\n");
+-              return -ENODEV;
+-      }
++      st->num_channels = device_get_child_node_count(dev);
++      if (!st->num_channels)
++              return dev_err_probe(dev, -ENODEV, "no channel children\n");
+       chan = devm_kcalloc(indio_dev->dev.parent, st->num_channels,
+                           sizeof(*chan), GFP_KERNEL);
+@@ -843,39 +841,38 @@ static int ad7124_of_parse_channel_config(struct iio_dev *indio_dev,
+       indio_dev->num_channels = st->num_channels;
+       st->channels = channels;
+-      for_each_available_child_of_node(np, child) {
++      device_for_each_child_node_scoped(dev, child) {
+               cfg = &st->channels[channel].cfg;
+-              ret = of_property_read_u32(child, "reg", &channel);
++              ret = fwnode_property_read_u32(child, "reg", &channel);
+               if (ret)
+-                      goto err;
++                      return ret;
+-              if (channel >= indio_dev->num_channels) {
+-                      dev_err(indio_dev->dev.parent,
++              if (channel >= indio_dev->num_channels)
++                      return dev_err_probe(dev, -EINVAL,
+                               "Channel index >= number of channels\n");
+-                      ret = -EINVAL;
+-                      goto err;
+-              }
+-              ret = of_property_read_u32_array(child, "diff-channels",
+-                                               ain, 2);
++              ret = fwnode_property_read_u32_array(child, "diff-channels",
++                                                   ain, 2);
+               if (ret)
+-                      goto err;
++                      return ret;
+               st->channels[channel].nr = channel;
+               st->channels[channel].ain = AD7124_CHANNEL_AINP(ain[0]) |
+                                                 AD7124_CHANNEL_AINM(ain[1]);
+-              cfg->bipolar = of_property_read_bool(child, "bipolar");
++              cfg->bipolar = fwnode_property_read_bool(child, "bipolar");
+-              ret = of_property_read_u32(child, "adi,reference-select", &tmp);
++              ret = fwnode_property_read_u32(child, "adi,reference-select", &tmp);
+               if (ret)
+                       cfg->refsel = AD7124_INT_REF;
+               else
+                       cfg->refsel = tmp;
+-              cfg->buf_positive = of_property_read_bool(child, "adi,buffered-positive");
+-              cfg->buf_negative = of_property_read_bool(child, "adi,buffered-negative");
++              cfg->buf_positive =
++                      fwnode_property_read_bool(child, "adi,buffered-positive");
++              cfg->buf_negative =
++                      fwnode_property_read_bool(child, "adi,buffered-negative");
+               chan[channel] = ad7124_channel_template;
+               chan[channel].address = channel;
+@@ -885,10 +882,6 @@ static int ad7124_of_parse_channel_config(struct iio_dev *indio_dev,
+       }
+       return 0;
+-err:
+-      of_node_put(child);
+-
+-      return ret;
+ }
+ static int ad7124_setup(struct ad7124_state *st)
+@@ -948,9 +941,7 @@ static int ad7124_probe(struct spi_device *spi)
+       struct iio_dev *indio_dev;
+       int i, ret;
+-      info = of_device_get_match_data(&spi->dev);
+-      if (!info)
+-              info = (void *)spi_get_device_id(spi)->driver_data;
++      info = spi_get_device_match_data(spi);
+       if (!info)
+               return -ENODEV;
+@@ -970,7 +961,7 @@ static int ad7124_probe(struct spi_device *spi)
+       if (ret < 0)
+               return ret;
+-      ret = ad7124_of_parse_channel_config(indio_dev, spi->dev.of_node);
++      ret = ad7124_parse_channel_config(indio_dev, &spi->dev);
+       if (ret < 0)
+               return ret;
+-- 
+2.43.0
+
diff --git a/queue-6.6/input-ads7846-ratelimit-the-spi_sync-error-message.patch b/queue-6.6/input-ads7846-ratelimit-the-spi_sync-error-message.patch
new file mode 100644 (file)
index 0000000..baafe2b
--- /dev/null
@@ -0,0 +1,40 @@
+From 50c368723eacadb9c4e4f27a0ef294e184814347 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 8 Jul 2024 23:18:57 +0200
+Subject: Input: ads7846 - ratelimit the spi_sync error message
+
+From: Marek Vasut <marex@denx.de>
+
+[ 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 <marex@denx.de>
+Link: https://lore.kernel.org/r/20240708211913.171243-1-marex@denx.de
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 a66375700a63..8b8c43b3c27f 100644
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -808,7 +808,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.6/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch b/queue-6.6/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch
new file mode 100644 (file)
index 0000000..139ad3a
--- /dev/null
@@ -0,0 +1,44 @@
+From d1faccb3b700f1ddb8f0bf12be9b921d225b1c46 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 14 Aug 2024 12:06:19 +0200
+Subject: Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table
+
+From: Takashi Iwai <tiwai@suse.de>
+
+[ 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 <tiwai@suse.de>
+Link: https://lore.kernel.org/r/20240814100630.2048-1-tiwai@suse.de
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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.6/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch b/queue-6.6/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch
new file mode 100644 (file)
index 0000000..7ab555c
--- /dev/null
@@ -0,0 +1,38 @@
+From 8d2e5019436512befaeedfab1937c0d752437086 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 23 Jul 2024 21:33:30 -0700
+Subject: Input: synaptics - enable SMBus for HP Elitebook 840 G2
+
+From: Jonathan Denose <jdenose@google.com>
+
+[ 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 <jdenose@google.com>
+Link: https://lore.kernel.org/r/20240719180612.1.Ib652dd808c274076f32cd7fc6c1160d2cf71753b@changeid
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 7a303a9d6bf7..cff3393f0dd0 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.6/ksmbd-override-fsids-for-share-path-check.patch b/queue-6.6/ksmbd-override-fsids-for-share-path-check.patch
new file mode 100644 (file)
index 0000000..910bccb
--- /dev/null
@@ -0,0 +1,224 @@
+From 2b8e7fccc7be75b2631936bb0abb6260a5961fa3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 5 Aug 2024 08:56:18 +0900
+Subject: ksmbd: override fsids for share path check
+
+From: Namjae Jeon <linkinjeon@kernel.org>
+
+[ 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 <constant.lee@samsung.com>
+Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 <linux/path.h>
+ #include <linux/unicode.h>
++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 458cc736286a..4ac6068c50cc 100644
+--- a/fs/smb/server/smb2pdu.c
++++ b/fs/smb/server/smb2pdu.c
+@@ -1959,7 +1959,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 474dadf6b7b8..13818ecb6e1b 100644
+--- a/fs/smb/server/smb_common.c
++++ b/fs/smb/server/smb_common.c
+@@ -732,10 +732,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;
+@@ -775,6 +775,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.6/ksmbd-override-fsids-for-smb2_query_info.patch b/queue-6.6/ksmbd-override-fsids-for-smb2_query_info.patch
new file mode 100644 (file)
index 0000000..2f296b3
--- /dev/null
@@ -0,0 +1,56 @@
+From 137c8b0d0c382fc269def4e913305eff86d7c6c9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 5 Aug 2024 08:57:03 +0900
+Subject: ksmbd: override fsids for smb2_query_info()
+
+From: Namjae Jeon <linkinjeon@kernel.org>
+
+[ 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 <constant.lee@samsung.com>
+Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 4ac6068c50cc..c527050bc981 100644
+--- a/fs/smb/server/smb2pdu.c
++++ b/fs/smb/server/smb2pdu.c
+@@ -5601,6 +5601,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");
+@@ -5619,6 +5624,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);
+@@ -5628,6 +5634,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.6/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch b/queue-6.6/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch
new file mode 100644 (file)
index 0000000..2bcb50f
--- /dev/null
@@ -0,0 +1,50 @@
+From a2ce430dae680974b4336a3c17301fd5bee9fed3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 7 Aug 2024 19:07:21 +0900
+Subject: net: ethernet: use ip_hdrlen() instead of bit shift
+
+From: Moon Yeounsu <yyyynoom@gmail.com>
+
+[ 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 <yyyynoom@gmail.com>
+Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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.6/net-hns3-use-correct-release-function-during-uniniti.patch b/queue-6.6/net-hns3-use-correct-release-function-during-uniniti.patch
new file mode 100644 (file)
index 0000000..13e0074
--- /dev/null
@@ -0,0 +1,39 @@
+From e4629cdd54c90ad6f09abdc5be97ed5c8052142d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 13 Aug 2024 22:10:24 +0800
+Subject: net: hns3: use correct release function during uninitialization
+
+From: Peiyang Wang <wangpeiyang1@huawei.com>
+
+[ Upstream commit 7660833d217528c8f2385528951ab820a031e4e3 ]
+
+pci_request_regions is called to apply for PCI I/O and memory resources
+when the driver is initialized, Therefore, when the driver is uninstalled,
+pci_release_regions should be used to release PCI I/O and memory resources
+instead of pci_release_mem_regions is used to release memory reasouces
+only.
+
+Signed-off-by: Peiyang Wang <wangpeiyang1@huawei.com>
+Signed-off-by: Jijie Shao <shaojijie@huawei.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+index 92c592c177e6..9650ce594e2f 100644
+--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+@@ -11370,7 +11370,7 @@ static void hclge_pci_uninit(struct hclge_dev *hdev)
+       pcim_iounmap(pdev, hdev->hw.hw.io_base);
+       pci_free_irq_vectors(pdev);
+-      pci_release_mem_regions(pdev);
++      pci_release_regions(pdev);
+       pci_disable_device(pdev);
+ }
+-- 
+2.43.0
+
diff --git a/queue-6.6/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch b/queue-6.6/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch
new file mode 100644 (file)
index 0000000..4b2f1ac
--- /dev/null
@@ -0,0 +1,76 @@
+From b3af26f262eab50ff847be4be74c98efab354a89 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 9 Aug 2024 21:38:06 +0200
+Subject: net: phy: vitesse: repair vsc73xx autonegotiation
+
+From: Pawel Dembicki <paweldembicki@gmail.com>
+
+[ Upstream commit de7a670f8defe4ed2115552ad23dea0f432f7be4 ]
+
+When the vsc73xx mdio bus work properly, the generic autonegotiation
+configuration works well.
+
+Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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.6/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch b/queue-6.6/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch
new file mode 100644 (file)
index 0000000..6c0a956
--- /dev/null
@@ -0,0 +1,84 @@
+From 0cc0400d4c3484d4f315b3a0a0f239eddc9881b4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 21 Aug 2024 14:05:02 -0400
+Subject: NFS: Avoid unnecessary rescanning of the per-server delegation list
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+[ 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 <trond.myklebust@hammerspace.com>
+Reviewed-by: Jeff Layton <jlayton@kernel.org>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 cf7365581031..a2034511b631 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.6/nfsv4-fix-clearing-of-layout-segments-in-layoutretur.patch b/queue-6.6/nfsv4-fix-clearing-of-layout-segments-in-layoutretur.patch
new file mode 100644 (file)
index 0000000..10217d3
--- /dev/null
@@ -0,0 +1,65 @@
+From 1d10887875a5fac51aecdbc28bc0a61954a87f57 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 21 Aug 2024 14:05:01 -0400
+Subject: NFSv4: Fix clearing of layout segments in layoutreturn
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+[ 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 <trond.myklebust@hammerspace.com>
+Reviewed-by: Jeff Layton <jlayton@kernel.org>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 e7ac249df1ad..299ea2b86df6 100644
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -9845,13 +9845,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 664d3128e730..3d1a9f8634a9 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.6/nvmem-core-add-nvmem_dev_size-helper.patch b/queue-6.6/nvmem-core-add-nvmem_dev_size-helper.patch
new file mode 100644 (file)
index 0000000..d27c997
--- /dev/null
@@ -0,0 +1,66 @@
+From cc38da4e2f0781f754e454db0f9734590c16592d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 21 Dec 2023 18:34:17 +0100
+Subject: nvmem: core: add nvmem_dev_size() helper
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+
+[ Upstream commit 33cf42e68efc8ff529a7eee08a4f0ba8c8d0a207 ]
+
+This is required by layouts that need to read whole NVMEM content. It's
+especially useful for NVMEM devices without hardcoded layout (like
+U-Boot environment data block).
+
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Link: https://lore.kernel.org/r/20231221173421.13737-2-zajec5@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 8679e8b4a1eb ("nvmem: u-boot-env: error if NVMEM device is too small")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvmem/core.c           | 13 +++++++++++++
+ include/linux/nvmem-consumer.h |  1 +
+ 2 files changed, 14 insertions(+)
+
+diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
+index e7fd1315d7ed..f28c005c2bb2 100644
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -2131,6 +2131,19 @@ const char *nvmem_dev_name(struct nvmem_device *nvmem)
+ }
+ EXPORT_SYMBOL_GPL(nvmem_dev_name);
++/**
++ * nvmem_dev_size() - Get the size of a given nvmem device.
++ *
++ * @nvmem: nvmem device.
++ *
++ * Return: size of the nvmem device.
++ */
++size_t nvmem_dev_size(struct nvmem_device *nvmem)
++{
++      return nvmem->size;
++}
++EXPORT_SYMBOL_GPL(nvmem_dev_size);
++
+ static int __init nvmem_init(void)
+ {
+       return bus_register(&nvmem_bus_type);
+diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
+index 4523e4e83319..526025561df1 100644
+--- a/include/linux/nvmem-consumer.h
++++ b/include/linux/nvmem-consumer.h
+@@ -81,6 +81,7 @@ int nvmem_device_cell_write(struct nvmem_device *nvmem,
+                           struct nvmem_cell_info *info, void *buf);
+ const char *nvmem_dev_name(struct nvmem_device *nvmem);
++size_t nvmem_dev_size(struct nvmem_device *nvmem);
+ void nvmem_add_cell_lookups(struct nvmem_cell_lookup *entries,
+                           size_t nentries);
+-- 
+2.43.0
+
diff --git a/queue-6.6/nvmem-u-boot-env-error-if-nvmem-device-is-too-small.patch b/queue-6.6/nvmem-u-boot-env-error-if-nvmem-device-is-too-small.patch
new file mode 100644 (file)
index 0000000..0022c92
--- /dev/null
@@ -0,0 +1,50 @@
+From f1a4c4f3a902a3e05dc3b864734afd4bf2452c69 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 2 Sep 2024 15:25:08 +0100
+Subject: nvmem: u-boot-env: error if NVMEM device is too small
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: John Thomson <git@johnthomson.fastmail.com.au>
+
+[ Upstream commit 8679e8b4a1ebdb40c4429e49368d29353e07b601 ]
+
+Verify data size before trying to parse it to avoid reading out of
+buffer. This could happen in case of problems at MTD level or invalid DT
+bindings.
+
+Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
+Cc: stable <stable@kernel.org>
+Fixes: d5542923f200 ("nvmem: add driver handling U-Boot environment variables")
+[rmilecki: simplify commit description & rebase]
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Link: https://lore.kernel.org/r/20240902142510.71096-2-srinivas.kandagatla@linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvmem/u-boot-env.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c
+index befbab156cda..adabbfdad6fb 100644
+--- a/drivers/nvmem/u-boot-env.c
++++ b/drivers/nvmem/u-boot-env.c
+@@ -176,6 +176,13 @@ static int u_boot_env_parse(struct u_boot_env *priv)
+               data_offset = offsetof(struct u_boot_env_image_broadcom, data);
+               break;
+       }
++
++      if (dev_size < data_offset) {
++              dev_err(dev, "Device too small for u-boot-env\n");
++              err = -EIO;
++              goto err_kfree;
++      }
++
+       crc32_addr = (__le32 *)(buf + crc32_offset);
+       crc32 = le32_to_cpu(*crc32_addr);
+       crc32_data_len = dev_size - crc32_data_offset;
+-- 
+2.43.0
+
diff --git a/queue-6.6/nvmem-u-boot-env-improve-coding-style.patch b/queue-6.6/nvmem-u-boot-env-improve-coding-style.patch
new file mode 100644 (file)
index 0000000..d24cd6b
--- /dev/null
@@ -0,0 +1,73 @@
+From ae81f8677125ec442874692372b713324bc80485 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 21 Dec 2023 18:34:20 +0100
+Subject: nvmem: u-boot-env: improve coding style
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+
+[ Upstream commit 6bafe07c930676d6430be471310958070816a595 ]
+
+1. Prefer kzalloc() over kcalloc()
+   See memory-allocation.rst which says: "to be on the safe side it's
+   best to use routines that set memory to zero, like kzalloc()"
+2. Drop dev_err() for u_boot_env_add_cells() fail
+   It can fail only on -ENOMEM. We don't want to print error then.
+3. Add extra "crc32_addr" variable
+   It makes code reading header's crc32 easier to understand / review.
+
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Link: https://lore.kernel.org/r/20231221173421.13737-5-zajec5@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 8679e8b4a1eb ("nvmem: u-boot-env: error if NVMEM device is too small")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvmem/u-boot-env.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c
+index 111905189341..befbab156cda 100644
+--- a/drivers/nvmem/u-boot-env.c
++++ b/drivers/nvmem/u-boot-env.c
+@@ -132,6 +132,7 @@ static int u_boot_env_parse(struct u_boot_env *priv)
+       size_t crc32_data_offset;
+       size_t crc32_data_len;
+       size_t crc32_offset;
++      __le32 *crc32_addr;
+       size_t data_offset;
+       size_t data_len;
+       size_t dev_size;
+@@ -143,7 +144,7 @@ static int u_boot_env_parse(struct u_boot_env *priv)
+       dev_size = nvmem_dev_size(nvmem);
+-      buf = kcalloc(1, dev_size, GFP_KERNEL);
++      buf = kzalloc(dev_size, GFP_KERNEL);
+       if (!buf) {
+               err = -ENOMEM;
+               goto err_out;
+@@ -175,7 +176,8 @@ static int u_boot_env_parse(struct u_boot_env *priv)
+               data_offset = offsetof(struct u_boot_env_image_broadcom, data);
+               break;
+       }
+-      crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset));
++      crc32_addr = (__le32 *)(buf + crc32_offset);
++      crc32 = le32_to_cpu(*crc32_addr);
+       crc32_data_len = dev_size - crc32_data_offset;
+       data_len = dev_size - data_offset;
+@@ -188,8 +190,6 @@ static int u_boot_env_parse(struct u_boot_env *priv)
+       buf[dev_size - 1] = '\0';
+       err = u_boot_env_add_cells(priv, buf, data_offset, data_len);
+-      if (err)
+-              dev_err(dev, "Failed to add cells: %d\n", err);
+ err_kfree:
+       kfree(buf);
+-- 
+2.43.0
+
diff --git a/queue-6.6/nvmem-u-boot-env-use-nvmem-device-helpers.patch b/queue-6.6/nvmem-u-boot-env-use-nvmem-device-helpers.patch
new file mode 100644 (file)
index 0000000..ae239b4
--- /dev/null
@@ -0,0 +1,92 @@
+From 4eafb665d481486be0ed6f45fdf98654a900eecd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 21 Dec 2023 18:34:19 +0100
+Subject: nvmem: u-boot-env: use nvmem device helpers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+
+[ Upstream commit a832556d23c5a11115f300011a5874d6107a0d62 ]
+
+Use nvmem_dev_size() and nvmem_device_read() to make this driver less
+mtd dependent.
+
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Link: https://lore.kernel.org/r/20231221173421.13737-4-zajec5@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 8679e8b4a1eb ("nvmem: u-boot-env: error if NVMEM device is too small")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvmem/u-boot-env.c | 23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c
+index dd9d0ad22712..111905189341 100644
+--- a/drivers/nvmem/u-boot-env.c
++++ b/drivers/nvmem/u-boot-env.c
+@@ -127,27 +127,34 @@ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf,
+ static int u_boot_env_parse(struct u_boot_env *priv)
+ {
++      struct nvmem_device *nvmem = priv->nvmem;
+       struct device *dev = priv->dev;
+       size_t crc32_data_offset;
+       size_t crc32_data_len;
+       size_t crc32_offset;
+       size_t data_offset;
+       size_t data_len;
++      size_t dev_size;
+       uint32_t crc32;
+       uint32_t calc;
+-      size_t bytes;
+       uint8_t *buf;
++      int bytes;
+       int err;
+-      buf = kcalloc(1, priv->mtd->size, GFP_KERNEL);
++      dev_size = nvmem_dev_size(nvmem);
++
++      buf = kcalloc(1, dev_size, GFP_KERNEL);
+       if (!buf) {
+               err = -ENOMEM;
+               goto err_out;
+       }
+-      err = mtd_read(priv->mtd, 0, priv->mtd->size, &bytes, buf);
+-      if ((err && !mtd_is_bitflip(err)) || bytes != priv->mtd->size) {
+-              dev_err(dev, "Failed to read from mtd: %d\n", err);
++      bytes = nvmem_device_read(nvmem, 0, dev_size, buf);
++      if (bytes < 0) {
++              err = bytes;
++              goto err_kfree;
++      } else if (bytes != dev_size) {
++              err = -EIO;
+               goto err_kfree;
+       }
+@@ -169,8 +176,8 @@ static int u_boot_env_parse(struct u_boot_env *priv)
+               break;
+       }
+       crc32 = le32_to_cpu(*(__le32 *)(buf + crc32_offset));
+-      crc32_data_len = priv->mtd->size - crc32_data_offset;
+-      data_len = priv->mtd->size - data_offset;
++      crc32_data_len = dev_size - crc32_data_offset;
++      data_len = dev_size - data_offset;
+       calc = crc32(~0, buf + crc32_data_offset, crc32_data_len) ^ ~0L;
+       if (calc != crc32) {
+@@ -179,7 +186,7 @@ static int u_boot_env_parse(struct u_boot_env *priv)
+               goto err_kfree;
+       }
+-      buf[priv->mtd->size - 1] = '\0';
++      buf[dev_size - 1] = '\0';
+       err = u_boot_env_add_cells(priv, buf, data_offset, data_len);
+       if (err)
+               dev_err(dev, "Failed to add cells: %d\n", err);
+-- 
+2.43.0
+
diff --git a/queue-6.6/nvmem-u-boot-env-use-nvmem_add_one_cell-nvmem-subsys.patch b/queue-6.6/nvmem-u-boot-env-use-nvmem_add_one_cell-nvmem-subsys.patch
new file mode 100644 (file)
index 0000000..b7f7eb8
--- /dev/null
@@ -0,0 +1,136 @@
+From 3c2cfa11848f7a35176687354df245d0a04b7dc1 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 21 Dec 2023 18:34:18 +0100
+Subject: nvmem: u-boot-env: use nvmem_add_one_cell() nvmem subsystem helper
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+
+[ Upstream commit 7c8979b42b1a9c5604f431ba804928e55919263c ]
+
+Simplify adding NVMEM cells.
+
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Link: https://lore.kernel.org/r/20231221173421.13737-3-zajec5@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 8679e8b4a1eb ("nvmem: u-boot-env: error if NVMEM device is too small")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/nvmem/u-boot-env.c | 55 +++++++++++++++-----------------------
+ 1 file changed, 21 insertions(+), 34 deletions(-)
+
+diff --git a/drivers/nvmem/u-boot-env.c b/drivers/nvmem/u-boot-env.c
+index c4ae94af4af7..dd9d0ad22712 100644
+--- a/drivers/nvmem/u-boot-env.c
++++ b/drivers/nvmem/u-boot-env.c
+@@ -23,13 +23,10 @@ enum u_boot_env_format {
+ struct u_boot_env {
+       struct device *dev;
++      struct nvmem_device *nvmem;
+       enum u_boot_env_format format;
+       struct mtd_info *mtd;
+-
+-      /* Cells */
+-      struct nvmem_cell_info *cells;
+-      int ncells;
+ };
+ struct u_boot_env_image_single {
+@@ -94,43 +91,36 @@ static int u_boot_env_read_post_process_ethaddr(void *context, const char *id, i
+ static int u_boot_env_add_cells(struct u_boot_env *priv, uint8_t *buf,
+                               size_t data_offset, size_t data_len)
+ {
++      struct nvmem_device *nvmem = priv->nvmem;
+       struct device *dev = priv->dev;
+       char *data = buf + data_offset;
+       char *var, *value, *eq;
+-      int idx;
+-
+-      priv->ncells = 0;
+-      for (var = data; var < data + data_len && *var; var += strlen(var) + 1)
+-              priv->ncells++;
+-
+-      priv->cells = devm_kcalloc(dev, priv->ncells, sizeof(*priv->cells), GFP_KERNEL);
+-      if (!priv->cells)
+-              return -ENOMEM;
+-      for (var = data, idx = 0;
++      for (var = data;
+            var < data + data_len && *var;
+-           var = value + strlen(value) + 1, idx++) {
++           var = value + strlen(value) + 1) {
++              struct nvmem_cell_info info = {};
++
+               eq = strchr(var, '=');
+               if (!eq)
+                       break;
+               *eq = '\0';
+               value = eq + 1;
+-              priv->cells[idx].name = devm_kstrdup(dev, var, GFP_KERNEL);
+-              if (!priv->cells[idx].name)
++              info.name = devm_kstrdup(dev, var, GFP_KERNEL);
++              if (!info.name)
+                       return -ENOMEM;
+-              priv->cells[idx].offset = data_offset + value - data;
+-              priv->cells[idx].bytes = strlen(value);
+-              priv->cells[idx].np = of_get_child_by_name(dev->of_node, priv->cells[idx].name);
++              info.offset = data_offset + value - data;
++              info.bytes = strlen(value);
++              info.np = of_get_child_by_name(dev->of_node, info.name);
+               if (!strcmp(var, "ethaddr")) {
+-                      priv->cells[idx].raw_len = strlen(value);
+-                      priv->cells[idx].bytes = ETH_ALEN;
+-                      priv->cells[idx].read_post_process = u_boot_env_read_post_process_ethaddr;
++                      info.raw_len = strlen(value);
++                      info.bytes = ETH_ALEN;
++                      info.read_post_process = u_boot_env_read_post_process_ethaddr;
+               }
+-      }
+-      if (WARN_ON(idx != priv->ncells))
+-              priv->ncells = idx;
++              nvmem_add_one_cell(nvmem, &info);
++      }
+       return 0;
+ }
+@@ -209,7 +199,6 @@ static int u_boot_env_probe(struct platform_device *pdev)
+       struct device *dev = &pdev->dev;
+       struct device_node *np = dev->of_node;
+       struct u_boot_env *priv;
+-      int err;
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+@@ -224,17 +213,15 @@ static int u_boot_env_probe(struct platform_device *pdev)
+               return PTR_ERR(priv->mtd);
+       }
+-      err = u_boot_env_parse(priv);
+-      if (err)
+-              return err;
+-
+       config.dev = dev;
+-      config.cells = priv->cells;
+-      config.ncells = priv->ncells;
+       config.priv = priv;
+       config.size = priv->mtd->size;
+-      return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &config));
++      priv->nvmem = devm_nvmem_register(dev, &config);
++      if (IS_ERR(priv->nvmem))
++              return PTR_ERR(priv->nvmem);
++
++      return u_boot_env_parse(priv);
+ }
+ static const struct of_device_id u_boot_env_of_match_table[] = {
+-- 
+2.43.0
+
diff --git a/queue-6.6/platform-surface-aggregator_registry-add-support-for.patch b/queue-6.6/platform-surface-aggregator_registry-add-support-for.patch
new file mode 100644 (file)
index 0000000..eceae0f
--- /dev/null
@@ -0,0 +1,50 @@
+From 6c33466ac5e4aec5d6ff7d7d661d5d8f600d19d7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+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 <luzmaximilian@gmail.com>
+
+[ 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 <luzmaximilian@gmail.com>
+Link: https://lore.kernel.org/r/20240811131948.261806-2-luzmaximilian@gmail.com
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 0fe5be539652..c2651599685e 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.6/platform-surface-aggregator_registry-add-support-for.patch-10885 b/queue-6.6/platform-surface-aggregator_registry-add-support-for.patch-10885
new file mode 100644 (file)
index 0000000..e1523bc
--- /dev/null
@@ -0,0 +1,43 @@
+From 22bc470219fe4a16dd3cc308290623309124e72a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+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 <luzmaximilian@gmail.com>
+
+[ 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 <luzmaximilian@gmail.com>
+Link: https://lore.kernel.org/r/20240811131948.261806-3-luzmaximilian@gmail.com
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 c2651599685e..8c5b5f35d848 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.6/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch b/queue-6.6/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch
new file mode 100644 (file)
index 0000000..5739e0e
--- /dev/null
@@ -0,0 +1,85 @@
+From 6394e589665541e8977cad62eb8ff59515710f6f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 8 Aug 2024 09:05:08 +0200
+Subject: powerpc/mm: Fix boot warning with hugepages and CONFIG_DEBUG_VIRTUAL
+
+From: Christophe Leroy <christophe.leroy@csgroup.eu>
+
+[ 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 <CE,ME>  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 <christophe.leroy@csgroup.eu>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://msgid.link/62b69c4baad067093f39e7e60df0fe27a86b8d2a.1723100702.git.christophe.leroy@csgroup.eu
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 20f72cd1d813..03eaad5949f1 100644
+--- a/arch/powerpc/kernel/setup-common.c
++++ b/arch/powerpc/kernel/setup-common.c
+@@ -950,6 +950,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 07e8f4f1e07f..9dbef559af4c 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.6/s390-mm-prevent-lowcore-vs-identity-mapping-overlap.patch b/queue-6.6/s390-mm-prevent-lowcore-vs-identity-mapping-overlap.patch
new file mode 100644 (file)
index 0000000..9092974
--- /dev/null
@@ -0,0 +1,69 @@
+From 4b415d5497099086b01b2e99a38c1b956f13db7f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 9 Aug 2024 08:47:15 +0200
+Subject: s390/mm: Prevent lowcore vs identity mapping overlap
+
+From: Alexander Gordeev <agordeev@linux.ibm.com>
+
+[ Upstream commit a3ca27c405faad584af6e8e38cdafe5be73230a1 ]
+
+The identity mapping position in virtual memory is randomized
+together with the kernel mapping. That position can never
+overlap with the lowcore even when the lowcore is relocated.
+
+Prevent overlapping with the lowcore to allow independent
+positioning of the identity mapping. With the current value
+of the alternative lowcore address of 0x70000 the overlap
+could happen in case the identity mapping is placed at zero.
+
+This is a prerequisite for uncoupling of randomization base
+of kernel image and identity mapping in virtual memory.
+
+Acked-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
+Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/s390/kernel/setup.c | 19 ++++++++++++++++++-
+ 1 file changed, 18 insertions(+), 1 deletion(-)
+
+diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
+index d48c7afe97e6..89fe0764af84 100644
+--- a/arch/s390/kernel/setup.c
++++ b/arch/s390/kernel/setup.c
+@@ -741,7 +741,23 @@ static void __init memblock_add_physmem_info(void)
+ }
+ /*
+- * Reserve memory used for lowcore/command line/kernel image.
++ * Reserve memory used for lowcore.
++ */
++static void __init reserve_lowcore(void)
++{
++      void *lowcore_start = get_lowcore();
++      void *lowcore_end = lowcore_start + sizeof(struct lowcore);
++      void *start, *end;
++
++      if ((void *)__identity_base < lowcore_end) {
++              start = max(lowcore_start, (void *)__identity_base);
++              end = min(lowcore_end, (void *)(__identity_base + ident_map_size));
++              memblock_reserve(__pa(start), __pa(end));
++      }
++}
++
++/*
++ * Reserve memory used for absolute lowcore/command line/kernel image.
+  */
+ static void __init reserve_kernel(void)
+ {
+@@ -939,6 +955,7 @@ void __init setup_arch(char **cmdline_p)
+       /* Do some memory reservations *before* memory is added to memblock */
+       reserve_pgtables();
++      reserve_lowcore();
+       reserve_kernel();
+       reserve_initrd();
+       reserve_certificate_list();
+-- 
+2.43.0
+
diff --git a/queue-6.6/scripts-kconfig-merge_config-config-files-add-a-trai.patch b/queue-6.6/scripts-kconfig-merge_config-config-files-add-a-trai.patch
new file mode 100644 (file)
index 0000000..505fd53
--- /dev/null
@@ -0,0 +1,48 @@
+From e79739ba642c8056f95083a795571ed4c4080975 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 5 Aug 2024 11:22:34 +0200
+Subject: scripts: kconfig: merge_config: config files: add a trailing newline
+
+From: Anders Roxell <anders.roxell@linaro.org>
+
+[ 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 <anders.roxell@linaro.org>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 902eb429b9db..0b7952471c18 100755
+--- a/scripts/kconfig/merge_config.sh
++++ b/scripts/kconfig/merge_config.sh
+@@ -167,6 +167,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.6/series b/queue-6.6/series
new file mode 100644 (file)
index 0000000..1307409
--- /dev/null
@@ -0,0 +1,35 @@
+device-property-add-cleanup.h-based-fwnode_handle_pu.patch
+device-property-introduce-device_for_each_child_node.patch
+iio-adc-ad7124-switch-from-of-specific-to-fwnode-bas.patch
+iio-adc-ad7124-fix-dt-configuration-parsing.patch
+nvmem-core-add-nvmem_dev_size-helper.patch
+nvmem-u-boot-env-use-nvmem_add_one_cell-nvmem-subsys.patch
+nvmem-u-boot-env-use-nvmem-device-helpers.patch
+nvmem-u-boot-env-improve-coding-style.patch
+nvmem-u-boot-env-error-if-nvmem-device-is-too-small.patch
+ksmbd-override-fsids-for-share-path-check.patch
+ksmbd-override-fsids-for-smb2_query_info.patch
+usbnet-ipheth-remove-extraneous-rx-urb-length-check.patch
+usbnet-ipheth-drop-rx-urbs-with-no-payload.patch
+usbnet-ipheth-do-not-stop-rx-on-failing-rx-callback.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-27866
+net-phy-vitesse-repair-vsc73xx-autonegotiation.patch
+powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch
+wifi-mt76-mt7921-fix-null-pointer-access-in-mt7921_i.patch
+net-hns3-use-correct-release-function-during-uniniti.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-10885
+drm-msm-adreno-fix-error-return-if-missing-firmware-.patch
+input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch
+s390-mm-prevent-lowcore-vs-identity-mapping-overlap.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.6/smb-server-fix-return-value-of-smb2_open.patch b/queue-6.6/smb-server-fix-return-value-of-smb2_open.patch
new file mode 100644 (file)
index 0000000..af8ee55
--- /dev/null
@@ -0,0 +1,38 @@
+From e76ca0910bad3cf5ff0aab9e2630f3596d6994c7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 22 Aug 2024 08:20:50 +0000
+Subject: smb/server: fix return value of smb2_open()
+
+From: ChenXiaoSong <chenxiaosong@kylinos.cn>
+
+[ 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 <chenxiaosong@kylinos.cn>
+Acked-by: Namjae Jeon <linkinjeon@kernel.org>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 c527050bc981..c6473b08b1f3 100644
+--- a/fs/smb/server/smb2pdu.c
++++ b/fs/smb/server/smb2pdu.c
+@@ -3714,7 +3714,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.6/usbnet-ipheth-do-not-stop-rx-on-failing-rx-callback.patch b/queue-6.6/usbnet-ipheth-do-not-stop-rx-on-failing-rx-callback.patch
new file mode 100644 (file)
index 0000000..f0836f2
--- /dev/null
@@ -0,0 +1,42 @@
+From 0a41deae4a960d61b96074ee3b3a041757ab70c0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 6 Aug 2024 19:28:08 +0200
+Subject: usbnet: ipheth: do not stop RX on failing RX callback
+
+From: Foster Snowhill <forst@pen.gy>
+
+[ Upstream commit 74efed51e0a4d62f998f806c307778b47fc73395 ]
+
+RX callbacks can fail for multiple reasons:
+
+* Payload too short
+* Payload formatted incorrecly (e.g. bad NCM framing)
+* Lack of memory
+
+None of these should cause the driver to seize up.
+
+Make such failures non-critical and continue processing further
+incoming URBs.
+
+Signed-off-by: Foster Snowhill <forst@pen.gy>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/usb/ipheth.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
+index f04c7bf79665..cdc72559790a 100644
+--- a/drivers/net/usb/ipheth.c
++++ b/drivers/net/usb/ipheth.c
+@@ -308,7 +308,6 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
+       if (retval != 0) {
+               dev_err(&dev->intf->dev, "%s: callback retval: %d\n",
+                       __func__, retval);
+-              return;
+       }
+ rx_submit:
+-- 
+2.43.0
+
diff --git a/queue-6.6/usbnet-ipheth-drop-rx-urbs-with-no-payload.patch b/queue-6.6/usbnet-ipheth-drop-rx-urbs-with-no-payload.patch
new file mode 100644 (file)
index 0000000..2518d94
--- /dev/null
@@ -0,0 +1,45 @@
+From 8fad56e5506630d72fd858b57950d226ce8ebe38 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 6 Aug 2024 19:28:07 +0200
+Subject: usbnet: ipheth: drop RX URBs with no payload
+
+From: Foster Snowhill <forst@pen.gy>
+
+[ Upstream commit 94d7eeb6c0ef0310992944f0d0296929816a2cb0 ]
+
+On iPhone 15 Pro Max one can observe periodic URBs with no payload
+on the "bulk in" (RX) endpoint. These don't seem to do anything
+meaningful. Reproduced on iOS 17.5.1 and 17.6.
+
+This behaviour isn't observed on iPhone 11 on the same iOS version. The
+nature of these zero-length URBs is so far unknown.
+
+Drop RX URBs with no payload.
+
+Signed-off-by: Foster Snowhill <forst@pen.gy>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/usb/ipheth.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
+index 017255615508..f04c7bf79665 100644
+--- a/drivers/net/usb/ipheth.c
++++ b/drivers/net/usb/ipheth.c
+@@ -286,6 +286,12 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
+               return;
+       }
++      /* iPhone may periodically send URBs with no payload
++       * on the "bulk in" endpoint. It is safe to ignore them.
++       */
++      if (urb->actual_length == 0)
++              goto rx_submit;
++
+       /* RX URBs starting with 0x00 0x01 do not encapsulate Ethernet frames,
+        * but rather are control frames. Their purpose is not documented, and
+        * they don't affect driver functionality, okay to drop them.
+-- 
+2.43.0
+
diff --git a/queue-6.6/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch b/queue-6.6/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch
new file mode 100644 (file)
index 0000000..ed8ac0b
--- /dev/null
@@ -0,0 +1,80 @@
+From 5f4b03ae1cfb1fa7eafc4ca9522c8f8071a192bc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 6 Aug 2024 19:28:09 +0200
+Subject: usbnet: ipheth: fix carrier detection in modes 1 and 4
+
+From: Foster Snowhill <forst@pen.gy>
+
+[ 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 <forst@pen.gy>
+Tested-by: Georgi Valkov <gvalkov@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 cdc72559790a..46afb95ffabe 100644
+--- a/drivers/net/usb/ipheth.c
++++ b/drivers/net/usb/ipheth.c
+@@ -355,13 +355,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
+
diff --git a/queue-6.6/usbnet-ipheth-remove-extraneous-rx-urb-length-check.patch b/queue-6.6/usbnet-ipheth-remove-extraneous-rx-urb-length-check.patch
new file mode 100644 (file)
index 0000000..5890b17
--- /dev/null
@@ -0,0 +1,57 @@
+From 7d7cede29b4fd7186a613e2a1423cd75936f313c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 6 Aug 2024 19:28:06 +0200
+Subject: usbnet: ipheth: remove extraneous rx URB length check
+
+From: Foster Snowhill <forst@pen.gy>
+
+[ Upstream commit 655b46d7a39ac6f049698b27c1568c0f7ff85d1e ]
+
+Rx URB length was already checked in ipheth_rcvbulk_callback_legacy()
+and ipheth_rcvbulk_callback_ncm(), depending on the current mode.
+The check in ipheth_rcvbulk_callback() was thus mostly a duplicate.
+
+The only place in ipheth_rcvbulk_callback() where we care about the URB
+length is for the initial control frame. These frames are always 4 bytes
+long. This has been checked as far back as iOS 4.2.1 on iPhone 3G.
+
+Remove the extraneous URB length check. For control frames, check for
+the specific 4-byte length instead.
+
+Signed-off-by: Foster Snowhill <forst@pen.gy>
+Tested-by: Georgi Valkov <gvalkov@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/usb/ipheth.c | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
+index 6eeef10edada..017255615508 100644
+--- a/drivers/net/usb/ipheth.c
++++ b/drivers/net/usb/ipheth.c
+@@ -286,11 +286,6 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
+               return;
+       }
+-      if (urb->actual_length <= IPHETH_IP_ALIGN) {
+-              dev->net->stats.rx_length_errors++;
+-              return;
+-      }
+-
+       /* RX URBs starting with 0x00 0x01 do not encapsulate Ethernet frames,
+        * but rather are control frames. Their purpose is not documented, and
+        * they don't affect driver functionality, okay to drop them.
+@@ -298,7 +293,8 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
+        * URB received from the bulk IN endpoint.
+        */
+       if (unlikely
+-              (((char *)urb->transfer_buffer)[0] == 0 &&
++              (urb->actual_length == 4 &&
++               ((char *)urb->transfer_buffer)[0] == 0 &&
+                ((char *)urb->transfer_buffer)[1] == 1))
+               goto rx_submit;
+-- 
+2.43.0
+
diff --git a/queue-6.6/wifi-mt76-mt7921-fix-null-pointer-access-in-mt7921_i.patch b/queue-6.6/wifi-mt76-mt7921-fix-null-pointer-access-in-mt7921_i.patch
new file mode 100644 (file)
index 0000000..024f5b2
--- /dev/null
@@ -0,0 +1,38 @@
+From eec0a0d079f477bd42b01ec9fe515084f24a7d29 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 12 Aug 2024 12:45:41 +0200
+Subject: wifi: mt76: mt7921: fix NULL pointer access in
+ mt7921_ipv6_addr_change
+
+From: Bert Karwatzki <spasswolf@web.de>
+
+[ Upstream commit 479ffee68d59c599f8aed8fa2dcc8e13e7bd13c3 ]
+
+When disabling wifi mt7921_ipv6_addr_change() is called as a notifier.
+At this point mvif->phy is already NULL so we cannot use it here.
+
+Signed-off-by: Bert Karwatzki <spasswolf@web.de>
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+Signed-off-by: Kalle Valo <kvalo@kernel.org>
+Link: https://patch.msgid.link/20240812104542.80760-1-spasswolf@web.de
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/mediatek/mt76/mt7921/main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+index 6a5c2cae087d..6dec54431312 100644
+--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
++++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+@@ -1095,7 +1095,7 @@ static void mt7921_ipv6_addr_change(struct ieee80211_hw *hw,
+                                   struct inet6_dev *idev)
+ {
+       struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+-      struct mt792x_dev *dev = mvif->phy->dev;
++      struct mt792x_dev *dev = mt792x_hw_dev(hw);
+       struct inet6_ifaddr *ifa;
+       struct in6_addr ns_addrs[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
+       struct sk_buff *skb;
+-- 
+2.43.0
+