Re: [PATCH v2] bus: mhi: host: don't free bhie tables during suspend/hibernation

From: Jeff Hugo
Date: Mon Apr 14 2025 - 10:52:55 EST


On 4/14/2025 1:32 AM, Muhammad Usama Anjum wrote:
On 4/12/25 6:22 AM, Krishna Chaitanya Chundru wrote:

On 4/12/2025 12:02 AM, Muhammad Usama Anjum wrote:
On 4/11/25 1:39 PM, Krishna Chaitanya Chundru wrote:


On 4/11/2025 12:32 PM, Muhammad Usama Anjum wrote:
On 4/11/25 8:37 AM, Krishna Chaitanya Chundru wrote:


On 4/10/2025 8:26 PM, Muhammad Usama Anjum wrote:
Fix dma_direct_alloc() failure at resume time during bhie_table
allocation. There is a crash report where at resume time, the memory
from the dma doesn't get allocated and MHI fails to re-initialize.
There may be fragmentation of some kind which fails the allocation
call.

To fix it, don't free the memory at power down during suspend /
hibernation. Instead, use the same allocated memory again after every
resume / hibernation. This patch has been tested with resume and
hibernation both.

The rddm is of constant size for a given hardware. While the
fbc_image
size depends on the firmware. If the firmware changes, we'll free and
If firmware image will change between suspend and resume ?
Yes, correct.

why the firmware image size will change between suspend & resume?
who will update the firmware image after bootup?
It is not expected behaviour.
I was trying to research if the firmware can change or not. I've not
found any documentation on it.

If the firmare is updated in filesystem before suspend/hibernate, would
the new firwmare be loaded the next time kernel resumes as the older
firmware is no where to be found?

What do you think about this?

I don't think firmware can be updated before suspend/hibernate. I don't
see any reason why it can be updated. If you think it can be updated
please quote relevant doc.
I've not found any documentation on it. Let's wait for others to review
and it it cannot be updated, I'll remove this part.


Wouldn't this be trivial to test? Boot the device, go modify the firmware on the filesystem, then go through a suspend cycle.

-Jeff