Messages in this thread Patch in this message | | | Date | Fri, 07 Mar 2008 12:11:50 +0900 | From | Tejun Heo <> | Subject | [PATCH 2/2] libata: kill SCSI devices before detaching ata_host |
| |
Kill SCSI devices before detaching port. This makes drives properly shut down on driver unload.
Signed-off-by: Tejun Heo <htejun@gmail.com> --- drivers/ata/libata-core.c | 8 ++++++++ 1 file changed, 8 insertions(+)
Index: work1/drivers/ata/libata-core.c =================================================================== --- work1.orig/drivers/ata/libata-core.c +++ work1/drivers/ata/libata-core.c @@ -7236,6 +7236,14 @@ static void ata_port_detach(struct ata_p if (!ap->ops->error_handler) goto skip_eh; + /* First, tell all SCSI devices that we're going down. Note + * that there's a small race window here. Devices which get + * hotplugged after forget_host but before EH is killed won't + * get shut down by SCSI layer properly and will miss cache + * flush and spin down. + */ + scsi_forget_host(ap->scsi_host); + /* tell EH we're leaving & flush EH */ spin_lock_irqsave(ap->lock, flags); ap->pflags |= ATA_PFLAG_UNLOADING;
| |