* [PATCH] fix cciss DMA unmap brokenness
@ 2005-08-17 19:16 Alex Williamson
0 siblings, 0 replies; 2+ messages in thread
From: Alex Williamson @ 2005-08-17 19:16 UTC (permalink / raw)
To: Mike Miller; +Cc: linux-kernel
The CCISS driver seems to loose track of DMA mappings created by it's
fill_cmd() routine. Neither callers of this routine are extracting the
DMA address created in order to do the unmap. Instead, they simply try
to unmap 0x0. It's easy to see this problem on an x86_64 system when
using the "swiotlb=force" boot option. In this case, the driver is
leaking resources of the swiotlb and not causing a sync of the bounce
buffer. Thanks
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
diff -r b9c8e9fdd6b2 drivers/block/cciss.c
--- a/drivers/block/cciss.c Wed Aug 17 04:06:25 2005
+++ b/drivers/block/cciss.c Wed Aug 17 12:53:40 2005
@@ -1420,8 +1420,10 @@
}
}
/* unlock the buffers from DMA */
+ buff_dma_handle.val32.lower = c->SG[0].Addr.lower;
+ buff_dma_handle.val32.upper = c->SG[0].Addr.upper;
pci_unmap_single( h->pdev, (dma_addr_t) buff_dma_handle.val,
- size, PCI_DMA_BIDIRECTIONAL);
+ c->SG[0].Len, PCI_DMA_BIDIRECTIONAL);
cmd_free(h, c, 0);
return(return_status);
@@ -1860,8 +1862,10 @@
cleanup1:
/* unlock the data buffer from DMA */
+ buff_dma_handle.val32.lower = c->SG[0].Addr.lower;
+ buff_dma_handle.val32.upper = c->SG[0].Addr.upper;
pci_unmap_single(info_p->pdev, (dma_addr_t) buff_dma_handle.val,
- size, PCI_DMA_BIDIRECTIONAL);
+ c->SG[0].Len, PCI_DMA_BIDIRECTIONAL);
cmd_free(info_p, c, 1);
return (status);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] fix cciss DMA unmap brokenness
@ 2005-08-17 20:56 Miller, Mike (OS Dev)
0 siblings, 0 replies; 2+ messages in thread
From: Miller, Mike (OS Dev) @ 2005-08-17 20:56 UTC (permalink / raw)
To: Williamson, Alex (Linux Kernel Dev), Jens Axboe, akpm; +Cc: linux-kernel
Alex wrote:
>
> The CCISS driver seems to loose track of DMA mappings
> created by it's
> fill_cmd() routine. Neither callers of this routine are
> extracting the DMA address created in order to do the unmap.
> Instead, they simply try to unmap 0x0. It's easy to see this
> problem on an x86_64 system when using the "swiotlb=force"
> boot option. In this case, the driver is leaking resources
> of the swiotlb and not causing a sync of the bounce buffer. Thanks
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Acked-by: Mike Miller <mike.miller@hp.com>
>
> diff -r b9c8e9fdd6b2 drivers/block/cciss.c
> --- a/drivers/block/cciss.c Wed Aug 17 04:06:25 2005
> +++ b/drivers/block/cciss.c Wed Aug 17 12:53:40 2005
> @@ -1420,8 +1420,10 @@
> }
> }
> /* unlock the buffers from DMA */
> + buff_dma_handle.val32.lower = c->SG[0].Addr.lower;
> + buff_dma_handle.val32.upper = c->SG[0].Addr.upper;
> pci_unmap_single( h->pdev, (dma_addr_t) buff_dma_handle.val,
> - size, PCI_DMA_BIDIRECTIONAL);
> + c->SG[0].Len, PCI_DMA_BIDIRECTIONAL);
> cmd_free(h, c, 0);
> return(return_status);
>
> @@ -1860,8 +1862,10 @@
>
> cleanup1:
> /* unlock the data buffer from DMA */
> + buff_dma_handle.val32.lower = c->SG[0].Addr.lower;
> + buff_dma_handle.val32.upper = c->SG[0].Addr.upper;
> pci_unmap_single(info_p->pdev, (dma_addr_t) buff_dma_handle.val,
> - size, PCI_DMA_BIDIRECTIONAL);
> + c->SG[0].Len, PCI_DMA_BIDIRECTIONAL);
> cmd_free(info_p, c, 1);
> return (status);
> }
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-17 20:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-17 19:16 [PATCH] fix cciss DMA unmap brokenness Alex Williamson
-- strict thread matches above, loose matches on Subject: below --
2005-08-17 20:56 Miller, Mike (OS Dev)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox