Re: (2) [PATCH v2 06/17] ufs: core: mcq: Configure resource regions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 07 2022 at 20:44 -0700, Daejun Park wrote:
Hi Asutosh Das,

[...]
+        res = &hba->res[RES_MCQ];
+        /* Bail if NCQ resource is provided */
Maybe MCQ?
Thanks, will fix it.


+        if (res->base)
+                goto out;
+
+        /* Manually allocate MCQ resource from ufs_mem */
+        res_mcq = res->resource;
Why we assign the value to res_mcq?

Hmm, good point, will fix it.

+        res_mcq = devm_kzalloc(hba->dev, sizeof(*res_mcq), GFP_KERNEL);
+        if (!res_mcq) {
+                dev_err(hba->dev, "Failed to allocate MCQ resource\n");
+                return ret;
+        }
+
+        res_mcq->start = res_mem->start +
+                         MCQ_SQATTR_OFFSET(hba->mcq_capabilities);
+        res_mcq->end = res_mcq->start + hba->nr_hw_queues * MCQ_QCFG_SIZE - 1;
+        res_mcq->flags = res_mem->flags;
+        res_mcq->name = "mcq";
+
+        ret = insert_resource(&iomem_resource, res_mcq);
+        if (ret) {
+                dev_err(hba->dev, "Failed to insert MCQ resource, err=%d\n", ret);
Should we free the res_mcq?

yes, will add it. Thanks.

+                return ret;
+        }
+
+        res->base = devm_ioremap_resource(hba->dev, res_mcq);
+        if (IS_ERR(res->base)) {
+                dev_err(hba->dev, "MCQ registers mapping failed, err=%d\n",
+                        (int)PTR_ERR(res->base));
Should we call remove_resource and free the res_mcq?

I'll add the cleanup here.
Thanks,
Daejun



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux