Bug 26151

Summary: burncd exists before fixating - 4.3 RC #0
Product: Base System Reporter: kar <kar>
Component: binAssignee: Søren Schmidt <sos>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description kar 2001-03-27 17:20:00 UTC
burncd exists before fixating. I was using the following command

1. burncd -f /dev/acd1c blank (for blanking the CDRW)

2. burncd -f /dev/acd1c data cd.iso fixate 

For the command 2, the data was written to disk succesfully when it starts fixating (msg displayed) but the burncd exists. I get PREVENT_ALLOW in bold text in the console. BUT the CDRW fixates and indicates it is busy. After about 2-5 minutes, the lights go off and when i mount the CD, CD is OK. 

I think burncd successfully fixates but the burncd exits before the fixate process completes. 

This problem does not appear in FreeBSD 4.2-RELEASE that i was using until I cvsup-ped the STABLE source.

How-To-Repeat: 1.  burncd -f /dev/acd1c blank (successfull)

2.  burncd -f /dev/acd1c data cd.iso fixate 

command 2 exists before fixating.
Comment 1 Kris Kennaway freebsd_committer freebsd_triage 2001-03-27 19:54:48 UTC
Responsible Changed
From-To: freebsd-bugs->sos

sos wrote burncd
Comment 2 Søren Schmidt freebsd_committer freebsd_triage 2001-04-02 20:30:19 UTC
State Changed
From-To: open->analyzed


Please try this patch and tell me if that works: 
--- atapi-cd.c  2001/02/25 21:35:20     1.48.2.10 
+++ atapi-cd.c  2001/04/02 19:36:45 
@@ -1364,11 +1364,15 @@ 
static int 
acd_close_disk(struct acd_softc *cdp, int multisession) 
{ 
-    int8_t ccb[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,  
-                      0, 0, 0, 0, 0, 0, 0, 0 }; 
+    int8_t ccb1[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,  
+                       0, 0, 0, 0, 0, 0, 0, 0 }; 
+    int8_t ccb2[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0,  
+                       0, 0, 0, 0, 0, 0, 0, 0 }; 
+    struct write_param param; 
int timeout = 5*60*2; 
int error; 
-    struct write_param param; 
+    char tmp[8]; 
+     

if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE, 
(caddr_t)&param, sizeof(param)))) 
@@ -1382,12 +1386,15 @@ 
if ((error = acd_mode_select(cdp, (caddr_t)&param, sizeof(param)))) 
return error; 

-    error = atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 30, NULL, NULL); 
+    error = atapi_queue_cmd(cdp->atp, ccb1, NULL, 0, 0, 30, NULL, NULL); 
if (error) 
return error; 
while (timeout-- > 0) { 
-        if ((error = atapi_test_ready(cdp->atp)) != EBUSY) 
-            return error; 
+        if ((error = atapi_test_ready(cdp->atp)) != EBUSY) { 
+           if (atapi_queue_cmd(cdp->atp, ccb2, tmp, sizeof(tmp), 
+                               ATPR_F_READ, 30, NULL, NULL) != EBUSY) 
+               return error; 
+       } 
tsleep(&error, PRIBIO, "acdcld", hz/2); 
} 
return EIO;
Comment 3 kar 2001-04-03 12:42:40 UTC
I have applied the patch but the problem still persists. burncd exits before 
fixating is complete.

I get a new message in bold. 

The following messages appear in bold:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

I am using Sony CD-RW (CRX100E).

Thanks
Karthik


--- atapi-cd.c  2001/02/25 21:35:20     1.48.2.10 
+++ atapi-cd.c  2001/04/02 19:36:45 
@@ -1364,11 +1364,15 @@ 
static int 
acd_close_disk(struct acd_softc *cdp, int multisession) 
{ 
-    int8_t ccb[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,  
-                      0, 0, 0, 0, 0, 0, 0, 0 }; 
+    int8_t ccb1[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,  
+                       0, 0, 0, 0, 0, 0, 0, 0 }; 
+    int8_t ccb2[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0,  
+                       0, 0, 0, 0, 0, 0, 0, 0 }; 
+    struct write_param param; 
int timeout = 5*60*2; 
int error; 
-    struct write_param param; 
+    char tmp[8]; 
+     

if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE, 
(caddr_t)&param, sizeof(param)))) 
@@ -1382,12 +1386,15 @@ 
if ((error = acd_mode_select(cdp, (caddr_t)&param, sizeof(param)))) 
return error; 

-    error = atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 30, NULL, NULL); 
+    error = atapi_queue_cmd(cdp->atp, ccb1, NULL, 0, 0, 30, NULL, NULL); 
if (error) 
return error; 
while (timeout-- > 0) { 
-        if ((error = atapi_test_ready(cdp->atp)) != EBUSY) 
-            return error; 
+        if ((error = atapi_test_ready(cdp->atp)) != EBUSY) { 
+           if (atapi_queue_cmd(cdp->atp, ccb2, tmp, sizeof(tmp), 
+                               ATPR_F_READ, 30, NULL, NULL) != EBUSY) 
+               return error; 
+       } 
tsleep(&error, PRIBIO, "acdcld", hz/2); 
} 
return EIO;
Comment 4 kar 2001-04-03 19:05:23 UTC
Messages:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

Occurence:

a. message 1 appeared after burncd exits when I use this command:
    burncd -f /dev/acd1c blank 

b. message 2 and 3 appeared after burncd exits when I use this command:
     burncd -f /dev/acd1c data cd.iso fixate
  
   After the data is written to disk, "fixating CD , please wait.." message 
appears, then burncd exits. After it exits  (I get # prompt), then the 
message 2 and 3 appears.

Thanks
Karthik



----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 11:42:40 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


I have applied the patch but the problem still persists. burncd exits before
fixating is complete.

I get a new message in bold.

The following messages appear in bold:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

I am using Sony CD-RW (CRX100E).

Thanks
Karthik


--- atapi-cd.c  2001/02/25 21:35:20     1.48.2.10
+++ atapi-cd.c  2001/04/02 19:36:45
@@ -1364,11 +1364,15 @@
static int
acd_close_disk(struct acd_softc *cdp, int multisession)
{
-    int8_t ccb[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
-                      0, 0, 0, 0, 0, 0, 0, 0 };
+    int8_t ccb1[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
+                       0, 0, 0, 0, 0, 0, 0, 0 };
+    int8_t ccb2[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0,
+                       0, 0, 0, 0, 0, 0, 0, 0 };
+    struct write_param param;
int timeout = 5*60*2;
int error;
-    struct write_param param;
+    char tmp[8];
+

if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE,
(caddr_t)&param, sizeof(param))))
@@ -1382,12 +1386,15 @@
if ((error = acd_mode_select(cdp, (caddr_t)&param, sizeof(param))))
return error;

-    error = atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 30, NULL, NULL);
+    error = atapi_queue_cmd(cdp->atp, ccb1, NULL, 0, 0, 30, NULL, NULL);
if (error)
return error;
while (timeout-- > 0) {
-        if ((error = atapi_test_ready(cdp->atp)) != EBUSY)
-            return error;
+        if ((error = atapi_test_ready(cdp->atp)) != EBUSY) {
+           if (atapi_queue_cmd(cdp->atp, ccb2, tmp, sizeof(tmp),
+                               ATPR_F_READ, 30, NULL, NULL) != EBUSY)
+               return error;
+       }
tsleep(&error, PRIBIO, "acdcld", hz/2);
}
return EIO;

-------------------------------------------------------
Comment 5 kar 2001-04-03 21:53:26 UTC
The patch works well. Now I don't get READ_CAPACITY and PREVENT_ALLOW 
messages, but burncd waits for too long even after the fixating process is 
completed.  This I found out as the CD-RECORDER light goes off completely 
(not blinking) but the burncd still waits. 

Using CTRL+C while waiting does not terminate the burncd.

Here is the duration of the process:
    Total wait after the message "fixating ..." displayed: 5 minutes (approx)
    Time taken for actual fixation: 2 minutes (approx.)
    Extra wait: rest.


BTW, can you suppress the message "READ_TOC", if that does not take too much 
time. 

Thanks
Karthik



----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 18:05:23 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


Messages:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

Occurence:

a. message 1 appeared after burncd exits when I use this command:
    burncd -f /dev/acd1c blank

b. message 2 and 3 appeared after burncd exits when I use this command:
     burncd -f /dev/acd1c data cd.iso fixate

   After the data is written to disk, "fixating CD , please wait.." message
appears, then burncd exits. After it exits  (I get # prompt), then the
message 2 and 3 appears.

Thanks
Karthik



----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 11:42:40 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


I have applied the patch but the problem still persists. burncd exits before
fixating is complete.

I get a new message in bold.

The following messages appear in bold:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

I am using Sony CD-RW (CRX100E).

Thanks
Karthik


--- atapi-cd.c  2001/02/25 21:35:20     1.48.2.10
+++ atapi-cd.c  2001/04/02 19:36:45
@@ -1364,11 +1364,15 @@
static int
acd_close_disk(struct acd_softc *cdp, int multisession)
{
-    int8_t ccb[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
-                      0, 0, 0, 0, 0, 0, 0, 0 };
+    int8_t ccb1[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
+                       0, 0, 0, 0, 0, 0, 0, 0 };
+    int8_t ccb2[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0,
+                       0, 0, 0, 0, 0, 0, 0, 0 };
+    struct write_param param;
int timeout = 5*60*2;
int error;
-    struct write_param param;
+    char tmp[8];
+

if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE,
(caddr_t)&param, sizeof(param))))
@@ -1382,12 +1386,15 @@
if ((error = acd_mode_select(cdp, (caddr_t)&param, sizeof(param))))
return error;

-    error = atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 30, NULL, NULL);
+    error = atapi_queue_cmd(cdp->atp, ccb1, NULL, 0, 0, 30, NULL, NULL);
if (error)
return error;
while (timeout-- > 0) {
-        if ((error = atapi_test_ready(cdp->atp)) != EBUSY)
-            return error;
+        if ((error = atapi_test_ready(cdp->atp)) != EBUSY) {
+           if (atapi_queue_cmd(cdp->atp, ccb2, tmp, sizeof(tmp),
+                               ATPR_F_READ, 30, NULL, NULL) != EBUSY)
+               return error;
+       }
tsleep(&error, PRIBIO, "acdcld", hz/2);
}
return EIO;

-------------------------------------------------------

-------------------------------------------------------
Comment 6 kar 2001-04-03 21:59:02 UTC
Sorry, I missed one thing in my previous mail (below).

I get a message "fixate returning early 0". Hope this is a debug message and 
will taken out later.

Thanks
Karthik

----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 20:53:26 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


The patch works well. Now I don't get READ_CAPACITY and PREVENT_ALLOW
messages, but burncd waits for too long even after the fixating process is
completed.  This I found out as the CD-RECORDER light goes off completely
(not blinking) but the burncd still waits.

Using CTRL+C while waiting does not terminate the burncd.

Here is the duration of the process:
    Total wait after the message "fixating ..." displayed: 5 minutes (approx)
    Time taken for actual fixation: 2 minutes (approx.)
    Extra wait: rest.


BTW, can you suppress the message "READ_TOC", if that does not take too much
time.

Thanks
Karthik



----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 18:05:23 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


Messages:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

Occurence:

a. message 1 appeared after burncd exits when I use this command:
    burncd -f /dev/acd1c blank

b. message 2 and 3 appeared after burncd exits when I use this command:
     burncd -f /dev/acd1c data cd.iso fixate

   After the data is written to disk, "fixating CD , please wait.." message
appears, then burncd exits. After it exits  (I get # prompt), then the
message 2 and 3 appears.

Thanks
Karthik



----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 11:42:40 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


I have applied the patch but the problem still persists. burncd exits before
fixating is complete.

I get a new message in bold.

The following messages appear in bold:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

I am using Sony CD-RW (CRX100E).

Thanks
Karthik


--- atapi-cd.c  2001/02/25 21:35:20     1.48.2.10
+++ atapi-cd.c  2001/04/02 19:36:45
@@ -1364,11 +1364,15 @@
static int
acd_close_disk(struct acd_softc *cdp, int multisession)
{
-    int8_t ccb[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
-                      0, 0, 0, 0, 0, 0, 0, 0 };
+    int8_t ccb1[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
+                       0, 0, 0, 0, 0, 0, 0, 0 };
+    int8_t ccb2[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0,
+                       0, 0, 0, 0, 0, 0, 0, 0 };
+    struct write_param param;
int timeout = 5*60*2;
int error;
-    struct write_param param;
+    char tmp[8];
+

if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE,
(caddr_t)&param, sizeof(param))))
@@ -1382,12 +1386,15 @@
if ((error = acd_mode_select(cdp, (caddr_t)&param, sizeof(param))))
return error;

-    error = atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 30, NULL, NULL);
+    error = atapi_queue_cmd(cdp->atp, ccb1, NULL, 0, 0, 30, NULL, NULL);
if (error)
return error;
while (timeout-- > 0) {
-        if ((error = atapi_test_ready(cdp->atp)) != EBUSY)
-            return error;
+        if ((error = atapi_test_ready(cdp->atp)) != EBUSY) {
+           if (atapi_queue_cmd(cdp->atp, ccb2, tmp, sizeof(tmp),
+                               ATPR_F_READ, 30, NULL, NULL) != EBUSY)
+               return error;
+       }
tsleep(&error, PRIBIO, "acdcld", hz/2);
}
return EIO;

-------------------------------------------------------

-------------------------------------------------------

-------------------------------------------------------
Comment 7 kar 2001-04-04 14:12:13 UTC
I managed to add the printf statements within my knowledge limits in C.

I got the speed, here is the text printed out for blanking

1> max_rs: 35344  cur_rs: 33541  max_ws: 49666 cur_ws 24833
2> max_rs: 4234  cur_rs: 1411  max_ws 706  cur_ws: 353

The text printed out before writing:

1> max_rs: 35344  cur_rs: 49666  max_ws: 49666 cur_ws 24833
2> max_rs: 4234  cur_rs: 706  max_ws 706  cur_ws: 353


max_rs = max_read_speed
cur_rs = cur_read_speed
max_ws = max_write_speed
cur_ws = cur_write_speed

The above speed values are from cdp->cap.xxxxx

I have used "%d" in printf. and the speeds are from function acd_set_speed.
The statements are added just below the for loop and after ntohs()
 conversion.

1> the values before ntohs() conversion.
2> the values after ntohs() conversion

Hope this helps you.

Thanks
Karthik

----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 20:59:02 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


Sorry, I missed one thing in my previous mail (below).

I get a message "fixate returning early 0". Hope this is a debug message and
will taken out later.

Thanks
Karthik

----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 20:53:26 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


The patch works well. Now I don't get READ_CAPACITY and PREVENT_ALLOW
messages, but burncd waits for too long even after the fixating process is
completed.  This I found out as the CD-RECORDER light goes off completely
(not blinking) but the burncd still waits.

Using CTRL+C while waiting does not terminate the burncd.

Here is the duration of the process:
    Total wait after the message "fixating ..." displayed: 5 minutes (approx)
    Time taken for actual fixation: 2 minutes (approx.)
    Extra wait: rest.


BTW, can you suppress the message "READ_TOC", if that does not take too much
time.

Thanks
Karthik



----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 18:05:23 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


Messages:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

Occurence:

a. message 1 appeared after burncd exits when I use this command:
    burncd -f /dev/acd1c blank

b. message 2 and 3 appeared after burncd exits when I use this command:
     burncd -f /dev/acd1c data cd.iso fixate

   After the data is written to disk, "fixating CD , please wait.." message
appears, then burncd exits. After it exits  (I get # prompt), then the
message 2 and 3 appears.

Thanks
Karthik



----------  Forwarded Message  ----------
Subject: Re: bin/26151: burncd exists before fixating - 4.3 RC #0
Date: Tue, 3 Apr 2001 11:42:40 +0000
From: K Karthik <kar@mglorysb.com>
To: freebsd-gnats-submit@FreeBSD.org, kar@mglorysb.com


I have applied the patch but the problem still persists. burncd exits before
fixating is complete.

I get a new message in bold.

The following messages appear in bold:

1. acd1: READ_TOC - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)
2. acd1: READ_CAPACITY - ILLEGAL REQUEST asc=24 ascq=00 error=04 (new)
3. acd1: PREVENT_ALLOW - ILLEGAL REQUEST asc=24 ascq=00 error=04 (old)

I am using Sony CD-RW (CRX100E).

Thanks
Karthik


--- atapi-cd.c  2001/02/25 21:35:20     1.48.2.10
+++ atapi-cd.c  2001/04/02 19:36:45
@@ -1364,11 +1364,15 @@
static int
acd_close_disk(struct acd_softc *cdp, int multisession)
{
-    int8_t ccb[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
-                      0, 0, 0, 0, 0, 0, 0, 0 };
+    int8_t ccb1[16] = { ATAPI_CLOSE_TRACK, 0x01, 0x02, 0, 0, 0, 0, 0,
+                       0, 0, 0, 0, 0, 0, 0, 0 };
+    int8_t ccb2[16] = { ATAPI_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0,
+                       0, 0, 0, 0, 0, 0, 0, 0 };
+    struct write_param param;
int timeout = 5*60*2;
int error;
-    struct write_param param;
+    char tmp[8];
+

if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE,
(caddr_t)&param, sizeof(param))))
@@ -1382,12 +1386,15 @@
if ((error = acd_mode_select(cdp, (caddr_t)&param, sizeof(param))))
return error;

-    error = atapi_queue_cmd(cdp->atp, ccb, NULL, 0, 0, 30, NULL, NULL);
+    error = atapi_queue_cmd(cdp->atp, ccb1, NULL, 0, 0, 30, NULL, NULL);
if (error)
return error;
while (timeout-- > 0) {
-        if ((error = atapi_test_ready(cdp->atp)) != EBUSY)
-            return error;
+        if ((error = atapi_test_ready(cdp->atp)) != EBUSY) {
+           if (atapi_queue_cmd(cdp->atp, ccb2, tmp, sizeof(tmp),
+                               ATPR_F_READ, 30, NULL, NULL) != EBUSY)
+               return error;
+       }
tsleep(&error, PRIBIO, "acdcld", hz/2);
}
return EIO;

-------------------------------------------------------

-------------------------------------------------------

-------------------------------------------------------

-------------------------------------------------------

-------------------------------------------------------
Comment 8 Søren Schmidt freebsd_committer freebsd_triage 2001-04-16 22:20:10 UTC
State Changed
From-To: analyzed->closed


This is fixed in -current, a MFC will bring it to 4.x but 
probably after 4.3 release.