Skip to content

Commit 868047f

Browse files
Matthew WilcoxLinus Torvalds
authored andcommitted
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>
1 parent 1a1a1a7 commit 868047f

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

‎drivers/block/DAC960.c‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*/
1818

1919

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"
2222

2323

2424
#include <linux/module.h>
@@ -1165,9 +1165,9 @@ static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T
11651165
int i;
11661166

11671167

1168-
if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V1_PciDmaMask))
1168+
if (pci_set_dma_mask(Controller->PCIDevice, DMA_32BIT_MASK))
11691169
return DAC960_Failure(Controller, "DMA mask out of range");
1170-
Controller->BounceBufferLimit = DAC690_V1_PciDmaMask;
1170+
Controller->BounceBufferLimit = DMA_32BIT_MASK;
11711171

11721172
if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) {
11731173
CommandMailboxesSize = 0;
@@ -1368,9 +1368,12 @@ static bool DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
13681368
dma_addr_t CommandMailboxDMA;
13691369
DAC960_V2_CommandStatus_T CommandStatus;
13701370

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");
13741377

13751378
/* This is a temporary dma mapping, used only in the scope of this function */
13761379
CommandMailbox = pci_alloc_consistent(PCI_Device,

‎drivers/block/DAC960.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@
6060
#define DAC960_V1_MaxPhysicalDevices 45
6161
#define DAC960_V2_MaxPhysicalDevices 272
6262

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-
7063
/*
7164
Define a 32/64 bit I/O Address data type.
7265
*/

0 commit comments

Comments
 (0)