Bug in ForeRunner LE (cache line settings) (was ATM (LANE) - related Kernel-Crashes)

From: chas williams (contractor)
Date: Tue Mar 16 2004 - 12:59:35 EST


while i was looking at the bug report on the sourceforge site, i decided
to take a quick look at your nicstar problem. can you try the following
patch (apply with patch -p1).


===== drivers/atm/nicstar.c 1.14 vs edited =====
--- 1.14/drivers/atm/nicstar.c Sun Feb 29 13:53:50 2004
+++ edited/drivers/atm/nicstar.c Tue Mar 16 12:43:19 2004
@@ -467,7 +467,7 @@
{
int j;
struct ns_dev *card = NULL;
- unsigned char pci_latency;
+ unsigned char pci_latency, cache_size;
unsigned error;
u32 data;
u32 u32d[4];
@@ -512,6 +512,21 @@
PRINTK("nicstar%d: membase at 0x%x.\n", i, card->membase);

pci_set_master(pcidev);
+
+ if (pci_read_config_byte(pcidev, PCI_CACHE_LINE_SIZE, &cache_size)) {
+ printk("nicstar%d: can't read cache line size?\n", i);
+ error = 6;
+ ns_init_card_error(card, error);
+ return error;
+ }
+
+ if ((cache_size << 2) != L1_CACHE_BYTES) {
+ printk("nicstar%d: PCI cache line size set incorrectly (%d), ", i, cache_size);
+ cache_size = L1_CACHE_BYTES >> 2;
+ printk("setting cache line size to %d\n", cache_size);
+ if (pci_write_config_byte(pcidev, PCI_CACHE_LINE_SIZE, cache_size))
+ printk("nicstar%d: can't set cache line size to %d\n", i, cache_size);
+ }

if (pci_read_config_byte(pcidev, PCI_LATENCY_TIMER, &pci_latency) != 0)
{
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/