Browse Source

[ath5k] Save proper cacheline size when fixing PCI configuration

Some BIOSes set the PCI cacheline size to zero for the card; the ath5k
driver fixes it to a reasonable in PCI config space, but failed to
correct the internal value it had already read. This resulted in
divide-by-zero errors when cacheline-aligning various data structures.

Fix by setting the internal cachelsz to a sane value at the same time
as we write that value to PCI config space.

Signed-off-by: Marty Connor <mdc@etherboot.org>
tags/v0.9.9
Joshua Oreman 14 years ago
parent
commit
7296f1f21c
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/drivers/net/ath5k/ath5k.c

+ 2
- 1
src/drivers/net/ath5k/ath5k.c View File

@@ -306,7 +306,8 @@ static int ath5k_probe(struct pci_device *pdev,
306 306
 		 * DMA to work so force a reasonable value here if it
307 307
 		 * comes up zero.
308 308
 		 */
309
-		pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 16);
309
+		csz = 16;
310
+		pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz);
310 311
 	}
311 312
 	/*
312 313
 	 * The default setting of latency timer yields poor results,

Loading…
Cancel
Save