| Summary: | CD-RW driver fails unless CD in drive at boot up | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Eyal Soha <eyal> |
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.2-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Eyal Soha
2000-12-10 00:00:01 UTC
The error is in sys/dev/ata/atapi-cd.c, line 122:
/* get drive capabilities, some drives needs this repeated */
for (count = 0 ; count < 5 ; count++) {
if (!(error = acd_mode_sense(cdp, ATAPI_CDROM_CAP_PAGE,
(caddr_t)&cdp->cap, sizeof(cdp->cap))))
break;
}
For debugging purposes, I changed 5 to 0xffffff.
When I have a CD installed in the drive or the CD-RW tray is open, I
usually need only two or three retries. When the CD-RW drive is
closed and there is no CD in it, I need between 6400 and 6500 retries.
The number of retries required fluctuates and drops significantly if I
put a delay before the for() loop. The drive is likely not ready by
the time the ATAPI_CDROM_CAP_PAGE command is being issued.
When the bug isn't being exhibited, the error returned by
acd_mode_sense is 0x5. (After getting error 0x5 once or twice, the
drive responds properly.)
When in the bug case (closed and empty CD-RW drive), the error
returned on the first call to acd_mode_sense() is 0x5. Subsequent
calls all return 0x10 (between 0x400 and 0x440 times) until the final
call which returns 0.
--
Eyal Soha <esoha@cisco.com> Work: (408) 527-9276
Software Engineer Page: (800) 365-4578
Cisco Systems <http://www.cisco.com> Epage: esoha@epage.cisco.com
State Changed From-To: open->closed This drive is buggy, but the atapi CDROM drive should cope with this now. |