Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Matthew Wilcox and committed by
Linus Torvalds
868047fc 1a1a1a75

+10 -14
+10 -7
drivers/block/DAC960.c
··· 17 17 */ 18 18 19 19 20 - #define DAC960_DriverVersion "2.5.48" 21 - #define DAC960_DriverDate "14 May 2006" 20 + #define DAC960_DriverVersion "2.5.49" 21 + #define DAC960_DriverDate "21 Aug 2007" 22 22 23 23 24 24 #include <linux/module.h> ··· 1165 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 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 1172 if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { 1173 1173 CommandMailboxesSize = 0; ··· 1368 1368 dma_addr_t CommandMailboxDMA; 1369 1369 DAC960_V2_CommandStatus_T CommandStatus; 1370 1370 1371 - if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V2_PciDmaMask)) 1372 - return DAC960_Failure(Controller, "DMA mask out of range"); 1373 - Controller->BounceBufferLimit = DAC690_V2_PciDmaMask; 1371 + if (!pci_set_dma_mask(Controller->PCIDevice, DMA_64BIT_MASK)) 1372 + Controller->BounceBufferLimit = DMA_64BIT_MASK; 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 1378 /* This is a temporary dma mapping, used only in the scope of this function */ 1376 1379 CommandMailbox = pci_alloc_consistent(PCI_Device,
-7
drivers/block/DAC960.h
··· 61 61 #define DAC960_V2_MaxPhysicalDevices 272 62 62 63 63 /* 64 - Define the pci dma mask supported by DAC960 V1 and V2 Firmware Controlers 65 - */ 66 - 67 - #define DAC690_V1_PciDmaMask 0xffffffff 68 - #define DAC690_V2_PciDmaMask 0xffffffffffffffffULL 69 - 70 - /* 71 64 Define a 32/64 bit I/O Address data type. 72 65 */ 73 66