> On Oct 20, 2019, at 3:38 PM, Klemens Nanni <[email protected]> wrote:
>
> On a PowerBook G4 running latest snapshots, I always get the following
> error when burning an ISO to CD (:
>
> G4# cdio -f cd0c tao install66.iso
> track 01 'd' 0021049/00180000 11%
> cdio: ioctl returned bad status while attempting to write: 3
> Closing session.
> G4#
>
> It's always three and so far various attempts to burn a CD (a new blank
> one each time) failed.
>
> Using `-s 2' to overwrite the implicit default of `-s auto' fixes it and
> the ISO gets burned successfully.
>
> This error comes from the SCIOCCOMMAND ioctl(2) in mmc.c:()writetrack();
> the error message's "3" is SCCMD_SENSE for which the following commit
> added retry logic long ago:
>
> revision 1.12
> date: 2006/06/21 21:53:36; author: mjc; state: Exp; lines: +6 -1;
> retry if sense code indicates not ready. fixes writing for drives
> that issue long write in progress if the write buffer is full.
> ok deraadt@
>
> 492 if (scr.retsts == SCCMD_SENSE && scr.sense[2] == 0x2) {
> 493 usleep(1000);
> 494 goto again;
> 495 }
> 496 if (scr.retsts != SCCMD_OK) {
> 497 printf("\r%60s", "");
> 498 warnx("ioctl returned bad status while "
> 499 "attempting to write: %d",
> 500 scr.retsts);
> 501 return (r);
> 502 }
>
> So in my case I'm hitting that check but `scr.sense[2] != 0x2', whatever
> that means. Any SCSI hackers know what's going on?
scr.sense should contain a struct scsi_sense_data. scr.sense[2] should
therefore be 'flags'. Against which there is a #define SSD_KEY 0x0f.
An SSD_KEY value of 2 would be SKEY_NOT_READY.
So the drive is reporting something other than not being ready. However the
cdio error reporting is somewhat deficient in not mentioning what the key is.
I'm guessing SKEY_MEDIUM_ERROR based on the debug output. :-)
I won't dwell on the lack of masking with 0x0f before checking scr.sense[2].
Since -s 2 makes it work I theorize that the media is not handing whatever
speed 'auto' decides on. Be interesting to know what speed 'auto' ends up being.
Most that I can figure out on my phone. :-)
.... Ken
>
> Happy to try diffs, but the number of blank CD-R discs I can burn^Wwaste
> on this is limited.
>
> Below is a dmesg with SCSIDEBUG enabled, including my last failed attempt
> immediately after boot.
>
> OpenBSD 6.6-current (GENERIC) #7: Sat Oct 12 10:31:25 CEST 2019
> x@y:/sys/arch/macppc/compile/GENERIC
> real mem = 2147483648 (2048MB)
> avail mem = 2069905408 (1974MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root: model PowerBook5,8
> cpu0 at mainbus0: 7447A (Revision 0x105): 1666 MHz: 512KB L2 cache
> mem0 at mainbus0
> spdmem0 at mem0: 1GB DDR2 SDRAM non-parity PC2-4200CL4 SO-DIMM
> spdmem1 at mem0: 1GB DDR2 SDRAM non-parity PC2-4200CL4 SO-DIMM
> memc0 at mainbus0: uni-n rev 0xd9
> "hw-clock" at memc0 not configured
> kiic0 at memc0 offset 0xf8001000
> iic0 at kiic0
> adt0 at iic0 addr 0x2e: adt7467 rev 0x71
> lmtemp0 at iic0 addr 0x49: ds1775
> mpcpcibr0 at mainbus0 pci: uni-north
> pci0 at mpcpcibr0 bus 0
> pchb0 at pci0 dev 11 function 0 "Apple Intrepid 2 AGP" rev 0x00
> agp at pchb0 not configured
> radeondrm0 at pci0 dev 16 function 0 "ATI Radeon Mobility M10" rev 0x00
> drm0 at radeondrm0
> radeondrm0: irq 48
> mpcpcibr1 at mainbus0 pci: uni-north
> pci1 at mpcpcibr1 bus 0
> macobio0 at pci1 dev 23 function 0 "Apple Intrepid" rev 0x00
> openpic0 at macobio0 offset 0x40000: version 0x4614 feature 3f0302 LE
> macgpio0 at macobio0 offset 0x50
> "modem-reset" at macgpio0 offset 0x1d not configured
> "accelerometer-1" at macgpio0 offset 0x13 not configured
> "accelerometer-2" at macgpio0 offset 0x14 not configured
> "amp-mute" at macgpio0 offset 0x20 not configured
> "dig-hw-reset" at macgpio0 offset 0x26 not configured
> "codec-error-irq" at macgpio0 offset 0x18 not configured
> "combo-in-sense" at macgpio0 offset 0xb not configured
> "combo-out-sense" at macgpio0 offset 0x12 not configured
> "codec-input-data-mux" at macgpio0 offset 0x23 not configured
> "codec-clock-mux" at macgpio0 offset 0x29 not configured
> "hw-reset" at macgpio0 offset 0x1a not configured
> "linein-detect" at macgpio0 offset 0xc not configured
> "lineout-detect" at macgpio0 offset 0x17 not configured
> "lineout-mute" at macgpio0 offset 0x1f not configured
> dfs0 at macgpio0 offset 0x1b: speeds: 1666, 833 MHz
> macgpio1 at macgpio0 offset 0x9: irq 47
> "programmer-switch" at macgpio0 offset 0x11 not configured
> "escc-legacy" at macobio0 offset 0x12000 not configured
> zs0 at macobio0 offset 0x13000: irq 22,23
> zstty0 at zs0 channel 0
> zstty1 at zs0 channel 1
> onyx0 at macobio0 offset 0x0: irq 30,1,2
> "timer" at macobio0 offset 0x15000 not configured
> adb0 at macobio0 offset 0x16000
> apm0 at adb0: battery flags 0x5, 0% charged
> piic0 at adb0
> iic1 at piic0
> "backlight" at macobio0 offset 0xf300 not configured
> kiic1 at macobio0 offset 0x18000
> iic2 at kiic1
> "pcm3052" at iic2 addr 0x46 not configured
> "cs8416" at iic2 addr 0x10 not configured
> audio0 at onyx0
> bwi0 at pci1 dev 17 function 0 "Broadcom BCM4318" rev 0x02: irq 52, address
> 00:14:51:7d:94:ee
> cbb0 at pci1 dev 20 function 0 "TI PCI1510 CardBus" rev 0x00: irq 53
> ohci0 at pci1 dev 21 function 0 "NEC USB" rev 0x43: irq 54, version 1.0
> ohci1 at pci1 dev 21 function 1 "NEC USB" rev 0x43: irq 54, version 1.0
> ehci0 at pci1 dev 21 function 2 "NEC USB" rev 0x04: irq 54
> usb0 at ehci0: USB revision 2.0
> uhub0 at usb0 configuration 1 interface 0 "NEC EHCI root hub" rev 2.00/1.00
> addr 1
> cardslot0 at cbb0 slot 0 flags 0
> cardbus0 at cardslot0: bus 1 device 0 cacheline 0x8, lattimer 0x20
> pcmcia0 at cardslot0
> usb1 at ohci0: USB revision 1.0
> uhub1 at usb1 configuration 1 interface 0 "NEC OHCI root hub" rev 1.00/1.00
> addr 1
> usb2 at ohci1: USB revision 1.0
> uhub2 at usb2 configuration 1 interface 0 "NEC OHCI root hub" rev 1.00/1.00
> addr 1
> mpcpcibr2 at mainbus0 pci: uni-north
> pci2 at mpcpcibr2 bus 0
> kauaiata0 at pci2 dev 13 function 0 "Apple Intrepid 2 ATA" rev 0x00
> wdc0 at kauaiata0 irq 39: DMA
> wd0 at wdc0 channel 0 drive 0: <TOSHIBA MK8026GAX>
> wd0: 16-sector PIO, LBA48, 76319MB, 156301488 sectors
> atapiscsi0 at wdc0 channel 0 drive 1
> scsibus1 at atapiscsi0: 2 targets
> probe(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x0
> SENSE KEY: Unit Attention
> ASC/ASCQ: Power On, Reset, or Bus Device Reset Occurred
> probe(atapiscsi0:0:0): got 36 of 95 bytes of inquiry data:
> ------------------------------
> 000: 05 80 00 32 5b 00 00 00 4d 41 54 53 48 49 54 41
> 016: 44 56 44 2d 52 20 20 20 55 4a 2d 38 34 36 20 20
> 032: 46 41 41 47
> ------------------------------
> wdc_atapi_intr: warning: reading only 95 of 96 bytes
> probe(atapiscsi0:0:0): got 95 of 95 bytes of inquiry data:
> ------------------------------
> 000: 05 80 00 32 5b 00 00 00 4d 41 54 53 48 49 54 41
> 016: 44 56 44 2d 52 20 20 20 55 4a 2d 38 34 36 20 20
> 032: 46 41 41 47 30 39 2f 30 32 2f 30 35 30 30 30 30
> 048: 01 2b 32 30 31 32 00 00 00 00 02 77 02 a0 00 00
> 064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> ------------------------------
> scsi_inqmatch: match priority 2. T_CDROM T_REMOV <"", "", "">
> cd0 at scsibus1 targ 0 lun 0: <MATSHITA, DVD-R UJ-846, FAAG> ATAPI removable
> probe(atapiscsi0:0:0): state 0, luns 1, openings 1
> probe(atapiscsi0:0:0): flags (0x0201) <REMOVABLE, ATAPI>
> probe(atapiscsi0:0:0): quirks (0x010e) <NOSYNC, NOWIDE, NOTAGS, NOSYNCCACHE>
> probe(atapiscsi0:1:0): got 4 of 4 bytes of inquiry data:
> ------------------------------
> 000: 00 00 00 00
> ------------------------------
> wd0(wdc0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 4
> cd0(wdc0:0:1): using PIO mode 4, DMA mode 2, Ultra-DMA mode 4
> "Apple Intrepid 2 FireWire" rev 0x00 at pci2 dev 14 function 0 not configured
> gem0 at pci2 dev 15 function 0 "Apple Intrepid 2 GMAC" rev 0x00: irq 41,
> address 00:14:51:22:38:7c
> brgphy0 at gem0 phy 0: BCM5462 10/100/1000baseT PHY, rev. 3
> uhidev0 at uhub1 port 2 configuration 1 interface 0 "Apple Computer
> HID-proxy" rev 2.00/19.65 addr 2
> uhidev0: iclass 3/1
> ukbd0 at uhidev0: 8 variable keys, 6 key codes
> wskbd0 at ukbd0 mux 1
> uhidev1 at uhub1 port 2 configuration 1 interface 1 "Apple Computer
> HID-proxy" rev 2.00/19.65 addr 2
> uhidev1: iclass 3/1
> ums0 at uhidev1: 5 buttons
> wsmouse0 at ums0 mux 0
> uhidev2 at uhub2 port 2 configuration 1 interface 0 "Apple Computer Apple
> Internal Keyboard / Trackpad" rev 2.00/0.86 addr 2
> uhidev2: iclass 3/1
> ukbd1 at uhidev2: 8 variable keys, 5 key codes, country code 13
> wskbd1 at ukbd1: console keyboard
> uhidev3 at uhub2 port 2 configuration 1 interface 1 "Apple Computer Apple
> Internal Keyboard / Trackpad" rev 2.00/0.86 addr 2
> uhidev3: iclass 3/1
> utpms0 at uhidev3: Geyser 2 Trackpad
> wsmouse1 at utpms0 mux 0
> uhidev4 at uhub2 port 2 configuration 1 interface 2 "Apple Computer Apple
> Internal Keyboard / Trackpad" rev 2.00/0.86 addr 2
> uhidev4: iclass 3/0
> uhid0 at uhidev4: input=1, output=0, feature=0
> vscsi0 at root
> scsibus2 at vscsi0: 256 targets
> softraid0 at root
> scsibus3 at softraid0: 256 targets
> bootpath: /pci@f4000000/ata-6@d/disk@0:/bsd.scsidebug
> root on wd0a (f3b00c0e522abc7c.a) swap on wd0b dump on wd0b
> initializing kernel modesetting (RV350 0x1002:0x4E50 0x1002:0x4E50 0x00).
> [drm] *ERROR* Unable to locate a BIOS ROM
> radeondrm0: 1440x960, 32bpp
> wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd1
> wskbd0: connecting to wsdisplay0
> wsdisplay0: screen 1-5 added (std, vt100 emulation)
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x0
> SENSE KEY: Unit Attention
> ASC/ASCQ: Not Ready To Ready Transition (Medium May Have Changed)
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x43
> SENSE KEY: Illegal Request
> ASC/ASCQ: Illegal Field in CDB
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x43
> SENSE KEY: Illegal Request
> ASC/ASCQ: Illegal Field in CDB
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x43
> SENSE KEY: Illegal Request
> ASC/ASCQ: Illegal Field in CDB
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x43
> SENSE KEY: Illegal Request
> ASC/ASCQ: Illegal Field in CDB
> cd0(atapiscsi0:0:0): DEFERRED Check Condition (error 0x71) on opcode 0x2a
> SENSE KEY: Media Error
> INFO: 0x515d (VALID flag on)
> COMMAND INFO: 0x2b0000
> ASC/ASCQ: Write Error
> cd0(atapiscsi0:0:0): DEFERRED Check Condition (error 0x71) on opcode 0x2a
> SENSE KEY: Media Error
> INFO: 0x515d (VALID flag on)
> COMMAND INFO: 0x2b0000
> ASC/ASCQ: Write Error
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x2a
> SENSE KEY: Media Error
> INFO: 0x53cc (VALID flag on)
> COMMAND INFO: 0xa50000
> ASC/ASCQ: Write Error
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x2a
> SENSE KEY: Media Error
> INFO: 0x53cc (VALID flag on)
> COMMAND INFO: 0xa50000
> ASC/ASCQ: Write Error
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x2a
> SENSE KEY: Media Error
> INFO: 0x53cc (VALID flag on)
> COMMAND INFO: 0xa50000
> ASC/ASCQ: Write Error
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x2a
> SENSE KEY: Media Error
> INFO: 0x53cc (VALID flag on)
> COMMAND INFO: 0xa50000
> ASC/ASCQ: Write Error
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x2a
> SENSE KEY: Media Error
> INFO: 0x53cc (VALID flag on)
> COMMAND INFO: 0xa50000
> ASC/ASCQ: Write Error
> cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x2a
> SENSE KEY: Media Error
> INFO: 0x53cc (VALID flag on)
> COMMAND INFO: 0xa50000
> ASC/ASCQ: Write Error
>