From db477cba133ce448381583e4cc4381bdb4ad742b Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 1 May 2007 11:50:15 +0200 Subject: [PATCH] --- yaml --- r: 56258 b: refs/heads/master c: f4d6d00466ef4879e4289f18c2f59210a06a7ada h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/ata/libata-core.c | 2 ++ trunk/drivers/ata/libata-eh.c | 3 +++ trunk/include/linux/libata.h | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 3fcccd676b50..1738605d7ef8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1626aeb881236c8cb022b5e4ca594146a951d669 +refs/heads/master: f4d6d00466ef4879e4289f18c2f59210a06a7ada diff --git a/trunk/drivers/ata/libata-core.c b/trunk/drivers/ata/libata-core.c index 9cff5c506573..6ac4f32ddcc2 100644 --- a/trunk/drivers/ata/libata-core.c +++ b/trunk/drivers/ata/libata-core.c @@ -5964,6 +5964,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host) if (!ap) return NULL; + ap->pflags |= ATA_PFLAG_INITIALIZING; ap->lock = &host->lock; ap->flags = ATA_FLAG_DISABLED; ap->print_id = -1; @@ -6332,6 +6333,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) ehi->action |= ATA_EH_SOFTRESET; ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET; + ap->pflags &= ~ATA_PFLAG_INITIALIZING; ap->pflags |= ATA_PFLAG_LOADING; ata_port_schedule_eh(ap); diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c index 412d6049afa3..ee9bb534153a 100644 --- a/trunk/drivers/ata/libata-eh.c +++ b/trunk/drivers/ata/libata-eh.c @@ -551,6 +551,9 @@ void ata_port_schedule_eh(struct ata_port *ap) { WARN_ON(!ap->ops->error_handler); + if (ap->pflags & ATA_PFLAG_INITIALIZING) + return; + ap->pflags |= ATA_PFLAG_EH_PENDING; scsi_schedule_eh(ap->scsi_host); diff --git a/trunk/include/linux/libata.h b/trunk/include/linux/libata.h index 95b74ba7dbf4..90abcdc3d4ef 100644 --- a/trunk/include/linux/libata.h +++ b/trunk/include/linux/libata.h @@ -190,6 +190,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_FLUSH_PORT_TASK = (1 << 16), /* flush port task */ ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */