Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20952b69 authored by Tejun Heo's avatar Tejun Heo
Browse files

[PATCH] libata: set PIO-0 after successful EH reset



Set ata_device->pio_mode to XFER_PIO_0 after a successful reset.  This
is to keep EH resets consistent with probe resets as updated by the
commit b6079ca4.  Note that, with
soon-to-follow hotplug update, EH resets will include probe resets.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
parent ef282407
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -1287,7 +1287,7 @@ static int ata_eh_reset(struct ata_port *ap, ata_reset_fn_t softreset,
	unsigned int classes[ATA_MAX_DEVICES];
	unsigned int classes[ATA_MAX_DEVICES];
	int tries = ATA_EH_RESET_TRIES;
	int tries = ATA_EH_RESET_TRIES;
	ata_reset_fn_t reset;
	ata_reset_fn_t reset;
	int rc;
	int i, rc;


	if (softreset && (!hardreset || (!sata_set_spd_needed(ap) &&
	if (softreset && (!hardreset || (!sata_set_spd_needed(ap) &&
					 !(ehc->i.action & ATA_EH_HARDRESET))))
					 !(ehc->i.action & ATA_EH_HARDRESET))))
@@ -1319,6 +1319,12 @@ static int ata_eh_reset(struct ata_port *ap, ata_reset_fn_t softreset,
	}
	}


	if (rc == 0) {
	if (rc == 0) {
		/* After the reset, the device state is PIO 0 and the
		 * controller state is undefined.  Record the mode.
		 */
		for (i = 0; i < ATA_MAX_DEVICES; i++)
			ap->device[i].pio_mode = XFER_PIO_0;

		if (postreset)
		if (postreset)
			postreset(ap, classes);
			postreset(ap, classes);