Unverified Commit f65056c2 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!2199 Not clear ATA_PFLAG_EH_PENDING and not thaw the port twice in ata_eh_reset()

Merge Pull Request from: @ci-robot 
 
PR sync from: Xingui Yang <yangxingui@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/7WJAGOMS4CV4A5ONOUUGFV33MX5YTSIX/ 
Clear port pending interrupts before reset, as per AHCI
specifications (Szuying). Followup fixes for this one are to not
clear ATA_PFLAG_EH_PENDING in ata_eh_reset() to allow EH to
continue on with other actions recorded with error interrupts
triggered before EH completes. A~Nd an additional fix to avoid
thawing a port twice in EH (Niklas).

Niklas Cassel (2):
  ata: libata-eh: do not clear ATA_PFLAG_EH_PENDING in ata_eh_reset()
  ata: libata-eh: do not thaw the port twice in ata_eh_reset()


-- 
2.17.1
 
https://gitee.com/openeuler/kernel/issues/I81M63 
 
Link:https://gitee.com/openeuler/kernel/pulls/2199

 

Reviewed-by: default avatarYihang Li <liyihang9@huawei.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 9f143496 e0b2c089
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -2703,23 +2703,13 @@ int ata_eh_reset(struct ata_link *link, int classify,
			postreset(slave, classes);
	}

	/*
	 * Some controllers can't be frozen very well and may set spurious
	 * error conditions during reset.  Clear accumulated error
	 * information and re-thaw the port if frozen.  As reset is the
	 * final recovery action and we cross check link onlineness against
	 * device classification later, no hotplug event is lost by this.
	 */
	/* clear cached SError */
	spin_lock_irqsave(link->ap->lock, flags);
	memset(&link->eh_info, 0, sizeof(link->eh_info));
	link->eh_info.serror = 0;
	if (slave)
		memset(&slave->eh_info, 0, sizeof(link->eh_info));
	ap->pflags &= ~ATA_PFLAG_EH_PENDING;
		slave->eh_info.serror = 0;
	spin_unlock_irqrestore(link->ap->lock, flags);

	if (ap->pflags & ATA_PFLAG_FROZEN)
		ata_eh_thaw_port(ap);

	/*
	 * Make sure onlineness and classification result correspond.
	 * Hotplug could have happened during reset and some