[Prism54-devel] Resetting the device doesn't wait for initialization

Jens Maurer Jens.Maurer@gmx.net
Mon, 12 Jan 2004 23:34:35 +0100


Hello!

Our reset procedure is in several parts:

The first part is in islpci_reset(), which uploads the firmware
and then calls islpci_reset_if(), which performs a soft reset
on the firmware.  Then, it returns.

The second part waits for ISL38XX_INT_IDENT_INIT from the device
to acknowledge the reset and then schedules further initialization
using
    schedule_work(&priv->mib_init_work);

The third part is in prism54_mib_init_work(), invoked from
schedule_work(), that sets all the funny OID-based stuff.

The problem is that "islpci_reset()" (and thus "ifconfig up")
can return (and enable the TX queue) BEFORE all the OID-based
settings have been performed.  Therefore, some packets may
already (attempt to) be sent before the device is fully
configured.  This sounds bad at least from a conceptual
standpoint.

I suggest the following:
The first part remains unchanged, except that we wait
on a waitqueue for the ISL38XX_INT_IDENT_INIT to happen
(with a timeout, of course, just in case the device is
acting funny).
The interrupt wakes the waiters on the waitqueue.
We then perform the third part as described above.  Only
when it is finished do we return from "islpci_reset()"
and enable the TX queue.  This also makes it easier to
understand the thread of control, because there are less
indirect calls.

Ideas, opinions?

Jens Maurer