linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 65/80] thunderbolt: Remove redundant pm_runtime_mark_last_busy() calls
       [not found] <20250704075225.3212486-1-sakari.ailus@linux.intel.com>
@ 2025-07-04  7:54 ` Sakari Ailus
  2025-07-04  7:54 ` [PATCH 67/80] usb: " Sakari Ailus
  1 sibling, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2025-07-04  7:54 UTC (permalink / raw)
  To: Andreas Noever, Michael Jamet, Mika Westerberg, Yehezkel Bernat
  Cc: linux-usb, linux-kernel

pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
The cover letter of the set can be found here
<URL:https://lore.kernel.org/linux-pm/20250704075225.3212486-1-sakari.ailus@linux.intel.com>.

In brief, this patch depends on PM runtime patches adding marking the last
busy timestamp in autosuspend related functions. The patches are here, on
rc2:

        git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
                pm-runtime-6.17-rc1

 drivers/thunderbolt/debugfs.c   | 11 -----------
 drivers/thunderbolt/domain.c    |  2 --
 drivers/thunderbolt/icm.c       |  7 -------
 drivers/thunderbolt/retimer.c   |  2 --
 drivers/thunderbolt/switch.c    |  4 ----
 drivers/thunderbolt/tb.c        |  9 ---------
 drivers/thunderbolt/usb4_port.c |  2 --
 7 files changed, 37 deletions(-)

diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c
index f8328ca7e22e..d0e91c93916d 100644
--- a/drivers/thunderbolt/debugfs.c
+++ b/drivers/thunderbolt/debugfs.c
@@ -262,7 +262,6 @@ static ssize_t regs_write(struct tb_switch *sw, struct tb_port *port,
 	mutex_unlock(&tb->lock);
 
 out:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 	free_page((unsigned long)buf);
 
@@ -403,7 +402,6 @@ static ssize_t port_sb_regs_write(struct file *file, const char __user *user_buf
 
 	mutex_unlock(&tb->lock);
 out:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 	free_page((unsigned long)buf);
 
@@ -436,7 +434,6 @@ static ssize_t retimer_sb_regs_write(struct file *file,
 
 	mutex_unlock(&tb->lock);
 out:
-	pm_runtime_mark_last_busy(&rt->dev);
 	pm_runtime_put_autosuspend(&rt->dev);
 	free_page((unsigned long)buf);
 
@@ -1304,7 +1301,6 @@ static int margining_run_write(void *data, u64 val)
 out_unlock:
 	mutex_unlock(&tb->lock);
 out_rpm_put:
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 
 	return ret;
@@ -1923,7 +1919,6 @@ static ssize_t counters_write(struct file *file, const char __user *user_buf,
 	mutex_unlock(&tb->lock);
 
 out:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 	free_page((unsigned long)buf);
 
@@ -2118,7 +2113,6 @@ static int port_regs_show(struct seq_file *s, void *not_used)
 out_unlock:
 	mutex_unlock(&tb->lock);
 out_rpm_put:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
@@ -2222,7 +2216,6 @@ static int switch_regs_show(struct seq_file *s, void *not_used)
 out_unlock:
 	mutex_unlock(&tb->lock);
 out_rpm_put:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
@@ -2283,7 +2276,6 @@ static int path_show(struct seq_file *s, void *not_used)
 out_unlock:
 	mutex_unlock(&tb->lock);
 out_rpm_put:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
@@ -2337,7 +2329,6 @@ static int counters_show(struct seq_file *s, void *not_used)
 	mutex_unlock(&tb->lock);
 
 out:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
@@ -2391,7 +2382,6 @@ static int port_sb_regs_show(struct seq_file *s, void *not_used)
 
 	mutex_unlock(&tb->lock);
 out_rpm_put:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
@@ -2506,7 +2496,6 @@ static int retimer_sb_regs_show(struct seq_file *s, void *not_used)
 
 	mutex_unlock(&tb->lock);
 out_rpm_put:
-	pm_runtime_mark_last_busy(&rt->dev);
 	pm_runtime_put_autosuspend(&rt->dev);
 
 	return ret;
diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c
index a3a7c8059eee..15d7c8881be1 100644
--- a/drivers/thunderbolt/domain.c
+++ b/drivers/thunderbolt/domain.c
@@ -150,7 +150,6 @@ static ssize_t boot_acl_show(struct device *dev, struct device_attribute *attr,
 	}
 
 out:
-	pm_runtime_mark_last_busy(&tb->dev);
 	pm_runtime_put_autosuspend(&tb->dev);
 	kfree(uuids);
 
@@ -222,7 +221,6 @@ static ssize_t boot_acl_store(struct device *dev, struct device_attribute *attr,
 	mutex_unlock(&tb->lock);
 
 err_rpm_put:
-	pm_runtime_mark_last_busy(&tb->dev);
 	pm_runtime_put_autosuspend(&tb->dev);
 err_free_acl:
 	kfree(acl);
diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c
index f213d9174dc5..ed8c9d8b1e36 100644
--- a/drivers/thunderbolt/icm.c
+++ b/drivers/thunderbolt/icm.c
@@ -367,7 +367,6 @@ static void icm_veto_end(struct tb *tb)
 	if (icm->veto) {
 		icm->veto = false;
 		/* Allow the domain suspend now */
-		pm_runtime_mark_last_busy(&tb->dev);
 		pm_runtime_put_autosuspend(&tb->dev);
 	}
 }
@@ -721,7 +720,6 @@ static void add_xdomain(struct tb_switch *sw, u64 route,
 	tb_xdomain_add(xd);
 
 out:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 }
 
@@ -883,7 +881,6 @@ icm_fr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr)
 			tb_switch_put(sw);
 	}
 
-	pm_runtime_mark_last_busy(&parent_sw->dev);
 	pm_runtime_put_autosuspend(&parent_sw->dev);
 
 	tb_switch_put(parent_sw);
@@ -917,7 +914,6 @@ icm_fr_device_disconnected(struct tb *tb, const struct icm_pkg_header *hdr)
 
 	remove_switch(sw);
 
-	pm_runtime_mark_last_busy(sw->dev.parent);
 	pm_runtime_put_autosuspend(sw->dev.parent);
 
 	tb_switch_put(sw);
@@ -1315,7 +1311,6 @@ __icm_tr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr,
 			tb_switch_put(sw);
 	}
 
-	pm_runtime_mark_last_busy(&parent_sw->dev);
 	pm_runtime_put_autosuspend(&parent_sw->dev);
 
 	tb_switch_put(parent_sw);
@@ -1346,7 +1341,6 @@ icm_tr_device_disconnected(struct tb *tb, const struct icm_pkg_header *hdr)
 
 	remove_switch(sw);
 
-	pm_runtime_mark_last_busy(sw->dev.parent);
 	pm_runtime_put_autosuspend(sw->dev.parent);
 
 	tb_switch_put(sw);
@@ -2078,7 +2072,6 @@ static void remove_unplugged_switch(struct tb_switch *sw)
 	bus_for_each_dev(&tb_bus_type, &sw->dev, NULL, complete_rpm);
 	tb_switch_remove(sw);
 
-	pm_runtime_mark_last_busy(parent);
 	pm_runtime_put_autosuspend(parent);
 
 	put_device(parent);
diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c
index 361fece3d818..fa861567d246 100644
--- a/drivers/thunderbolt/retimer.c
+++ b/drivers/thunderbolt/retimer.c
@@ -53,7 +53,6 @@ static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes)
 	mutex_unlock(&rt->tb->lock);
 
 out:
-	pm_runtime_mark_last_busy(&rt->dev);
 	pm_runtime_put_autosuspend(&rt->dev);
 
 	return ret;
@@ -304,7 +303,6 @@ static ssize_t nvm_authenticate_store(struct device *dev,
 		tb_retimer_unset_inbound_sbtx(rt->port);
 	mutex_unlock(&rt->tb->lock);
 exit_rpm:
-	pm_runtime_mark_last_busy(&rt->dev);
 	pm_runtime_put_autosuspend(&rt->dev);
 
 	if (ret)
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index e9f4186f20f4..44e821444412 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -318,7 +318,6 @@ static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes)
 	mutex_unlock(&sw->tb->lock);
 
 out:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
@@ -1846,7 +1845,6 @@ static ssize_t authorized_store(struct device *dev,
 
 	pm_runtime_get_sync(&sw->dev);
 	ret = tb_switch_set_authorized(sw, val);
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret ? ret : count;
@@ -2078,7 +2076,6 @@ static ssize_t nvm_authenticate_sysfs(struct device *dev, const char *buf,
 exit_unlock:
 	mutex_unlock(&sw->tb->lock);
 exit_rpm:
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
@@ -3351,7 +3348,6 @@ int tb_switch_add(struct tb_switch *sw)
 	if (sw->rpm) {
 		pm_runtime_set_autosuspend_delay(&sw->dev, TB_AUTOSUSPEND_DELAY);
 		pm_runtime_use_autosuspend(&sw->dev);
-		pm_runtime_mark_last_busy(&sw->dev);
 		pm_runtime_enable(&sw->dev);
 		pm_request_autosuspend(&sw->dev);
 	}
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index c14ab1fbeeaf..bd8bfd774345 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -1271,7 +1271,6 @@ static void tb_scan_switch(struct tb_switch *sw)
 	tb_switch_for_each_port(sw, port)
 		tb_scan_port(port);
 
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 }
 
@@ -1415,7 +1414,6 @@ static void tb_scan_port(struct tb_port *port)
 
 out_rpm_put:
 	if (port->usb4) {
-		pm_runtime_mark_last_busy(&port->usb4->dev);
 		pm_runtime_put_autosuspend(&port->usb4->dev);
 	}
 }
@@ -1740,9 +1738,7 @@ static void tb_deactivate_and_free_tunnel(struct tb_tunnel *tunnel)
 		 */
 		tb_configure_sym(tb, src_port, dst_port, true);
 		/* Now we can allow the domain to runtime suspend again */
-		pm_runtime_mark_last_busy(&dst_port->sw->dev);
 		pm_runtime_put_autosuspend(&dst_port->sw->dev);
-		pm_runtime_mark_last_busy(&src_port->sw->dev);
 		pm_runtime_put_autosuspend(&src_port->sw->dev);
 		fallthrough;
 
@@ -2046,9 +2042,7 @@ static void tb_tunnel_one_dp(struct tb *tb, struct tb_port *in,
 err_dealloc_dp:
 	tb_switch_dealloc_dp_resource(in->sw, in);
 err_rpm_put:
-	pm_runtime_mark_last_busy(&out->sw->dev);
 	pm_runtime_put_autosuspend(&out->sw->dev);
-	pm_runtime_mark_last_busy(&in->sw->dev);
 	pm_runtime_put_autosuspend(&in->sw->dev);
 }
 
@@ -2508,7 +2502,6 @@ static void tb_handle_hotplug(struct work_struct *work)
 		}
 	}
 
-	pm_runtime_mark_last_busy(&sw->dev);
 	pm_runtime_put_autosuspend(&sw->dev);
 
 put_sw:
@@ -2516,7 +2509,6 @@ static void tb_handle_hotplug(struct work_struct *work)
 out:
 	mutex_unlock(&tb->lock);
 
-	pm_runtime_mark_last_busy(&tb->dev);
 	pm_runtime_put_autosuspend(&tb->dev);
 
 	kfree(ev);
@@ -2843,7 +2835,6 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
 unlock:
 	mutex_unlock(&tb->lock);
 
-	pm_runtime_mark_last_busy(&tb->dev);
 	pm_runtime_put_autosuspend(&tb->dev);
 
 	kfree(ev);
diff --git a/drivers/thunderbolt/usb4_port.c b/drivers/thunderbolt/usb4_port.c
index 852a45fcd19d..4739e92bb46f 100644
--- a/drivers/thunderbolt/usb4_port.c
+++ b/drivers/thunderbolt/usb4_port.c
@@ -200,7 +200,6 @@ static ssize_t offline_store(struct device *dev,
 out_unlock:
 	mutex_unlock(&tb->lock);
 out_rpm:
-	pm_runtime_mark_last_busy(&usb4->dev);
 	pm_runtime_put_autosuspend(&usb4->dev);
 
 	return ret ? ret : count;
@@ -242,7 +241,6 @@ static ssize_t rescan_store(struct device *dev,
 out_unlock:
 	mutex_unlock(&tb->lock);
 out_rpm:
-	pm_runtime_mark_last_busy(&usb4->dev);
 	pm_runtime_put_autosuspend(&usb4->dev);
 
 	return ret ? ret : count;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 67/80] usb: Remove redundant pm_runtime_mark_last_busy() calls
       [not found] <20250704075225.3212486-1-sakari.ailus@linux.intel.com>
  2025-07-04  7:54 ` [PATCH 65/80] thunderbolt: Remove redundant pm_runtime_mark_last_busy() calls Sakari Ailus
@ 2025-07-04  7:54 ` Sakari Ailus
  2025-07-04  9:11   ` Thierry Reding
                     ` (2 more replies)
  1 sibling, 3 replies; 5+ messages in thread
From: Sakari Ailus @ 2025-07-04  7:54 UTC (permalink / raw)
  To: Peter Chen, Pawel Laszczak, Roger Quadros, Greg Kroah-Hartman,
	Thinh Nguyen, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Michal Simek, Chunfeng Yun, Mathias Nyman,
	Matthias Brugger, AngeloGioacchino Del Regno, Thierry Reding,
	Jonathan Hunter, Bastien Nocera, Bin Liu
  Cc: linux-usb, linux-kernel, imx, linux-arm-kernel, linux-mediatek,
	linux-tegra, linux-omap

pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
pm_runtime_mark_last_busy().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
The cover letter of the set can be found here
<URL:https://lore.kernel.org/linux-pm/20250704075225.3212486-1-sakari.ailus@linux.intel.com>.

In brief, this patch depends on PM runtime patches adding marking the last
busy timestamp in autosuspend related functions. The patches are here, on
rc2:

        git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
                pm-runtime-6.17-rc1

 drivers/usb/cdns3/cdns3-gadget.c            | 1 -
 drivers/usb/cdns3/cdnsp-gadget.c            | 1 -
 drivers/usb/chipidea/core.c                 | 1 -
 drivers/usb/chipidea/otg_fsm.c              | 1 -
 drivers/usb/dwc3/core.c                     | 2 --
 drivers/usb/dwc3/dwc3-am62.c                | 1 -
 drivers/usb/dwc3/dwc3-imx8mp.c              | 1 -
 drivers/usb/dwc3/dwc3-pci.c                 | 1 -
 drivers/usb/dwc3/dwc3-xilinx.c              | 1 -
 drivers/usb/gadget/udc/cdns2/cdns2-gadget.c | 1 -
 drivers/usb/host/xhci-mtk.c                 | 1 -
 drivers/usb/host/xhci-tegra.c               | 1 -
 drivers/usb/misc/apple-mfi-fastcharge.c     | 1 -
 drivers/usb/mtu3/mtu3_plat.c                | 1 -
 drivers/usb/musb/musb_core.c                | 5 -----
 drivers/usb/musb/musb_debugfs.c             | 5 -----
 drivers/usb/musb/musb_dsps.c                | 1 -
 drivers/usb/musb/musb_gadget.c              | 4 ----
 drivers/usb/musb/omap2430.c                 | 1 -
 19 files changed, 31 deletions(-)

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index d9d8dc05b235..168707213ed9 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -3251,7 +3251,6 @@ static void cdns3_gadget_exit(struct cdns *cdns)
 	priv_dev = cdns->gadget_dev;
 
 
-	pm_runtime_mark_last_busy(cdns->dev);
 	pm_runtime_put_autosuspend(cdns->dev);
 
 	usb_del_gadget(&priv_dev->gadget);
diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
index 55f95f41b3b4..2ffe24a6e477 100644
--- a/drivers/usb/cdns3/cdnsp-gadget.c
+++ b/drivers/usb/cdns3/cdnsp-gadget.c
@@ -1996,7 +1996,6 @@ static void cdnsp_gadget_exit(struct cdns *cdns)
 	struct cdnsp_device *pdev = cdns->gadget_dev;
 
 	devm_free_irq(pdev->dev, cdns->dev_irq, pdev);
-	pm_runtime_mark_last_busy(cdns->dev);
 	pm_runtime_put_autosuspend(cdns->dev);
 	usb_del_gadget_udc(&pdev->gadget);
 	cdnsp_gadget_free_endpoints(pdev);
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 694b4a8e4e1d..a6ce73dcc871 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -1372,7 +1372,6 @@ static int ci_controller_resume(struct device *dev)
 	ci->in_lpm = false;
 	if (ci->wakeup_int) {
 		ci->wakeup_int = false;
-		pm_runtime_mark_last_busy(ci->dev);
 		pm_runtime_put_autosuspend(ci->dev);
 		enable_irq(ci->irq);
 		if (ci_otg_is_fsm_mode(ci))
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index a093544482d5..929536dc96ec 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -629,7 +629,6 @@ int ci_otg_fsm_work(struct ci_hdrc *ci)
 				ci_otg_queue_work(ci);
 			}
 		} else if (ci->fsm.otg->state == OTG_STATE_A_HOST) {
-			pm_runtime_mark_last_busy(ci->dev);
 			pm_runtime_put_autosuspend(ci->dev);
 			return 0;
 		}
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 8002c23a5a02..77b309ebd704 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -279,7 +279,6 @@ static void __dwc3_set_mode(struct work_struct *work)
 	}
 
 out:
-	pm_runtime_mark_last_busy(dwc->dev);
 	pm_runtime_put_autosuspend(dwc->dev);
 	mutex_unlock(&dwc->mutex);
 }
@@ -2642,7 +2641,6 @@ int dwc3_runtime_idle(struct dwc3 *dwc)
 		break;
 	}
 
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_autosuspend(dev);
 
 	return 0;
diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index 9db8f3ca493d..e11d7643f966 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -292,7 +292,6 @@ static int dwc3_ti_probe(struct platform_device *pdev)
 	/* Setting up autosuspend */
 	pm_runtime_set_autosuspend_delay(dev, DWC3_AM62_AUTOSUSPEND_DELAY);
 	pm_runtime_use_autosuspend(dev);
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 	return 0;
 
diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
index 3edc5aca76f9..37700d95bc09 100644
--- a/drivers/usb/dwc3/dwc3-imx8mp.c
+++ b/drivers/usb/dwc3/dwc3-imx8mp.c
@@ -307,7 +307,6 @@ static int dwc3_imx8mp_resume(struct dwc3_imx8mp *dwc3_imx, pm_message_t msg)
 	if (dwc3_imx->wakeup_pending) {
 		dwc3_imx->wakeup_pending = false;
 		if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_DEVICE) {
-			pm_runtime_mark_last_busy(dwc->dev);
 			pm_runtime_put_autosuspend(dwc->dev);
 		} else {
 			/*
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 54a4ee2b90b7..07dfa0b5d184 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -321,7 +321,6 @@ static void dwc3_pci_resume_work(struct work_struct *work)
 		return;
 	}
 
-	pm_runtime_mark_last_busy(&dwc3->dev);
 	pm_runtime_put_sync_autosuspend(&dwc3->dev);
 }
 #endif
diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index 1e28d6f50ed0..0a8c47876ff9 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -383,7 +383,6 @@ static int __maybe_unused dwc3_xlnx_runtime_resume(struct device *dev)
 
 static int __maybe_unused dwc3_xlnx_runtime_idle(struct device *dev)
 {
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_autosuspend(dev);
 
 	return 0;
diff --git a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
index 7e69944ef18a..9b53daf76583 100644
--- a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
+++ b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
@@ -2415,7 +2415,6 @@ int cdns2_gadget_resume(struct cdns2_device *pdev, bool hibernated)
 
 void cdns2_gadget_remove(struct cdns2_device *pdev)
 {
-	pm_runtime_mark_last_busy(pdev->dev);
 	pm_runtime_put_autosuspend(pdev->dev);
 
 	usb_del_gadget(&pdev->gadget);
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 208558cf822d..06043c7c3100 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -670,7 +670,6 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 	}
 
 	device_enable_async_suspend(dev);
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 	pm_runtime_forbid(dev);
 
diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index 0c7af44d4dae..554b03e3ae92 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -1394,7 +1394,6 @@ static void tegra_xhci_id_work(struct work_struct *work)
 		}
 
 		tegra_xhci_set_port_power(tegra, true, true);
-		pm_runtime_mark_last_busy(tegra->dev);
 
 	} else {
 		if (tegra->otg_usb3_port >= 0)
diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/apple-mfi-fastcharge.c
index 8e852f4b8262..47b38dcc2992 100644
--- a/drivers/usb/misc/apple-mfi-fastcharge.c
+++ b/drivers/usb/misc/apple-mfi-fastcharge.c
@@ -134,7 +134,6 @@ static int apple_mfi_fc_set_property(struct power_supply *psy,
 		ret = -EINVAL;
 	}
 
-	pm_runtime_mark_last_busy(&mfi->udev->dev);
 	pm_runtime_put_autosuspend(&mfi->udev->dev);
 
 	return ret;
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index 7b5a431acb56..cc8a864dbd63 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -431,7 +431,6 @@ static int mtu3_probe(struct platform_device *pdev)
 	}
 
 	device_enable_async_suspend(dev);
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 	pm_runtime_forbid(dev);
 
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index c7234b236971..0acc62569ae5 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2031,7 +2031,6 @@ static void musb_pm_runtime_check_session(struct musb *musb)
 		if (!musb->session)
 			break;
 		trace_musb_state(musb, devctl, "Allow PM on possible host mode disconnect");
-		pm_runtime_mark_last_busy(musb->controller);
 		pm_runtime_put_autosuspend(musb->controller);
 		musb->session = false;
 		return;
@@ -2063,7 +2062,6 @@ static void musb_pm_runtime_check_session(struct musb *musb)
 					      msecs_to_jiffies(3000));
 	} else {
 		trace_musb_state(musb, devctl, "Allow PM with no session");
-		pm_runtime_mark_last_busy(musb->controller);
 		pm_runtime_put_autosuspend(musb->controller);
 	}
 
@@ -2090,7 +2088,6 @@ static void musb_irq_work(struct work_struct *data)
 		sysfs_notify(&musb->controller->kobj, NULL, "mode");
 	}
 
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 }
 
@@ -2564,7 +2561,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
 	musb_init_debugfs(musb);
 
 	musb->is_initialized = 1;
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 
 	return 0;
@@ -2887,7 +2883,6 @@ static int musb_resume(struct device *dev)
 			error);
 	spin_unlock_irqrestore(&musb->lock, flags);
 
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 
 	return 0;
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 2d623284edf6..5092d62c2062 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -106,7 +106,6 @@ static int musb_regdump_show(struct seq_file *s, void *unused)
 		}
 	}
 
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 	return 0;
 }
@@ -119,7 +118,6 @@ static int musb_test_mode_show(struct seq_file *s, void *unused)
 
 	pm_runtime_get_sync(musb->controller);
 	test = musb_readb(musb->mregs, MUSB_TESTMODE);
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 
 	if (test == (MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_FS))
@@ -216,7 +214,6 @@ static ssize_t musb_test_mode_write(struct file *file,
 	musb_writeb(musb->mregs, MUSB_TESTMODE, test);
 
 ret:
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 	return count;
 }
@@ -243,7 +240,6 @@ static int musb_softconnect_show(struct seq_file *s, void *unused)
 		reg = musb_readb(musb->mregs, MUSB_DEVCTL);
 		connect = reg & MUSB_DEVCTL_SESSION ? 1 : 0;
 
-		pm_runtime_mark_last_busy(musb->controller);
 		pm_runtime_put_autosuspend(musb->controller);
 		break;
 	default:
@@ -304,7 +300,6 @@ static ssize_t musb_softconnect_write(struct file *file,
 		}
 	}
 
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 	return count;
 }
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 12f587ab8511..9f93ed59a7e6 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -296,7 +296,6 @@ static void otg_timer(struct timer_list *t)
 	if (err < 0)
 		dev_err(dev, "%s resume work: %i\n", __func__, err);
 	spin_unlock_irqrestore(&musb->lock, flags);
-	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 }
 
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 6869c58367f2..f6ea91df80e4 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1258,7 +1258,6 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
 
 unlock:
 	spin_unlock_irqrestore(&musb->lock, lockflags);
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 
 	return status;
@@ -1642,7 +1641,6 @@ static void musb_gadget_work(struct work_struct *work)
 	spin_lock_irqsave(&musb->lock, flags);
 	musb_pullup(musb, musb->softconnect);
 	spin_unlock_irqrestore(&musb->lock, flags);
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 }
 
@@ -1862,7 +1860,6 @@ static int musb_gadget_start(struct usb_gadget *g,
 	if (musb->xceiv && musb->xceiv->last_event == USB_EVENT_ID)
 		musb_platform_set_vbus(musb, 1);
 
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 
 	return 0;
@@ -1915,7 +1912,6 @@ static int musb_gadget_stop(struct usb_gadget *g)
 	 */
 
 	/* Force check of devctl register for PM runtime */
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 
 	return 0;
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 2970967a4fd2..191901317d7f 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -151,7 +151,6 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
 	default:
 		dev_dbg(musb->controller, "ID float\n");
 	}
-	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);
 	atomic_notifier_call_chain(&musb->xceiv->notifier,
 			musb->xceiv->last_event, NULL);
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 67/80] usb: Remove redundant pm_runtime_mark_last_busy() calls
  2025-07-04  7:54 ` [PATCH 67/80] usb: " Sakari Ailus
@ 2025-07-04  9:11   ` Thierry Reding
  2025-07-07  9:35   ` AngeloGioacchino Del Regno
  2025-07-21  2:25   ` Peter Chen (CIX)
  2 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2025-07-04  9:11 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Peter Chen, Pawel Laszczak, Roger Quadros, Greg Kroah-Hartman,
	Thinh Nguyen, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Michal Simek, Chunfeng Yun, Mathias Nyman,
	Matthias Brugger, AngeloGioacchino Del Regno, Jonathan Hunter,
	Bastien Nocera, Bin Liu, linux-usb, linux-kernel, imx,
	linux-arm-kernel, linux-mediatek, linux-tegra, linux-omap

[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

On Fri, Jul 04, 2025 at 10:54:53AM +0300, Sakari Ailus wrote:
> pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> pm_runtime_mark_last_busy().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
[...]
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 0c7af44d4dae..554b03e3ae92 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -1394,7 +1394,6 @@ static void tegra_xhci_id_work(struct work_struct *work)
>  		}
>  
>  		tegra_xhci_set_port_power(tegra, true, true);
> -		pm_runtime_mark_last_busy(tegra->dev);
>  
>  	} else {
>  		if (tegra->otg_usb3_port >= 0)

pm_runtime_mark_last_busy() was previously called conditionally only for
host mode, but not for peripheral mode. That said, since that call was
now moved into the pm_runtime_put_autosuspend(), any issues would
already have been introduced by the series that this depends on, so
we'll see if there's any fallout.

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 67/80] usb: Remove redundant pm_runtime_mark_last_busy() calls
  2025-07-04  7:54 ` [PATCH 67/80] usb: " Sakari Ailus
  2025-07-04  9:11   ` Thierry Reding
@ 2025-07-07  9:35   ` AngeloGioacchino Del Regno
  2025-07-21  2:25   ` Peter Chen (CIX)
  2 siblings, 0 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-07-07  9:35 UTC (permalink / raw)
  To: Sakari Ailus, Peter Chen, Pawel Laszczak, Roger Quadros,
	Greg Kroah-Hartman, Thinh Nguyen, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Michal Simek,
	Chunfeng Yun, Mathias Nyman, Matthias Brugger, Thierry Reding,
	Jonathan Hunter, Bastien Nocera, Bin Liu
  Cc: linux-usb, linux-kernel, imx, linux-arm-kernel, linux-mediatek,
	linux-tegra, linux-omap

Il 04/07/25 09:54, Sakari Ailus ha scritto:
> pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> pm_runtime_mark_last_busy().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>


For MediaTek MTU3:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 67/80] usb: Remove redundant pm_runtime_mark_last_busy() calls
  2025-07-04  7:54 ` [PATCH 67/80] usb: " Sakari Ailus
  2025-07-04  9:11   ` Thierry Reding
  2025-07-07  9:35   ` AngeloGioacchino Del Regno
@ 2025-07-21  2:25   ` Peter Chen (CIX)
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Chen (CIX) @ 2025-07-21  2:25 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Pawel Laszczak, Roger Quadros, Greg Kroah-Hartman, Thinh Nguyen,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Michal Simek, Chunfeng Yun, Mathias Nyman, Matthias Brugger,
	AngeloGioacchino Del Regno, Thierry Reding, Jonathan Hunter,
	Bastien Nocera, Bin Liu, linux-usb, linux-kernel, imx,
	linux-arm-kernel, linux-mediatek, linux-tegra, linux-omap

On 25-07-04 10:54:53, Sakari Ailus wrote:
> pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> pm_runtime_mark_last_busy().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

For chipidea and cdns3 parts:

Acked-by: Peter Chen <peter.chen@kernel.org>

Peter
> ---
> The cover letter of the set can be found here
> <URL:https://lore.kernel.org/linux-pm/20250704075225.3212486-1-sakari.ailus@linux.intel.com>.
> 
> In brief, this patch depends on PM runtime patches adding marking the last
> busy timestamp in autosuspend related functions. The patches are here, on
> rc2:
> 
>         git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \
>                 pm-runtime-6.17-rc1
> 
>  drivers/usb/cdns3/cdns3-gadget.c            | 1 -
>  drivers/usb/cdns3/cdnsp-gadget.c            | 1 -
>  drivers/usb/chipidea/core.c                 | 1 -
>  drivers/usb/chipidea/otg_fsm.c              | 1 -
>  drivers/usb/dwc3/core.c                     | 2 --
>  drivers/usb/dwc3/dwc3-am62.c                | 1 -
>  drivers/usb/dwc3/dwc3-imx8mp.c              | 1 -
>  drivers/usb/dwc3/dwc3-pci.c                 | 1 -
>  drivers/usb/dwc3/dwc3-xilinx.c              | 1 -
>  drivers/usb/gadget/udc/cdns2/cdns2-gadget.c | 1 -
>  drivers/usb/host/xhci-mtk.c                 | 1 -
>  drivers/usb/host/xhci-tegra.c               | 1 -
>  drivers/usb/misc/apple-mfi-fastcharge.c     | 1 -
>  drivers/usb/mtu3/mtu3_plat.c                | 1 -
>  drivers/usb/musb/musb_core.c                | 5 -----
>  drivers/usb/musb/musb_debugfs.c             | 5 -----
>  drivers/usb/musb/musb_dsps.c                | 1 -
>  drivers/usb/musb/musb_gadget.c              | 4 ----
>  drivers/usb/musb/omap2430.c                 | 1 -
>  19 files changed, 31 deletions(-)
> 
> diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
> index d9d8dc05b235..168707213ed9 100644
> --- a/drivers/usb/cdns3/cdns3-gadget.c
> +++ b/drivers/usb/cdns3/cdns3-gadget.c
> @@ -3251,7 +3251,6 @@ static void cdns3_gadget_exit(struct cdns *cdns)
>  	priv_dev = cdns->gadget_dev;
>  
>  
> -	pm_runtime_mark_last_busy(cdns->dev);
>  	pm_runtime_put_autosuspend(cdns->dev);
>  
>  	usb_del_gadget(&priv_dev->gadget);
> diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
> index 55f95f41b3b4..2ffe24a6e477 100644
> --- a/drivers/usb/cdns3/cdnsp-gadget.c
> +++ b/drivers/usb/cdns3/cdnsp-gadget.c
> @@ -1996,7 +1996,6 @@ static void cdnsp_gadget_exit(struct cdns *cdns)
>  	struct cdnsp_device *pdev = cdns->gadget_dev;
>  
>  	devm_free_irq(pdev->dev, cdns->dev_irq, pdev);
> -	pm_runtime_mark_last_busy(cdns->dev);
>  	pm_runtime_put_autosuspend(cdns->dev);
>  	usb_del_gadget_udc(&pdev->gadget);
>  	cdnsp_gadget_free_endpoints(pdev);
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 694b4a8e4e1d..a6ce73dcc871 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -1372,7 +1372,6 @@ static int ci_controller_resume(struct device *dev)
>  	ci->in_lpm = false;
>  	if (ci->wakeup_int) {
>  		ci->wakeup_int = false;
> -		pm_runtime_mark_last_busy(ci->dev);
>  		pm_runtime_put_autosuspend(ci->dev);
>  		enable_irq(ci->irq);
>  		if (ci_otg_is_fsm_mode(ci))
> diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
> index a093544482d5..929536dc96ec 100644
> --- a/drivers/usb/chipidea/otg_fsm.c
> +++ b/drivers/usb/chipidea/otg_fsm.c
> @@ -629,7 +629,6 @@ int ci_otg_fsm_work(struct ci_hdrc *ci)
>  				ci_otg_queue_work(ci);
>  			}
>  		} else if (ci->fsm.otg->state == OTG_STATE_A_HOST) {
> -			pm_runtime_mark_last_busy(ci->dev);
>  			pm_runtime_put_autosuspend(ci->dev);
>  			return 0;
>  		}
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 8002c23a5a02..77b309ebd704 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -279,7 +279,6 @@ static void __dwc3_set_mode(struct work_struct *work)
>  	}
>  
>  out:
> -	pm_runtime_mark_last_busy(dwc->dev);
>  	pm_runtime_put_autosuspend(dwc->dev);
>  	mutex_unlock(&dwc->mutex);
>  }
> @@ -2642,7 +2641,6 @@ int dwc3_runtime_idle(struct dwc3 *dwc)
>  		break;
>  	}
>  
> -	pm_runtime_mark_last_busy(dev);
>  	pm_runtime_autosuspend(dev);
>  
>  	return 0;
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index 9db8f3ca493d..e11d7643f966 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -292,7 +292,6 @@ static int dwc3_ti_probe(struct platform_device *pdev)
>  	/* Setting up autosuspend */
>  	pm_runtime_set_autosuspend_delay(dev, DWC3_AM62_AUTOSUSPEND_DELAY);
>  	pm_runtime_use_autosuspend(dev);
> -	pm_runtime_mark_last_busy(dev);
>  	pm_runtime_put_autosuspend(dev);
>  	return 0;
>  
> diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
> index 3edc5aca76f9..37700d95bc09 100644
> --- a/drivers/usb/dwc3/dwc3-imx8mp.c
> +++ b/drivers/usb/dwc3/dwc3-imx8mp.c
> @@ -307,7 +307,6 @@ static int dwc3_imx8mp_resume(struct dwc3_imx8mp *dwc3_imx, pm_message_t msg)
>  	if (dwc3_imx->wakeup_pending) {
>  		dwc3_imx->wakeup_pending = false;
>  		if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_DEVICE) {
> -			pm_runtime_mark_last_busy(dwc->dev);
>  			pm_runtime_put_autosuspend(dwc->dev);
>  		} else {
>  			/*
> diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
> index 54a4ee2b90b7..07dfa0b5d184 100644
> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -321,7 +321,6 @@ static void dwc3_pci_resume_work(struct work_struct *work)
>  		return;
>  	}
>  
> -	pm_runtime_mark_last_busy(&dwc3->dev);
>  	pm_runtime_put_sync_autosuspend(&dwc3->dev);
>  }
>  #endif
> diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
> index 1e28d6f50ed0..0a8c47876ff9 100644
> --- a/drivers/usb/dwc3/dwc3-xilinx.c
> +++ b/drivers/usb/dwc3/dwc3-xilinx.c
> @@ -383,7 +383,6 @@ static int __maybe_unused dwc3_xlnx_runtime_resume(struct device *dev)
>  
>  static int __maybe_unused dwc3_xlnx_runtime_idle(struct device *dev)
>  {
> -	pm_runtime_mark_last_busy(dev);
>  	pm_runtime_autosuspend(dev);
>  
>  	return 0;
> diff --git a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
> index 7e69944ef18a..9b53daf76583 100644
> --- a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
> +++ b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
> @@ -2415,7 +2415,6 @@ int cdns2_gadget_resume(struct cdns2_device *pdev, bool hibernated)
>  
>  void cdns2_gadget_remove(struct cdns2_device *pdev)
>  {
> -	pm_runtime_mark_last_busy(pdev->dev);
>  	pm_runtime_put_autosuspend(pdev->dev);
>  
>  	usb_del_gadget(&pdev->gadget);
> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> index 208558cf822d..06043c7c3100 100644
> --- a/drivers/usb/host/xhci-mtk.c
> +++ b/drivers/usb/host/xhci-mtk.c
> @@ -670,7 +670,6 @@ static int xhci_mtk_probe(struct platform_device *pdev)
>  	}
>  
>  	device_enable_async_suspend(dev);
> -	pm_runtime_mark_last_busy(dev);
>  	pm_runtime_put_autosuspend(dev);
>  	pm_runtime_forbid(dev);
>  
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index 0c7af44d4dae..554b03e3ae92 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -1394,7 +1394,6 @@ static void tegra_xhci_id_work(struct work_struct *work)
>  		}
>  
>  		tegra_xhci_set_port_power(tegra, true, true);
> -		pm_runtime_mark_last_busy(tegra->dev);
>  
>  	} else {
>  		if (tegra->otg_usb3_port >= 0)
> diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/apple-mfi-fastcharge.c
> index 8e852f4b8262..47b38dcc2992 100644
> --- a/drivers/usb/misc/apple-mfi-fastcharge.c
> +++ b/drivers/usb/misc/apple-mfi-fastcharge.c
> @@ -134,7 +134,6 @@ static int apple_mfi_fc_set_property(struct power_supply *psy,
>  		ret = -EINVAL;
>  	}
>  
> -	pm_runtime_mark_last_busy(&mfi->udev->dev);
>  	pm_runtime_put_autosuspend(&mfi->udev->dev);
>  
>  	return ret;
> diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
> index 7b5a431acb56..cc8a864dbd63 100644
> --- a/drivers/usb/mtu3/mtu3_plat.c
> +++ b/drivers/usb/mtu3/mtu3_plat.c
> @@ -431,7 +431,6 @@ static int mtu3_probe(struct platform_device *pdev)
>  	}
>  
>  	device_enable_async_suspend(dev);
> -	pm_runtime_mark_last_busy(dev);
>  	pm_runtime_put_autosuspend(dev);
>  	pm_runtime_forbid(dev);
>  
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index c7234b236971..0acc62569ae5 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -2031,7 +2031,6 @@ static void musb_pm_runtime_check_session(struct musb *musb)
>  		if (!musb->session)
>  			break;
>  		trace_musb_state(musb, devctl, "Allow PM on possible host mode disconnect");
> -		pm_runtime_mark_last_busy(musb->controller);
>  		pm_runtime_put_autosuspend(musb->controller);
>  		musb->session = false;
>  		return;
> @@ -2063,7 +2062,6 @@ static void musb_pm_runtime_check_session(struct musb *musb)
>  					      msecs_to_jiffies(3000));
>  	} else {
>  		trace_musb_state(musb, devctl, "Allow PM with no session");
> -		pm_runtime_mark_last_busy(musb->controller);
>  		pm_runtime_put_autosuspend(musb->controller);
>  	}
>  
> @@ -2090,7 +2088,6 @@ static void musb_irq_work(struct work_struct *data)
>  		sysfs_notify(&musb->controller->kobj, NULL, "mode");
>  	}
>  
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  }
>  
> @@ -2564,7 +2561,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
>  	musb_init_debugfs(musb);
>  
>  	musb->is_initialized = 1;
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  
>  	return 0;
> @@ -2887,7 +2883,6 @@ static int musb_resume(struct device *dev)
>  			error);
>  	spin_unlock_irqrestore(&musb->lock, flags);
>  
> -	pm_runtime_mark_last_busy(dev);
>  	pm_runtime_put_autosuspend(dev);
>  
>  	return 0;
> diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
> index 2d623284edf6..5092d62c2062 100644
> --- a/drivers/usb/musb/musb_debugfs.c
> +++ b/drivers/usb/musb/musb_debugfs.c
> @@ -106,7 +106,6 @@ static int musb_regdump_show(struct seq_file *s, void *unused)
>  		}
>  	}
>  
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  	return 0;
>  }
> @@ -119,7 +118,6 @@ static int musb_test_mode_show(struct seq_file *s, void *unused)
>  
>  	pm_runtime_get_sync(musb->controller);
>  	test = musb_readb(musb->mregs, MUSB_TESTMODE);
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  
>  	if (test == (MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_FS))
> @@ -216,7 +214,6 @@ static ssize_t musb_test_mode_write(struct file *file,
>  	musb_writeb(musb->mregs, MUSB_TESTMODE, test);
>  
>  ret:
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  	return count;
>  }
> @@ -243,7 +240,6 @@ static int musb_softconnect_show(struct seq_file *s, void *unused)
>  		reg = musb_readb(musb->mregs, MUSB_DEVCTL);
>  		connect = reg & MUSB_DEVCTL_SESSION ? 1 : 0;
>  
> -		pm_runtime_mark_last_busy(musb->controller);
>  		pm_runtime_put_autosuspend(musb->controller);
>  		break;
>  	default:
> @@ -304,7 +300,6 @@ static ssize_t musb_softconnect_write(struct file *file,
>  		}
>  	}
>  
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  	return count;
>  }
> diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
> index 12f587ab8511..9f93ed59a7e6 100644
> --- a/drivers/usb/musb/musb_dsps.c
> +++ b/drivers/usb/musb/musb_dsps.c
> @@ -296,7 +296,6 @@ static void otg_timer(struct timer_list *t)
>  	if (err < 0)
>  		dev_err(dev, "%s resume work: %i\n", __func__, err);
>  	spin_unlock_irqrestore(&musb->lock, flags);
> -	pm_runtime_mark_last_busy(dev);
>  	pm_runtime_put_autosuspend(dev);
>  }
>  
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index 6869c58367f2..f6ea91df80e4 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -1258,7 +1258,6 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
>  
>  unlock:
>  	spin_unlock_irqrestore(&musb->lock, lockflags);
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  
>  	return status;
> @@ -1642,7 +1641,6 @@ static void musb_gadget_work(struct work_struct *work)
>  	spin_lock_irqsave(&musb->lock, flags);
>  	musb_pullup(musb, musb->softconnect);
>  	spin_unlock_irqrestore(&musb->lock, flags);
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  }
>  
> @@ -1862,7 +1860,6 @@ static int musb_gadget_start(struct usb_gadget *g,
>  	if (musb->xceiv && musb->xceiv->last_event == USB_EVENT_ID)
>  		musb_platform_set_vbus(musb, 1);
>  
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  
>  	return 0;
> @@ -1915,7 +1912,6 @@ static int musb_gadget_stop(struct usb_gadget *g)
>  	 */
>  
>  	/* Force check of devctl register for PM runtime */
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  
>  	return 0;
> diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
> index 2970967a4fd2..191901317d7f 100644
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -151,7 +151,6 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
>  	default:
>  		dev_dbg(musb->controller, "ID float\n");
>  	}
> -	pm_runtime_mark_last_busy(musb->controller);
>  	pm_runtime_put_autosuspend(musb->controller);
>  	atomic_notifier_call_chain(&musb->xceiv->notifier,
>  			musb->xceiv->last_event, NULL);
> -- 
> 2.39.5
> 

-- 

Best regards,
Peter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-21  2:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250704075225.3212486-1-sakari.ailus@linux.intel.com>
2025-07-04  7:54 ` [PATCH 65/80] thunderbolt: Remove redundant pm_runtime_mark_last_busy() calls Sakari Ailus
2025-07-04  7:54 ` [PATCH 67/80] usb: " Sakari Ailus
2025-07-04  9:11   ` Thierry Reding
2025-07-07  9:35   ` AngeloGioacchino Del Regno
2025-07-21  2:25   ` Peter Chen (CIX)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).