fdc.c (6e50e38fcce8c444397d635c689c842a5af05dae) fdc.c (5f6fcd82a2fe44a9a330cd655028e5ea35d0c00a)
1/*-
2 * Copyright (c) 2004 Poul-Henning Kamp
3 * Copyright (c) 1990 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Don Ahn.
8 *

--- 1191 unchanged lines hidden (view full) ---

1200 printf("\n");
1201 }
1202 printf("Retry line %d\n", retry_line);
1203 }
1204 fdc->retry += i;
1205 mtx_lock(&fdc->fdc_mtx);
1206 }
1207 fdc->flags &= ~(FDC_KTHREAD_EXIT | FDC_KTHREAD_ALIVE);
1/*-
2 * Copyright (c) 2004 Poul-Henning Kamp
3 * Copyright (c) 1990 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Don Ahn.
8 *

--- 1191 unchanged lines hidden (view full) ---

1200 printf("\n");
1201 }
1202 printf("Retry line %d\n", retry_line);
1203 }
1204 fdc->retry += i;
1205 mtx_lock(&fdc->fdc_mtx);
1206 }
1207 fdc->flags &= ~(FDC_KTHREAD_EXIT | FDC_KTHREAD_ALIVE);
1208 wakeup(&fdc->fdc_thread);
1209 mtx_unlock(&fdc->fdc_mtx);
1210
1211 kthread_exit(0);
1212}
1213
1214/*
1215 * Enqueue a request.
1216 */

--- 489 unchanged lines hidden (view full) ---

1706
1707 fdc = device_get_softc(dev);
1708
1709 /* have our children detached first */
1710 if ((error = bus_generic_detach(dev)))
1711 return (error);
1712
1713 /* kill worker thread */
1208 mtx_unlock(&fdc->fdc_mtx);
1209
1210 kthread_exit(0);
1211}
1212
1213/*
1214 * Enqueue a request.
1215 */

--- 489 unchanged lines hidden (view full) ---

1705
1706 fdc = device_get_softc(dev);
1707
1708 /* have our children detached first */
1709 if ((error = bus_generic_detach(dev)))
1710 return (error);
1711
1712 /* kill worker thread */
1714 fdc->flags |= FDC_KTHREAD_EXIT;
1715 mtx_lock(&fdc->fdc_mtx);
1713 mtx_lock(&fdc->fdc_mtx);
1714 fdc->flags |= FDC_KTHREAD_EXIT;
1716 wakeup(&fdc->head);
1717 while ((fdc->flags & FDC_KTHREAD_ALIVE) != 0)
1718 msleep(&fdc->fdc_thread, &fdc->fdc_mtx, PRIBIO, "fdcdet", 0);
1719 mtx_unlock(&fdc->fdc_mtx);
1720
1721 /* reset controller, turn motor off */
1722 fdout_wr(fdc, 0);
1723

--- 328 unchanged lines hidden ---
1715 wakeup(&fdc->head);
1716 while ((fdc->flags & FDC_KTHREAD_ALIVE) != 0)
1717 msleep(&fdc->fdc_thread, &fdc->fdc_mtx, PRIBIO, "fdcdet", 0);
1718 mtx_unlock(&fdc->fdc_mtx);
1719
1720 /* reset controller, turn motor off */
1721 fdout_wr(fdc, 0);
1722

--- 328 unchanged lines hidden ---