All of lore.kernel.org
 help / color / mirror / Atom feed
* slicoss: a hardware debugging question
@ 2014-04-21 20:50 David Matlack
  2014-04-22  5:01 ` David Matlack
  0 siblings, 1 reply; 2+ messages in thread
From: David Matlack @ 2014-04-21 20:50 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* slicoss: a hardware debugging question
  2014-04-21 20:50 slicoss: a hardware debugging question David Matlack
@ 2014-04-22  5:01 ` David Matlack
  0 siblings, 0 replies; 2+ messages in thread
From: David Matlack @ 2014-04-22  5:01 UTC (permalink / raw)
  To: kernelnewbies

On 04/21, David Matlack wrote:
> The only problem is, this times out more than half the time. And when it
> succeeds, it [seemingly] always takes 22 cycles.

Figured it out :). The driver was only telling the device about the
lower 32-bits of the address of the ISR. That doesn't quite work on
64-bit machines!

--David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-22  5:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-21 20:50 slicoss: a hardware debugging question David Matlack
2014-04-22  5:01 ` David Matlack

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.