Hi Folks, I have written some userspace code that talks to SG via SG_IO, issuing SCSI-ATA-Passthru commands. Upon commands that take long as f.e. the ATA-Command SecurityEraseUnit, I get strange behaviour. Seems like the SCSI-Subsystem does not recognize that this special command can take long time till completion. It returns after the timeout (which I'd like to be able to reconfigure), but obviously does not set the sense data accordingly (my debug output should show up if the sense contained any errors, but it didn't). It only logs correctly to syslog. The hardware driver used was AHCI on a JMicron 20363. Question: Is there a way to disable/change the kernel command timeouts, for those few ATA-Commands that won't return for a long period of time? Following is some syslog showing briefly what happened: Feb 7 10:37:07 dobbelherz kernel: ata10: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Feb 7 10:37:07 dobbelherz kernel: ata10.00: ATA-7: SAMSUNG HD103UJ, 1AA01112, max UDMA7 Feb 7 10:37:07 dobbelherz kernel: ata10.00: 1953525168 sectors, multi 0: LBA48 NCQ (depth 31/32), AA Feb 7 10:37:07 dobbelherz kernel: ata10.00: configured for UDMA/133 Feb 7 10:37:07 dobbelherz kernel: scsi 9:0:0:0: Direct-Access ATA SAMSUNG HD103UJ 1AA0 PQ: 0 ANSI: 5 Feb 7 10:37:07 dobbelherz kernel: sd 9:0:0:0: Attached scsi generic sg4 type 0 Feb 7 10:37:07 dobbelherz kernel: sd 9:0:0:0: [sdd] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB) Feb 7 10:37:07 dobbelherz kernel: sd 9:0:0:0: [sdd] Write Protect is off Feb 7 10:37:07 dobbelherz kernel: sd 9:0:0:0: [sdd] Mode Sense: 00 3a 00 00 Feb 7 10:37:07 dobbelherz kernel: sd 9:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Feb 7 10:37:07 dobbelherz kernel: sdd: unknown partition table Feb 7 10:37:07 dobbelherz kernel: sd 9:0:0:0: [sdd] Attached SCSI disk Feb 7 10:38:05 dobbelherz kernel: ata10.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen Feb 7 10:38:05 dobbelherz kernel: ata10.00: failed command: SECURITY ERASE UNIT Feb 7 10:38:05 dobbelherz kernel: ata10.00: cmd f4/00:01:00:00:00/00:00:00:00:00/00 tag 0 pio 512 out Feb 7 10:38:05 dobbelherz kernel: res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) Feb 7 10:38:05 dobbelherz kernel: ata10.00: status: { DRDY } Feb 7 10:38:05 dobbelherz kernel: ata10: hard resetting link Feb 7 10:38:15 dobbelherz kernel: ata10: softreset failed (device not ready) Feb 7 10:38:15 dobbelherz kernel: ata10: hard resetting link Feb 7 10:38:25 dobbelherz kernel: ata10: softreset failed (device not ready) Feb 7 10:38:25 dobbelherz kernel: ata10: hard resetting link Feb 7 10:38:35 dobbelherz kernel: ata10: link is slow to respond, please be patient (ready=0) Feb 7 10:39:00 dobbelherz kernel: ata10: softreset failed (device not ready) Feb 7 10:39:00 dobbelherz kernel: ata10: limiting SATA link speed to 1.5 Gbps Feb 7 10:39:00 dobbelherz kernel: ata10: hard resetting link Feb 7 10:39:05 dobbelherz kernel: ata10: softreset failed (device not ready) Feb 7 10:39:05 dobbelherz kernel: ata10: reset failed, giving up Feb 7 10:39:05 dobbelherz kernel: ata10.00: disabled Feb 7 10:39:05 dobbelherz kernel: ata10: EH complete --> at this point obviously a SCSI_INQUIRY returned bad data, else my program would have sent ATA_IDENTIFY_DEVICE instead of SCSI_READ_CAPACITY. Feb 7 10:39:05 dobbelherz kernel: sd 9:0:0:0: [sdd] READ CAPACITY(16) failed Feb 7 10:39:05 dobbelherz kernel: sd 9:0:0:0: [sdd] Result: hostbyte=0x04 driverbyte=0x00 Feb 7 10:39:05 dobbelherz kernel: sd 9:0:0:0: [sdd] Sense not available. Feb 7 10:39:05 dobbelherz kernel: sd 9:0:0:0: [sdd] READ CAPACITY failed Feb 7 10:39:05 dobbelherz kernel: sd 9:0:0:0: [sdd] Result: hostbyte=0x04 driverbyte=0x00 Feb 7 10:39:05 dobbelherz kernel: sd 9:0:0:0: [sdd] Sense not available. Feb 7 10:39:05 dobbelherz kernel: sd 9:0:0:0: [sdd] Asking for cache data failed Feb 7 10:39:05 dobbelherz kernel: sd 9:0:0:0: [sdd] Assuming drive cache: write through Feb 7 10:39:05 dobbelherz kernel: sdd: detected capacity change from 1000204886016 to 0 All the best, Stefan Hübner -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html