From: Chris Wilson <chris@chris-wilson.co.uk>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>,
Gustavo Padovan <gustavo.padovan@collabora.com>,
Sean Paul <seanpaul@chromium.org>,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linaro-mm-sig@lists.linaro.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] dma-buf: fix locking in sync_print_obj()
Date: Fri, 24 Jan 2020 11:15:31 +0000 [thread overview]
Message-ID: <157986453128.2524.3980064063029834231@skylake-alporthouse-com> (raw)
In-Reply-To: <20200124103123.GL1847@kadam>
Quoting Dan Carpenter (2020-01-24 10:31:23)
> On Fri, Jan 24, 2020 at 10:20:56AM +0000, Chris Wilson wrote:
> > Quoting Dan Carpenter (2020-01-24 10:13:12)
> > > This is always called with IRQs disabled and we don't actually want to
> > > enable IRQs at the end.
> > >
> > > Fixes: a6aa8fca4d79 ("dma-buf/sw-sync: Reduce irqsave/irqrestore from known context")
> > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > ---
> > > drivers/dma-buf/sync_debug.c | 5 +++--
> > > 1 file changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c
> > > index 101394f16930..952331344b1c 100644
> > > --- a/drivers/dma-buf/sync_debug.c
> > > +++ b/drivers/dma-buf/sync_debug.c
> > > @@ -107,15 +107,16 @@ static void sync_print_fence(struct seq_file *s,
> > > static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
> > > {
> > > struct list_head *pos;
> > > + unsigned long flags;
> > >
> > > seq_printf(s, "%s: %d\n", obj->name, obj->value);
> > >
> > > - spin_lock_irq(&obj->lock);
> > > + spin_lock_irqsave(&obj->lock, flags);
> >
> > Exactly, it can be just spin_lock() as the irq state is known.
> >
>
> I did consider that but I wasn't sure how this is going to be used in
> the future so I took a conservative approach.
Sure, it's debug so not critical (lists within lists to a seqfile, ouch)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
prev parent reply other threads:[~2020-01-24 11:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 10:13 [PATCH] dma-buf: fix locking in sync_print_obj() Dan Carpenter
2020-01-24 10:20 ` Chris Wilson
2020-01-24 10:31 ` Dan Carpenter
2020-01-24 11:15 ` Chris Wilson [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=157986453128.2524.3980064063029834231@skylake-alporthouse-com \
--to=chris@chris-wilson.co.uk \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo.padovan@collabora.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-media@vger.kernel.org \
--cc=seanpaul@chromium.org \
--cc=sumit.semwal@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).