public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: benh@kernel.crashing.org
Cc: linux-input@atrey.karlin.mff.cuni.cz,
	linux-kernel@vger.kernel.org, paulus@samba.org, anton@samba.org,
	greg@kroah.com
Subject: Re: DMA APIs gumble grumble
Date: Thu, 09 Nov 2006 18:50:26 -0800 (PST)	[thread overview]
Message-ID: <20061109.185026.07639529.davem@davemloft.net> (raw)
In-Reply-To: <1163120524.4982.61.camel@localhost.localdomain>

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Fri, 10 Nov 2006 12:02:04 +1100

> > Please just mirror what I did on sparc64 for sparc32, see changeset
> > 42f142371e48fbc44956d57b4e506bb6ce673cd7, with followup bug fixes
> > in 36321426e320c2c6bc2f8a1587d6f4d695fca84c and
> > 7233589d77fdb593b482a8b7ee867e901f54b593.
> 
> Question about sparc. It's implementation of pci_alloc_consistent(),
> unlike the other ones from before we had a GFP mask massed, does
> GFP_KERNEL allocations and not GFP_ATOMIC. Thus it's never expected to
> be called in atomic context. In fact, it does various other things like
> calling allocate_resource which is not something you ever want to be
> called from interrupt context.

pci_alloc_consistent() is not allowed from atomic contexts.

> I'm splitting it into a pci_do_alloc_consistent that takes a gfp arg,
> and a pair of pci_alloc_consistent & dma_alloc_consistent wrappers.
> 
> Do you think I should have the former pass GFP_KERNEL like the current
> implementation does or switch it to GFP_ATOMIC like everybody does ? In
> this case, should I also change the kmalloc done in there to allocate a
> struct resource to use the gfp argument ? (It's currently doing
> GFP_KERNEL).

pci_alloc_consistent() really cannot be allowed to use GFP_ATOMIC.

  reply	other threads:[~2006-11-10  2:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08  1:54 DMA APIs gumble grumble Benjamin Herrenschmidt
2006-11-08  4:46 ` David Miller
2006-11-08  5:23   ` Benjamin Herrenschmidt
2006-11-08  5:29     ` David Miller
2006-11-08  5:44       ` Benjamin Herrenschmidt
2006-11-10  1:02   ` Benjamin Herrenschmidt
2006-11-10  2:50     ` David Miller [this message]
2006-11-10  2:55       ` Benjamin Herrenschmidt
2006-11-10  3:01         ` David Miller
2006-11-10  4:07           ` Benjamin Herrenschmidt
2006-11-08  8:25 ` Muli Ben-Yehuda
2006-11-08  8:47   ` Benjamin Herrenschmidt
2006-11-08  9:21     ` Muli Ben-Yehuda
2006-11-08 10:00       ` Benjamin Herrenschmidt
2006-11-08 22:56     ` Russell King
2006-11-08 23:41       ` Benjamin Herrenschmidt
2006-11-09  0:43       ` Benjamin Herrenschmidt

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=20061109.185026.07639529.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=greg@kroah.com \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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