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] [day] [month] [year] [list]
Message-ID: <20250224164400.w3lpzxxwfbrj5lb6@thinkpad>
Date: Mon, 24 Feb 2025 22:14:00 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Muhammad Usama Anjum <Usama.Anjum@...labora.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Johan Hovold <johan@...nel.org>,
	Loic Poulain <loic.poulain@...aro.org>,
	linux-arm-msm@...r.kernel.org, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, mhi@...ts.linux.dev,
	kernel@...labora.com, ath11k@...ts.infradead.org,
	jjohnson@...nel.org
Subject: Re: [BUG REPORT] MHI's resume from hibernate is broken

On Thu, Feb 20, 2025 at 05:34:06PM +0500, Muhammad Usama Anjum wrote:
> On 2/20/25 12:50 PM, Manivannan Sadhasivam wrote:
> > On Mon, Feb 17, 2025 at 07:35:50PM +0500, Muhammad Usama Anjum wrote:
> >> On 2/14/25 12:04 PM, Manivannan Sadhasivam wrote:
> >>> Hi,
> >> Thank you so much for replying.
> >>
> >>>
> >>> + ath11k list and Jeff
> >>>
> >>> On Tue, Feb 11, 2025 at 01:15:55PM +0500, Muhammad Usama Anjum wrote:
> >>>> Hi,
> >>>>
> >>>> I've been digging in the MHI code to find the reason behind broken
> >>>> resume from hibernation for MHI. The same resume function is used
> >>>> for both resume from suspend and resume from hibernation. The resume
> >>>> from suspend works fine because at resume time the state of MHI is 
> >>>> MHI_STATE_M3. On the other hand, the state is MHI_STATE_RESET when
> >>>> we resume from hibernation.
> >>>>
> >>>> It seems resume from MHI_STATE_RESET state isn't correctly supported.
> >>>> The channel state is MHI_CH_STATE_ENABLED at this point. We get error
> >>>> while switching channel state from MHI_CH_STATE_ENABLE to
> >>>> MHI_CH_STATE_RUNNING. Hence, channel state change fails and later mhi
> >>>> resume fails as well. 
> >>>>
> >>>> I've put some debug prints to understand the issue. These may be
> >>>> helpful:
> >>>>
> >>>> [  669.032683] mhi_update_channel_state: switch to MHI_CH_STATE_TYPE_START[2] channel state not possible cuzof channel current state[1]. mhi state: [0] Return -EINVAL
> >>>> [  669.032685] mhi_prepare_channel: mhi_update_channel_state to MHI_CH_STATE_TYPE_START[2] returned -22
> >>>> [  669.032693] qcom_mhi_qrtr mhi0_IPCR: failed to prepare for autoqueue transfer -22
> >>>>
> >>>
> >>> Thanks for the report!
> >>>
> >>> Could you please enable the MHI and ath11k debug logs and share the full dmesg
> >>> to help us understand the issue better?
> >> The ath11k debug was already enabled. CONFIG_MHI_BUS_DEBUG wasn't enabled. 
> > 
> > Sorry for not being clear. I asked you to enable the dev_dbg() logs in the MHI
> > driver. But it is not required. See below.
> I've disabled the MHI_BUG_DEBUG. It only enables some files. Ideally if those files
> being used, there shouldn't be any difference. But they are definitely changing the
> timings.
> 
> > 
> >> I've
> >> enabled it and now the hibernate is working without any issue. It is very strange
> >> how can CONFIG_MHI_BUS_DEBUG make any difference. I don't have much background on
> >> how it is helping.
> >>
> > 
> > Probably some timing issue. But enabling the MHI debug logs could also hide the
> > issue. So you should disable the CONFIG_MHI_BUS_DEBUG option and collect the MHI
> > trace logs that we recently added.
> Disabled the MHI_BUS_DEBUG and collected logs by Dynamic debug:
> [  584.040189] mhi mhi0: Allowing M3 transition
> [  584.040202] mhi mhi0: Waiting for M3 completion
> [  584.040480] mhi mhi0: State change event to state: M3
> ..
> [  584.535478] qcom_mhi_qrtr mhi0_IPCR: failed to prepare for autoqueue transfer -22
> [  584.535482] qcom_mhi_qrtr mhi0_IPCR: PM: dpm_run_callback(): qcom_mhi_qrtr_pm_resume_early [qrtr_mhi] returns -22
> [  584.535490] qcom_mhi_qrtr mhi0_IPCR: PM: failed to restore early: error -22
> [  584.831583] mhi mhi0: Entered with PM state: M3, MHI state: M3
> 
> It seems like the state save was success at hibernate time. The error is originating
> at resume from hibernation.
> 

I just tried hibernation on my RB5 board featuring QCA6390 WLAN chip which makes
use of ath11k driver. I did encounter the resume failure, but the error log was
slightly different. Then looking at the ath11k driver made me realize that they
reverted the hibernation support due to suspend issue reported on some Lenovo
platforms: 2f833e8948d6 ("Revert "wifi: ath11k: support hibernation"").

So that explained the resume failure. I reverted the revert and that allowed me
to resume properly from hibernation. So please try to do the same and see if it
helps you.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ