[PATCH V2 2/6] i3c: master: Mark last_busy on IBI when runtime PM is allowed

Adrian Hunter adrian.hunter at intel.com
Wed Feb 4 10:24:21 PST 2026


On 04/02/2026 18:10, Frank Li wrote:
> On Wed, Feb 04, 2026 at 01:15:07PM +0200, Adrian Hunter wrote:
>> When an IBI can be received after the controller is
>> pm_runtime_put_autosuspend()'ed, the interrupt may occur just before the
>> device is auto-suspended.  In such cases, the runtime PM core may not see
>> any recent activity and may suspend the device earlier than intended.
>>
>> Mark the controller as last busy whenever an IBI is queued (when
>> rpm_ibi_allowed is set) so that the auto-suspend delay correctly reflects
>> recent bus activity and avoids premature suspension.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter at intel.com>
>> ---
> 
> Although it is no harmful, I think it is not necessary to mark last busy.
> 
> schedule's workqueue task to do i3c transfer, which will call run time
> resume.
> 
> Are sure it will block your function without this patch?

It is not necessary at this time.  I wanted to cover the case
where an IBI is not followed by a transfer from the target
device driver.  Perhaps a device could operate almost entirely
using IBIs, but there is nothing like that presently.

Let me know if you think we should leave it for now.

> 
> Frank
> 
>>
>>
>> Changes in V2:
>>
>> 	Adjusted slightly for earlier changes
>>
>>
>>  drivers/i3c/master.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
>> index 49fb6e30a68e..48d1b1256290 100644
>> --- a/drivers/i3c/master.c
>> +++ b/drivers/i3c/master.c
>> @@ -2721,9 +2721,14 @@ static void i3c_master_unregister_i3c_devs(struct i3c_master_controller *master)
>>   */
>>  void i3c_master_queue_ibi(struct i3c_dev_desc *dev, struct i3c_ibi_slot *slot)
>>  {
>> +	struct i3c_master_controller *master = i3c_dev_get_master(dev);
>> +
>>  	if (!dev->ibi || !slot)
>>  		return;
>>
>> +	if (master->rpm_ibi_allowed)
>> +		pm_runtime_mark_last_busy(master->dev.parent);
>> +
>>  	atomic_inc(&dev->ibi->pending_ibis);
>>  	queue_work(dev->ibi->wq, &slot->work);
>>  }
>> --
>> 2.51.0
>>




More information about the linux-i3c mailing list