From 49f6c51b9bd5d06d0ae2b477c3d85e3de64bd71c Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 12 Sep 2024 08:21:00 -0400 Subject: [PATCH] Fixes for 5.10 Signed-off-by: Sasha Levin --- ...pdate-target-inode-s-ctime-on-unlink.patch | 43 ++++++++ ...ix-error-return-if-missing-firmware-.patch | 40 ++++++++ ...ratelimit-the-spi_sync-error-message.patch | 40 ++++++++ ...fujitsu-lifebook-e756-to-i8042-quirk.patch | 44 +++++++++ ...enable-smbus-for-hp-elitebook-840-g2.patch | 38 +++++++ ...t-use-ip_hdrlen-instead-of-bit-shift.patch | 50 ++++++++++ ...tesse-repair-vsc73xx-autonegotiation.patch | 76 ++++++++++++++ ...ssary-rescanning-of-the-per-server-d.patch | 84 ++++++++++++++++ ...oot-warning-with-hugepages-and-confi.patch | 85 ++++++++++++++++ ...merge_config-config-files-add-a-trai.patch | 48 +++++++++ queue-5.10/series | 14 +++ ...able-guctl1-bit-10-for-fixing-termin.patch | 99 +++++++++++++++++++ ...update-lc-timer-as-per-usb-spec-v3.2.patch | 77 +++++++++++++++ ...b-dwc3-decouple-usb-2.0-l1-l2-events.patch | 79 +++++++++++++++ ...x-carrier-detection-in-modes-1-and-4.patch | 80 +++++++++++++++ 15 files changed, 897 insertions(+) create mode 100644 queue-5.10/btrfs-update-target-inode-s-ctime-on-unlink.patch create mode 100644 queue-5.10/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch create mode 100644 queue-5.10/input-ads7846-ratelimit-the-spi_sync-error-message.patch create mode 100644 queue-5.10/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch create mode 100644 queue-5.10/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch create mode 100644 queue-5.10/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch create mode 100644 queue-5.10/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch create mode 100644 queue-5.10/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch create mode 100644 queue-5.10/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch create mode 100644 queue-5.10/scripts-kconfig-merge_config-config-files-add-a-trai.patch create mode 100644 queue-5.10/series create mode 100644 queue-5.10/usb-dwc3-core-enable-guctl1-bit-10-for-fixing-termin.patch create mode 100644 queue-5.10/usb-dwc3-core-update-lc-timer-as-per-usb-spec-v3.2.patch create mode 100644 queue-5.10/usb-dwc3-decouple-usb-2.0-l1-l2-events.patch create mode 100644 queue-5.10/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch diff --git a/queue-5.10/btrfs-update-target-inode-s-ctime-on-unlink.patch b/queue-5.10/btrfs-update-target-inode-s-ctime-on-unlink.patch new file mode 100644 index 00000000000..c40b9858b3c --- /dev/null +++ b/queue-5.10/btrfs-update-target-inode-s-ctime-on-unlink.patch @@ -0,0 +1,43 @@ +From a8357a7aa49ea45a1ef4793725b18e210cce86bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Aug 2024 12:30:52 -0400 +Subject: btrfs: update target inode's ctime on unlink + +From: Jeff Layton + +[ Upstream commit 3bc2ac2f8f0b78a13140fc72022771efe0c9b778 ] + +Unlink changes the link count on the target inode. POSIX mandates that +the ctime must also change when this occurs. + +According to https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html: + +"Upon successful completion, unlink() shall mark for update the last data + modification and last file status change timestamps of the parent + directory. Also, if the file's link count is not 0, the last file status + change timestamp of the file shall be marked for update." + +Signed-off-by: Jeff Layton +Reviewed-by: David Sterba +[ add link to the opengroup docs ] +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/inode.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c +index cd3156a9a268..24598acb9a31 100644 +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -3704,6 +3704,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, + + btrfs_i_size_write(dir, dir->vfs_inode.i_size - name_len * 2); + inode_inc_iversion(&inode->vfs_inode); ++ inode_set_ctime_current(&inode->vfs_inode); + inode_inc_iversion(&dir->vfs_inode); + inode->vfs_inode.i_ctime = dir->vfs_inode.i_mtime = + dir->vfs_inode.i_ctime = current_time(&inode->vfs_inode); +-- +2.43.0 + diff --git a/queue-5.10/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch b/queue-5.10/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch new file mode 100644 index 00000000000..6f46df74f01 --- /dev/null +++ b/queue-5.10/drm-msm-adreno-fix-error-return-if-missing-firmware-.patch @@ -0,0 +1,40 @@ +From 7876d6008e431d4f69a3cfbbd6f75ef7416b0e5b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Jul 2024 09:06:30 -0700 +Subject: drm/msm/adreno: Fix error return if missing firmware-name + +From: Rob Clark + +[ Upstream commit 624ab9cde26a9f150b4fd268b0f3dae3184dc40c ] + +-ENODEV is used to signify that there is no zap shader for the platform, +and the CPU can directly take the GPU out of secure mode. We want to +use this return code when there is no zap-shader node. But not when +there is, but without a firmware-name property. This case we want to +treat as-if the needed fw is not found. + +Signed-off-by: Rob Clark +Reviewed-by: Dmitry Baryshkov +Reviewed-by: Akhil P Oommen +Patchwork: https://patchwork.freedesktop.org/patch/604564/ +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c +index 11a6a41b4910..a5f95801adfe 100644 +--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c ++++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c +@@ -93,7 +93,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-5.10/input-ads7846-ratelimit-the-spi_sync-error-message.patch b/queue-5.10/input-ads7846-ratelimit-the-spi_sync-error-message.patch new file mode 100644 index 00000000000..ea0ade2b700 --- /dev/null +++ b/queue-5.10/input-ads7846-ratelimit-the-spi_sync-error-message.patch @@ -0,0 +1,40 @@ +From d83e450e5e5f72172255cd4a4551812426a71b49 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jul 2024 23:18:57 +0200 +Subject: Input: ads7846 - ratelimit the spi_sync error message + +From: Marek Vasut + +[ Upstream commit ccbfea78adf75d3d9e87aa739dab83254f5333fa ] + +In case the touch controller is not connected, this message keeps scrolling +on the console indefinitelly. Ratelimit it to avoid filling kernel logs. + +" +ads7846 spi2.1: spi_sync --> -22 +" + +Signed-off-by: Marek Vasut +Link: https://lore.kernel.org/r/20240708211913.171243-1-marex@denx.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/touchscreen/ads7846.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c +index 1753288cedde..08a1eac2dfa2 100644 +--- a/drivers/input/touchscreen/ads7846.c ++++ b/drivers/input/touchscreen/ads7846.c +@@ -819,7 +819,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-5.10/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch b/queue-5.10/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch new file mode 100644 index 00000000000..571b6c4ebf3 --- /dev/null +++ b/queue-5.10/input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch @@ -0,0 +1,44 @@ +From 077049099bdf6cbc75ce792234ba2ef2ec52054d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Aug 2024 12:06:19 +0200 +Subject: Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table + +From: Takashi Iwai + +[ Upstream commit 7ce7c2283fa6843ab3c2adfeb83dcc504a107858 ] + +Yet another quirk entry for Fujitsu laptop. Lifebook E756 requires +i8041.nomux for keeping the touchpad working after suspend/resume. + +Link: https://bugzilla.suse.com/show_bug.cgi?id=1229056 +Signed-off-by: Takashi Iwai +Link: https://lore.kernel.org/r/20240814100630.2048-1-tiwai@suse.de +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/serio/i8042-acpipnpio.h | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/input/serio/i8042-acpipnpio.h b/drivers/input/serio/i8042-acpipnpio.h +index 91edfb88a218..29676ff37766 100644 +--- a/drivers/input/serio/i8042-acpipnpio.h ++++ b/drivers/input/serio/i8042-acpipnpio.h +@@ -617,6 +617,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-5.10/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch b/queue-5.10/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch new file mode 100644 index 00000000000..ba50f7d87d5 --- /dev/null +++ b/queue-5.10/input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch @@ -0,0 +1,38 @@ +From 0b0f27bae568ee21efef6636556588621d237e6b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Jul 2024 21:33:30 -0700 +Subject: Input: synaptics - enable SMBus for HP Elitebook 840 G2 + +From: Jonathan Denose + +[ Upstream commit da897484557b34a54fabb81f6c223c19a69e546d ] + +The kernel reports that the touchpad for this device can support a +different bus. + +With SMBus enabled the touchpad movement is smoother and three-finger +gestures are recognized. + +Signed-off-by: Jonathan Denose +Link: https://lore.kernel.org/r/20240719180612.1.Ib652dd808c274076f32cd7fc6c1160d2cf71753b@changeid +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/mouse/synaptics.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c +index e2c130832c15..82504b0ce01b 100644 +--- a/drivers/input/mouse/synaptics.c ++++ b/drivers/input/mouse/synaptics.c +@@ -187,6 +187,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-5.10/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch b/queue-5.10/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch new file mode 100644 index 00000000000..d537960eccc --- /dev/null +++ b/queue-5.10/net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch @@ -0,0 +1,50 @@ +From be85e7b8c6571dd814130645c311049396a805a3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Aug 2024 19:07:21 +0900 +Subject: net: ethernet: use ip_hdrlen() instead of bit shift + +From: Moon Yeounsu + +[ Upstream commit 9a039eeb71a42c8b13408a1976e300f3898e1be0 ] + +`ip_hdr(skb)->ihl << 2` is the same as `ip_hdrlen(skb)` +Therefore, we should use a well-defined function not a bit shift +to find the header length. + +It also compresses two lines to a single line. + +Signed-off-by: Moon Yeounsu +Reviewed-by: Christophe JAILLET +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/jme.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c +index e9efe074edc1..80858206c514 100644 +--- a/drivers/net/ethernet/jme.c ++++ b/drivers/net/ethernet/jme.c +@@ -947,15 +947,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-5.10/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch b/queue-5.10/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch new file mode 100644 index 00000000000..d20b6325083 --- /dev/null +++ b/queue-5.10/net-phy-vitesse-repair-vsc73xx-autonegotiation.patch @@ -0,0 +1,76 @@ +From dea47c566f751abd2a0ff655828ce2ae5257d4a4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Aug 2024 21:38:06 +0200 +Subject: net: phy: vitesse: repair vsc73xx autonegotiation + +From: Pawel Dembicki + +[ Upstream commit de7a670f8defe4ed2115552ad23dea0f432f7be4 ] + +When the vsc73xx mdio bus work properly, the generic autonegotiation +configuration works well. + +Reviewed-by: Linus Walleij +Signed-off-by: Pawel Dembicki +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/phy/vitesse.c | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c +index bb680352708a..3f594c8784e2 100644 +--- a/drivers/net/phy/vitesse.c ++++ b/drivers/net/phy/vitesse.c +@@ -232,16 +232,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. */ +@@ -424,7 +414,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, + }, { +@@ -433,7 +422,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, + }, { +@@ -442,7 +430,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, + }, { +@@ -451,7 +438,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-5.10/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch b/queue-5.10/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch new file mode 100644 index 00000000000..a13821a393a --- /dev/null +++ b/queue-5.10/nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch @@ -0,0 +1,84 @@ +From b858878e95c641ca0e86612508fcc9ff937191b1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Aug 2024 14:05:02 -0400 +Subject: NFS: Avoid unnecessary rescanning of the per-server delegation list + +From: Trond Myklebust + +[ Upstream commit f92214e4c312f6ea9d78650cc6291d200f17abb6 ] + +If the call to nfs_delegation_grab_inode() fails, we will not have +dropped any locks that require us to rescan the list. + +Signed-off-by: Trond Myklebust +Reviewed-by: Jeff Layton +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + fs/nfs/delegation.c | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c +index 1eb6c7a142ff..c15188d0b6b3 100644 +--- a/fs/nfs/delegation.c ++++ b/fs/nfs/delegation.c +@@ -609,6 +609,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); +@@ -619,12 +622,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(); + +@@ -1140,7 +1137,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) || +@@ -1151,7 +1147,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) { +@@ -1272,7 +1268,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) || +@@ -1283,7 +1278,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-5.10/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch b/queue-5.10/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch new file mode 100644 index 00000000000..d36cf50ad0f --- /dev/null +++ b/queue-5.10/powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch @@ -0,0 +1,85 @@ +From 50a02a9d6580571707f45edfa8891cdae2decd38 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Aug 2024 09:05:08 +0200 +Subject: powerpc/mm: Fix boot warning with hugepages and CONFIG_DEBUG_VIRTUAL + +From: Christophe Leroy + +[ Upstream commit e7e846dc6c73fbc94ae8b4ec20d05627646416f2 ] + +Booting with CONFIG_DEBUG_VIRTUAL leads to following warning when +passing hugepage reservation on command line: + + Kernel command line: hugepagesz=1g hugepages=1 hugepagesz=64m hugepages=1 hugepagesz=256m hugepages=1 noreboot + HugeTLB: allocating 1 of page size 1.00 GiB failed. Only allocated 0 hugepages. + ------------[ cut here ]------------ + WARNING: CPU: 0 PID: 0 at arch/powerpc/include/asm/io.h:948 __alloc_bootmem_huge_page+0xd4/0x284 + Modules linked in: + CPU: 0 PID: 0 Comm: swapper Not tainted 6.10.0-rc6-00396-g6b0e82791bd0-dirty #936 + Hardware name: MPC8544DS e500v2 0x80210030 MPC8544 DS + NIP: c1020240 LR: c10201d0 CTR: 00000000 + REGS: c13fdd30 TRAP: 0700 Not tainted (6.10.0-rc6-00396-g6b0e82791bd0-dirty) + MSR: 00021000 CR: 44084288 XER: 20000000 + + GPR00: c10201d0 c13fde20 c130b560 e8000000 e8001000 00000000 00000000 c1420000 + GPR08: 00000000 00028001 00000000 00000004 44084282 01066ac0 c0eb7c9c efffe149 + GPR16: c0fc4228 0000005f ffffffff c0eb7d0c c0eb7cc0 c0eb7ce0 ffffffff 00000000 + GPR24: c1441cec efffe153 e8001000 c14240c0 00000000 c1441d64 00000000 e8000000 + NIP [c1020240] __alloc_bootmem_huge_page+0xd4/0x284 + LR [c10201d0] __alloc_bootmem_huge_page+0x64/0x284 + Call Trace: + [c13fde20] [c10201d0] __alloc_bootmem_huge_page+0x64/0x284 (unreliable) + [c13fde50] [c10207b8] hugetlb_hstate_alloc_pages+0x8c/0x3e8 + [c13fdeb0] [c1021384] hugepages_setup+0x240/0x2cc + [c13fdef0] [c1000574] unknown_bootoption+0xfc/0x280 + [c13fdf30] [c0078904] parse_args+0x200/0x4c4 + [c13fdfa0] [c1000d9c] start_kernel+0x238/0x7d0 + [c13fdff0] [c0000434] set_ivor+0x12c/0x168 + Code: 554aa33e 7c042840 3ce0c142 80a7427c 5109a016 50caa016 7c9a2378 7fdcf378 4180000c 7c052040 41810160 7c095040 <0fe00000> 38c00000 40800108 3c60c0eb + ---[ end trace 0000000000000000 ]--- + +This is due to virt_addr_valid() using high_memory before it is set. + +high_memory is set in mem_init() using max_low_pfn, but max_low_pfn +is available long before, it is set in mem_topology_setup(). So just +like commit daa9ada2093e ("powerpc/mm: Fix boot crash with FLATMEM") +moved the setting of max_mapnr immediately after the call to +mem_topology_setup(), the same can be done for high_memory. + +Signed-off-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://msgid.link/62b69c4baad067093f39e7e60df0fe27a86b8d2a.1723100702.git.christophe.leroy@csgroup.eu +Signed-off-by: Sasha Levin +--- + arch/powerpc/kernel/setup-common.c | 1 + + arch/powerpc/mm/mem.c | 2 -- + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c +index 1e417c3eedfe..b99b35ba2412 100644 +--- a/arch/powerpc/kernel/setup-common.c ++++ b/arch/powerpc/kernel/setup-common.c +@@ -908,6 +908,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 08e3422eb792..cd6a68a64d87 100644 +--- a/arch/powerpc/mm/mem.c ++++ b/arch/powerpc/mm/mem.c +@@ -292,8 +292,6 @@ void __init mem_init(void) + swiotlb_init(0); + #endif + +- high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); +- + kasan_late_init(); + + memblock_free_all(); +-- +2.43.0 + diff --git a/queue-5.10/scripts-kconfig-merge_config-config-files-add-a-trai.patch b/queue-5.10/scripts-kconfig-merge_config-config-files-add-a-trai.patch new file mode 100644 index 00000000000..4a1e72748ef --- /dev/null +++ b/queue-5.10/scripts-kconfig-merge_config-config-files-add-a-trai.patch @@ -0,0 +1,48 @@ +From 58fba4d86c0fa4ce91021500f1f7bbb076656492 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Aug 2024 11:22:34 +0200 +Subject: scripts: kconfig: merge_config: config files: add a trailing newline + +From: Anders Roxell + +[ Upstream commit 33330bcf031818e60a816db0cfd3add9eecc3b28 ] + +When merging files without trailing newlines at the end of the file, two +config fragments end up at the same row if file1.config doens't have a +trailing newline at the end of the file. + +file1.config "CONFIG_1=y" +file2.config "CONFIG_2=y" +./scripts/kconfig/merge_config.sh -m .config file1.config file2.config + +This will generate a .config looking like this. +cat .config +... +CONFIG_1=yCONFIG_2=y" + +Making sure so we add a newline at the end of every config file that is +passed into the script. + +Signed-off-by: Anders Roxell +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + scripts/kconfig/merge_config.sh | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh +index 63c8565206a4..d7d5c58b8b6a 100755 +--- a/scripts/kconfig/merge_config.sh ++++ b/scripts/kconfig/merge_config.sh +@@ -150,6 +150,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-5.10/series b/queue-5.10/series new file mode 100644 index 00000000000..ee7eeb00f6d --- /dev/null +++ b/queue-5.10/series @@ -0,0 +1,14 @@ +usb-dwc3-decouple-usb-2.0-l1-l2-events.patch +usb-dwc3-core-enable-guctl1-bit-10-for-fixing-termin.patch +usb-dwc3-core-update-lc-timer-as-per-usb-spec-v3.2.patch +usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch +net-ethernet-use-ip_hdrlen-instead-of-bit-shift.patch +net-phy-vitesse-repair-vsc73xx-autonegotiation.patch +powerpc-mm-fix-boot-warning-with-hugepages-and-confi.patch +btrfs-update-target-inode-s-ctime-on-unlink.patch +input-ads7846-ratelimit-the-spi_sync-error-message.patch +input-synaptics-enable-smbus-for-hp-elitebook-840-g2.patch +scripts-kconfig-merge_config-config-files-add-a-trai.patch +drm-msm-adreno-fix-error-return-if-missing-firmware-.patch +input-i8042-add-fujitsu-lifebook-e756-to-i8042-quirk.patch +nfs-avoid-unnecessary-rescanning-of-the-per-server-d.patch diff --git a/queue-5.10/usb-dwc3-core-enable-guctl1-bit-10-for-fixing-termin.patch b/queue-5.10/usb-dwc3-core-enable-guctl1-bit-10-for-fixing-termin.patch new file mode 100644 index 00000000000..a0c7a8dc05b --- /dev/null +++ b/queue-5.10/usb-dwc3-core-enable-guctl1-bit-10-for-fixing-termin.patch @@ -0,0 +1,99 @@ +From 0ef511353b267df487379bff9672af3b932a55b7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Sep 2022 10:52:35 +0530 +Subject: usb: dwc3: core: Enable GUCTL1 bit 10 for fixing termination error + after resume bug + +From: Piyush Mehta + +[ Upstream commit 63d7f9810a38102cdb8cad214fac98682081e1a7 ] + +When configured in HOST mode, after issuing U3/L2 exit controller fails +to send proper CRC checksum in CRC5 field. Because of this behavior +Transaction Error is generated, resulting in reset and re-enumeration of +usb device attached. Enabling chicken bit 10 of GUCTL1 will correct this +problem. + +When this bit is set to '1', the UTMI/ULPI opmode will be changed to +"normal" along with HS terminations, term, and xcvr signals after EOR. +This option is to support certain legacy UTMI/ULPI PHYs. + +Added "snps,resume-hs-terminations" quirk to resolved the above issue. + +Signed-off-by: Piyush Mehta +Link: https://lore.kernel.org/r/20220920052235.194272-3-piyush.mehta@amd.com +Signed-off-by: Greg Kroah-Hartman +Stable-dep-of: 9149c9b0c7e0 ("usb: dwc3: core: update LC timer as per USB Spec V3.2") +Signed-off-by: Sasha Levin +--- + drivers/usb/dwc3/core.c | 17 +++++++++++++++++ + drivers/usb/dwc3/core.h | 4 ++++ + 2 files changed, 21 insertions(+) + +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c +index 3a88e4268590..82db59304492 100644 +--- a/drivers/usb/dwc3/core.c ++++ b/drivers/usb/dwc3/core.c +@@ -1054,6 +1054,21 @@ static int dwc3_core_init(struct dwc3 *dwc) + dwc3_writel(dwc->regs, DWC3_GUCTL2, reg); + } + ++ /* ++ * When configured in HOST mode, after issuing U3/L2 exit controller ++ * fails to send proper CRC checksum in CRC5 feild. Because of this ++ * behaviour Transaction Error is generated, resulting in reset and ++ * re-enumeration of usb device attached. All the termsel, xcvrsel, ++ * opmode becomes 0 during end of resume. Enabling bit 10 of GUCTL1 ++ * will correct this problem. This option is to support certain ++ * legacy ULPI PHYs. ++ */ ++ if (dwc->resume_hs_terminations) { ++ reg = dwc3_readl(dwc->regs, DWC3_GUCTL1); ++ reg |= DWC3_GUCTL1_RESUME_OPMODE_HS_HOST; ++ dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); ++ } ++ + if (!DWC3_VER_IS_PRIOR(DWC3, 250A)) { + reg = dwc3_readl(dwc->regs, DWC3_GUCTL1); + +@@ -1378,6 +1393,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) + "snps,dis-del-phy-power-chg-quirk"); + dwc->dis_tx_ipgap_linecheck_quirk = device_property_read_bool(dev, + "snps,dis-tx-ipgap-linecheck-quirk"); ++ dwc->resume_hs_terminations = device_property_read_bool(dev, ++ "snps,resume-hs-terminations"); + dwc->parkmode_disable_ss_quirk = device_property_read_bool(dev, + "snps,parkmode-disable-ss-quirk"); + +diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h +index 620c19deeee7..dbfb17ee4cca 100644 +--- a/drivers/usb/dwc3/core.h ++++ b/drivers/usb/dwc3/core.h +@@ -254,6 +254,7 @@ + #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28) + #define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) + #define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17) ++#define DWC3_GUCTL1_RESUME_OPMODE_HS_HOST BIT(10) + + /* Global Status Register */ + #define DWC3_GSTS_OTG_IP BIT(10) +@@ -1051,6 +1052,8 @@ struct dwc3_scratchpad_array { + * change quirk. + * @dis_tx_ipgap_linecheck_quirk: set if we disable u2mac linestate + * check during HS transmit. ++ * @resume-hs-terminations: Set if we enable quirk for fixing improper crc ++ * generation after resume from suspend. + * @parkmode_disable_ss_quirk: set if we need to disable all SuperSpeed + * instances in park mode. + * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk +@@ -1252,6 +1255,7 @@ struct dwc3 { + unsigned dis_u2_freeclk_exists_quirk:1; + unsigned dis_del_phy_power_chg_quirk:1; + unsigned dis_tx_ipgap_linecheck_quirk:1; ++ unsigned resume_hs_terminations:1; + unsigned parkmode_disable_ss_quirk:1; + + unsigned tx_de_emphasis_quirk:1; +-- +2.43.0 + diff --git a/queue-5.10/usb-dwc3-core-update-lc-timer-as-per-usb-spec-v3.2.patch b/queue-5.10/usb-dwc3-core-update-lc-timer-as-per-usb-spec-v3.2.patch new file mode 100644 index 00000000000..c9451cfa6d8 --- /dev/null +++ b/queue-5.10/usb-dwc3-core-update-lc-timer-as-per-usb-spec-v3.2.patch @@ -0,0 +1,77 @@ +From 30ba4ef1eaebdbf2a526f4ae143914c745e3f4b3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 29 Aug 2024 15:15:02 +0530 +Subject: usb: dwc3: core: update LC timer as per USB Spec V3.2 + +From: Faisal Hassan + +[ Upstream commit 9149c9b0c7e046273141e41eebd8a517416144ac ] + +This fix addresses STAR 9001285599, which only affects DWC_usb3 version +3.20a. The timer value for PM_LC_TIMER in DWC_usb3 3.20a for the Link +ECN changes is incorrect. If the PM TIMER ECN is enabled via GUCTL2[19], +the link compliance test (TD7.21) may fail. If the ECN is not enabled +(GUCTL2[19] = 0), the controller will use the old timer value (5us), +which is still acceptable for the link compliance test. Therefore, clear +GUCTL2[19] to pass the USB link compliance test: TD 7.21. + +Cc: stable@vger.kernel.org +Signed-off-by: Faisal Hassan +Acked-by: Thinh Nguyen +Link: https://lore.kernel.org/r/20240829094502.26502-1-quic_faisalh@quicinc.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/dwc3/core.c | 15 +++++++++++++++ + drivers/usb/dwc3/core.h | 2 ++ + 2 files changed, 17 insertions(+) + +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c +index 82db59304492..b0ce9c1ed450 100644 +--- a/drivers/usb/dwc3/core.c ++++ b/drivers/usb/dwc3/core.c +@@ -1054,6 +1054,21 @@ static int dwc3_core_init(struct dwc3 *dwc) + dwc3_writel(dwc->regs, DWC3_GUCTL2, reg); + } + ++ /* ++ * STAR 9001285599: This issue affects DWC_usb3 version 3.20a ++ * only. If the PM TIMER ECM is enabled through GUCTL2[19], the ++ * link compliance test (TD7.21) may fail. If the ECN is not ++ * enabled (GUCTL2[19] = 0), the controller will use the old timer ++ * value (5us), which is still acceptable for the link compliance ++ * test. Therefore, do not enable PM TIMER ECM in 3.20a by ++ * setting GUCTL2[19] by default; instead, use GUCTL2[19] = 0. ++ */ ++ if (DWC3_VER_IS(DWC3, 320A)) { ++ reg = dwc3_readl(dwc->regs, DWC3_GUCTL2); ++ reg &= ~DWC3_GUCTL2_LC_TIMER; ++ dwc3_writel(dwc->regs, DWC3_GUCTL2, reg); ++ } ++ + /* + * When configured in HOST mode, after issuing U3/L2 exit controller + * fails to send proper CRC checksum in CRC5 feild. Because of this +diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h +index dbfb17ee4cca..1765e58089fc 100644 +--- a/drivers/usb/dwc3/core.h ++++ b/drivers/usb/dwc3/core.h +@@ -381,6 +381,7 @@ + + /* Global User Control Register 2 */ + #define DWC3_GUCTL2_RST_ACTBITLATER BIT(14) ++#define DWC3_GUCTL2_LC_TIMER BIT(19) + + /* Global User Control Register 3 */ + #define DWC3_GUCTL3_SPLITDISABLE BIT(14) +@@ -1166,6 +1167,7 @@ struct dwc3 { + #define DWC3_REVISION_290A 0x5533290a + #define DWC3_REVISION_300A 0x5533300a + #define DWC3_REVISION_310A 0x5533310a ++#define DWC3_REVISION_320A 0x5533320a + #define DWC3_REVISION_330A 0x5533330a + + #define DWC31_REVISION_ANY 0x0 +-- +2.43.0 + diff --git a/queue-5.10/usb-dwc3-decouple-usb-2.0-l1-l2-events.patch b/queue-5.10/usb-dwc3-decouple-usb-2.0-l1-l2-events.patch new file mode 100644 index 00000000000..3d22c325cce --- /dev/null +++ b/queue-5.10/usb-dwc3-decouple-usb-2.0-l1-l2-events.patch @@ -0,0 +1,79 @@ +From 966c4a922aed674103fcc10bfdeef97ce186c796 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 12 Aug 2021 01:26:35 -0700 +Subject: usb: dwc3: Decouple USB 2.0 L1 & L2 events + +From: Jack Pham + +[ Upstream commit 843714bb37d9a3780160d7b4a4a72b8077a77589 ] + +On DWC_usb3 revisions 3.00a and newer (including DWC_usb31 and +DWC_usb32) the GUCTL1 register gained the DEV_DECOUPLE_L1L2_EVT +field (bit 31) which when enabled allows the controller in device +mode to treat USB 2.0 L1 LPM & L2 events separately. + +After commit d1d90dd27254 ("usb: dwc3: gadget: Enable suspend +events") the controller will now receive events (and therefore +interrupts) for every state change when entering/exiting either +L1 or L2 states. Since L1 is handled entirely by the hardware +and requires no software intervention, there is no need to even +enable these events and unnecessarily notify the gadget driver. +Enable the aforementioned bit to help reduce the overall interrupt +count for these L1 events that don't need to be handled while +retaining the events for full L2 suspend/wakeup. + +Tested-by: Jun Li +Tested-by: Amit Pundir # for RB5 (sm8250) +Tested-by: John Stultz # for HiKey960 & db845c +Reviewed-by: Jun Li +Acked-by: Felipe Balbi +Signed-off-by: Jack Pham +Link: https://lore.kernel.org/r/20210812082635.12924-1-jackp@codeaurora.org +Signed-off-by: Greg Kroah-Hartman +Stable-dep-of: 9149c9b0c7e0 ("usb: dwc3: core: update LC timer as per USB Spec V3.2") +Signed-off-by: Sasha Levin +--- + drivers/usb/dwc3/core.c | 9 +++++++++ + drivers/usb/dwc3/core.h | 5 +++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c +index ee7682faa6f3..3a88e4268590 100644 +--- a/drivers/usb/dwc3/core.c ++++ b/drivers/usb/dwc3/core.c +@@ -1064,6 +1064,15 @@ static int dwc3_core_init(struct dwc3 *dwc) + if (!DWC3_VER_IS_PRIOR(DWC3, 290A)) + reg |= DWC3_GUCTL1_DEV_L1_EXIT_BY_HW; + ++ /* ++ * Decouple USB 2.0 L1 & L2 events which will allow for ++ * gadget driver to only receive U3/L2 suspend & wakeup ++ * events and prevent the more frequent L1 LPM transitions ++ * from interrupting the driver. ++ */ ++ if (!DWC3_VER_IS_PRIOR(DWC3, 300A)) ++ reg |= DWC3_GUCTL1_DEV_DECOUPLE_L1L2_EVT; ++ + if (dwc->dis_tx_ipgap_linecheck_quirk) + reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS; + +diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h +index 1c8496fc732e..620c19deeee7 100644 +--- a/drivers/usb/dwc3/core.h ++++ b/drivers/usb/dwc3/core.h +@@ -250,9 +250,10 @@ + #define DWC3_GCTL_DSBLCLKGTNG BIT(0) + + /* Global User Control 1 Register */ +-#define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17) ++#define DWC3_GUCTL1_DEV_DECOUPLE_L1L2_EVT BIT(31) + #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28) +-#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) ++#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) ++#define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17) + + /* Global Status Register */ + #define DWC3_GSTS_OTG_IP BIT(10) +-- +2.43.0 + diff --git a/queue-5.10/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch b/queue-5.10/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch new file mode 100644 index 00000000000..fc24a4c6afd --- /dev/null +++ b/queue-5.10/usbnet-ipheth-fix-carrier-detection-in-modes-1-and-4.patch @@ -0,0 +1,80 @@ +From a50eee9f9a9ac817435f1025c8c6ac1a3fcf2465 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Aug 2024 19:28:09 +0200 +Subject: usbnet: ipheth: fix carrier detection in modes 1 and 4 + +From: Foster Snowhill + +[ Upstream commit 67927a1b255d883881be9467508e0af9a5e0be9d ] + +Apart from the standard "configurations", "interfaces" and "alternate +interface settings" in USB, iOS devices also have a notion of +"modes". In different modes, the device exposes a different set of +available configurations. + +Depending on the iOS version, and depending on the current mode, the +length and contents of the carrier state control message differs: + +* 1 byte (seen on iOS 4.2.1, 8.4): + * 03: carrier off (mode 0) + * 04: carrier on (mode 0) +* 3 bytes (seen on iOS 10.3.4, 15.7.6): + * 03 03 03: carrier off (mode 0) + * 04 04 03: carrier on (mode 0) +* 4 bytes (seen on iOS 16.5, 17.6): + * 03 03 03 00: carrier off (mode 0) + * 04 03 03 00: carrier off (mode 1) + * 06 03 03 00: carrier off (mode 4) + * 04 04 03 04: carrier on (mode 0 and 1) + * 06 04 03 04: carrier on (mode 4) + +Before this change, the driver always used the first byte of the +response to determine carrier state. + +From this larger sample, the first byte seems to indicate the number of +available USB configurations in the current mode (with the exception of +the default mode 0), and in some cases (namely mode 1 and 4) does not +correlate with the carrier state. + +Previous logic erroneously counted `04 03 03 00` as "carrier on" and +`06 04 03 04` as "carrier off" on iOS versions that support mode 1 and +mode 4 respectively. + +Only modes 0, 1 and 4 expose the USB Ethernet interfaces necessary for +the ipheth driver. + +Check the second byte of the control message where possible, and fall +back to checking the first byte on older iOS versions. + +Signed-off-by: Foster Snowhill +Tested-by: Georgi Valkov +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/usb/ipheth.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c +index 4485388dcff2..bb3d4c5dadfc 100644 +--- a/drivers/net/usb/ipheth.c ++++ b/drivers/net/usb/ipheth.c +@@ -253,13 +253,14 @@ static int ipheth_carrier_set(struct ipheth_device *dev) + 0x02, /* index */ + dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE, + IPHETH_CTRL_TIMEOUT); +- if (retval < 0) { ++ if (retval <= 0) { + dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n", + __func__, retval); + return retval; + } + +- if (dev->ctrl_buf[0] == IPHETH_CARRIER_ON) { ++ if ((retval == 1 && dev->ctrl_buf[0] == IPHETH_CARRIER_ON) || ++ (retval >= 2 && dev->ctrl_buf[1] == IPHETH_CARRIER_ON)) { + netif_carrier_on(dev->net); + if (dev->tx_urb->status != -EINPROGRESS) + netif_wake_queue(dev->net); +-- +2.43.0 + -- 2.47.3