Merge "ufs: host: qcom: Get queue ID from MSI index in ESI handler"
This commit is contained in:
commit
7df0016e14
@ -4780,11 +4780,13 @@ static void ufs_qcom_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
|
||||
ufshcd_mcq_config_esi(hba, msg);
|
||||
}
|
||||
|
||||
static irqreturn_t ufs_qcom_mcq_esi_handler(int irq, void *__hba)
|
||||
static irqreturn_t ufs_qcom_mcq_esi_handler(int irq, void *data)
|
||||
{
|
||||
struct ufs_hba *hba = __hba;
|
||||
struct msi_desc *desc = data;
|
||||
struct device *dev = msi_desc_to_dev(desc);
|
||||
struct ufs_hba *hba = dev_get_drvdata(dev);
|
||||
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
|
||||
u32 id = irq - host->esi_base;
|
||||
u32 id = desc->msi_index;
|
||||
struct ufs_hw_queue *hwq = &hba->uhq[id];
|
||||
|
||||
ufshcd_mcq_write_cqis(hba, 0x1, id);
|
||||
@ -4819,8 +4821,6 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
|
||||
|
||||
if (host->esi_enabled)
|
||||
return 0;
|
||||
else if (host->esi_base < 0)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* 1. We only handle CQs as of now.
|
||||
@ -4829,16 +4829,15 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
|
||||
nr_irqs = hba->nr_hw_queues - hba->nr_queues[HCTX_TYPE_POLL];
|
||||
ret = platform_msi_domain_alloc_irqs(hba->dev, nr_irqs,
|
||||
ufs_qcom_write_msi_msg);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
msi_for_each_desc(desc, hba->dev, MSI_DESC_ALL) {
|
||||
if (!desc->msi_index)
|
||||
host->esi_base = desc->irq;
|
||||
|
||||
ret = devm_request_irq(hba->dev, desc->irq,
|
||||
ufs_qcom_mcq_esi_handler,
|
||||
IRQF_SHARED, "qcom-mcq-esi", hba);
|
||||
IRQF_SHARED, "qcom-mcq-esi", desc);
|
||||
if (ret) {
|
||||
dev_err(hba->dev, "%s: Fail to request IRQ for %d, err = %d\n",
|
||||
__func__, desc->irq, ret);
|
||||
@ -4847,7 +4846,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
|
||||
}
|
||||
|
||||
/* dev_cmd queue does not worth esi affinity */
|
||||
if (desc->irq != host->esi_base)
|
||||
if (desc->msi_index)
|
||||
ufs_qcom_set_esi_affinity_hint(hba, desc->irq);
|
||||
}
|
||||
|
||||
@ -4870,12 +4869,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
|
||||
}
|
||||
|
||||
out:
|
||||
if (ret) {
|
||||
host->esi_base = -1;
|
||||
dev_warn(hba->dev, "Failed to request Platform MSI %d\n", ret);
|
||||
} else {
|
||||
if (!ret)
|
||||
host->esi_enabled = true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -610,7 +610,6 @@ struct ufs_qcom_host {
|
||||
struct list_head regs_list_head;
|
||||
bool ber_th_exceeded;
|
||||
|
||||
int esi_base;
|
||||
bool esi_enabled;
|
||||
|
||||
bool bypass_pbl_rst_wa;
|
||||
|
Loading…
Reference in New Issue
Block a user