On Wed, Apr 19, 2006 at 05:08:41PM +0800, zhao, forrest wrote: > Tejun, > > I did some initial hotplug test in our lab today. And > this is the printk output in dmesg when I unplug the > SATA disk at port 2: > > ata2: stat 0x50 err 0x0 SError 0x90402 action 0x2 > (irq_stat 0x04400000, PHY RDY changed) > ata2: soft resetting channel for error handling > ata2: SATA link down (SStatus 21 SControl 300) > ata2: limiting SATA link speed to 1.5 Gbps > ata2: some devices seem to be offline, will retry in 5 secs > ata2: hard resetting channel for error handling > ata2: SATA link down (SStatus 0 SControl 310) > ata2: some devices seem to be offline, will retry in 5 secs > ata2: hard resetting channel for error handling > ata2: SATA link down (SStatus 0 SControl 310) > ata2: dev 0 disabled > // why hard reset again?? > ata2: hard resetting channel for error handling > ata2: SATA link down (SStatus 0 SControl 310) > // ?? > ata2: dev 0 detaching (SCSI 1:0:0:0) > > > My question is: why hard-reset is executed again after > dev0 at ata2 has been disabled? > > Could you help me understand the idea behind this logic? > Hello, Zhao. The port could be frozen due to the error which caused the attached device to fail. So, EH is trying to put the port into known state before finishing EH such that we can deal with later events (hotplug). I've added logics to avoid unnecessary resets in my working tree such that unnecessary resets are avoided if.. * the port is not frozen * the port is frozen but hotplug is scheduled Hope it helped. -- tejun - : 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