All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: James Bottomley <James.Bottomley@suse.de>
Cc: Stefan Bader <stefan.bader@canonical.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] sym53c8xx_2: Avoid calling __sym_mfree with irqs disabled
Date: Thu, 25 Mar 2010 12:05:38 -0600	[thread overview]
Message-ID: <20100325180538.GN3875@parisc-linux.org> (raw)
In-Reply-To: <1269537678.9182.8.camel@mulgrave.site>

On Thu, Mar 25, 2010 at 11:21:17AM -0600, James Bottomley wrote:
> On Thu, 2010-03-25 at 18:05 +0100, Stefan Bader wrote:
> > The following patch was tested and seemed to avoid the warning. Howver
> > I am not completely sure that none of the later functions need to be
> > protected with spinlocks. Though it feels ok. But maybe someone can do
> > some sanity checking.
> 
> So, I'm afraid you're right, the patch as is won't work ... the problem
> is that __sym_mfree_dma does list manipulation and for safety that has
> to be under a lock.
> 
> The inception of this problem is that ARM needs a sleeping function on
> DMA free but nothing else does so, on every platform that sym2 is
> supported, this warning is bogus.

Oh good, I'm glad you wrote this, it saves me the typing ;-)

> One way of getting rid of it might be to undef SYM_MEM_FREE_UNUSED which
> will prevent the free routines actually from releasing memory ...
> another might be to drop the lock and reacquire it around the free ...
> but that's sitting in a list traversal function so it may expose us to
> list races again, so really the whole of the freeing routines would have
> to be re-written to be list safe under lock ...

The solution I'd suggest is to take out the WARN_ON in the x86 code.
It's never going to cause trouble on x86.

The real solution is to use DMA pools, but my supply of tuits is quite
limited these days, and converting sym2 to modern APIs isn't high on
my priority list.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2010-03-25 18:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1269536751-2463-1-git-send-email-stefan.bader@canonical.com>
2010-03-25 17:21 ` [PATCH] sym53c8xx_2: Avoid calling __sym_mfree with irqs disabled James Bottomley
2010-03-25 18:05   ` Matthew Wilcox [this message]
2010-03-25 18:18     ` Stefan Bader

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=20100325180538.GN3875@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=James.Bottomley@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stefan.bader@canonical.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.