Deleted Added
full compact
28c28
< __FBSDID("$FreeBSD: head/sys/dev/aic/aic.c 192066 2009-05-13 22:31:25Z des $");
---
> __FBSDID("$FreeBSD: head/sys/dev/aic/aic.c 241591 2012-10-15 16:09:59Z jhb $");
30a31
> #include <sys/conf.h>
38a40
> #include <sys/rman.h>
53a56
> static void aic_intr_locked(struct aic_softc *aic);
74,75d76
< static struct aic_scb *free_scbs;
<
80,83c81,85
< int s = splcam();
< if ((scb = free_scbs) != NULL)
< free_scbs = (struct aic_scb *)free_scbs->ccb;
< splx(s);
---
>
> if (!dumping)
> mtx_assert(&aic->lock, MA_OWNED);
> if ((scb = SLIST_FIRST(&aic->free_scbs)) != NULL)
> SLIST_REMOVE_HEAD(&aic->free_scbs, link);
90c92,94
< int s = splcam();
---
>
> if (!dumping)
> mtx_assert(&aic->lock, MA_OWNED);
97,99c101
< scb->ccb = (union ccb *)free_scbs;
< free_scbs = scb;
< splx(s);
---
> SLIST_INSERT_HEAD(&aic->free_scbs, scb, link);
106d107
< int s;
110a112
> mtx_assert(&aic->lock, MA_OWNED);
119d120
< s = splcam();
121d121
< splx(s);
178,179d177
< s = splcam();
<
217d214
< splx(s);
238d234
< s = splcam();
251d246
< splx(s);
314d308
< int s;
316,317c310,311
< s = splcam();
<
---
> if (!dumping)
> mtx_assert(&aic->lock, MA_OWNED);
319d312
< splx(s);
329,330c322,323
< ccb->ccb_h.timeout_ch = timeout(aic_timeout, (caddr_t)scb,
< (ccb->ccb_h.timeout * hz) / 1000);
---
> callout_reset(&scb->timer, (ccb->ccb_h.timeout * hz) / 1000,
> aic_timeout, scb);
333d325
< splx(s);
1056c1048
< untimeout(aic_timeout, (caddr_t)scb, ccb->ccb_h.timeout_ch);
---
> callout_stop(&scb->timer);
1086,1088c1078,1080
< ccb_h->timeout_ch =
< timeout(aic_timeout, (caddr_t)pending_scb,
< (ccb_h->timeout * hz) / 1000);
---
> callout_reset(&pending_scb->timer,
> (ccb_h->timeout * hz) / 1000, aic_timeout,
> pending_scb);
1105,1107c1097,1099
< ccb_h->timeout_ch =
< timeout(aic_timeout, (caddr_t)nexus_scb,
< (ccb_h->timeout * hz) / 1000);
---
> callout_reset(&nexus_scb->timer,
> (ccb_h->timeout * hz) / 1000, aic_timeout,
> nexus_scb);
1126c1118
< aic_intr(cam_sim_softc(sim));
---
> aic_intr_locked(cam_sim_softc(sim));
1135d1126
< int s;
1136a1128
> mtx_assert(&aic->lock, MA_OWNED);
1143,1144d1134
< s = splcam();
<
1146d1135
< splx(s);
1153a1143
> struct aic_scb *pending_scb;
1161,1162c1151,1152
< untimeout(aic_timeout, (caddr_t)ccb_h->ccb_scb_ptr,
< ccb_h->timeout_ch);
---
> pending_scb = ccb_h->ccb_scb_ptr;
> callout_stop(&pending_scb->timer);
1166,1167c1156,1157
< untimeout(aic_timeout, (caddr_t)ccb_h->ccb_scb_ptr,
< ccb_h->timeout_ch);
---
> pending_scb = ccb_h->ccb_scb_ptr;
> callout_stop(&pending_scb->timer);
1171,1172c1161
< ccb->ccb_h.timeout_ch =
< timeout(aic_timeout, (caddr_t)scb, 5 * hz);
---
> callout_reset(&scb->timer, 5 * hz, aic_timeout, scb);
1181,1182d1169
<
< splx(s);
1188a1176,1184
>
> mtx_lock(&aic->lock);
> aic_intr_locked(aic);
> mtx_unlock(&aic->lock);
> }
>
> void
> aic_intr_locked(struct aic_softc *aic)
> {
1436a1433
> SLIST_INIT(&aic->free_scbs);
1484d1480
< free_scbs = NULL;
1487a1484
> callout_init_mtx(&scb->timer, &aic->lock, 0);
1546c1543
< aic->unit, &Giant, 2, 256, devq);
---
> device_get_unit(aic->dev), &aic->lock, 2, 256, devq);
1551a1549
> mtx_lock(&aic->lock);
1553a1552
> mtx_unlock(&aic->lock);
1561a1561
> mtx_unlock(&aic->lock);
1567c1567
< printf("aic%d: %s", aic->unit, aic_chip_names[aic->chip_type]);
---
> device_printf(aic->dev, "%s", aic_chip_names[aic->chip_type]);
1576a1577
> mtx_unlock(&aic->lock);
1582a1584,1587
> struct aic_scb *scb;
> int i;
>
> mtx_lock(&aic->lock);
1586a1592,1596
> mtx_unlock(&aic->lock);
> for (i = 255; i >= 0; i--) {
> scb = &aic->scbs[i];
> callout_drain(&scb->timer);
> }