Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Jeff Johnson <jjohnson@kernel.org>,
	Jeffrey Hugo <quic_jhugo@quicinc.com>,
	Yan Zhen <yanzhen@vivo.com>,
	Youssef Samir <quic_yabdulra@quicinc.com>,
	Qiang Yu <quic_qianyu@quicinc.com>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kunwu Chan <chentao@kylinos.cn>,
	kernel@collabora.com, mhi@lists.linux.dev,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-wireless@vger.kernel.org, ath11k@lists.infradead.org
Subject: Re: [PATCH v2] bus: mhi: host: don't free bhie tables during suspend/hibernation
Date: Fri, 25 Apr 2025 12:14:39 +0500	[thread overview]
Message-ID: <1136c7cb-1c7b-410b-93d2-c74aec939196@collabora.com> (raw)
In-Reply-To: <h2wv7drxntokziiwbzjw5xjzbctbomp6cfcba7ppfbih6o7so7@p6dazv32xfx4>

On 4/25/25 12:04 PM, Manivannan Sadhasivam wrote:
> On Thu, Apr 10, 2025 at 07:56:54PM +0500, 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.
>>
> 
> If dma_direct_alloc() fails, then it is a platform limitation/issue. We cannot
> workaround that in the device drivers. What is the guarantee that other drivers
> will also continue to work? Will you go ahead and patch all of them which
> release memory during suspend?
> 
> Please investigate why the allocation fails. Even this is not a device issue, so
> we cannot add quirks :/
This isn't a platform specific quirk. We are only hitting it because
there is high memory pressure during suspend/resume. This dma allocation
failure can happen with memory pressure on any device.

The purpose of this patch is just to make driver more robust to memory
pressure during resume.

I'm not sure about MHI. But other drivers already have such patches as
dma_direct_alloc() is susceptible to failures when memory pressure is
high. This patch was motivated from ath12k [1] and ath11k [2].

[1]
https://lore.kernel.org/all/20240419034034.2842-1-quic_bqiang@quicinc.com/
[2]
https://lore.kernel.org/all/20220506141448.10340-1-quic_akolli@quicinc.com/

What do you think can be the way forward for this patch?

> 
>> 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
>> allocate new memory for it.
>>
>> Here are the crash logs:
>>
>> [ 3029.338587] mhi mhi0: Requested to power ON
>> [ 3029.338621] mhi mhi0: Power on setup success
>> [ 3029.668654] kworker/u33:8: page allocation failure: order:7, mode:0xc04(GFP_NOIO|GFP_DMA32), nodemask=(null),cpuset=/,mems_allowed=0
>> [ 3029.668682] CPU: 4 UID: 0 PID: 2744 Comm: kworker/u33:8 Not tainted 6.11.11-valve10-1-neptune-611-gb69e902b4338 #1ed779c892334112fb968aaa3facf9686b5ff0bd7
>> [ 3029.668690] Hardware name: Valve Galileo/Galileo, BIOS F7G0112 08/01/2024
> 
> Did you intend to leak this information? If not, please remove it from
> stacktrace.
The device isn't private. Its fine.

> 
> - Mani
> 


-- 
Regards,
Usama

  reply	other threads:[~2025-04-25  7:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 14:56 [PATCH v2] bus: mhi: host: don't free bhie tables during suspend/hibernation Muhammad Usama Anjum
2025-04-10 17:00 ` Greg Kroah-Hartman
2025-04-11 18:47   ` Muhammad Usama Anjum
2025-04-11  3:37 ` Krishna Chaitanya Chundru
2025-04-11  7:02   ` Muhammad Usama Anjum
2025-04-11  8:39     ` Krishna Chaitanya Chundru
2025-04-11 18:32       ` Muhammad Usama Anjum
2025-04-12  1:22         ` Krishna Chaitanya Chundru
2025-04-14  7:32           ` Muhammad Usama Anjum
2025-04-14 14:14             ` Jeff Hugo
2025-04-18  8:10               ` Muhammad Usama Anjum
2025-04-18 14:08                 ` Jeff Hugo
2025-04-22  7:23                   ` Muhammad Usama Anjum
2025-04-22 14:22                     ` Jeff Hugo
2025-04-23  6:41                       ` Muhammad Usama Anjum
2025-04-11 16:10 ` Jeff Hugo
2025-04-11 19:10   ` Muhammad Usama Anjum
2025-04-25  7:04 ` Manivannan Sadhasivam
2025-04-25  7:14   ` Muhammad Usama Anjum [this message]
2025-04-25  7:32     ` Manivannan Sadhasivam
2025-04-25  7:42       ` Muhammad Usama Anjum
2025-04-25  8:59         ` Manivannan Sadhasivam
2025-04-25 11:41           ` Muhammad Usama Anjum
2025-04-25 14:47             ` Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1136c7cb-1c7b-410b-93d2-c74aec939196@collabora.com \
    --to=usama.anjum@collabora.com \
    --cc=ath11k@lists.infradead.org \
    --cc=chentao@kylinos.cn \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jjohnson@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=kernel@collabora.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mhi@lists.linux.dev \
    --cc=quic_jhugo@quicinc.com \
    --cc=quic_qianyu@quicinc.com \
    --cc=quic_yabdulra@quicinc.com \
    --cc=yanzhen@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox