|
@@ -2063,6 +2063,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
|
|
ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
|
|
ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
|
|
ata_reset_fn_t hardreset, ata_postreset_fn_t postreset)
|
|
ata_reset_fn_t hardreset, ata_postreset_fn_t postreset)
|
|
{
|
|
{
|
|
|
|
+ struct ata_port *ap = link->ap;
|
|
struct ata_eh_context *ehc = &link->eh_context;
|
|
struct ata_eh_context *ehc = &link->eh_context;
|
|
unsigned int *classes = ehc->classes;
|
|
unsigned int *classes = ehc->classes;
|
|
int verbose = !(ehc->i.flags & ATA_EHI_QUIET);
|
|
int verbose = !(ehc->i.flags & ATA_EHI_QUIET);
|
|
@@ -2071,9 +2072,14 @@ int ata_eh_reset(struct ata_link *link, int classify,
|
|
unsigned long deadline;
|
|
unsigned long deadline;
|
|
unsigned int action;
|
|
unsigned int action;
|
|
ata_reset_fn_t reset;
|
|
ata_reset_fn_t reset;
|
|
|
|
+ unsigned long flags;
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
/* about to reset */
|
|
/* about to reset */
|
|
|
|
+ spin_lock_irqsave(ap->lock, flags);
|
|
|
|
+ ap->pflags |= ATA_PFLAG_RESETTING;
|
|
|
|
+ spin_unlock_irqrestore(ap->lock, flags);
|
|
|
|
+
|
|
ata_eh_about_to_do(link, NULL, ehc->i.action & ATA_EH_RESET_MASK);
|
|
ata_eh_about_to_do(link, NULL, ehc->i.action & ATA_EH_RESET_MASK);
|
|
|
|
|
|
/* Determine which reset to use and record in ehc->i.action.
|
|
/* Determine which reset to use and record in ehc->i.action.
|
|
@@ -2231,6 +2237,11 @@ int ata_eh_reset(struct ata_link *link, int classify,
|
|
out:
|
|
out:
|
|
/* clear hotplug flag */
|
|
/* clear hotplug flag */
|
|
ehc->i.flags &= ~ATA_EHI_HOTPLUGGED;
|
|
ehc->i.flags &= ~ATA_EHI_HOTPLUGGED;
|
|
|
|
+
|
|
|
|
+ spin_lock_irqsave(ap->lock, flags);
|
|
|
|
+ ap->pflags &= ~ATA_PFLAG_RESETTING;
|
|
|
|
+ spin_unlock_irqrestore(ap->lock, flags);
|
|
|
|
+
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|