public inbox for ath11k@lists.infradead.org
 help / color / mirror / Atom feed
From: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Jeff Johnson <jjohnson@kernel.org>,
	Jeff Hugo <jeff.hugo@oss.qualcomm.com>,
	Youssef Samir <quic_yabdulra@quicinc.com>,
	Matthew Leung <quic_mattleun@quicinc.com>,
	Yan Zhen <yanzhen@vivo.com>,
	Alexander Wilhelm <alexander.wilhelm@westermo.com>,
	Alex Elder <elder@kernel.org>, Kunwu Chan <chentao@kylinos.cn>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Siddartha Mohanadoss <smohanad@codeaurora.org>,
	Sujeev Dias <sdias@codeaurora.org>,
	Julia Lawall <julia.lawall@lip6.fr>,
	John Crispin <john@phrozen.org>,
	Muna Sinada <quic_msinada@quicinc.com>,
	Venkateswara Naralasetty <quic_vnaralas@quicinc.com>,
	Maharaja Kennadyrajan <quic_mkenna@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
Cc: kernel@collabora.com
Subject: Re: [PATCH 3/3] bus: mhi: keep device context through suspend cycles
Date: Thu, 10 Jul 2025 22:47:53 +0530	[thread overview]
Message-ID: <304d71ca-5773-4fa6-aece-50f92b70c77f@oss.qualcomm.com> (raw)
In-Reply-To: <c40f13e8-7420-4046-880d-7c72620fc021@collabora.com>



On 7/10/2025 8:37 PM, Muhammad Usama Anjum wrote:
> On 7/8/25 3:15 PM, Krishna Chaitanya Chundru wrote:
>>
>>
>> On 6/30/2025 1:13 PM, Muhammad Usama Anjum wrote:
>>> 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@collabora.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);
>> mhi init dev ctxt also initializes the ring pointers to base value,
>> I think we should take care of them also ?
> Are you referring to mhi_rings? They are getting initialized inside
> mhi_init_dev_ctxt() and de-initialized in __mhi_deinit_dev_ctxt(). That's
> why I've not handled them separately.
> 
Maybe I was not clear in my previous comment/not a correct place to do
the comment.

My point you are not freeing __mhi_deinit_dev_ctxt as part of suspend,
that means we are expecting device will continue to use the rp and wr 
pointers of ring as the previous i.e before suspend pointers.

What if PCIe keeps link in D3cold as part of system suspend, will the
device able to handle the previous rp & wp of ring. I don't think
device can handle this.

- Krishna Chaitanya.
>>
>> - Krishna Chaitanya.
>>> -    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);
>>>    
> 


  reply	other threads:[~2025-07-10 19:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30  7:43 [PATCH 0/3] bus: mhi: keep dma buffers through suspend/hibernation cycles Muhammad Usama Anjum
2025-06-30  7:43 ` [PATCH 1/3] bus: mhi: host: keep bhi buffer through suspend cycle Muhammad Usama Anjum
2025-07-01 10:25   ` Greg Kroah-Hartman
2025-07-02 15:24     ` Muhammad Usama Anjum
2025-07-08  9:47   ` Krishna Chaitanya Chundru
2025-07-10 14:14     ` Muhammad Usama Anjum
2025-06-30  7:43 ` [PATCH 2/3] bus: mhi: don't deinitialize and re-initialize again Muhammad Usama Anjum
2025-07-01 10:25   ` Greg Kroah-Hartman
2025-07-02 15:25     ` Muhammad Usama Anjum
2025-07-01 14:49   ` Jeff Johnson
2025-07-02 15:28     ` Muhammad Usama Anjum
2025-07-02 17:25       ` Jeff Johnson
2025-07-02  3:50   ` Baochen Qiang
2025-07-02 16:12     ` Muhammad Usama Anjum
2025-07-03  1:59       ` Baochen Qiang
2025-07-07  8:19         ` Muhammad Usama Anjum
2025-07-07  9:00           ` Baochen Qiang
2025-07-07 13:11             ` Muhammad Usama Anjum
2025-07-08  1:43               ` Baochen Qiang
2025-07-08  9:12                 ` Muhammad Usama Anjum
2025-07-08 10:38                   ` Baochen Qiang
2025-06-30  7:43 ` [PATCH 3/3] bus: mhi: keep device context through suspend cycles Muhammad Usama Anjum
2025-07-01 10:26   ` Greg Kroah-Hartman
2025-07-08 10:15   ` Krishna Chaitanya Chundru
2025-07-10 15:07     ` Muhammad Usama Anjum
2025-07-10 17:17       ` Krishna Chaitanya Chundru [this message]
2025-07-11 10:22         ` Muhammad Usama Anjum

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=304d71ca-5773-4fa6-aece-50f92b70c77f@oss.qualcomm.com \
    --to=krishna.chundru@oss.qualcomm.com \
    --cc=alexander.wilhelm@westermo.com \
    --cc=ath11k@lists.infradead.org \
    --cc=chentao@kylinos.cn \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeff.hugo@oss.qualcomm.com \
    --cc=jjohnson@kernel.org \
    --cc=john@phrozen.org \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel@collabora.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mhi@lists.linux.dev \
    --cc=quic_mattleun@quicinc.com \
    --cc=quic_mkenna@quicinc.com \
    --cc=quic_msinada@quicinc.com \
    --cc=quic_vnaralas@quicinc.com \
    --cc=quic_yabdulra@quicinc.com \
    --cc=sdias@codeaurora.org \
    --cc=smohanad@codeaurora.org \
    --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