FROMLIST: scsi: ufs: core: Add host quirk UFSHCD_QUIRK_MCQ_BROKEN_RTC
Some host does not implement SQ Run Time Command (SQRTC) register thus need this quirk to skip related flow. Bug: 267974767 Link: https://lore.kernel.org/all/20230612085817.12275-3-powen.kao@mediatek.com/ Signed-off-by: Po-Wen Kao <powen.kao@mediatek.com> Change-Id: I52192e065f2ac63f0c77b2cb16ae1226d1e7cd9a
This commit is contained in:
parent
27b569b568
commit
0171df9359
2 changed files with 18 additions and 0 deletions
|
|
@ -468,6 +468,9 @@ static int ufshcd_mcq_sq_stop(struct ufs_hba *hba, struct ufs_hw_queue *hwq)
|
|||
u32 id = hwq->id, val;
|
||||
int err;
|
||||
|
||||
if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_RTC)
|
||||
return -ETIMEDOUT;
|
||||
|
||||
writel(SQ_STOP, mcq_opr_base(hba, OPR_SQD, id) + REG_SQRTC);
|
||||
reg = mcq_opr_base(hba, OPR_SQD, id) + REG_SQRTS;
|
||||
err = read_poll_timeout(readl, val, val & SQ_STS, 20,
|
||||
|
|
@ -484,6 +487,9 @@ static int ufshcd_mcq_sq_start(struct ufs_hba *hba, struct ufs_hw_queue *hwq)
|
|||
u32 id = hwq->id, val;
|
||||
int err;
|
||||
|
||||
if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_RTC)
|
||||
return -ETIMEDOUT;
|
||||
|
||||
writel(SQ_START, mcq_opr_base(hba, OPR_SQD, id) + REG_SQRTC);
|
||||
reg = mcq_opr_base(hba, OPR_SQD, id) + REG_SQRTS;
|
||||
err = read_poll_timeout(readl, val, !(val & SQ_STS), 20,
|
||||
|
|
@ -511,6 +517,9 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag)
|
|||
u32 nexus, id, val;
|
||||
int err;
|
||||
|
||||
if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_RTC)
|
||||
return -ETIMEDOUT;
|
||||
|
||||
if (task_tag != hba->nutrs - UFSHCD_NUM_RESERVED) {
|
||||
if (!cmd)
|
||||
return -EINVAL;
|
||||
|
|
@ -593,6 +602,9 @@ static bool ufshcd_mcq_sqe_search(struct ufs_hba *hba,
|
|||
u64 addr, match;
|
||||
u32 sq_head_slot;
|
||||
|
||||
if (hba->quirks & UFSHCD_QUIRK_MCQ_BROKEN_RTC)
|
||||
return true;
|
||||
|
||||
mutex_lock(&hwq->sq_mutex);
|
||||
|
||||
ufshcd_mcq_sq_stop(hba, hwq);
|
||||
|
|
|
|||
|
|
@ -623,6 +623,12 @@ enum ufshcd_quirks {
|
|||
* Enable this quirk will disable CQES and use per queue interrupt.
|
||||
*/
|
||||
UFSHCD_QUIRK_MCQ_BROKEN_INTR = 1 << 20,
|
||||
|
||||
/*
|
||||
* Some host does not implement SQ Run Time Command (SQRTC) register
|
||||
* thus need this quirk to skip related flow.
|
||||
*/
|
||||
UFSHCD_QUIRK_MCQ_BROKEN_RTC = 1 << 21,
|
||||
};
|
||||
|
||||
enum ufshcd_android_quirks {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue