Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
rwcr authored and Marty Connor committed Oct 17, 2009
1 parent 489bd2f commit 7296f1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/drivers/net/ath5k/ath5k.c
Expand Up @@ -306,7 +306,8 @@ static int ath5k_probe(struct pci_device *pdev,
* DMA to work so force a reasonable value here if it
* comes up zero.
*/
pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 16);
csz = 16;
pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz);
}
/*
* The default setting of latency timer yields poor results,
Expand Down

0 comments on commit 7296f1f

Please sign in to comment.