lkml.org 
[lkml]   [2008]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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;

\
 
 \ /
  Last update: 2008-03-07 04:15    [W:0.038 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site