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

Commit 524546f2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: Record last intr status and its timestamp"

parents adc8e47e 08b32900
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -521,6 +521,11 @@ static void ufshcd_print_host_state(struct ufs_hba *hba)
	dev_err(hba->dev, "UFS Host state=%d\n", hba->ufshcd_state);
	dev_err(hba->dev, "lrb in use=0x%lx, outstanding reqs=0x%lx tasks=0x%lx\n",
		hba->lrb_in_use, hba->outstanding_reqs, hba->outstanding_tasks);
#if defined(CONFIG_SCSI_UFSHCD_QTI)
	dev_err(hba->dev, "last intr ts=%lld, last intr status=0x%x\n",
		ktime_to_us(hba->ufs_stats.last_intr_ts),
		hba->ufs_stats.last_intr_status);
#endif
	dev_err(hba->dev, "saved_err=0x%x, saved_uic_err=0x%x\n",
		hba->saved_err, hba->saved_uic_err);
	dev_err(hba->dev, "Device power mode=%d, UIC link state=%d\n",
@@ -6100,6 +6105,10 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba)

	spin_lock(hba->host->host_lock);
	intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
#if defined(CONFIG_SCSI_UFSHCD_QTI)
	hba->ufs_stats.last_intr_status = intr_status;
	hba->ufs_stats.last_intr_ts = ktime_get();
#endif

	/*
	 * There could be max of hba->nutrs reqs in flight and in worst case