[Bug 277115] sysutils/cdrdao: zero length and odd-sized DMA transfer attempted

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 17 Feb 2024 17:29:38 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277115

            Bug ID: 277115
           Summary: sysutils/cdrdao: zero length and odd-sized DMA
                    transfer attempted
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: jhale@FreeBSD.org
          Reporter: freebsd@dev.thsi.be
          Assignee: jhale@FreeBSD.org
             Flags: maintainer-feedback?(jhale@FreeBSD.org)

Cdrdao doesn't work on (S)ATA drives anymore:

cdrdao disk-info --device /dev/cd0
/dev/cd0:       Rev:
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

ERROR: Cannot setup device /dev/cd0.

dmesg shows:
ata0: FAILURE - zero length DMA transfer attempted
ata0: setting up DMA failed

This is caused by a bad SCSI CCB having CAM_DIR_IN and a zero length
(presumably FreeBSD started to reject zero-sized DMA SCSI transfer), fixed by
using CAM_DIR_NONE in such case.

After this issue is fixed, for any cd with an odd number of tracks there will
be the following error (note that read-cd and "slow mode" read-toc will still
work):

cdrdao read-toc --device /dev/cd0 --fast-toc -v9999   toc-file
...
Reading toc data...
getTocGeneric: data len 124
Raw toc data len: 191
ERROR: Cannot read disk toc.

And dmesg to show:

ata0: FAILURE - odd-sized DMA transfer attempt 191 % 2
ata0: setting up DMA failed

191 is 11 bytes * 17 tracks + 4, read from the disc, see
dao/GenericMMC.cc:GenericMMC::getRawToc  


The attached patch adds a cdrdao patch that fixes both issues. It also
sets the GNU_CONFIGURE_MANPREFIX according to the new rule, and portrevision is
incremented.

After patch:
cdrdao read-toc --device /dev/cd0 --fast-toc -v9999   toc-file
/dev/cd0:       Rev:
Reading driver table from file "/usr/local/share/cdrdao/drivers".
Found 316 valid driver table entries.
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)

Reading toc data...
getTocGeneric: data len 124
Raw toc data len: 191
Raw toc contains HEX values.
[output truncated]

-- 
You are receiving this mail because:
You are the assignee for the bug.