diff options
author | Matthew Wilcox <matthew@wil.cx> | 2007-09-11 18:23:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-11 20:21:19 -0400 |
commit | 868047fcbb85dbb44ddd98c336fef83236a2c06a (patch) | |
tree | a2d6722342fa02c7105399c42f596f6ff5323b12 /drivers/block/DAC960.c | |
parent | 1a1a1a758bf0107d1f78ff1d622f45987803d894 (diff) |
Fix DAC960 driver on machines which don't support 64-bit DMA
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=8942
Use PCI_DMA_* constants instead of own private definitions Fall back to
32-bit DMA mask if a 64-bit one fails
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Acked-by: Jeff Garzik <jeff@garzik.org>
Tested-by: Lars <polynomial-c@gmx.de>
Cc: Alessandro Polverini <alex@nibbles.it>
Cc: <dac@conglom-o.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/DAC960.c')
-rw-r--r-- | drivers/block/DAC960.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 92bf868ca056..504a95d888b2 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c | |||
@@ -17,8 +17,8 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | 19 | ||
20 | #define DAC960_DriverVersion "2.5.48" | 20 | #define DAC960_DriverVersion "2.5.49" |
21 | #define DAC960_DriverDate "14 May 2006" | 21 | #define DAC960_DriverDate "21 Aug 2007" |
22 | 22 | ||
23 | 23 | ||
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
@@ -1165,9 +1165,9 @@ static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T | |||
1165 | int i; | 1165 | int i; |
1166 | 1166 | ||
1167 | 1167 | ||
1168 | if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V1_PciDmaMask)) | 1168 | if (pci_set_dma_mask(Controller->PCIDevice, DMA_32BIT_MASK)) |
1169 | return DAC960_Failure(Controller, "DMA mask out of range"); | 1169 | return DAC960_Failure(Controller, "DMA mask out of range"); |
1170 | Controller->BounceBufferLimit = DAC690_V1_PciDmaMask; | 1170 | Controller->BounceBufferLimit = DMA_32BIT_MASK; |
1171 | 1171 | ||
1172 | if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { | 1172 | if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { |
1173 | CommandMailboxesSize = 0; | 1173 | CommandMailboxesSize = 0; |
@@ -1368,9 +1368,12 @@ static bool DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T | |||
1368 | dma_addr_t CommandMailboxDMA; | 1368 | dma_addr_t CommandMailboxDMA; |
1369 | DAC960_V2_CommandStatus_T CommandStatus; | 1369 | DAC960_V2_CommandStatus_T CommandStatus; |
1370 | 1370 | ||
1371 | if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V2_PciDmaMask)) | 1371 | if (!pci_set_dma_mask(Controller->PCIDevice, DMA_64BIT_MASK)) |
1372 | return DAC960_Failure(Controller, "DMA mask out of range"); | 1372 | Controller->BounceBufferLimit = DMA_64BIT_MASK; |
1373 | Controller->BounceBufferLimit = DAC690_V2_PciDmaMask; | 1373 | else if (!pci_set_dma_mask(Controller->PCIDevice, DMA_32BIT_MASK)) |
1374 | Controller->BounceBufferLimit = DMA_32BIT_MASK; | ||
1375 | else | ||
1376 | return DAC960_Failure(Controller, "DMA mask out of range"); | ||
1374 | 1377 | ||
1375 | /* This is a temporary dma mapping, used only in the scope of this function */ | 1378 | /* This is a temporary dma mapping, used only in the scope of this function */ |
1376 | CommandMailbox = pci_alloc_consistent(PCI_Device, | 1379 | CommandMailbox = pci_alloc_consistent(PCI_Device, |