2002-09-28 20:47:08

by Arnd Bergmann

[permalink] [raw]
Subject: [patch] e100 schedule while atomic

Running e100 on linux-2.5.39 showed that the driver incorrectly
holds a lock while calling request_irq(), which does kmalloc().

This patch appears to solve the problem. Not sure if it is correct,
but something like it has to be done.

Arnd <><

===== drivers/net/e100/e100_main.c 1.25 vs edited =====
--- 1.25/drivers/net/e100/e100_main.c Fri Sep 20 01:58:59 2002
+++ edited/drivers/net/e100/e100_main.c Sat Sep 28 21:41:11 2002
@@ -986,11 +986,20 @@
netif_start_queue(dev);

e100_start_ru(bdp);
- if ((rc = request_irq(dev->irq, &e100intr, SA_SHIRQ,
- dev->name, dev)) != 0) {
- del_timer_sync(&bdp->watchdog_timer);
- goto err_exit;
+
+ read_unlock(&(bdp->isolate_lock));
+ rc = request_irq(dev->irq, &e100intr, SA_SHIRQ, dev->name, dev);
+ read_lock(&(bdp->isolate_lock));
+
+ if (rc != 0)
+ goto err_exit2;
+
+ if (bdp->driver_isolated) {
+ free_irq(dev->irq, dev);
+ rc = -EBUSY;
+ goto err_exit2;
}
+
if (bdp->params.b_params & PRM_RX_CONG) {
DECLARE_TASKLET(polling_tasklet,
e100_polling_tasklet, (unsigned long) bdp);
@@ -1003,6 +1012,8 @@

goto exit;

+err_exit2:
+ del_timer_sync(&bdp->watchdog_timer);
err_exit:
e100_clear_pools(bdp);
exit:


2002-09-30 21:44:11

by Feldman, Scott

[permalink] [raw]
Subject: RE: [patch] e100 schedule while atomic

Arnd wrote:

> Running e100 on linux-2.5.39 showed that the driver
> incorrectly holds a lock while calling request_irq(), which
> does kmalloc().
>
> This patch appears to solve the problem. Not sure if it is
> correct, but something like it has to be done.

Thanks for pointing this out. I don't think the lock needs to be held at
all in e100_open, so we'll look into cleaning that up. Regardless, we'll
included a fix for this problem in our next set of patches to Jeff.

-scott