[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1cd4a1ed-f4e7-4c7b-a19f-f79afddbe310@collabora.com>
Date: Mon, 17 Feb 2025 19:35:50 +0500
From: Muhammad Usama Anjum <Usama.Anjum@...labora.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc: Usama.Anjum@...labora.com, "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 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. 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.
I've attached the logs which are from 6.11.11. But I'd gotten the same error with
last week's next as well. I've attached the logs. Let me know if more logs are
required.
>
>> This same error has been reported on some fix patches [1] [2]. Are there
>> any patches which I should test?
>>
>> Is officially hibernation use case supported at all?
>>
>
> Yes. The hibernation support was tested with x86 host machine for both MHI
> modems and WLAN chipsets (especially ath11k devices).
>
>> In my view, this path may not have gotten tested and can be fixed easily
>> as we need to perform, more or less the same steps which were performed
>> at init time. But I've not found much documentation around MHI protocol
>> and its state machine, how is mhi state related to mhi channels support.
>>
>
> During hibernation, the power to the device could be lost. But it should be
> handled by the ath11k driver. Maybe the debug logs could help us know what is
> going wrong.
>
> - Mani
>
--
BR,
Muhammad Usama Anjum
View attachment "debugfs_mhi" of type "text/plain" (9953 bytes)
View attachment "debugfs_mhi_bus-debug" of type "text/plain" (9653 bytes)
View attachment "log__with_mhi_bus_debug" of type "text/plain" (95477 bytes)
View attachment "log__without_mhi_bus_debug" of type "text/plain" (107338 bytes)
Powered by blists - more mailing lists