slicoss: a hardware debugging question

David Matlack matlackdavid at gmail.com
Mon Apr 21 16:50:50 EDT 2014


I've been working on the staging slicoss driver (for an ethernet NIC).
I haven't been able to find any detailed documentation about the card
online, all I have is the source code.

During the PCI probe routine slic_entry_probe(), the driver attempts
to load some configuration data from the card. The driver disables
interrupts from the deviece and polls the ISR which signals the
completed transfer.

The relevant code is in
drivers/staging/slicoss/slicoss.c:slic_card_init:
[...]
slic_config_get(adapter, phys_configl, phys_configh);

for (;;) {
        if (adapter->pshmem->isr) {
                [...]
        } else {
                mdelay(1);
                i++;
                if (i > 5000) {
                        dev_err(&adapter->pcidev->dev,
                                "%d config data fetch timed out!\n",
                                adapter->port);
                        [...]
                }
        }
}
[...]

The only problem is, this times out more than half the time. And when it
succeeds, it [seemingly] always takes 22 cycles. I have tried increasing
5000 to various higher numbers (up to 50000) with no effect. I thought it
might be a compiler optimization or coherence issue so I threw a mb() in
the loop and that seemed to have no effect as well.

Any recommendations on debugging?

Thanks.
--David



More information about the Kernelnewbies mailing list