Date: Fri, 25 Oct 1996 02:10:22 -0400 From: Luoqi Chen <luoqi@watermarkgroup.com> To: freebsd-hackers@freebsd.org Subject: ATAPI bug fix Message-ID: <327059CE.41C67EA6@watermarkgroup.com>
next in thread | raw e-mail | index | archive | help
A process may hang when a CD is inserted during an open operation (90% of the time if I try to switch CD when xcdplayer is running). In function atapi_start(), the request may have already failed before wdstart returns (e.g. timeout waiting for DRQ because of insertion of the CD). The fix is sleep only if the request is still on the queue. The following diff is for 2.1.5R. -lq *** atapi.c.orig Fri Oct 25 00:28:58 1996 --- atapi.c Fri Oct 25 01:55:03 1996 *************** *** 788,794 **** ac->cmd[13], ac->cmd[14], ac->cmd[15], count); atapi_enqueue (ata, ac); wdstart (ata->ctrlr); ! tsleep ((caddr_t)ac, PRIBIO, "atareq", 0); result = ac->result; atapi_free (ata, ac); --- 788,795 ---- ac->cmd[13], ac->cmd[14], ac->cmd[15], count); atapi_enqueue (ata, ac); wdstart (ata->ctrlr); ! if (ac == ata->queue) ! tsleep ((caddr_t)ac, PRIBIO, "atareq", 0); result = ac->result; atapi_free (ata, ac);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?327059CE.41C67EA6>