All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Loic Poulain <loic.poulain@linaro.org>
Cc: linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Hemant Kumar <hemantk@codeaurora.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Subject: Re: [PATCH] mhi: Fix double dma free
Date: Tue, 09 Feb 2021 19:02:06 +0200	[thread overview]
Message-ID: <87tuqltbsh.fsf@codeaurora.org> (raw)
In-Reply-To: <CAMZdPi9xRTrhkZ+q4db0GKZb+AcJ9YXY_-_wTO6KNROCxipj0g@mail.gmail.com> (Loic Poulain's message of "Tue, 9 Feb 2021 16:55:04 +0100")

Loic Poulain <loic.poulain@linaro.org> writes:

> Hi Kalle,
>
> On Tue, 9 Feb 2021 at 16:45, Loic Poulain <loic.poulain@linaro.org> wrote:
>>
>> mhi_deinit_chan_ctxt functionthat takes care of unitializing channel
>> resources, including unmapping coherent MHI areas, can be called
>> from different path in case of controller unregistering/removal:
>>  - From a client driver remove callback, via mhi_unprepare_channel
>>  - From mhi_driver_remove that unitialize all channels
>>
>> mhi_driver_remove()
>> |-> driver->remove()
>> |    |-> mhi_unprepare_channel()
>> |        |-> mhi_deinit_chan_ctxt()
>> |...
>> |-> mhi_deinit_chan_ctxt()
>>
>> This leads to double dma freeing...
>>
>> Fix that by preventing deinit for already uninitialized channel.
>>
>> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
>> Reported-by: Kalle Valo <kvalo@codeaurora.org>
>
> This is a 'blind' fix tentative, can you please check if it resolves
> the issue on your side?

I did a quick test few times and I don't see any crashes anymore, thanks!

Tested-by: Kalle Valo <kvalo@codeaurora.org>

And like Jeffrey said:

Fixes: a7f422f2f89e ("bus: mhi: Fix channel close issue on driver remove")

Is it too late to push this to v5.11? But this should go to v5.12.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2021-02-09 17:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 15:53 [PATCH] mhi: Fix double dma free Loic Poulain
2021-02-09 15:55 ` Loic Poulain
2021-02-09 17:02   ` Kalle Valo [this message]
2021-02-09 15:55 ` Jeffrey Hugo
2021-02-09 16:06   ` Loic Poulain
2021-02-09 17:27     ` Bhaumik Bhatt
2021-02-09 18:17       ` Loic Poulain
2021-02-10  4:37         ` Bhaumik Bhatt
2021-02-10  8:17           ` Manivannan Sadhasivam
  -- strict thread matches above, loose matches on Subject: below --
2021-02-09 15:52 Loic Poulain

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=87tuqltbsh.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=hemantk@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=manivannan.sadhasivam@linaro.org \
    /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 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.