mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
[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>
This commit is contained in:
parent
6a445d3ba6
commit
bb2a37bf41
1 changed files with 6 additions and 2 deletions
|
@ -1730,8 +1730,10 @@ case CMD_HARDWARE_ERR:
|
|||
}
|
||||
}
|
||||
/* 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);
|
||||
|
||||
|
@ -2011,8 +2013,10 @@ static int sendcmd(
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue