public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: nick.cheng@areca.com.tw
Cc: 'Daniel Drake' <dsd@gentoo.org>,
	linux-scsi@vger.kernel.org, 'erich' <erich@areca.com.tw>
Subject: RE: Patch added to scsi-rc-fixes-2.6:  [SCSI] arcmsr: fix message allocation
Date: Mon, 25 Feb 2008 06:38:30 -0800	[thread overview]
Message-ID: <1203950310.3254.9.camel@localhost.localdomain> (raw)
In-Reply-To: <000401c8779b$de5619c0$8800a8c0@Nick>

On Mon, 2008-02-25 at 18:47 +0800, nickcheng wrote:
> Sorry, maybe I did not ask distinctly enough.
> I mean if I would like to allocate a memory space from ZONE_DMA for atomic
> context, why can I not use kmalloc(1032, GFP_ATOMIC|GFP_DMA)?
> In case of lack of GFP_DMA, kmalloc would grab the memory from ZONE_HIGH or
> ZONE_HIGHMEM, isn't it?(I read it from the textbook of Linux Kernel
> Development by Robert Love)

Um, no that's not true at all.  GFP_DMA only allocates memory from
ZONE_DMA and fails otherwise.  You only need memory from ZONE_DMA if you
cannot address physical memory above 24 bits (the old ISA restriction).
This only applies if you're a standard ISA device and you're going
actually to DMA to the memory in question.  Neither of which applies in
the arcmsr case, since you're only using the memory as a copy buffer
within the kernel (it never sees an actual DMA transfer), and arcmsr
doesn't have the ISA restrictions.

> Or the basic is that you don't think it is necessary to allocate a memory
> space from DMA area?
> Please give me some comments.

It's unnecessary because you never DMA to it, but even if you did, since
arcmsr is a non-ISA device (with 64 bit DMA mask falling back to 32) you
can just use ordinary kmalloc'd memory for that (provided you obey the
coherence requirements).

James



  reply	other threads:[~2008-02-25 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <001401c87753$3edf4670$8800a8c0@Nick>
2008-02-25 10:14 ` Patch added to scsi-rc-fixes-2.6: [SCSI] arcmsr: fix message allocation Daniel Drake
2008-02-25 10:47   ` nickcheng
2008-02-25 14:38     ` James Bottomley [this message]
2008-02-26  4:29       ` Patch added to scsi-rc-fixes-2.6: [SCSI] arcmsr: fix messageallocation nickcheng
2008-02-26 16:14         ` James Bottomley

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=1203950310.3254.9.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=dsd@gentoo.org \
    --cc=erich@areca.com.tw \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nick.cheng@areca.com.tw \
    /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