linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Ira W. Snyder" <iws@ovro.caltech.edu>
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:25:37 +1100	[thread overview]
Message-ID: <1327613137.24487.0.camel@pasglop> (raw)
In-Reply-To: <1327611614-18508-1-git-send-email-iws@ovro.caltech.edu>

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.

Cheers,
Ben.

  reply	other threads:[~2012-01-26 21:25 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 [this message]
2012-01-27 16:07   ` Ira W. Snyder

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=1327613137.24487.0.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=iws@ovro.caltech.edu \
    --cc=linuxppc-dev@lists.ozlabs.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).