[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69903c69a95902c0ddc8fb9e7a6762abf28aa034.camel@pengutronix.de>
Date: Fri, 06 Mar 2020 11:20:51 +0100
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Laurentiu Palcu <laurentiu.palcu@....nxp.com>,
Lucas Stach <l.stach@...gutronix.de>
Cc: Laurentiu Palcu <laurentiu.palcu@....com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
linux-arm-kernel@...ts.infradead.org, agx@...xcpu.org,
lukas@...mn.com, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH v3 2/4] drm/imx: Add initial support for DCSS on iMX8MQ
Hi Laurentiu,
On Fri, 2020-03-06 at 11:58 +0200, Laurentiu Palcu wrote:
> On Wed, Feb 26, 2020 at 02:19:11PM +0100, Lucas Stach wrote:
[...]
> > > +/* This function will be called from interrupt context. */
> > > +void dcss_scaler_write_sclctrl(struct dcss_scaler *scl)
> > > +{
> > > + int chnum;
> > > +
> > > + for (chnum = 0; chnum < 3; chnum++) {
> > > + struct dcss_scaler_ch *ch = &scl->ch[chnum];
> > > +
> > > + if (ch->scaler_ctrl_chgd) {
> > > + dcss_ctxld_write_irqsafe(scl->ctxld, scl->ctx_id,
> > > + ch->scaler_ctrl,
> > > + ch->base_ofs +
> > > + DCSS_SCALER_CTRL);
> >
> > Why is this using the _irqsafe variant without any locking? Won't this
> > lead to potential internal state corruption? dcss_ctxld_write is using
> > the _irqsave locking variants, so it fine with being called from IRQ
> > context.
>
> This is only called from __dcss_ctxld_enable() which is already protected
> by lock/unlock in dcss_ctxld_kick().
You could add a lockdep_assert_held() line to the top of this function
to make it clear this depends on the lock being held.
regards
Philipp
Powered by blists - more mailing lists