Skip to content

scsi/atapi: MMC fixes

Thomas Schmitt qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 of 5 patches 1 replyIn review

Patches in v1 No applies recorded yet

None of the 5 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/5] scsi/atapi: MMC fixes

Hi,

Quoted 5 lines

I only tested CD-RW DAO burning of an ISO image, plus invoking a bunch of commands from Thomas's logs). The burning succeeded but reading the resulting medium failed consistently at 26 MB. However, the same happened even when doing CD passthrough via virtio, so it may be due to a different bug.

Did you get a sense code from the failure ?

My best guess would be that you announced 26 MB by the SEND CUE SHEET command.
Proposals for inspection of CD medium structure on real Linux:

wodim -v dev=/dev/sr0 -toc
cdrecord -v dev=/dev/sr0 -minfo
cdrskin -v dev=/dev/sr0 -minfo
xorriso -outdev /dev/sr0 -toc

SCSI command logs are available by -V resp. -scsi_log on.

Quoted 3 lines

Also detect blanking of a disc and reset the maximum LBA. It's possible that more special casing is necessary, e.g. for track-at-once, since those do not start with blanking.

I did not explore GET EVENT STATUS NOTIFICATION yet, which might address this issue.

Some scenarios:

Writing CD TAO or Packet, Incremental Streaming on DVD-R[W], or writing on DVD+R and BD-R without RESERVE TRACK, will cause the new readable size to be determined only after CLOSE TRACK SESSION.
SEND CUE SHEET resp. RESERVE TRACK determine the size before writing begins.

DVD-RAM and BD-RE can change their formatted size by FORMAT UNIT. In this case, the new size is determined as soon as TEST UNIT READY resp. REQUEST SENSE deliver no sense data any more.
If the Immed Bit in the Format List Header of FORMAT UNIT is not set, then the size is already determined when FORMAT UNIT returns.

I never worked with formatted CD-RW. But i assume that FORMAT UNIT has a similar effect on size as with DVD-RAM.

DVD+RW and formatted DVD-RW can grow their formatted size during writing. This is started by FORMAT UNIT but the size is decided only when writing ends. This end is not unambigously to detect. One may at any time continue writing as long as the medium is in the tray.

Quoted 4 lines

The FORMAT
UNIT command is still somewhat broken for block devices because its parameter list length is not in the CDB. However it works for CD/DVD drives, which mandate the length of the payload.

Ouch.
One will have to distinguish the interpretation by Peripheral Qualifier and Peripheral Device Type from INQUIRE (SSC = 0x02, MMC = 0x05).

Quoted 1 line

[PATCH 4/5] scsi: remove block descriptors from CDs

It was a good stumble stone for my own code.

Have a nice day :)

Thomas