Skip to contentSkip to conversation

mei: Remove redundant pm_runtime_mark_last_busy() calls

PATCH In review Sakari Ailus 2 participants 2 messages Oct 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mei: Remove redundant pm_runtime_mark_last_busy() calls

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().

---
 drivers/misc/mei/client.c    | 14 ++------------
 drivers/misc/mei/interrupt.c |  2 --
 2 files changed, 2 insertions(+), 14 deletions(-)
drivers/misc/mei/client.c +2 -12
index 159e8b841564..5dc665515263 100644
@@ -709,7 +709,6 @@ void mei_host_client_init(struct mei_device *dev)
 
 	schedule_work(&dev->bus_rescan_work);
 
-	pm_runtime_mark_last_busy(dev->parent);
 	dev_dbg(&dev->dev, "rpm: autosuspend\n");
 	pm_request_autosuspend(dev->parent);
 }
@@ -991,7 +990,6 @@ int mei_cl_disconnect(struct mei_cl *cl)
 	rets = __mei_cl_disconnect(cl);
 
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
 	return rets;
@@ -1167,7 +1165,6 @@ int mei_cl_connect(struct mei_cl *cl, struct mei_me_client *me_cl,
 	rets = cl->status;
 out:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
 	mei_io_cb_free(cb);
@@ -1554,7 +1551,6 @@ int mei_cl_notify_request(struct mei_cl *cl,
 
 out:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
 	mei_io_cb_free(cb);
@@ -1702,7 +1698,6 @@ int mei_cl_read_start(struct mei_cl *cl, size_t length, const struct file *fp)
 
 out:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 nortpm:
 	if (rets)
@@ -2092,7 +2087,6 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, unsigned long time
 	rets = buf_len;
 err:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 free:
 	mei_io_cb_free(cb);
@@ -2116,12 +2110,10 @@ void mei_cl_complete(struct mei_cl *cl, struct mei_cl_cb *cb)
 	case MEI_FOP_WRITE:
 		mei_tx_cb_dequeue(cb);
 		cl->writing_state = MEI_WRITE_COMPLETE;
-		if (waitqueue_active(&cl->tx_wait)) {
+		if (waitqueue_active(&cl->tx_wait))
 			wake_up_interruptible(&cl->tx_wait);
-		} else {
-			pm_runtime_mark_last_busy(dev->parent);
+		else
 			pm_request_autosuspend(dev->parent);
-		}
 		break;
 
 	case MEI_FOP_READ:
@@ -2366,7 +2358,6 @@ int mei_cl_dma_alloc_and_map(struct mei_cl *cl, const struct file *fp,
 		mei_cl_dma_free(cl);
 
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
 	mei_io_cb_free(cb);
@@ -2444,7 +2435,6 @@ int mei_cl_dma_unmap(struct mei_cl *cl, const struct file *fp)
 		mei_cl_dma_free(cl);
 out:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
 	mei_io_cb_free(cb);
drivers/misc/mei/interrupt.c +0 -2
index 3aa66b6b0d36..3f210413fd32 100644
@@ -229,7 +229,6 @@ static int mei_cl_irq_read_msg(struct mei_cl *cl,
 		cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx);
 		list_move_tail(&cb->list, cmpl_list);
 	} else {
-		pm_runtime_mark_last_busy(dev->parent);
 		pm_request_autosuspend(dev->parent);
 	}
 
@@ -310,7 +309,6 @@ static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb,
 		return ret;
 	}
 
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_request_autosuspend(dev->parent);
 
 	list_move_tail(&cb->list, &cl->rd_pending);
Signature · 1 line
2.47.3
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

Subject: [PATCH 1/1] mei: Remove redundant pm_runtime_mark_last_busy() calls

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().

Quoted 118 lines
---
 drivers/misc/mei/client.c    | 14 ++------------
 drivers/misc/mei/interrupt.c |  2 --
 2 files changed, 2 insertions(+), 14 deletions(-)
drivers/misc/mei/client.c +0 -3
index 159e8b841564..5dc665515263 100644
@@ -709,7 +709,6 @@ void mei_host_client_init(struct mei_device *dev)
 
 	schedule_work(&dev->bus_rescan_work);
 
-	pm_runtime_mark_last_busy(dev->parent);
 	dev_dbg(&dev->dev, "rpm: autosuspend\n");
 	pm_request_autosuspend(dev->parent);
 }
@@ -991,7 +990,6 @@ int mei_cl_disconnect(struct mei_cl *cl)
 	rets = __mei_cl_disconnect(cl);
 
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
 	return rets;
@@ -1167,7 +1165,6 @@ int mei_cl_connect(struct mei_cl *cl, struct
 mei_me_client *me_cl,
 	rets = cl->status;
 out:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
drivers/misc/mei/client.c +0 -2
 	mei_io_cb_free(cb);
@@ -1554,7 +1551,6 @@ int mei_cl_notify_request(struct mei_cl *cl,
 
 out:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
 	mei_io_cb_free(cb);
@@ -1702,7 +1698,6 @@ int mei_cl_read_start(struct mei_cl *cl, size_t
 length, const struct file *fp)
 
 out:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 nortpm:
drivers/misc/mei/client.c +0 -0
 	if (rets)
@@ -2092,7 +2087,6 @@ ssize_t mei_cl_write(struct mei_cl *cl, struct

mei_cl_cb *cb, unsigned long time

drivers/misc/mei/client.c +2 -5
 	rets = buf_len;
 err:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 free:
 	mei_io_cb_free(cb);
@@ -2116,12 +2110,10 @@ void mei_cl_complete(struct mei_cl *cl, struct
 mei_cl_cb *cb)
 	case MEI_FOP_WRITE:
 		mei_tx_cb_dequeue(cb);
 		cl->writing_state = MEI_WRITE_COMPLETE;
-		if (waitqueue_active(&cl->tx_wait)) {
+		if (waitqueue_active(&cl->tx_wait))
 			wake_up_interruptible(&cl->tx_wait);
-		} else {
-			pm_runtime_mark_last_busy(dev->parent);
+		else
 			pm_request_autosuspend(dev->parent);
-		}
 		break;
 
drivers/misc/mei/client.c +0 -1
 	case MEI_FOP_READ:
@@ -2366,7 +2358,6 @@ int mei_cl_dma_alloc_and_map(struct mei_cl *cl,
 const struct file *fp,
 		mei_cl_dma_free(cl);
 
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
drivers/misc/mei/client.c +0 -1
 	mei_io_cb_free(cb);
@@ -2444,7 +2435,6 @@ int mei_cl_dma_unmap(struct mei_cl *cl, const
 struct file *fp)
 		mei_cl_dma_free(cl);
 out:
 	cl_dbg(dev, cl, "rpm: autosuspend\n");
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_runtime_put_autosuspend(dev->parent);
 
drivers/misc/mei/client.c +0 -0
 	mei_io_cb_free(cb);
drivers/misc/mei/interrupt.c +0 -2
index 3aa66b6b0d36..3f210413fd32 100644
@@ -229,7 +229,6 @@ static int mei_cl_irq_read_msg(struct mei_cl *cl,
 		cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx);
 		list_move_tail(&cb->list, cmpl_list);
 	} else {
-		pm_runtime_mark_last_busy(dev->parent);
 		pm_request_autosuspend(dev->parent);
 	}
 
@@ -310,7 +309,6 @@ static int mei_cl_irq_read(struct mei_cl *cl, struct
 mei_cl_cb *cb,
 		return ret;
 	}
 
-	pm_runtime_mark_last_busy(dev->parent);
 	pm_request_autosuspend(dev->parent);
 

list_move_tail(&cb->list, &cl->rd_pending);
--
2.47.3