From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Miquel van Smoorenburg <miquels@cistron.nl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
David Howells <dhowells@redhat.com>,
akpm@linux-foundation.org, alan@redhat.com,
Markus.Lidel@shadowconnect.com, vvs@sw.ru,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] Mark i2o config broken on 64-bit platforms.
Date: Wed, 09 Jul 2008 14:59:55 -0500 [thread overview]
Message-ID: <1215633595.3444.18.camel@localhost.localdomain> (raw)
In-Reply-To: <1215631336.18506.15.camel@localhost.localdomain>
On Wed, 2008-07-09 at 21:22 +0200, Miquel van Smoorenburg wrote:
> On Wed, 2008-07-09 at 14:13 -0500, James Bottomley wrote:
> > On Wed, 2008-07-09 at 21:06 +0200, Miquel van Smoorenburg wrote:
> > > On Wed, 2008-07-09 at 16:49 +0100, Alan Cox wrote:
> > > > On Wed, 09 Jul 2008 15:15:14 +0100
> > > > David Howells <dhowells@redhat.com> wrote:
> > > >
> > > > > Miquel van Smoorenburg <miquels@cistron.nl> wrote:
> > > > > Maybe, but have you looked at i2o_cfg_passthru()? Take this, for example:
> > > > >
> > > > > /* Allocate memory for the transfer */
> > > > > p = kmalloc(sg_size, GFP_KERNEL);
> > > > > ...
> > > > > //TODO 64bit fix
> > > > > sg[i].addr_bus = virt_to_bus(p);
> > > > >
> > > > > That looks distinctly dodgy. virt_to_bus() returns a 64-bit address, and as
> > > >
> > > > Agreed - stick | GFP_DMA32 on the end then ;)
> > >
> > > GFP_DMA32 doesn't work with kmalloc(), you need dma_alloc_coherent() or
> > > pci_alloc_consistent() [here, i2o_dma_alloc() ]
> >
> > Yes it does ... it was specifically designed for it. GFP_DMA32 was
> > introduced to allow this type of thing to happen (in the old days most
> > drivers were allowed to assume kmalloc would return memory whose
> > physical address was < 4GB; GFP_DMA32 allows that to continue while
> > allowing kmalloc to stray beyond 4GB physical).
>
> If you use alloc_pages(), yes. But not for kmalloc(). There are no
> general GFP_DMA32 slabs.
No ... it's platform specific. Platforms whose ZONE_NORMAL covers only
up to 4GB need do nothing. However, x86_64 definitely implements
ZONE_DMA32 for precisely this. Several other platforms (like ia64)
should but don't.
James
next prev parent reply other threads:[~2008-07-09 20:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-09 11:35 [PATCH] Mark i2o config broken on 64-bit platforms David Howells
2008-07-09 11:47 ` Andrew Morton
2008-07-09 12:07 ` David Howells
2008-07-09 13:47 ` Miquel van Smoorenburg
2008-07-09 14:15 ` David Howells
2008-07-09 15:08 ` Bernd Petrovitsch
2008-07-09 15:49 ` Alan Cox
2008-07-09 15:49 ` Alan Cox
2008-07-09 16:42 ` David Howells
2008-07-09 19:06 ` Miquel van Smoorenburg
2008-07-09 19:13 ` James Bottomley
2008-07-09 19:22 ` Miquel van Smoorenburg
2008-07-09 19:59 ` James Bottomley [this message]
2008-07-09 20:06 ` Miquel van Smoorenburg
2008-07-10 11:13 ` Alan Cox
2008-07-10 12:12 ` David Howells
2008-07-10 14:53 ` Alan Cox
2008-07-10 14:53 ` Alan Cox
2008-07-10 15:23 ` Alan Cox
2008-07-09 18:49 ` Miquel van Smoorenburg
2008-07-10 11:45 ` Alan Cox
2008-07-09 14:46 ` Alan Cox
2008-07-09 16:18 ` David Howells
2008-07-09 14:47 ` Alan Cox
2008-07-09 14:47 ` Alan Cox
2008-07-09 15:46 ` Jeff Garzik
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=1215633595.3444.18.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=Markus.Lidel@shadowconnect.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alan@redhat.com \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=miquels@cistron.nl \
--cc=vvs@sw.ru \
/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.