On 8/28/06, Tejun Heo <htejun@xxxxxxxxx> wrote:
Fajun Chen wrote: >> You can use SCSI userscan interface. >> > Is this a scsi command? I looked at scsi spec and haven't found it > yet. I know how to initiate user scan from proc or sysfs, Yeap, that's what I meant. > but there is > no way to know the result of user scan through proc or sysfs. I'm > looking for a way to check when a pata drive is back online after a > power cycle. May I issue userscan periodically until its result > indicates pata drive is available? Hmmm.. When new devices are attached, hotplug events are generated. I think that's the only way to get any result back, so when it fails, there's no indication. Periodically repeating userscan request should be fine although it may result in an extra reset after successfully detecting the device. That shouldn't hurt too much.
I assume that alt status register will be updated when pata/sata is back online. So as an alternative and less invasive way, could I check alt status register and start user scan only if device is ready on alt status register? libata has ata_altstatus() function, is it available to user space? If not, may I expose it? I'm looking for a way to check device registers without side effects. Thanks, Fajun - To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html