Norbert Preining <[EMAIL PROTECTED]> writes:
> On Don, 10 Jan 2002, [EMAIL PROTECTED] wrote:
>
>> insmod smc-ircc
>> Using /lib/modules/2.4.17/kernel/drivers/net/irda/smc-ircc.o
>> /lib/modules/2.4.17/kernel/drivers/net/irda/smc-ircc.o: init_module: No such device
>> Hint: insmod errors ca be caused by incorrect module parameters, including invalid
>IO or IRQ parameters
>>
>> --8<--- snip
>
> Do it TWO times >
> modprobe smc-ircc
> modprobe smc-ircc
> this helped for me, don't ask me why!
That's the same experience as I did (except that I used ifconfig to
load the module). The reason was that I had loaded the serial driver
and let it grab the IrDA port first. Looks like smc-ircc/irport will
fail, but force the serial driver away the first time you try to load
it in this case. That's why it succeeds the second time. I guess this
is a bug (is it fixed by ir247_drv_region-2.diff?), and that it may
cause some problems since the serial driver probably still thinks it
is controlling the port. A simple workaround is not to load serial.o
first, or use setserial to avoid it detecting the IrDA port as a
serial port.
Anyway, I looked at the power management functions in smc-ircc, and
that didn't look good at all. It seems to be a half-finished hack to
work around some obscure hardware problem. It doesn't even unregister
itself with the power management system upon closure.
I believe that the thing it tries to do (bringing down/up the irda0
interface on suspend/resume) is something that really belongs in
userspace. It can easily be implemented through hooks in apmd for
those machines that need it. If anyone believes otherwise then they
should write an implementation that at least doesn't cause an oops..
The attached patch will remove all functionality from the power
management functions but keep them as dummies (in case someone wants
to add a hardware check/reenable functionality, that probably belong
here if there is hardware requiring it). The patch will hopefully also
properly unregister the functions when closing the driver. Testing is
as usual limited to "it works for me". It makes suspend/resume work as
expected on the Armada M300, both when irda0 is up and when it's
down. Without it, the driver fails when resuming if the interface is
down and causes an oops when suspended if the interface is up.
Bj�rn
--- linux-2.4.17-orig/drivers/net/irda/smc-ircc.c Fri Oct 5 03:41:09 2001
+++ linux-2.4.17/drivers/net/irda/smc-ircc.c Thu Jan 10 20:10:52 2002
@@ -1117,16 +1117,19 @@
{
MESSAGE("%s, Suspending\n", driver_name);
+#if 0
if (self->io->suspended)
return;
ircc_net_close(self->netdev);
self->io->suspended = 1;
+#endif
}
static void ircc_wakeup(struct ircc_cb *self)
{
+#if 0
unsigned long flags;
if (!self->io->suspended)
@@ -1138,6 +1141,7 @@
ircc_net_open(self->netdev);
restore_flags(flags);
+#endif
MESSAGE("%s, Waking up\n", driver_name);
}
@@ -1173,6 +1177,9 @@
IRDA_DEBUG(0, __FUNCTION__ "\n");
ASSERT(self != NULL, return -1;);
+
+ /* unregister with PM system */
+ pm_unregister(self->pmdev);
iobase = self->irport->io.fir_base;