Patch "media: hi846: fix usage of pm_runtime_get_if_in_use()" has been added to the 6.4-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

    media: hi846: fix usage of pm_runtime_get_if_in_use()

to the 6.4-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:
     media-hi846-fix-usage-of-pm_runtime_get_if_in_use.patch
and it can be found in the queue-6.4 subdirectory.

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



commit cca6eefeb42b229a179cf84f85f93fb7185158f0
Author: Martin Kepplinger <martink@xxxxxxxxx>
Date:   Tue Apr 25 11:47:47 2023 +0200

    media: hi846: fix usage of pm_runtime_get_if_in_use()
    
    [ Upstream commit 04fc06f6dc1592ed5d675311ac50d8fba5db62ab ]
    
    pm_runtime_get_if_in_use() does not only return nonzero values when
    the device is in use, it can return a negative errno too.
    
    And especially during resuming from system suspend, when runtime pm
    is not yet up again, -EAGAIN is being returned, so the subsequent
    pm_runtime_put() call results in a refcount underflow.
    
    Fix system-resume by handling -EAGAIN of pm_runtime_get_if_in_use().
    
    Signed-off-by: Martin Kepplinger <martin.kepplinger@xxxxxxx>
    Fixes: e8c0882685f9 ("media: i2c: add driver for the SK Hynix Hi-846 8M pixel camera")
    Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c
index 306dc35e925fd..f8709cdf28b39 100644
--- a/drivers/media/i2c/hi846.c
+++ b/drivers/media/i2c/hi846.c
@@ -1353,7 +1353,8 @@ static int hi846_set_ctrl(struct v4l2_ctrl *ctrl)
 					 exposure_max);
 	}
 
-	if (!pm_runtime_get_if_in_use(&client->dev))
+	ret = pm_runtime_get_if_in_use(&client->dev);
+	if (!ret || ret == -EAGAIN)
 		return 0;
 
 	switch (ctrl->id) {



[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