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

Commit ddc64162 authored by Can Guo's avatar Can Guo
Browse files

scsi: ufs: complete requests in host reset and restore path



In UFS host reset and restore path, before probe, driver shall stop and
start the host controller once. After host controller is stopped, the
pending requests, if any, are cleared from doorbell. These pending requests
are not completed at this time, instead they are completed once for all in
the IRQ handler of the first NOP_OUT command sent after link startup during
probe. Since the OCSs of these pending requests are not SUCCESS, their
UPIUs shall be dumped. When there are multiple pending requests, the err
logs can be overwhelming and may lead to stability issues because they are
from IRQ context. Therefore, before probe, complete these pending requests
right after host controller is stopped and silence the UPIU err logs when
complete these requests in this path.

Change-Id: I6b6d6e6d226425cd5170217cd4fde60f16134513
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent 364e8d57
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -7075,8 +7075,8 @@ static void ufshcd_err_handler(struct work_struct *work)

	/*
	 * if host reset is required then skip clearing the pending
	 * transfers forcefully because they will automatically get
	 * cleared after link startup.
	 * transfers forcefully because they will get cleared during
	 * host reset and restore
	 */
	if (needs_reset)
		goto skip_pending_xfer_clear;
@@ -7891,9 +7891,15 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)
	int err;
	unsigned long flags;

	/* Reset the host controller */
	/*
	 * Stop the host controller and complete the requests
	 * cleared by h/w
	 */
	spin_lock_irqsave(hba->host->host_lock, flags);
	ufshcd_hba_stop(hba, false);
	hba->silence_err_logs = true;
	ufshcd_complete_requests(hba);
	hba->silence_err_logs = false;
	spin_unlock_irqrestore(hba->host->host_lock, flags);

	/* scale up clocks to max frequency before full reinitialization */