Sense fetching [Was: cdrtools /devel ...]

[ Available lists | Index of freebsd-stable | Month of Nov 2010 | Week of 5 Nov 2010 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Alexander Motin <mav@FreeBSD.org>
Date
5 Nov 2010 18:51:03
Subject
Sense fetching [Was: cdrtools /devel ...]
Message-ID
4CD45209.5010607@FreeBSD.org

Referenced by
Marius Strobl (freebsd-current) , Marius Strobl, Marius Strobl (freebsd-scsi) , Joerg Schilling, Joerg Schilling (freebsd-scsi) , Joerg Schilling (freebsd-current) , Alexander Motin, Alexander Motin (freebsd-current) , Alexander Motin (freebsd-scsi) , Joerg Schilling (freebsd-scsi) , Joerg Schilling, Joerg Schilling (freebsd-current) , Alexander Motin, Alexander Motin (freebsd-scsi) , Alexander Motin (freebsd-current) , Joerg Schilling (freebsd-current) , Joerg Schilling (freebsd-scsi) , Joerg Schilling, Alexander Motin, Alexander Motin (freebsd-current) , Alexander Motin (freebsd-scsi) , Joerg Schilling, Joerg Schilling (freebsd-scsi) , Joerg Schilling (freebsd-current) , Alexander Motin (freebsd-current) , Alexander Motin (freebsd-scsi) , Alexander Motin, Joerg Schilling, Joerg Schilling (freebsd-current) , Joerg Schilling (freebsd-scsi) , Alexander Motin, Alexander Motin (freebsd-scsi) , Alexander Motin (freebsd-current) , Joerg Schilling (freebsd-scsi) , Joerg Schilling (freebsd-current) , Joerg Schilling, Brandon Gooch, Brandon Gooch (freebsd-scsi) , Brandon Gooch (freebsd-current) , Jakub Lach (freebsd-current) , Alexander Motin (freebsd-scsi) , Alexander Motin, Alexander Motin (freebsd-current) , Jakub Lach (freebsd-current) , Brandon Gooch, Brandon Gooch (freebsd-current) , Brandon Gooch (freebsd-scsi) , Alexander Motin, Alexander Motin (freebsd-current) , Alexander Motin (freebsd-scsi) , Brandon Gooch, Brandon Gooch (freebsd-current) , Brandon Gooch (freebsd-scsi) , Alexander Motin (freebsd-current) , Alexander Motin, Alexander Motin (freebsd-scsi) , Jakub Lach, Brandon Gooch, Brandon Gooch (freebsd-current) , David Demelier, Lawrence Stewart, Lawrence Stewart (freebsd-current) , Lawrence Stewart (freebsd-scsi) , Buganini (freebsd-current) , Alexander Motin (freebsd-scsi) , Alexander Motin (freebsd-current) , Alexander Motin, Buganini, Buganini (freebsd-scsi) , Jakub Lach

[ Hide this part ]
Hi.

I've reviewed tests that scgcheck does to SCSI subsystem. It shown
combination of several issues in both CAM, ahci(4) and cdrtools itself.
Several small patches allow us to pass most of that tests:
http://people.freebsd.org/~mav/sense/

ahci_resid.patch: Add support for reporting residual length on data
underrun. SCSI commands often returns results shorter then expected.
Returned value allows application to know/check how much data it really
has. It is also important for sense fetching, as ATAPI and USB devices
return sense as data in response to REQUEST_SENSE command.

sense_resid.patch: When manually requesting sense data (ATAPI or USB),
request only as much data as user requested (not the fixed structure
size), and return respective sense residual length.

pass_autosence.patch: Unless CAM_DIS_AUTOSENSE is set, always fetch
sense if not done by SIM, independently of CAM_PASS_ERR_RECOVER. As soon
as device freeze released before returning to user-level, user-level
application by definition can't reliably fetch sense data if some other
application (like hald) tries to access device same time.

cdrtools.patch: Make libscg (part of cdrtools) on FreeBSD to submit
wanted sense length to CAM and do not clear sense return buffer. It is
mostly cosmetics, important probably only for scgcheck.

Testers and reviewers welcome. I am especially interested in opinion
about pass_autosence.patch -- may be we should lower sense fetching even
deeper, to make it work for all cam_periph_runccb() consumers.

--
Alexander Motin

Elapsed time: 0.503 seconds