lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250630074330.253867-4-usama.anjum@collabora.com>
Date: Mon, 30 Jun 2025 12:43:30 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Manivannan Sadhasivam <mani@...nel.org>,
	Jeff Johnson <jjohnson@...nel.org>,
	Jeff Hugo <jeff.hugo@....qualcomm.com>,
	Youssef Samir <quic_yabdulra@...cinc.com>,
	Matthew Leung <quic_mattleun@...cinc.com>,
	Muhammad Usama Anjum <usama.anjum@...labora.com>,
	Yan Zhen <yanzhen@...o.com>,
	Alexander Wilhelm <alexander.wilhelm@...termo.com>,
	Alex Elder <elder@...nel.org>,
	Kunwu Chan <chentao@...inos.cn>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Siddartha Mohanadoss <smohanad@...eaurora.org>,
	Sujeev Dias <sdias@...eaurora.org>,
	Julia Lawall <julia.lawall@...6.fr>,
	John Crispin <john@...ozen.org>,
	Muna Sinada <quic_msinada@...cinc.com>,
	Venkateswara Naralasetty <quic_vnaralas@...cinc.com>,
	Maharaja Kennadyrajan <quic_mkenna@...cinc.com>,
	mhi@...ts.linux.dev,
	linux-arm-msm@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-wireless@...r.kernel.org,
	ath11k@...ts.infradead.org
Cc: kernel@...labora.com
Subject: [PATCH 3/3] bus: mhi: keep device context through suspend cycles

Don't deinitialize the device context while going into suspend or
hibernation cycles. Otherwise the resume may fail if at resume time, the
memory pressure is high and no dma memory is available.

Tested-on: WCN6855 WLAN.HSP.1.1-03926.13-QCAHSPSWPL_V2_SILICONZ_CE-2.52297.6

Fixes: 3000f85b8f47 ("bus: mhi: core: Add support for basic PM operations")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
---
 drivers/bus/mhi/host/init.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c
index 2e0f18c939e68..8f56e73fdc42e 100644
--- a/drivers/bus/mhi/host/init.c
+++ b/drivers/bus/mhi/host/init.c
@@ -1133,9 +1133,11 @@ int mhi_prepare_for_power_up(struct mhi_controller *mhi_cntrl)
 
 	mutex_lock(&mhi_cntrl->pm_mutex);
 
-	ret = mhi_init_dev_ctxt(mhi_cntrl);
-	if (ret)
-		goto error_dev_ctxt;
+	if (!mhi_cntrl->mhi_ctxt) {
+		ret = mhi_init_dev_ctxt(mhi_cntrl);
+		if (ret)
+			goto error_dev_ctxt;
+	}
 
 	ret = mhi_read_reg(mhi_cntrl, mhi_cntrl->regs, BHIOFF, &bhi_off);
 	if (ret) {
@@ -1212,8 +1214,6 @@ void mhi_deinit_dev_ctxt(struct mhi_controller *mhi_cntrl)
 {
 	mhi_cntrl->bhi = NULL;
 	mhi_cntrl->bhie = NULL;
-
-	__mhi_deinit_dev_ctxt(mhi_cntrl);
 }
 
 void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl)
@@ -1234,6 +1234,7 @@ void mhi_unprepare_after_power_down(struct mhi_controller *mhi_cntrl)
 	}
 
 	mhi_deinit_dev_ctxt(mhi_cntrl);
+	__mhi_deinit_dev_ctxt(mhi_cntrl);
 }
 EXPORT_SYMBOL_GPL(mhi_unprepare_after_power_down);
 
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ