public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: "Ira W. Snyder" <iws@ovro•caltech.edu>
To: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Cc: linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH 1/1] carma-fpga: fix race between data dumping and DMA callback
Date: Fri, 27 Jan 2012 08:07:58 -0800	[thread overview]
Message-ID: <20120127160757.GA23496@ovro.caltech.edu> (raw)
In-Reply-To: <1327613137.24487.0.camel@pasglop>

On Fri, Jan 27, 2012 at 08:25:37AM +1100, Benjamin Herrenschmidt wrote:
> On Thu, 2012-01-26 at 13:00 -0800, Ira W. Snyder wrote:
> > 
> > @@ -970,7 +984,13 @@ static ssize_t data_en_show(struct device *dev, struct device_attribute *attr,
> >                             char *buf)
> >  {
> >         struct fpga_device *priv = dev_get_drvdata(dev);
> > -       return snprintf(buf, PAGE_SIZE, "%u\n", priv->enabled);
> > +       int ret;
> > +
> > +       spin_lock_irq(&priv->lock);
> > +       ret = snprintf(buf, PAGE_SIZE, "%u\n", priv->enabled);
> > +       spin_unlock_irq(&priv->lock);
> > +
> > +       return ret;
> >  } 
> 
> I don't think the lock buys you anything here.
> 

You're right. Feel free to drop the hunk.

Ira

> Cheers,
> Ben.
> 
> 

      reply	other threads:[~2012-01-27 16:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 21:00 [PATCH 1/1] carma-fpga: fix race between data dumping and DMA callback Ira W. Snyder
2012-01-26 21:25 ` Benjamin Herrenschmidt
2012-01-27 16:07   ` Ira W. Snyder [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=20120127160757.GA23496@ovro.caltech.edu \
    --to=iws@ovro$(echo .)caltech.edu \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    /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