Skip to contentSkip to conversation

2.6.25-rc1/2 CD/DVD burning broken

PATCH Applied Andreas Schwab 7 participants 25 messages Feb 16, 2008 – Feb 26, 2008

lore
Share & tools
lore
#0 lore raw

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid)
resid: 63488

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#1 lore raw
Quoted 11 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid) resid: 63488

Does libata on the same hardware work?

Jeff

#2 lore raw
Quoted 13 lines · Jeff Garzik
Quoted 11 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid) resid: 63488

Quoted 1 line

Does libata on the same hardware work?

There is no libata driver for ide-pmac.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#3 lore raw
Quoted 14 lines · Andreas Schwab
Quoted 12 lines · Jeff Garzik
Quoted 11 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid) resid: 63488

Quoted 3 lines
Quoted 1 line

Does libata on the same hardware work?

There is no libata driver for ide-pmac.

..

What chipset is that.. CMD646 ?

#4 lore raw
Quoted 15 lines · Mark Lord
Quoted 14 lines · Andreas Schwab
Quoted 12 lines · Jeff Garzik
Quoted 11 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid) resid: 63488

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Does libata on the same hardware work?

There is no libata driver for ide-pmac.

..

What chipset is that.. CMD646 ?

Apple KeyLargo ATA-3 and Apple K2 ATA-6.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#5 lore raw
In reply to Andreas Schwab

Hi,

Quoted 4 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Quoted 8 lines

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid)
resid: 63488

blk_end_request: changing ide-cd (take 4)

This patch converts ide-cd (cdrom_newpc_intr()) to use blk_end_request interfaces. Related 'uptodate' arguments are converted to 'error'.

In PIO mode, ide-cd (cdrom_newpc_intr()) needs to defer end_that_request_last() until the device clears DRQ_STAT and raises an interrupt after end_that_request_first().
So blk_end_request() has to return without completing request even if no leftover in the request.

ide-cd uses blk_end_request_callback() and a dummy callback function, which just returns value '1', to tell blk_end_request_callback() about that.

[...]

I looked at the commit again but nothing seems obviously wrong (probably there was a silent change in the behavior of block layer API that upsets ide-cd)...

Kiyoshi/Jens: please follow up on this bug.

Thanks,
Bart

#6 lore raw

Hi Andreas,

Quoted 4 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Quoted 8 lines

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid)
resid: 63488

Could you try this patch?
I've only done a compile test, so this patch may not work.

During the conversion to blk_end_request, the code was changed *not* to set rq->data_len = 0.
I removed that part because I thought it was just a trigger to call post_transform_command(). However, since data_len can be used as a residual length of the transfer, it might have to remain there.
Actually, wodim seems checking the residual count how far it wrote (e.g. wodim/wodim.c:write_track_data()).

This patch brings back the rq->data_len = 0.

drivers/ide/ide-cd.c +5 -1
@@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(
 end_request:
 	if (blk_pc_request(rq)) {
 		unsigned long flags;
+		unsigned int dlen = rq->data_len;
+
+		if (dma)
+			rq->data_len = 0;
 
 		spin_lock_irqsave(&ide_lock, flags);
-		if (__blk_end_request(rq, 0, rq->data_len))
+		if (__blk_end_request(rq, 0, dlen))
 			BUG();
 		HWGROUP(drive)->rq = NULL;
 		spin_unlock_irqrestore(&ide_lock, flags);

Thanks,
Kiyoshi Ueda

#7 lore raw

It works great for me.

Thanks,
Laura.

Quoted 49 lines · Kiyoshi Ueda

Hi Andreas,

Quoted 11 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid) resid: 63488

Could you try this patch?
I've only done a compile test, so this patch may not work.

During the conversion to blk_end_request, the code was changed *not* to set rq->data_len = 0.
I removed that part because I thought it was just a trigger to call post_transform_command(). However, since data_len can be used as a residual length of the transfer, it might have to remain there.
Actually, wodim seems checking the residual count how far it wrote (e.g. wodim/wodim.c:write_track_data()).

This patch brings back the rq->data_len = 0.

drivers/ide/ide-cd.c +5 -1
@@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(
 end_request:
 	if (blk_pc_request(rq)) {
 		unsigned long flags;
+		unsigned int dlen = rq->data_len;
+
+		if (dma)
+			rq->data_len = 0;
 
 		spin_lock_irqsave(&ide_lock, flags);
-		if (__blk_end_request(rq, 0, rq->data_len))
+		if (__blk_end_request(rq, 0, dlen))
 			BUG();
 		HWGROUP(drive)->rq = NULL;
 		spin_unlock_irqrestore(&ide_lock, flags);

Thanks,
Kiyoshi Ueda

#8 lore raw
In reply to Kiyoshi Ueda
Quoted 12 lines · Kiyoshi Ueda

Could you try this patch?
I've only done a compile test, so this patch may not work.

During the conversion to blk_end_request, the code was changed *not* to set rq->data_len = 0.
I removed that part because I thought it was just a trigger to call post_transform_command(). However, since data_len can be used as a residual length of the transfer, it might have to remain there.
Actually, wodim seems checking the residual count how far it wrote (e.g. wodim/wodim.c:write_track_data()).

Quoted 1 line

This patch brings back the rq->data_len = 0.

Looks good, I was successfully able to burn a CD-RW.

Thanks, Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#9 lore raw
In reply to Kiyoshi Ueda
Quoted 19 lines · Kiyoshi Ueda

Hi Andreas,

Quoted 4 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Quoted 8 lines

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid)
resid: 63488

Could you try this patch?
I've only done a compile test, so this patch may not work.

Quoted 8 lines

During the conversion to blk_end_request, the code was changed *not* to set rq->data_len = 0.
I removed that part because I thought it was just a trigger to call post_transform_command(). However, since data_len can be used as a residual length of the transfer, it might have to remain there.
Actually, wodim seems checking the residual count how far it wrote (e.g. wodim/wodim.c:write_track_data()).

and there seems to be some discrepancy between the different burning tools for i just did test burning a cdimage with cdrdao unter 2.6.25-rc2 and it _works_ flawlessly:

# cdrdao write --device /dev/hdc test.toc

Cdrdao version 1.2.2 - (C) Andreas Mueller <[email protected]>
SCSI interface library - (C) Joerg Schilling Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'ubuntu-0.8ubuntu1'

/dev/hdc: TOSHIBA ODD-DVD SD-R6372 Rev: 1730
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Starting write at speed 4...
Pausing 10 seconds - hit CTRL-C to abort. Process can be aborted with QUIT signal (usually CTRL-\). Turning BURN-Proof on
Executing power calibration...
Power calibration successful.
Writing track 01 (mode MODE1_RAW/MODE1_RAW )...

Wrote 1 of 18 MB (Buffers 100%  94%).
Wrote 2 of 18 MB (Buffers 100%  94%).
Wrote 3 of 18 MB (Buffers 100%  94%).
Wrote 4 of 18 MB (Buffers 100%  94%).
Wrote 5 of 18 MB (Buffers 100%  94%).
Wrote 6 of 18 MB (Buffers 100%  94%).
Wrote 7 of 18 MB (Buffers 100%  94%).
Wrote 8 of 18 MB (Buffers 100%  94%).
Wrote 9 of 18 MB (Buffers 100%  94%).
Wrote 10 of 18 MB (Buffers 100%  94%).
Wrote 11 of 18 MB (Buffers 100%  94%).
Wrote 12 of 18 MB (Buffers 100%  94%).
Wrote 13 of 18 MB (Buffers 100%  94%).
Wrote 14 of 18 MB (Buffers 100%  94%).
Wrote 15 of 18 MB (Buffers 100%  94%).
Wrote 16 of 18 MB (Buffers 100%  94%).
Wrote 17 of 18 MB (Buffers 100%  94%).
Wrote 18 of 18 MB (Buffers 100%  94%).

Wrote 8056 blocks. Buffer fill min 100%/max 100%. Flushing cache...
Writing finished successfully.

Quoted 20 lines

This patch brings back the rq->data_len = 0.

drivers/ide/ide-cd.c +5 -1
@@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(
 end_request:
 	if (blk_pc_request(rq)) {
 		unsigned long flags;
+		unsigned int dlen = rq->data_len;
+
+		if (dma)
+			rq->data_len = 0;
 
 		spin_lock_irqsave(&ide_lock, flags);
-		if (__blk_end_request(rq, 0, rq->data_len))
+		if (__blk_end_request(rq, 0, dlen))
 			BUG();
 		HWGROUP(drive)->rq = NULL;
 		spin_unlock_irqrestore(&ide_lock, flags);
Quoted 2 lines

Thanks,
Kiyoshi Ueda

next will test the one above...

Signature · 2 lines
Regards/Gruß,
    Boris.
#10 lore raw
Quoted 96 lines · Borislav Petkov
Quoted 19 lines · Kiyoshi Ueda

Hi Andreas,

Quoted 4 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Quoted 8 lines

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid)
resid: 63488

Could you try this patch?
I've only done a compile test, so this patch may not work.

Quoted 8 lines

During the conversion to blk_end_request, the code was changed *not* to set rq->data_len = 0.
I removed that part because I thought it was just a trigger to call post_transform_command(). However, since data_len can be used as a residual length of the transfer, it might have to remain there.
Actually, wodim seems checking the residual count how far it wrote (e.g. wodim/wodim.c:write_track_data()).

and there seems to be some discrepancy between the different burning tools for i just did test burning a cdimage with cdrdao unter 2.6.25-rc2 and it _works_ flawlessly:

# cdrdao write --device /dev/hdc test.toc

Cdrdao version 1.2.2 - (C) Andreas Mueller <[email protected]>
SCSI interface library - (C) Joerg Schilling Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'ubuntu-0.8ubuntu1'

/dev/hdc: TOSHIBA ODD-DVD SD-R6372 Rev: 1730
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Starting write at speed 4...
Pausing 10 seconds - hit CTRL-C to abort. Process can be aborted with QUIT signal (usually CTRL-\). Turning BURN-Proof on
Executing power calibration...
Power calibration successful.
Writing track 01 (mode MODE1_RAW/MODE1_RAW )...

Wrote 1 of 18 MB (Buffers 100%  94%).
Wrote 2 of 18 MB (Buffers 100%  94%).
Wrote 3 of 18 MB (Buffers 100%  94%).
Wrote 4 of 18 MB (Buffers 100%  94%).
Wrote 5 of 18 MB (Buffers 100%  94%).
Wrote 6 of 18 MB (Buffers 100%  94%).
Wrote 7 of 18 MB (Buffers 100%  94%).
Wrote 8 of 18 MB (Buffers 100%  94%).
Wrote 9 of 18 MB (Buffers 100%  94%).
Wrote 10 of 18 MB (Buffers 100%  94%).
Wrote 11 of 18 MB (Buffers 100%  94%).
Wrote 12 of 18 MB (Buffers 100%  94%).
Wrote 13 of 18 MB (Buffers 100%  94%).
Wrote 14 of 18 MB (Buffers 100%  94%).
Wrote 15 of 18 MB (Buffers 100%  94%).
Wrote 16 of 18 MB (Buffers 100%  94%).
Wrote 17 of 18 MB (Buffers 100%  94%).
Wrote 18 of 18 MB (Buffers 100%  94%).

Wrote 8056 blocks. Buffer fill min 100%/max 100%. Flushing cache...
Writing finished successfully.

Quoted 20 lines

This patch brings back the rq->data_len = 0.

drivers/ide/ide-cd.c +5 -1
@@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(
 end_request:
 	if (blk_pc_request(rq)) {
 		unsigned long flags;
+		unsigned int dlen = rq->data_len;
+
+		if (dma)
+			rq->data_len = 0;
 
 		spin_lock_irqsave(&ide_lock, flags);
-		if (__blk_end_request(rq, 0, rq->data_len))
+		if (__blk_end_request(rq, 0, dlen))
 			BUG();
 		HWGROUP(drive)->rq = NULL;
 		spin_unlock_irqrestore(&ide_lock, flags);
Quoted 4 lines
Quoted 2 lines

Thanks,
Kiyoshi Ueda

next will test the one above...

confirmed here too - burning succeeds both with wodim and cdrdao.

Quoted 4 lines
Signature · 3 lines
-- 
Regards/Gruß,
    Boris.
Signature · 2 lines
Regards/Gruß,
    Boris.
#11 lore raw

PATCH 1/1 ide-cd: fix missing residual count setting in DMA mode (Was 2.6.25-rc1/2 CD/DVD burning broken)

Hi,

Quoted 97 lines · Borislav Petkov
Quoted 96 lines · Borislav Petkov
Quoted 19 lines · Kiyoshi Ueda

Hi Andreas,

Quoted 4 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Quoted 8 lines

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid)
resid: 63488

Could you try this patch?
I've only done a compile test, so this patch may not work.

Quoted 8 lines

During the conversion to blk_end_request, the code was changed *not* to set rq->data_len = 0.
I removed that part because I thought it was just a trigger to call post_transform_command(). However, since data_len can be used as a residual length of the transfer, it might have to remain there.
Actually, wodim seems checking the residual count how far it wrote (e.g. wodim/wodim.c:write_track_data()).

and there seems to be some discrepancy between the different burning tools for i just did test burning a cdimage with cdrdao unter 2.6.25-rc2 and it _works_ flawlessly:

# cdrdao write --device /dev/hdc test.toc

Cdrdao version 1.2.2 - (C) Andreas Mueller <[email protected]>
SCSI interface library - (C) Joerg Schilling Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'ubuntu-0.8ubuntu1'

/dev/hdc: TOSHIBA ODD-DVD SD-R6372 Rev: 1730
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Starting write at speed 4...
Pausing 10 seconds - hit CTRL-C to abort. Process can be aborted with QUIT signal (usually CTRL-\). Turning BURN-Proof on
Executing power calibration...
Power calibration successful.
Writing track 01 (mode MODE1_RAW/MODE1_RAW )...

Wrote 1 of 18 MB (Buffers 100%  94%).
Wrote 2 of 18 MB (Buffers 100%  94%).
Wrote 3 of 18 MB (Buffers 100%  94%).
Wrote 4 of 18 MB (Buffers 100%  94%).
Wrote 5 of 18 MB (Buffers 100%  94%).
Wrote 6 of 18 MB (Buffers 100%  94%).
Wrote 7 of 18 MB (Buffers 100%  94%).
Wrote 8 of 18 MB (Buffers 100%  94%).
Wrote 9 of 18 MB (Buffers 100%  94%).
Wrote 10 of 18 MB (Buffers 100%  94%).
Wrote 11 of 18 MB (Buffers 100%  94%).
Wrote 12 of 18 MB (Buffers 100%  94%).
Wrote 13 of 18 MB (Buffers 100%  94%).
Wrote 14 of 18 MB (Buffers 100%  94%).
Wrote 15 of 18 MB (Buffers 100%  94%).
Wrote 16 of 18 MB (Buffers 100%  94%).
Wrote 17 of 18 MB (Buffers 100%  94%).
Wrote 18 of 18 MB (Buffers 100%  94%).

Wrote 8056 blocks. Buffer fill min 100%/max 100%. Flushing cache...
Writing finished successfully.

Quoted 20 lines

This patch brings back the rq->data_len = 0.

drivers/ide/ide-cd.c +5 -1
@@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(
 end_request:
 	if (blk_pc_request(rq)) {
 		unsigned long flags;
+		unsigned int dlen = rq->data_len;
+
+		if (dma)
+			rq->data_len = 0;
 
 		spin_lock_irqsave(&ide_lock, flags);
-		if (__blk_end_request(rq, 0, rq->data_len))
+		if (__blk_end_request(rq, 0, dlen))
 			BUG();
 		HWGROUP(drive)->rq = NULL;
 		spin_unlock_irqrestore(&ide_lock, flags);
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Thanks,
Kiyoshi Ueda

next will test the one above...

confirmed here too - burning succeeds both with wodim and cdrdao.

Thank you for testing, Laura, Andreas, Boris.
And I'm really sorry about the bug, all.

Bart,
Please review and apply the patch below to fix the bug.

[PATCH] ide-cd: fix missing residual count setting in DMA mode

This patch fixes the missing residual count setting in DMA mode, which was introduced during the conversion to blk-end-request. The residual count could be used by the request submitter. So if it isn't set correctly, some upper layers does not work. (e.g. wodim for CD burning.)

The bug is in only DMA mode.
In PIO mode, we are setting the residual count correctly, so no need to fix.

---
 drivers/ide/ide-cd.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/ide/ide-cd.c +5 -1
@@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(
 end_request:
 	if (blk_pc_request(rq)) {
 		unsigned long flags;
+		unsigned int dlen = rq->data_len;
+
+		if (dma)
+			rq->data_len = 0;
 
 		spin_lock_irqsave(&ide_lock, flags);
-		if (__blk_end_request(rq, 0, rq->data_len))
+		if (__blk_end_request(rq, 0, dlen))
 			BUG();
 		HWGROUP(drive)->rq = NULL;
 		spin_unlock_irqrestore(&ide_lock, flags);

Thanks,
Kiyoshi Ueda

#12 lore raw

Re: [PATCH] ide-cd: fix missing residual count setting in DMA mode (Was 2.6.25-rc1/2 CD/DVD burning broken)

Quoted 124 lines · Kiyoshi Ueda

Hi,

Quoted 97 lines · Borislav Petkov
Quoted 96 lines · Borislav Petkov
Quoted 19 lines · Kiyoshi Ueda

Hi Andreas,

Quoted 4 lines · Andreas Schwab

Since commit aaa04c28cb9a1efd42541fdb7ab648231c2a2263 [blk_end_request:
changing ide-cd (take 4)] I cannot burn any CD/DVD any more, getting the following error from wodim:

Quoted 8 lines

Errno: 0 (Success), write_g1 scsi sendcmd: no error
CDB: 2A 00 00 00 00 00 00 00 1F 00
status: 0x2 (CHECK CONDITION)
Sense Bytes: 70 00 05 00 00 00 00 0E 00 00 00 00 21 02 00 00 Sense Key: 0x5 Illegal Request, Segment 0
Sense Code: 0x21 Qual 0x02 (invalid address for write) Fru 0x0 Sense flags: Blk 0 (not valid)
resid: 63488

Could you try this patch?
I've only done a compile test, so this patch may not work.

Quoted 8 lines

During the conversion to blk_end_request, the code was changed *not* to set rq->data_len = 0.
I removed that part because I thought it was just a trigger to call post_transform_command(). However, since data_len can be used as a residual length of the transfer, it might have to remain there.
Actually, wodim seems checking the residual count how far it wrote (e.g. wodim/wodim.c:write_track_data()).

and there seems to be some discrepancy between the different burning tools for i just did test burning a cdimage with cdrdao unter 2.6.25-rc2 and it _works_ flawlessly:

# cdrdao write --device /dev/hdc test.toc

Cdrdao version 1.2.2 - (C) Andreas Mueller <[email protected]>
SCSI interface library - (C) Joerg Schilling Paranoia DAE library - (C) Monty

Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.

Using libscg version 'ubuntu-0.8ubuntu1'

/dev/hdc: TOSHIBA ODD-DVD SD-R6372 Rev: 1730
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Starting write at speed 4...
Pausing 10 seconds - hit CTRL-C to abort. Process can be aborted with QUIT signal (usually CTRL-\). Turning BURN-Proof on
Executing power calibration...
Power calibration successful.
Writing track 01 (mode MODE1_RAW/MODE1_RAW )...

Wrote 1 of 18 MB (Buffers 100%  94%).
Wrote 2 of 18 MB (Buffers 100%  94%).
Wrote 3 of 18 MB (Buffers 100%  94%).
Wrote 4 of 18 MB (Buffers 100%  94%).
Wrote 5 of 18 MB (Buffers 100%  94%).
Wrote 6 of 18 MB (Buffers 100%  94%).
Wrote 7 of 18 MB (Buffers 100%  94%).
Wrote 8 of 18 MB (Buffers 100%  94%).
Wrote 9 of 18 MB (Buffers 100%  94%).
Wrote 10 of 18 MB (Buffers 100%  94%).
Wrote 11 of 18 MB (Buffers 100%  94%).
Wrote 12 of 18 MB (Buffers 100%  94%).
Wrote 13 of 18 MB (Buffers 100%  94%).
Wrote 14 of 18 MB (Buffers 100%  94%).
Wrote 15 of 18 MB (Buffers 100%  94%).
Wrote 16 of 18 MB (Buffers 100%  94%).
Wrote 17 of 18 MB (Buffers 100%  94%).
Wrote 18 of 18 MB (Buffers 100%  94%).

Wrote 8056 blocks. Buffer fill min 100%/max 100%. Flushing cache...
Writing finished successfully.

Quoted 20 lines

This patch brings back the rq->data_len = 0.

drivers/ide/ide-cd.c +5 -1
@@ -1207,9 +1207,13 @@ static ide_startstop_t cdrom_newpc_intr(
 end_request:
 	if (blk_pc_request(rq)) {
 		unsigned long flags;
+		unsigned int dlen = rq->data_len;
+
+		if (dma)
+			rq->data_len = 0;
 
 		spin_lock_irqsave(&ide_lock, flags);
-		if (__blk_end_request(rq, 0, rq->data_len))
+		if (__blk_end_request(rq, 0, dlen))
 			BUG();
 		HWGROUP(drive)->rq = NULL;
 		spin_unlock_irqrestore(&ide_lock, flags);
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Thanks,
Kiyoshi Ueda

next will test the one above...

confirmed here too - burning succeeds both with wodim and cdrdao.

Thank you for testing, Laura, Andreas, Boris.
And I'm really sorry about the bug, all.

Bart,
Please review and apply the patch below to fix the bug.

[PATCH] ide-cd: fix missing residual count setting in DMA mode

This patch fixes the missing residual count setting in DMA mode, which was introduced during the conversion to blk-end-request. The residual count could be used by the request submitter. So if it isn't set correctly, some upper layers does not work. (e.g. wodim for CD burning.)

Quoted 6 lines

The bug is in only DMA mode.
In PIO mode, we are setting the residual count correctly, so no need to fix.

Looks fine, thanks for fixing it so quickly.

Applied.

#13 lore raw
In reply to Kiyoshi Ueda
Quoted 2 lines · Kiyoshi Ueda

Could you try this patch?
I've only done a compile test, so this patch may not work.

Unfortunately, that is not enough to get DVD burning working again. This is the error that growisofs is getting:

ioctl(6, SG_IO, {'S', SG_DXFER_TO_DEV, cmd[10]=[2a, 00, 00, 00, 03, 10, 00, 00, 10, 00], mx_sb_len=64, iovec_count=0, dxfer_len=32768, timeout=60000, flags=0x3, data[32768]=["\360R\360\314Wt\277\241\36.\347\356L$\201]\210\372_~]I\213\366\253SV\2\372\356\312\257"...], status=02, masked_status=01, sb[0]=[], host_status=0, driver_status=0, resid=32768, duration=0, info=0x1}) = 0 write(2, ":-( unable to WRITE@LBA=310h: ", 30) = 30

It looks like the sense buffer is not filled in. In a successfully run of growisfs under 2.6.24.2 the sense code is "LONG WRITE IN PROGRESS".

I also see that resid always equals dxfer_len even when the transfer was successful, although growisofs does not seem to care. With 2.6.24.2 resid is only non-zero when a sense error occurred.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#14 lore raw
Quoted 11 lines · Andreas Schwab
Quoted 2 lines · Kiyoshi Ueda

Could you try this patch?
I've only done a compile test, so this patch may not work.

Unfortunately, that is not enough to get DVD burning working again. This is the error that growisofs is getting:

ioctl(6, SG_IO, {'S', SG_DXFER_TO_DEV, cmd[10]=[2a, 00, 00, 00, 03, 10, 00, 00, 10, 00], mx_sb_len=64, iovec_count=0, dxfer_len=32768, timeout=60000, flags=0x3, data[32768]=["\360R\360\314Wt\277\241\36.\347\356L$\201]\210\372_~]I\213\366\253SV\2\372\356\312\257"...], status=02, masked_status=01, sb[0]=[], host_status=0, driver_status=0, resid=32768, duration=0, info=0x1}) = 0 write(2, ":-( unable to WRITE@LBA=310h: ", 30) = 30

Quoted 6 lines

It looks like the sense buffer is not filled in. In a successfully run of growisfs under 2.6.24.2 the sense code is "LONG WRITE IN PROGRESS".

I also see that resid always equals dxfer_len even when the transfer was successful, although growisofs does not seem to care. With 2.6.24.2 resid is only non-zero when a sense error occurred.

Hm, strange,

burning a dvd here with growisofs works just fine. However, my strace -v won't dereference the struct pointer passed to the ioctl:

...
open("/dev/dvd", O_RDWR|O_NONBLOCK|O_LARGEFILE) = 5
...
ioctl(5, SG_IO, 0xbf804d14) = 0
...

Signature · 2 lines
Regards/Gruß,
    Boris.
#15 lore raw
Quoted 1 line · Borislav Petkov

burning a dvd here with growisofs works just fine.

You probably don't have a Pioneer.

Quoted 2 lines

However, my strace -v won't dereference the struct pointer passed to the ioctl:

I use strace 4.5.16.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#16 lore raw

Hi Andreas,

Quoted 11 lines · Andreas Schwab
Quoted 2 lines · Kiyoshi Ueda

Could you try this patch?
I've only done a compile test, so this patch may not work.

Unfortunately, that is not enough to get DVD burning working again. This is the error that growisofs is getting:

ioctl(6, SG_IO, {'S', SG_DXFER_TO_DEV, cmd[10]=[2a, 00, 00, 00, 03, 10, 00, 00, 10, 00], mx_sb_len=64, iovec_count=0, dxfer_len=32768, timeout=60000, flags=0x3, data[32768]=["\360R\360\314Wt\277\241\36.\347\356L$\201]\210\372_~]I\213\366\253SV\2\372\356\312\257"...], status=02, masked_status=01, sb[0]=[], host_status=0, driver_status=0, resid=32768, duration=0, info=0x1}) = 0 write(2, ":-( unable to WRITE@LBA=310h: ", 30) = 30

Quoted 6 lines

It looks like the sense buffer is not filled in. In a successfully run of growisfs under 2.6.24.2 the sense code is "LONG WRITE IN PROGRESS".

I also see that resid always equals dxfer_len even when the transfer was successful, although growisofs does not seem to care. With 2.6.24.2 resid is only non-zero when a sense error occurred.

I'm looking at this problem, but currently no idea why the conversion to blk_end_request causes it.

growisofs (in dvd+rw-tools-7.0) seems to care only the sense buffer of the sg_io_hdr, as you said. (growisofs_mmc.cpp:poor_mans_pwrite64() and transport.hxx:transport()) So if the driver sets the sense code correctly, growisofs should work correctly I think.
However, I can't find why the blk_end_request patch affects the sense code setting.

Could you give me some more information below to help investigation?
o Have you tried bisecting the kernel changes to find suspicious commit? If so, that information will be much appreciated.
o Is this problem 100% reproducible on your Pioneer drive?
o What is your dvd+rw-tools version?
o Do you get some messages from kernel like "DMA error" when the problem happens?

And I'm sorry but I can't make enough time for this problem until late this week.

Thanks,
Kiyoshi Ueda

#17 lore raw
Quoted 2 lines · Kiyoshi Ueda

o Have you tried bisecting the kernel changes to find suspicious commit? If so, that information will be much appreciated.

That is close to impossible. Intervening kernels either don't boot or crash while burning. Especially the one with the bad commit crashes in cdrom_newpc_intr almost immediately when burning starts.

Quoted 1 line

o Is this problem 100% reproducible on your Pioneer drive?

Yes. See the comment in the growisofs sources, this sense code is Pioneer specific.

Quoted 2 lines

o Do you get some messages from kernel like "DMA error" when the problem happens?

Never.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#18 lore raw
In reply to Kiyoshi Ueda
Quoted 2 lines · Kiyoshi Ueda

I'm looking at this problem, but currently no idea why the conversion to blk_end_request causes it.

cdrom_newpc_intr apparently never sets rq->sense_len.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#19 lore raw
Quoted 7 lines · Andreas Schwab
Quoted 2 lines · Kiyoshi Ueda

I'm looking at this problem, but currently no idea why the conversion to blk_end_request causes it.

cdrom_newpc_intr apparently never sets rq->sense_len.

actually it does, see the code chunk around line 1188 in 2.6.25-rc2, for example.

Signature · 2 lines
Regards/Gruß,
    Boris.
#20 lore raw
Quoted 11 lines · Borislav Petkov
Quoted 7 lines · Andreas Schwab
Quoted 2 lines · Kiyoshi Ueda

I'm looking at this problem, but currently no idea why the conversion to blk_end_request causes it.

cdrom_newpc_intr apparently never sets rq->sense_len.

actually it does, see the code chunk around line 1188 in 2.6.25-rc2, for example.

Yes, it does, but it always adds zero.

Move counting of sense bytes into the transfer loop.

---
 drivers/ide/ide-cd.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/ide/ide-cd.c +2 -3
@@ -1182,11 +1182,10 @@ static ide_startstop_t cdrom_newpc_intr(
 			else
 				rq->data += blen;
 		}
+		if (!write && blk_sense_request(rq))
+			rq->sense_len += blen;
 	}
 
-	if (write && blk_sense_request(rq))
-		rq->sense_len += thislen;
-
 	/*
 	 * pad, if necessary
 	 */

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#21 lore raw
Quoted 8 lines · Andreas Schwab
Quoted 6 lines · Borislav Petkov
Quoted 5 lines · Andreas Schwab
Quoted 2 lines · Kiyoshi Ueda

I'm looking at this problem, but currently no idea why the conversion to blk_end_request causes it.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

cdrom_newpc_intr apparently never sets rq->sense_len.

actually it does, see the code chunk around line 1188 in 2.6.25-rc2, for example.

Yes, it does, but it always adds zero.

yep, true. Does that fix your dvd burning problem?

Quoted 32 lines

Move counting of sense bytes into the transfer loop.

---
 drivers/ide/ide-cd.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/ide/ide-cd.c +2 -3
@@ -1182,11 +1182,10 @@ static ide_startstop_t cdrom_newpc_intr(
 			else
 				rq->data += blen;
 		}
+		if (!write && blk_sense_request(rq))
+			rq->sense_len += blen;
 	}
 
-	if (write && blk_sense_request(rq))
-		rq->sense_len += thislen;
-
 	/*
 	 * pad, if necessary
 	 */

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Signature · 2 lines
Regards/Gruß,
    Boris.
#22 lore raw
Quoted 12 lines · Borislav Petkov
Quoted 11 lines · Andreas Schwab
Quoted 9 lines · Borislav Petkov
Quoted 7 lines · Andreas Schwab
Quoted 2 lines · Kiyoshi Ueda

I'm looking at this problem, but currently no idea why the conversion to blk_end_request causes it.

cdrom_newpc_intr apparently never sets rq->sense_len.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

actually it does, see the code chunk around line 1188 in 2.6.25-rc2, for example.

Yes, it does, but it always adds zero.

yep, true. Does that fix your dvd burning problem?

Yes, sure.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#23 lore raw
Quoted 17 lines · Andreas Schwab
Quoted 15 lines · Borislav Petkov
Quoted 14 lines · Andreas Schwab
Quoted 11 lines · Borislav Petkov
Quoted 7 lines · Andreas Schwab
Quoted 2 lines · Kiyoshi Ueda

I'm looking at this problem, but currently no idea why the conversion to blk_end_request causes it.

cdrom_newpc_intr apparently never sets rq->sense_len.

actually it does, see the code chunk around line 1188 in 2.6.25-rc2, for example.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Yes, it does, but it always adds zero.

yep, true. Does that fix your dvd burning problem?

Yes, sure.

Andreas.

Bart,

please apply the enclosed patch since it fixes dvd burning with growisofs on Pioneer drives as reported by Andreas.

Thanks.

---
From: Andreas Schwab <[email protected]>

Move counting of sense bytes into the transfer loop.

---
 drivers/ide/ide-cd.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/ide/ide-cd.c +2 -3
@@ -1182,11 +1182,10 @@ static ide_startstop_t cdrom_newpc_intr(
 			else
 				rq->data += blen;
 		}
+		if (!write && blk_sense_request(rq))
+			rq->sense_len += blen;
 	}
 
-	if (write && blk_sense_request(rq))
-		rq->sense_len += thislen;
-
 	/*
 	 * pad, if necessary
 	 */
Signature · 2 lines
Regards/Gruß,
    Boris.
#24 lore raw
Quoted 33 lines · Borislav Petkov
Quoted 17 lines · Andreas Schwab
Quoted 15 lines · Borislav Petkov
Quoted 14 lines · Andreas Schwab
Quoted 11 lines · Borislav Petkov
Quoted 7 lines · Andreas Schwab
Quoted 2 lines · Kiyoshi Ueda

I'm looking at this problem, but currently no idea why the conversion to blk_end_request causes it.

cdrom_newpc_intr apparently never sets rq->sense_len.

actually it does, see the code chunk around line 1188 in 2.6.25-rc2, for example.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Yes, it does, but it always adds zero.

yep, true. Does that fix your dvd burning problem?

Yes, sure.

Andreas.

Bart,

please apply the enclosed patch since it fixes dvd burning with growisofs on Pioneer drives as reported by Andreas.

Thanks.

Quoted 7 lines

---
From: Andreas Schwab <[email protected]>

Move counting of sense bytes into the transfer loop.

applied, thanks!