linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH #upstream-fixes 1/2] libata: invert ATA_PFLAG_INITIALIZING to RUNNING
@ 2007-08-20 11:50 Tejun Heo
  2007-08-20 11:53 ` [PATCH #upstream-fixes 2/2] libata: prevent EH from being scheduled after port is detached Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2007-08-20 11:50 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide

Invert the meaning of ATA_PFLAG_INITIALIZING and rename it to
ATA_PFLAG_RUNNING.  This will be used to prevent EH from being
scheduled during host removal.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/libata-core.c |    4 +---
 drivers/ata/libata-eh.c   |    2 +-
 include/linux/libata.h    |    2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

Index: work/drivers/ata/libata-core.c
===================================================================
--- work.orig/drivers/ata/libata-core.c
+++ work/drivers/ata/libata-core.c
@@ -6052,7 +6052,6 @@ struct ata_port *ata_port_alloc(struct a
 	if (!ap)
 		return NULL;
 
-	ap->pflags |= ATA_PFLAG_INITIALIZING;
 	ap->lock = &host->lock;
 	ap->flags = ATA_FLAG_DISABLED;
 	ap->print_id = -1;
@@ -6428,8 +6427,7 @@ int ata_host_register(struct ata_host *h
 			ehi->action |= ATA_EH_SOFTRESET;
 			ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET;
 
-			ap->pflags &= ~ATA_PFLAG_INITIALIZING;
-			ap->pflags |= ATA_PFLAG_LOADING;
+			ap->pflags |= ATA_PFLAG_LOADING | ATA_PFLAG_RUNNING;
 			ata_port_schedule_eh(ap);
 
 			spin_unlock_irqrestore(ap->lock, flags);
Index: work/drivers/ata/libata-eh.c
===================================================================
--- work.orig/drivers/ata/libata-eh.c
+++ work/drivers/ata/libata-eh.c
@@ -709,7 +709,7 @@ void ata_port_schedule_eh(struct ata_por
 {
 	WARN_ON(!ap->ops->error_handler);
 
-	if (ap->pflags & ATA_PFLAG_INITIALIZING)
+	if (!(ap->pflags & ATA_PFLAG_RUNNING))
 		return;
 
 	ata_eh_set_pending(ap, 1);
Index: work/include/linux/libata.h
===================================================================
--- work.orig/include/linux/libata.h
+++ work/include/linux/libata.h
@@ -194,7 +194,7 @@ enum {
 	ATA_PFLAG_LOADING	= (1 << 4), /* boot/loading probe */
 	ATA_PFLAG_UNLOADING	= (1 << 5), /* module is unloading */
 	ATA_PFLAG_SCSI_HOTPLUG	= (1 << 6), /* SCSI hotplug scheduled */
-	ATA_PFLAG_INITIALIZING	= (1 << 7), /* being initialized, don't touch */
+	ATA_PFLAG_RUNNING	= (1 << 7), /* port up & running */
 
 	ATA_PFLAG_SUSPENDED	= (1 << 17), /* port is suspended (power) */
 	ATA_PFLAG_PM_PENDING	= (1 << 18), /* PM operation pending */

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-20 12:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 11:50 [PATCH #upstream-fixes 1/2] libata: invert ATA_PFLAG_INITIALIZING to RUNNING Tejun Heo
2007-08-20 11:53 ` [PATCH #upstream-fixes 2/2] libata: prevent EH from being scheduled after port is detached Tejun Heo
2007-08-20 12:27   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).