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

Commit 309afcb5 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik
Browse files

[PATCH] libata: make user scan wait for scan to complete



Make user scan wait for scan to complete.  This way user can wait for
warm plug request to complete and is prevented from causing EH event
storm by repetitively issuing scan request while EH is in progress.

Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Cc: Fajun Chen <fajunchen@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 722420fe
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -3182,9 +3182,11 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
			rc = -EINVAL;
	}

	if (rc == 0)
	if (rc == 0) {
		ata_port_schedule_eh(ap);

		spin_unlock_irqrestore(ap->lock, flags);
		ata_port_wait_eh(ap);
	} else
		spin_unlock_irqrestore(ap->lock, flags);

	return rc;