lkml.org 
[lkml]   [2020]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 2/4] drm/imx: Add initial support for DCSS on iMX8MQ
From
Date
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

\
 
 \ /
  Last update: 2020-03-06 11:21    [W:0.063 / U:5.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site