[PATCH v2 0/3] bus: mhi: keep dma buffers through suspend/hibernation cycles

Muhammad Usama Anjum posted 3 patches 2 months, 3 weeks ago
drivers/bus/mhi/host/boot.c     | 44 ++++++++++++++++++++-------------
drivers/bus/mhi/host/init.c     | 41 ++++++++++++++++++++++++++----
drivers/bus/mhi/host/internal.h |  2 ++
include/linux/mhi.h             |  2 ++
4 files changed, 67 insertions(+), 22 deletions(-)
[PATCH v2 0/3] bus: mhi: keep dma buffers through suspend/hibernation cycles
Posted by Muhammad Usama Anjum 2 months, 3 weeks ago
When there is memory pressure during resume and no DMA memory is
available, the ath11k driver fails to resume. The driver currently
frees its DMA memory during suspend or hibernate, and attempts to
re-allocate it during resume. However, if the DMA memory has been
consumed by other software in the meantime, these allocations can
fail, leading to critical failures in the WiFi driver. It has been
reported [1].

Although I have recently fixed several instances [2] [3] to ensure
DMA memory is not freed once allocated, we continue to receive
reports of new failures.

In this series, 3 more such cases are being fixed. There are still
some cases which I'm trying to fix. They can be discussed separately.

[1] https://lore.kernel.org/all/ead32f5b-730a-4b81-b38f-93d822f990c6@collabora.com
[2] https://lore.kernel.org/all/20250428080242.466901-1-usama.anjum@collabora.com
[3] https://lore.kernel.org/all/20250516184952.878726-1-usama.anjum@collabora.com

Muhammad Usama Anjum (3):
  bus: mhi: host: keep bhi buffer through suspend cycle
  bus: mhi: host: keep bhie buffer through suspend cycle
  bus: mhi: keep device context through suspend cycles

 drivers/bus/mhi/host/boot.c     | 44 ++++++++++++++++++++-------------
 drivers/bus/mhi/host/init.c     | 41 ++++++++++++++++++++++++++----
 drivers/bus/mhi/host/internal.h |  2 ++
 include/linux/mhi.h             |  2 ++
 4 files changed, 67 insertions(+), 22 deletions(-)

-- 
2.39.5
Re: [PATCH v2 0/3] bus: mhi: keep dma buffers through suspend/hibernation cycles
Posted by Baochen Qiang 2 months, 3 weeks ago

On 7/15/2025 9:25 PM, Muhammad Usama Anjum wrote:
> When there is memory pressure during resume and no DMA memory is
> available, the ath11k driver fails to resume. The driver currently
> frees its DMA memory during suspend or hibernate, and attempts to
> re-allocate it during resume. However, if the DMA memory has been
> consumed by other software in the meantime, these allocations can
> fail, leading to critical failures in the WiFi driver. It has been
> reported [1].
> 
> Although I have recently fixed several instances [2] [3] to ensure
> DMA memory is not freed once allocated, we continue to receive
> reports of new failures.
> 
> In this series, 3 more such cases are being fixed. There are still
> some cases which I'm trying to fix. They can be discussed separately.
> 
> [1] https://lore.kernel.org/all/ead32f5b-730a-4b81-b38f-93d822f990c6@collabora.com
> [2] https://lore.kernel.org/all/20250428080242.466901-1-usama.anjum@collabora.com
> [3] https://lore.kernel.org/all/20250516184952.878726-1-usama.anjum@collabora.com
> 
> Muhammad Usama Anjum (3):
>   bus: mhi: host: keep bhi buffer through suspend cycle
>   bus: mhi: host: keep bhie buffer through suspend cycle
>   bus: mhi: keep device context through suspend cycles
> 
>  drivers/bus/mhi/host/boot.c     | 44 ++++++++++++++++++++-------------
>  drivers/bus/mhi/host/init.c     | 41 ++++++++++++++++++++++++++----
>  drivers/bus/mhi/host/internal.h |  2 ++
>  include/linux/mhi.h             |  2 ++
>  4 files changed, 67 insertions(+), 22 deletions(-)
> 

changelog missing
Re: [PATCH v2 0/3] bus: mhi: keep dma buffers through suspend/hibernation cycles
Posted by Muhammad Usama Anjum 2 months, 3 weeks ago
On 7/16/25 8:36 AM, Baochen Qiang wrote:
> 
> 
> On 7/15/2025 9:25 PM, Muhammad Usama Anjum wrote:
>> When there is memory pressure during resume and no DMA memory is
>> available, the ath11k driver fails to resume. The driver currently
>> frees its DMA memory during suspend or hibernate, and attempts to
>> re-allocate it during resume. However, if the DMA memory has been
>> consumed by other software in the meantime, these allocations can
>> fail, leading to critical failures in the WiFi driver. It has been
>> reported [1].
>>
>> Although I have recently fixed several instances [2] [3] to ensure
>> DMA memory is not freed once allocated, we continue to receive
>> reports of new failures.
>>
>> In this series, 3 more such cases are being fixed. There are still
>> some cases which I'm trying to fix. They can be discussed separately.
>>
>> [1] https://lore.kernel.org/all/ead32f5b-730a-4b81-b38f-93d822f990c6@collabora.com
>> [2] https://lore.kernel.org/all/20250428080242.466901-1-usama.anjum@collabora.com
>> [3] https://lore.kernel.org/all/20250516184952.878726-1-usama.anjum@collabora.com
>>
>> Muhammad Usama Anjum (3):
>>   bus: mhi: host: keep bhi buffer through suspend cycle
>>   bus: mhi: host: keep bhie buffer through suspend cycle
>>   bus: mhi: keep device context through suspend cycles
>>
>>  drivers/bus/mhi/host/boot.c     | 44 ++++++++++++++++++++-------------
>>  drivers/bus/mhi/host/init.c     | 41 ++++++++++++++++++++++++++----
>>  drivers/bus/mhi/host/internal.h |  2 ++
>>  include/linux/mhi.h             |  2 ++
>>  4 files changed, 67 insertions(+), 22 deletions(-)
>>
> 
> changelog missing
Sorry, missed the changelog in the cover letter. For now, please find
changelog in the individual patches. I'll add changelog if there would be
v3.


>