[patch] e100 schedule while atomic

From: Arnd Bergmann (arnd@bergmann-dalldorf.de)
Date: Sat Sep 28 2002 - 15:53:14 EST


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:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Sep 30 2002 - 22:00:38 EST