All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] bus: mhi: keep dma buffers through suspend/hibernation cycles
@ 2025-07-15 13:25 Muhammad Usama Anjum
  2025-07-15 13:25 ` [PATCH v2 1/3] bus: mhi: host: keep bhi buffer through suspend cycle Muhammad Usama Anjum
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Muhammad Usama Anjum @ 2025-07-15 13:25 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Muhammad Usama Anjum,
	Youssef Samir, Matthew Leung, Alexander Wilhelm, Kunwu Chan,
	Krishna Chaitanya Chundru, Jacek Lawrynowicz, Yan Zhen,
	Sujeev Dias, Greg Kroah-Hartman, Siddartha Mohanadoss, mhi,
	linux-arm-msm, linux-kernel
  Cc: kernel

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


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/3] bus: mhi: host: keep bhie buffer through suspend cycle
@ 2025-07-21 13:20 kernel test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2025-07-21 13:20 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250715132509.2643305-3-usama.anjum@collabora.com>
References: <20250715132509.2643305-3-usama.anjum@collabora.com>
TO: Muhammad Usama Anjum <usama.anjum@collabora.com>
TO: Manivannan Sadhasivam <mani@kernel.org>
TO: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
TO: Muhammad Usama Anjum <usama.anjum@collabora.com>
TO: Youssef Samir <quic_yabdulra@quicinc.com>
TO: Matthew Leung <quic_mattleun@quicinc.com>
TO: Alexander Wilhelm <alexander.wilhelm@westermo.com>
TO: Kunwu Chan <chentao@kylinos.cn>
TO: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
TO: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
TO: Yan Zhen <yanzhen@vivo.com>
TO: Sujeev Dias <sdias@codeaurora.org>
TO: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
TO: Siddartha Mohanadoss <smohanad@codeaurora.org>
TO: mhi@lists.linux.dev
TO: linux-arm-msm@vger.kernel.org
TO: linux-kernel@vger.kernel.org
CC: kernel@collabora.com
CC: stable@vger.kernel.org

Hi Muhammad,

kernel test robot noticed the following build warnings:

[auto build test WARNING on mani-mhi/mhi-next]
[cannot apply to linus/master v6.16-rc7 next-20250721]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Muhammad-Usama-Anjum/bus-mhi-host-keep-bhi-buffer-through-suspend-cycle/20250715-213507
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git mhi-next
patch link:    https://lore.kernel.org/r/20250715132509.2643305-3-usama.anjum%40collabora.com
patch subject: [PATCH v2 2/3] bus: mhi: host: keep bhie buffer through suspend cycle
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: microblaze-randconfig-r073-20250720 (https://download.01.org/0day-ci/archive/20250721/202507212035.KdorzQHi-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 8.5.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202507212035.KdorzQHi-lkp@intel.com/

New smatch warnings:
drivers/bus/mhi/host/boot.c:489 mhi_load_image_bhie() error: we previously assumed '*image' could be null (see line 484)

Old smatch warnings:
drivers/bus/mhi/host/boot.c:467 mhi_load_image_bhi() error: we previously assumed '*image' could be null (see line 461)
drivers/bus/mhi/host/boot.c:611 mhi_fw_load_handler() error: we previously assumed 'mhi_cntrl->fbc_image' could be null (see line 601)

vim +489 drivers/bus/mhi/host/boot.c

f88f1d0998ea2e5 Matthew Leung        2025-01-17  478  
f88f1d0998ea2e5 Matthew Leung        2025-01-17  479  static int mhi_load_image_bhie(struct mhi_controller *mhi_cntrl, const u8 *fw_data, size_t size)
f88f1d0998ea2e5 Matthew Leung        2025-01-17  480  {
c46b43146b53aed Muhammad Usama Anjum 2025-07-15  481  	struct image_info **image = &mhi_cntrl->bhie_image;
f88f1d0998ea2e5 Matthew Leung        2025-01-17  482  	int ret;
f88f1d0998ea2e5 Matthew Leung        2025-01-17  483  
c46b43146b53aed Muhammad Usama Anjum 2025-07-15 @484  	if (!(*image)) {
c46b43146b53aed Muhammad Usama Anjum 2025-07-15  485  		ret = mhi_alloc_bhie_table(mhi_cntrl, image, size);
f88f1d0998ea2e5 Matthew Leung        2025-01-17  486  		if (ret)
f88f1d0998ea2e5 Matthew Leung        2025-01-17  487  			return ret;
f88f1d0998ea2e5 Matthew Leung        2025-01-17  488  
c46b43146b53aed Muhammad Usama Anjum 2025-07-15 @489  		mhi_firmware_copy_bhie(mhi_cntrl, fw_data, size, *image);
c46b43146b53aed Muhammad Usama Anjum 2025-07-15  490  	}
f88f1d0998ea2e5 Matthew Leung        2025-01-17  491  
c46b43146b53aed Muhammad Usama Anjum 2025-07-15  492  	ret = mhi_fw_load_bhie(mhi_cntrl, &(*image)->mhi_buf[(*image)->entries - 1]);
c46b43146b53aed Muhammad Usama Anjum 2025-07-15  493  	if (ret) {
c46b43146b53aed Muhammad Usama Anjum 2025-07-15  494  		mhi_free_bhie_table(mhi_cntrl, *image);
c46b43146b53aed Muhammad Usama Anjum 2025-07-15  495  		*image = NULL;
c46b43146b53aed Muhammad Usama Anjum 2025-07-15  496  	}
f88f1d0998ea2e5 Matthew Leung        2025-01-17  497  
f88f1d0998ea2e5 Matthew Leung        2025-01-17  498  	return ret;
f88f1d0998ea2e5 Matthew Leung        2025-01-17  499  }
f88f1d0998ea2e5 Matthew Leung        2025-01-17  500  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-07-21 13:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 13:25 [PATCH v2 0/3] bus: mhi: keep dma buffers through suspend/hibernation cycles Muhammad Usama Anjum
2025-07-15 13:25 ` [PATCH v2 1/3] bus: mhi: host: keep bhi buffer through suspend cycle Muhammad Usama Anjum
2025-07-16  3:41   ` Baochen Qiang
2025-07-16  9:34   ` Greg Kroah-Hartman
2025-07-17 10:00     ` Muhammad Usama Anjum
2025-07-17 11:50       ` Greg Kroah-Hartman
2025-07-15 13:25 ` [PATCH v2 2/3] bus: mhi: host: keep bhie " Muhammad Usama Anjum
2025-07-16  9:35   ` Greg Kroah-Hartman
2025-07-15 13:25 ` [PATCH v2 3/3] bus: mhi: keep device context through suspend cycles Muhammad Usama Anjum
2025-07-16  9:35   ` Greg Kroah-Hartman
2025-07-16  3:36 ` [PATCH v2 0/3] bus: mhi: keep dma buffers through suspend/hibernation cycles Baochen Qiang
2025-07-17 10:01   ` Muhammad Usama Anjum
  -- strict thread matches above, loose matches on Subject: below --
2025-07-21 13:20 [PATCH v2 2/3] bus: mhi: host: keep bhie buffer through suspend cycle kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.