All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: linux-media@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Chen-Yu Tsai <wens@csie.org>,
	Samuel Holland <samuel@sholland.org>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: kernel@collabora.com, stable@vger.kernel.org,
	linux-staging@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH v1 2/3] media: cedrus: Set the platform driver data earlier
Date: Thu, 25 Aug 2022 23:04:50 +0200	[thread overview]
Message-ID: <3448453.iIbC2pHGDl@kista> (raw)
In-Reply-To: <6a8f2555-1bd4-ac81-390e-b597e3c886f6@collabora.com>

Dne nedelja, 21. avgust 2022 ob 22:40:21 CEST je Dmitry Osipenko napisal(a):
> On 8/20/22 11:25, Jernej Škrabec wrote:
> > Dne petek, 19. avgust 2022 ob 17:37:20 CEST je Nicolas Dufresne 
napisal(a):
> >> Le vendredi 19 août 2022 à 06:17 +0200, Jernej Škrabec a écrit :
> >>> Dne četrtek, 18. avgust 2022 ob 22:33:07 CEST je Nicolas Dufresne
> > 
> > napisal(a):
> >>>> From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> >>>> 
> >>>> The cedrus_hw_resume() crashes with NULL deference on driver probe if
> >>>> runtime PM is disabled because it uses platform data that hasn't been
> >>>> set up yet. Fix this by setting the platform data earlier during probe.
> >>> 
> >>> Does it even work without PM? Maybe it would be better if Cedrus would
> >>> select PM in Kconfig.
> >> 
> >> I cannot comment myself on this, but it does not seem to invalidate this
> >> Dmitry's fix.
> > 
> > If NULL pointer dereference happens only when PM is disabled, then it
> > does. I have PM always enabled and I never experienced above issue.
> 
> Originally this fix was needed when I changed cedrus_hw_probe() to do
> the rpm-resume while was debugging the hang issue and then also noticed
> that the !PM should be broken. It's a good common practice for all
> drivers to have the drv data set early to avoid such problems, hence it
> won't hurt to make this change anyways.

Ok, as others pointed out, this is still a good thing, so:

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>


> 
> In practice nobody disables PM other than for debugging purposes and !PM
> handling is often broken in drivers. I assume that it might be even
> better to enable PM for all Allwiner SoCs and remove !PM handling from
> all the affected drivers, like it was done for Tegra some time ago.
> 

Maybe in the future :)

Best regards,
Jernej

> --
> Best regards,
> Dmitry




WARNING: multiple messages have this Message-ID (diff)
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: linux-media@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Chen-Yu Tsai <wens@csie.org>,
	Samuel Holland <samuel@sholland.org>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: kernel@collabora.com, stable@vger.kernel.org,
	linux-staging@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH v1 2/3] media: cedrus: Set the platform driver data earlier
Date: Thu, 25 Aug 2022 23:04:50 +0200	[thread overview]
Message-ID: <3448453.iIbC2pHGDl@kista> (raw)
In-Reply-To: <6a8f2555-1bd4-ac81-390e-b597e3c886f6@collabora.com>

Dne nedelja, 21. avgust 2022 ob 22:40:21 CEST je Dmitry Osipenko napisal(a):
> On 8/20/22 11:25, Jernej Škrabec wrote:
> > Dne petek, 19. avgust 2022 ob 17:37:20 CEST je Nicolas Dufresne 
napisal(a):
> >> Le vendredi 19 août 2022 à 06:17 +0200, Jernej Škrabec a écrit :
> >>> Dne četrtek, 18. avgust 2022 ob 22:33:07 CEST je Nicolas Dufresne
> > 
> > napisal(a):
> >>>> From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> >>>> 
> >>>> The cedrus_hw_resume() crashes with NULL deference on driver probe if
> >>>> runtime PM is disabled because it uses platform data that hasn't been
> >>>> set up yet. Fix this by setting the platform data earlier during probe.
> >>> 
> >>> Does it even work without PM? Maybe it would be better if Cedrus would
> >>> select PM in Kconfig.
> >> 
> >> I cannot comment myself on this, but it does not seem to invalidate this
> >> Dmitry's fix.
> > 
> > If NULL pointer dereference happens only when PM is disabled, then it
> > does. I have PM always enabled and I never experienced above issue.
> 
> Originally this fix was needed when I changed cedrus_hw_probe() to do
> the rpm-resume while was debugging the hang issue and then also noticed
> that the !PM should be broken. It's a good common practice for all
> drivers to have the drv data set early to avoid such problems, hence it
> won't hurt to make this change anyways.

Ok, as others pointed out, this is still a good thing, so:

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>


> 
> In practice nobody disables PM other than for debugging purposes and !PM
> handling is often broken in drivers. I assume that it might be even
> better to enable PM for all Allwiner SoCs and remove !PM handling from
> all the affected drivers, like it was done for Tegra some time ago.
> 

Maybe in the future :)

Best regards,
Jernej

> --
> Best regards,
> Dmitry




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-08-25 21:04 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 20:33 [PATCH v1 0/3] cedrus: Various bug fixes Nicolas Dufresne
2022-08-18 20:33 ` [PATCH v1 1/3] media: cedrus: Fix watchdog race condition Nicolas Dufresne
2022-08-18 20:33   ` Nicolas Dufresne
2022-08-22  8:04   ` Paul Kocialkowski
2022-08-22  8:04     ` Paul Kocialkowski
2022-08-25 21:02   ` Jernej Škrabec
2022-08-25 21:02     ` Jernej Škrabec
2022-08-18 20:33 ` [PATCH v1 2/3] media: cedrus: Set the platform driver data earlier Nicolas Dufresne
2022-08-18 20:33   ` Nicolas Dufresne
2022-08-19  4:17   ` Jernej Škrabec
2022-08-19  4:17     ` Jernej Škrabec
2022-08-19 15:37     ` Nicolas Dufresne
2022-08-19 15:37       ` Nicolas Dufresne
2022-08-20  8:25       ` Jernej Škrabec
2022-08-20  8:25         ` Jernej Škrabec
2022-08-21 20:40         ` Dmitry Osipenko
2022-08-21 20:40           ` Dmitry Osipenko
2022-08-25 21:04           ` Jernej Škrabec [this message]
2022-08-25 21:04             ` Jernej Škrabec
2022-08-23  3:57         ` Samuel Holland
2022-08-23  3:57           ` Samuel Holland
2022-08-23 12:22           ` Paul Kocialkowski
2022-08-23 12:22             ` Paul Kocialkowski
2022-08-18 20:33 ` [PATCH v1 3/3] media: cedrus: Fix endless loop in cedrus_h265_skip_bits() Nicolas Dufresne
2022-08-18 20:33   ` Nicolas Dufresne
2022-08-18 20:39   ` Dmitry Osipenko
2022-08-18 20:39     ` Dmitry Osipenko
2022-08-18 21:17     ` Nicolas Dufresne
2022-08-18 21:17       ` Nicolas Dufresne
2022-08-19  4:16   ` Jernej Škrabec
2022-08-19  4:16     ` Jernej Škrabec
2022-08-19 15:39     ` Nicolas Dufresne
2022-08-19 15:39       ` Nicolas Dufresne
2022-08-25 21:13       ` Jernej Škrabec
2022-08-25 21:13         ` Jernej Škrabec

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=3448453.iIbC2pHGDl@kista \
    --to=jernej.skrabec@gmail.com \
    --cc=dmitry.osipenko@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mripard@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=samuel@sholland.org \
    --cc=stable@vger.kernel.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.