From: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Jeff Johnson <jjohnson@kernel.org>,
Youssef Samir <quic_yabdulra@quicinc.com>,
Matthew Leung <quic_mattleun@quicinc.com>,
Yan Zhen <yanzhen@vivo.com>, Alex Elder <elder@kernel.org>,
Kunwu Chan <chentao@kylinos.cn>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>,
"Dr. David Alan Gilbert" <linux@treblig.org>
Cc: kernel@collabora.com, sebastian.reichel@collabora.com,
Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
Baochen Qiang <quic_bqiang@quicinc.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, ath12k@lists.infradead.org
Subject: Re: [PATCH v5] bus: mhi: host: don't free bhie tables during suspend/hibernation
Date: Fri, 16 May 2025 08:59:11 -0600 [thread overview]
Message-ID: <f6eac84d-3d67-4f99-a9c5-a9f03d748010@oss.qualcomm.com> (raw)
In-Reply-To: <20250514081447.279981-1-usama.anjum@collabora.com>
On 5/14/2025 2:14 AM, Muhammad Usama Anjum wrote:
> Fix dma_direct_alloc() failure at resume time during bhie_table
> allocation because of memory pressure. There is a report where at
> resume time, the memory from the dma doesn't get allocated and MHI
> fails to re-initialize.
>
> 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.
>
> There are two allocations of bhie; rddm and fbc. Optimize both of those
There are 3, but you touch 2. I just commented on this in v4. Only
touching two is fine (the device for the 3rd one doesn't need this), but
the documentation must be accurate.
> allocations. 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. This patch is moticated from
moticated? Motivated maybe?
> the ath12k [1] and ath11k [2] patches. They don't free the memory and
> reuse the same memory if new size is same. The firmware caching hasn't
> been implemented for the drivers other than the nouveau. (The changing
> of firmware isn't tested/supported for wireless drivers. But let's
> follow the example patches here.)
>
> [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/
>
> Tested-on: WCN6855 WLAN.HSP.1.1-03926.13-QCAHSPSWPL_V2_SILICONZ_CE-2.52297.6
> Tested-on: WCN7850 hw2.0 WLAN.HMT.1.1.c5-00284-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
> Tested-by: Baochen Qiang <quic_bqiang@quicinc.com>
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
> Changes since v1:
> - Don't free bhie tables during suspend/hibernation only
> - Handle fbc_image changed size correctly
> - Remove fbc_image getting set to NULL in *free_bhie_table()
>
> Changes since v2:
> - Remove the new mhi_partial_unprepare_after_power_down() and instead
> update mhi_power_down_keep_dev() to use
> mhi_power_down_unprepare_keep_dev() as suggested by Mani
> - Update all users of this API such as ath12k (previously only ath11k
> was updated)
> - Define prev_fw_sz in docs
> - Do better alignment of comments
>
> Changes since v3:
> - Fix state machine of ath12k by setting ATH12K_MHI_DEINIT with
> ATH12K_MHI_POWER_OFF_KEEP_DEV state (Thanks Sebastian for testing and
> finding the problem)
> - Use static with mhi_power_down_unprepare_keep_dev()
> - Remove crash log as it was showing that kworker wasn't able to
> allocate memory.
>
> Changes since v4:
> - Update desctiption
While I'm commenting on spelling, "description"
Code looks ok to me. I think we just need to hash out some of the
documentation and this will be good to go.
next prev parent reply other threads:[~2025-05-16 15:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 8:14 [PATCH v5] bus: mhi: host: don't free bhie tables during suspend/hibernation Muhammad Usama Anjum
2025-05-16 14:59 ` Jeff Hugo [this message]
2025-05-16 18:42 ` Muhammad Usama Anjum
2025-05-16 19:07 ` Jeff Hugo
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=f6eac84d-3d67-4f99-a9c5-a9f03d748010@oss.qualcomm.com \
--to=jeff.hugo@oss.qualcomm.com \
--cc=ath11k@lists.infradead.org \
--cc=ath12k@lists.infradead.org \
--cc=chentao@kylinos.cn \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jacek.lawrynowicz@linux.intel.com \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=jjohnson@kernel.org \
--cc=kernel@collabora.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linux@treblig.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mhi@lists.linux.dev \
--cc=quic_bqiang@quicinc.com \
--cc=quic_mattleun@quicinc.com \
--cc=quic_yabdulra@quicinc.com \
--cc=sebastian.reichel@collabora.com \
--cc=usama.anjum@collabora.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