Patch "Revert "usbnet: smsc95xx: Fix deadlock on runtime resume"" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Revert "usbnet: smsc95xx: Fix deadlock on runtime resume"

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     revert-usbnet-smsc95xx-fix-deadlock-on-runtime-resume.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Mon Aug 29 10:10:59 AM CEST 2022
From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Aug 2022 10:06:53 +0200
Subject: Revert "usbnet: smsc95xx: Fix deadlock on runtime resume"

From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

This reverts commit b574d1e3e9a2432b5acd9c4a9dc8d70b6a37aaf1 which is
commit 7b960c967f2aa01ab8f45c5a0bd78e754cffdeee upstream.

It is reported to cause problems, so drop it from the 5.15.y tree until
the root cause can be determined.

Reported-by: Lukas Wunner <lukas@xxxxxxxxx>
Cc: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Cc: Ferry Toth <fntoth@xxxxxxxxx>
Cc: Andrew Lunn <andrew@xxxxxxx>
Cc: Andre Edich <andre.edich@xxxxxxxxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
Cc: Sasha Levin <sashal@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20220826132137.GA24932@xxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/net/usb/smsc95xx.c |   26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)

--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -69,7 +69,6 @@ struct smsc95xx_priv {
 	struct fwnode_handle *irqfwnode;
 	struct mii_bus *mdiobus;
 	struct phy_device *phydev;
-	struct task_struct *pm_task;
 };
 
 static bool turbo_mode = true;
@@ -79,14 +78,13 @@ MODULE_PARM_DESC(turbo_mode, "Enable mul
 static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
 					    u32 *data, int in_pm)
 {
-	struct smsc95xx_priv *pdata = dev->driver_priv;
 	u32 buf;
 	int ret;
 	int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
 
 	BUG_ON(!dev);
 
-	if (current != pdata->pm_task)
+	if (!in_pm)
 		fn = usbnet_read_cmd;
 	else
 		fn = usbnet_read_cmd_nopm;
@@ -110,14 +108,13 @@ static int __must_check __smsc95xx_read_
 static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index,
 					     u32 data, int in_pm)
 {
-	struct smsc95xx_priv *pdata = dev->driver_priv;
 	u32 buf;
 	int ret;
 	int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
 
 	BUG_ON(!dev);
 
-	if (current != pdata->pm_task)
+	if (!in_pm)
 		fn = usbnet_write_cmd;
 	else
 		fn = usbnet_write_cmd_nopm;
@@ -1485,12 +1482,9 @@ static int smsc95xx_suspend(struct usb_i
 	u32 val, link_up;
 	int ret;
 
-	pdata->pm_task = current;
-
 	ret = usbnet_suspend(intf, message);
 	if (ret < 0) {
 		netdev_warn(dev->net, "usbnet_suspend error\n");
-		pdata->pm_task = NULL;
 		return ret;
 	}
 
@@ -1730,7 +1724,6 @@ done:
 	if (ret && PMSG_IS_AUTO(message))
 		usbnet_resume(intf);
 
-	pdata->pm_task = NULL;
 	return ret;
 }
 
@@ -1751,31 +1744,29 @@ static int smsc95xx_resume(struct usb_in
 	/* do this first to ensure it's cleared even in error case */
 	pdata->suspend_flags = 0;
 
-	pdata->pm_task = current;
-
 	if (suspend_flags & SUSPEND_ALLMODES) {
 		/* clear wake-up sources */
 		ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
 		if (ret < 0)
-			goto done;
+			return ret;
 
 		val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_);
 
 		ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
 		if (ret < 0)
-			goto done;
+			return ret;
 
 		/* clear wake-up status */
 		ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
 		if (ret < 0)
-			goto done;
+			return ret;
 
 		val &= ~PM_CTL_WOL_EN_;
 		val |= PM_CTL_WUPS_;
 
 		ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
 		if (ret < 0)
-			goto done;
+			return ret;
 	}
 
 	phy_init_hw(pdata->phydev);
@@ -1784,20 +1775,15 @@ static int smsc95xx_resume(struct usb_in
 	if (ret < 0)
 		netdev_warn(dev->net, "usbnet_resume error\n");
 
-done:
-	pdata->pm_task = NULL;
 	return ret;
 }
 
 static int smsc95xx_reset_resume(struct usb_interface *intf)
 {
 	struct usbnet *dev = usb_get_intfdata(intf);
-	struct smsc95xx_priv *pdata = dev->driver_priv;
 	int ret;
 
-	pdata->pm_task = current;
 	ret = smsc95xx_reset(dev);
-	pdata->pm_task = NULL;
 	if (ret < 0)
 		return ret;
 


Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are

queue-5.15/btrfs-replace-btrfs_max_extent_size-with-fs_info-max_extent_size.patch
queue-5.15/block-add-bdev_max_segments-helper.patch
queue-5.15/block-add-a-bdev_max_zone_append_sectors-helper.patch
queue-5.15/cgroup-fix-race-condition-at-rebind_subsystems.patch
queue-5.15/xen-privcmd-fix-error-exit-of-privcmd_ioctl_dm_op.patch
queue-5.15/kernel-sys_ni-add-compat-entry-for-fadvise64_64.patch
queue-5.15/asm-generic-sections-refactor-memory_intersects.patch
queue-5.15/audit-fix-potential-double-free-on-error-path-from-fsnotify_add_inode_mark.patch
queue-5.15/x86-entry-move-cld-to-the-start-of-the-idtentry-macro.patch
queue-5.15/btrfs-replace-drop-assert-for-suspended-replace.patch
queue-5.15/parisc-fix-exception-handler-for-fldw-and-fstw-instructions.patch
queue-5.15/btrfs-fix-possible-memory-leak-in-btrfs_get_dev_args_from_path.patch
queue-5.15/revert-memcg-cleanup-racy-sum-avoidance-code.patch
queue-5.15/revert-usbnet-smsc95xx-forward-phy-interrupts-to-phy-driver-to-avoid-polling.patch
queue-5.15/x86-nospec-unwreck-the-rsb-stuffing.patch
queue-5.15/drivers-base-fix-userspace-break-from-using-bin_attr.patch
queue-5.15/btrfs-add-info-when-mount-fails-due-to-stale-replace-target.patch
queue-5.15/nouveau-explicitly-wait-on-the-fence-in-nouveau_bo_move_m2mf.patch
queue-5.15/s390-fix-double-free-of-gs-and-ri-cbs-on-fork-failure.patch
queue-5.15/x86-unwind-orc-unwind-ftrace-trampolines-with-correct-orc-entry.patch
queue-5.15/eth-sun-cassini-remove-dead-code.patch
queue-5.15/s390-mm-do-not-trigger-write-fault-when-vma-does-not-allow-vm_write.patch
queue-5.15/acpi-processor-remove-freq-qos-request-for-all-cpus.patch
queue-5.15/btrfs-fix-silent-failure-when-deleting-root-reference.patch
queue-5.15/mm-damon-dbgfs-avoid-duplicate-context-directory-creation.patch
queue-5.15/btrfs-check-if-root-is-readonly-while-setting-security-xattr.patch
queue-5.15/smb3-missing-inode-locks-in-punch-hole.patch
queue-5.15/revert-usbnet-smsc95xx-fix-deadlock-on-runtime-resume.patch
queue-5.15/writeback-avoid-use-after-free-after-removing-device.patch
queue-5.15/riscv-traps-add-missing-prototype.patch
queue-5.15/perf-x86-lbr-enable-the-branch-type-for-the-arch-lbr-by-default.patch
queue-5.15/loop-check-for-overflow-while-configuring-loop.patch
queue-5.15/io_uring-fix-issue-with-io_write-not-always-undoing-sb_start_write.patch
queue-5.15/bootmem-remove-the-vmemmap-pages-from-kmemleak-in-put_page_bootmem.patch
queue-5.15/fbdev-fbcon-properly-revert-changes-when-vc_resize-failed.patch
queue-5.15/btrfs-convert-count_max_extents-to-use-fs_info-max_extent_size.patch
queue-5.15/btrfs-zoned-revive-max_zone_append_bytes.patch
queue-5.15/wifi-rtlwifi-remove-always-true-condition-pointed-out-by-gcc-12.patch
queue-5.15/x86-bugs-add-unknown-reporting-for-mmio-stale-data.patch
queue-5.15/parisc-make-config_64bit-available-for-arch-parisc64-only.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux