From: Sakari Ailus <sakari.ailus@linux•intel.com>
To: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli•org>
Cc: Eugen Hristev <ehristev@kernel•org>,
Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi•com>,
Mauro Carvalho Chehab <mchehab@kernel•org>,
Florian Fainelli <florian.fainelli@broadcom•com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom•com>,
Ray Jui <rjui@broadcom•com>,
Scott Branden <sbranden@broadcom•com>,
Dave Stevenson <dave.stevenson@raspberrypi•com>,
Hans Verkuil <hverkuil@kernel•org>,
Laurent Pinchart <laurent.pinchart@ideasonboard•com>,
Naushir Patuck <naush@raspberrypi•com>,
linux-media@vger•kernel.org,
linux-rpi-kernel@lists•infradead.org,
linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org
Subject: Re: [PATCH] media: bcm2835-unicam: Fix log status runtime access
Date: Fri, 22 May 2026 13:28:47 +0300 [thread overview]
Message-ID: <ahAv3430zwqeDXnQ@kekkonen.localdomain> (raw)
In-Reply-To: <4d7deb19-d384-497e-8139-c977a9f3679d@yoseli.org>
Hi Eugen, Jean-Michel,
On Fri, May 22, 2026 at 10:31:51AM +0200, Jean-Michel Hautbois wrote:
> Hi Eugen,
>
> Thanks for the fix, the issue is real, but I think the patch leaks a runtime
> PM reference.
>
> Le 21/05/2026 à 20:09, Eugen Hristev a écrit :
> > When requesting log status, the block might be powered
> > off, but registers are being read.
> > Avoid reading the registers if the device is not
> > resumed, thus also avoid powering up the device just
> > for log status.
Please rewrap this, most editors can do that automatically.
> >
> > Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface")
> > Signed-off-by: Eugen Hristev <ehristev@kernel•org>
> > ---
> > drivers/media/platform/broadcom/bcm2835-unicam.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
> > index 8d28ba0b59a3..818694f007e2 100644
> > --- a/drivers/media/platform/broadcom/bcm2835-unicam.c
> > +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
> > @@ -2052,6 +2052,10 @@ static int unicam_log_status(struct file *file, void *fh)
> > node->fmt.fmt.pix.width, node->fmt.fmt.pix.height);
> > dev_info(unicam->dev, "V4L2 format: %08x\n",
> > node->fmt.fmt.pix.pixelformat);
> > +
> > + if (!pm_runtime_get_if_in_use(unicam->dev))
> > + return 0;
> > +
>
> pm_runtime_get_if_in_use() returns 1 and increments the usage counter is
> active and in use.
Also, should this be pm_runtime_get_if_active() instead?
>
> I think we need to add:
> pm_runtime_put(unicam->dev);
>
> Just before the return 0;
>
> BTW, we may miss a dev_info explaining why the live data is skipped when the
> device is suspended ?
--
Regards,
Sakari Ailus
prev parent reply other threads:[~2026-05-22 10:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 18:09 [PATCH] media: bcm2835-unicam: Fix log status runtime access Eugen Hristev
2026-05-22 8:31 ` Jean-Michel Hautbois
2026-05-22 10:28 ` Sakari Ailus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ahAv3430zwqeDXnQ@kekkonen.localdomain \
--to=sakari.ailus@linux$(echo .)intel.com \
--cc=bcm-kernel-feedback-list@broadcom$(echo .)com \
--cc=dave.stevenson@raspberrypi$(echo .)com \
--cc=ehristev@kernel$(echo .)org \
--cc=florian.fainelli@broadcom$(echo .)com \
--cc=hverkuil@kernel$(echo .)org \
--cc=jeanmichel.hautbois@yoseli$(echo .)org \
--cc=kernel-list@raspberrypi$(echo .)com \
--cc=laurent.pinchart@ideasonboard$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-media@vger$(echo .)kernel.org \
--cc=linux-rpi-kernel@lists$(echo .)infradead.org \
--cc=mchehab@kernel$(echo .)org \
--cc=naush@raspberrypi$(echo .)com \
--cc=rjui@broadcom$(echo .)com \
--cc=sbranden@broadcom$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox