Re: [PATCH v3 5/6] pds_core: add host backed memory support for firmware
From: Rao, Nikhil
Date: Sat Jun 13 2026 - 19:26:46 EST
[..]+void pdsc_host_mem_add(struct pdsc *pdsc)
+{
+
+ for (i = 0; i < count; i++) {
+ err = pdsc_host_mem_add_one(pdsc, i);
+ if (err)
+ break;
When pdsc_host_mem_add_one() returns an error, pdsc->host_mem_reqs[i].pg
will be zero.
In pdsc_host_mem_add_one(), If the MEM_ADD devcmd fails, pg is still valid (allocated and DMA-mapped). The counter (pdsc->num_host_mem_reqs) is incremented after both alloc_pages() and dma_map_page() succeed, with a comment explaining why:
/* Track this allocation so pdsc_host_mem_free() can clean it up */
pdsc->num_host_mem_reqs++;
> Errors are not propagate to the caller...
Partial allocation is acceptable; firmware works with whatever memory it gets. The initialized entries are tracked by num_host_mem_reqs and cleaned up correctly on shutdown.
Will address - remove redundant memset, change to dev_warn.
Thanks for the review,
Nikhil