* Re: __get_free_pages() problem on ia64
2006-09-26 15:28 __get_free_pages() problem on ia64 Adhiraj
@ 2006-09-26 16:48 ` Matthew Wilcox
2006-09-27 5:20 ` Adhiraj
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2006-09-26 16:48 UTC (permalink / raw)
To: linux-ia64
On Tue, Sep 26, 2006 at 08:46:40PM +0530, Adhiraj wrote:
> I found a strange thing on ia64 platform. When I allocate pages using
> __get_free_pages() with GFP_DMA, sometimes the physical addresses of
> allocated pages fall beyond 4G.
>
> I am working on a device driver where the device does not support
> addresses above 4G and hence I have to implement bounce buffers. The
You should be using the services described in
Documentation/DMA-mapping.txt rather than allocating your own bounce
buffers.
> The dma mask for the driver is set to 64 bits using pci_set_dma_mask().
Well, that's one of your problems right there .... if your device can
only DMA up to 4GB then you should set it to DMA_32BIT_MASK.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: __get_free_pages() problem on ia64
2006-09-26 15:28 __get_free_pages() problem on ia64 Adhiraj
2006-09-26 16:48 ` Matthew Wilcox
@ 2006-09-27 5:20 ` Adhiraj
2006-09-27 11:26 ` Matthew Wilcox
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Adhiraj @ 2006-09-27 5:20 UTC (permalink / raw)
To: linux-ia64
On Tue, 2006-09-26 at 10:48 -0600, Matthew Wilcox wrote:
> On Tue, Sep 26, 2006 at 08:46:40PM +0530, Adhiraj wrote:
> > I found a strange thing on ia64 platform. When I allocate pages using
> > __get_free_pages() with GFP_DMA, sometimes the physical addresses of
> > allocated pages fall beyond 4G.
> >
> > I am working on a device driver where the device does not support
> > addresses above 4G and hence I have to implement bounce buffers. The
>
> You should be using the services described in
> Documentation/DMA-mapping.txt rather than allocating your own bounce
> buffers.
Ok, thanks, I will look into it. But the question is why do I get
addresses beyond 4G (virt_to_phys() of returned addresses) even when I
use GFP_DMA. Is this a known problem on ia64?
>
> > The dma mask for the driver is set to 64 bits using pci_set_dma_mask().
>
> Well, that's one of your problems right there .... if your device can
> only DMA up to 4GB then you should set it to DMA_32BIT_MASK.
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: __get_free_pages() problem on ia64
2006-09-26 15:28 __get_free_pages() problem on ia64 Adhiraj
2006-09-26 16:48 ` Matthew Wilcox
2006-09-27 5:20 ` Adhiraj
@ 2006-09-27 11:26 ` Matthew Wilcox
2006-09-27 16:11 ` Luck, Tony
2006-09-27 16:15 ` Matthew Wilcox
4 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2006-09-27 11:26 UTC (permalink / raw)
To: linux-ia64
On Wed, Sep 27, 2006 at 10:38:13AM +0530, Adhiraj wrote:
> Ok, thanks, I will look into it. But the question is why do I get
> addresses beyond 4G (virt_to_phys() of returned addresses) even when I
> use GFP_DMA. Is this a known problem on ia64?
All memory is DMAable as we have an IOMMU. ZONE_DMA doesn't mean what
you think it means.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: __get_free_pages() problem on ia64
2006-09-26 15:28 __get_free_pages() problem on ia64 Adhiraj
` (2 preceding siblings ...)
2006-09-27 11:26 ` Matthew Wilcox
@ 2006-09-27 16:11 ` Luck, Tony
2006-09-27 16:15 ` Matthew Wilcox
4 siblings, 0 replies; 6+ messages in thread
From: Luck, Tony @ 2006-09-27 16:11 UTC (permalink / raw)
To: linux-ia64
> > Ok, thanks, I will look into it. But the question is why do I get
> > addresses beyond 4G (virt_to_phys() of returned addresses) even when I
> > use GFP_DMA. Is this a known problem on ia64?
>
> All memory is DMAable as we have an IOMMU. ZONE_DMA doesn't mean what
> you think it means.
You have an IOMMU ... but not all ia64 systems do (hence the need for swiotlb).
-Tony
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: __get_free_pages() problem on ia64
2006-09-26 15:28 __get_free_pages() problem on ia64 Adhiraj
` (3 preceding siblings ...)
2006-09-27 16:11 ` Luck, Tony
@ 2006-09-27 16:15 ` Matthew Wilcox
4 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2006-09-27 16:15 UTC (permalink / raw)
To: linux-ia64
On Wed, Sep 27, 2006 at 09:11:37AM -0700, Luck, Tony wrote:
> > > Ok, thanks, I will look into it. But the question is why do I get
> > > addresses beyond 4G (virt_to_phys() of returned addresses) even when I
> > > use GFP_DMA. Is this a known problem on ia64?
> >
> > All memory is DMAable as we have an IOMMU. ZONE_DMA doesn't mean what
> > you think it means.
>
> You have an IOMMU ... but not all ia64 systems do (hence the need for swiotlb).
From the device driver's point of view, all ia64 systems have an IOMMU,
whether it be implemented in hardware (all sane systems) or software
(Intel ones).
^ permalink raw reply [flat|nested] 6+ messages in thread