Re: [PATCH v3 08/17] ufs: core: mcq: Allocate memory for mcq mode

From: Asutosh Das
Date: Mon Oct 31 2022 - 15:39:57 EST


On Sun, Oct 30 2022 at 05:28 -0700, Avri Altman wrote:
[...]

+/* SDB - Single Doorbell */
+static void ufshcd_release_sdb_queue(struct ufs_hba *hba, int nutrs)
+{
+ size_t ucdl_size, utrdl_size;
+
+ ucdl_size = sizeof(struct utp_transfer_cmd_desc) * nutrs;
+ dmam_free_coherent(hba->dev, ucdl_size, hba->ucdl_base_addr,
+ hba->ucdl_dma_addr);
+
+ utrdl_size = sizeof(struct utp_transfer_req_desc) * nutrs;
+ dmam_free_coherent(hba->dev, utrdl_size, hba->utrdl_base_addr,
+ hba->utrdl_dma_addr);
+
+ devm_kfree(hba->dev, hba->lrb);
Is it possible not to release the lrb here?
and then you won't be needing to call ufshcd_memory_alloc again?

The hba->nutrs may have changed so number of lrb's may increase as well.
So a reallocation is needed, I think.

-asd