diff options
author | Mike Miller <mike.miller@hp.com> | 2005-09-13 04:25:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-13 11:22:30 -0400 |
commit | bb2a37bf4131d64b76dcdb126e3ff5bf371b1842 (patch) | |
tree | 7f654cc2fbf4a6e0e1f970d4345486a8d88bdf27 /drivers/block | |
parent | 6a445d3ba6b90ce13a843ad5d1a0867388b08096 (diff) |
[PATCH] cciss: fix for DMA brokeness
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.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/cciss.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 49f05410a117..c56f995aadad 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1730,8 +1730,10 @@ case CMD_HARDWARE_ERR: | |||
1730 | } | 1730 | } |
1731 | } | 1731 | } |
1732 | /* unlock the buffers from DMA */ | 1732 | /* unlock the buffers from DMA */ |
1733 | buff_dma_handle.val32.lower = c->SG[0].Addr.lower; | ||
1734 | buff_dma_handle.val32.upper = c->SG[0].Addr.upper; | ||
1733 | pci_unmap_single( h->pdev, (dma_addr_t) buff_dma_handle.val, | 1735 | pci_unmap_single( h->pdev, (dma_addr_t) buff_dma_handle.val, |
1734 | size, PCI_DMA_BIDIRECTIONAL); | 1736 | c->SG[0].Len, PCI_DMA_BIDIRECTIONAL); |
1735 | cmd_free(h, c, 0); | 1737 | cmd_free(h, c, 0); |
1736 | return(return_status); | 1738 | return(return_status); |
1737 | 1739 | ||
@@ -2011,8 +2013,10 @@ resend_cmd1: | |||
2011 | 2013 | ||
2012 | cleanup1: | 2014 | cleanup1: |
2013 | /* unlock the data buffer from DMA */ | 2015 | /* unlock the data buffer from DMA */ |
2016 | buff_dma_handle.val32.lower = c->SG[0].Addr.lower; | ||
2017 | buff_dma_handle.val32.upper = c->SG[0].Addr.upper; | ||
2014 | pci_unmap_single(info_p->pdev, (dma_addr_t) buff_dma_handle.val, | 2018 | pci_unmap_single(info_p->pdev, (dma_addr_t) buff_dma_handle.val, |
2015 | size, PCI_DMA_BIDIRECTIONAL); | 2019 | c->SG[0].Len, PCI_DMA_BIDIRECTIONAL); |
2016 | cmd_free(info_p, c, 1); | 2020 | cmd_free(info_p, c, 1); |
2017 | return (status); | 2021 | return (status); |
2018 | } | 2022 | } |