Commit c817fa04 authored by Andrew Morton's avatar Andrew Morton Committed by James Bottomley

[PATCH] aic7xxx deadlock fix

We cannot call del_timer_sync() from within that timer's handler function!
parent c891f36a
...@@ -3973,11 +3973,10 @@ ahc_linux_alloc_device(struct ahc_softc *ahc, ...@@ -3973,11 +3973,10 @@ ahc_linux_alloc_device(struct ahc_softc *ahc,
} }
static void static void
ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev) __ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev)
{ {
struct ahc_linux_target *targ; struct ahc_linux_target *targ;
del_timer_sync(&dev->timer);
targ = dev->target; targ = dev->target;
targ->devices[dev->lun] = NULL; targ->devices[dev->lun] = NULL;
free(dev, M_DEVBUF); free(dev, M_DEVBUF);
...@@ -3987,6 +3986,13 @@ ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev) ...@@ -3987,6 +3986,13 @@ ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev)
ahc_linux_free_target(ahc, targ); ahc_linux_free_target(ahc, targ);
} }
static void
ahc_linux_free_device(struct ahc_softc *ahc, struct ahc_linux_device *dev)
{
del_timer_sync(&dev->timer);
__ahc_linux_free_device(ahc, dev);
}
void void
ahc_send_async(struct ahc_softc *ahc, char channel, ahc_send_async(struct ahc_softc *ahc, char channel,
u_int target, u_int lun, ac_code code, void *arg) u_int target, u_int lun, ac_code code, void *arg)
...@@ -4697,7 +4703,7 @@ ahc_linux_dev_timed_unfreeze(u_long arg) ...@@ -4697,7 +4703,7 @@ ahc_linux_dev_timed_unfreeze(u_long arg)
ahc_linux_run_device_queue(ahc, dev); ahc_linux_run_device_queue(ahc, dev);
if (TAILQ_EMPTY(&dev->busyq) if (TAILQ_EMPTY(&dev->busyq)
&& dev->active == 0) && dev->active == 0)
ahc_linux_free_device(ahc, dev); __ahc_linux_free_device(ahc, dev);
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment