mhi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Hemant Kumar <quic_hemantk@quicinc.com>
To: Maxim Kochetkov <fido_max@inbox.ru>, <mhi@lists.linux.dev>
Cc: <manivannan.sadhasivam@linaro.org>, <bbhatt@codeaurora.org>,
	"Maxim Kochetkov" <mkochetkov@airspan.com>
Subject: Re: [PATCH] net: qrtr: start MHI channel after endpoit creation
Date: Mon, 2 May 2022 19:35:05 -0700	[thread overview]
Message-ID: <642cccfd-6e70-9024-1a05-6df48a740156@quicinc.com> (raw)
In-Reply-To: <20220430103430.37349-1-fido_max@inbox.ru>


On 4/30/2022 3:34 AM, Maxim Kochetkov wrote:
> From: Maxim Kochetkov <mkochetkov@airspan.com>
>
> MHI channel may generates event/interrupt right after enabling.
> It may leads to 2 race conditions issues.
>
> 1)
> Such event may be dropped by qcom_mhi_qrtr_dl_callback() at check:
>
> 	if (!qdev || mhi_res->transaction_status)
> 		return;
>
> Because dev_set_drvdata(&mhi_dev->dev, qdev) may be not performed at
> this moment. In this situation qrtr-ns will be unable to enumerate
> services in device.
> ---------------------------------------------------------------
>
> 2)
> Such event may come at the moment after dev_set_drvdata() and
> before qrtr_endpoint_register(). In this case kernel will panic with
> accessing wrong pointer at qcom_mhi_qrtr_dl_callback():
>
> 	rc = qrtr_endpoint_post(&qdev->ep, mhi_res->buf_addr,
> 				mhi_res->bytes_xferd);
>
> Because endpoint is not created yet.
> --------------------------------------------------------------
> So move mhi_prepare_for_transfer_autoqueue after endpoint creation
> to fix it.
>
> Fixes: a2e2cc0dbb11 ("net: qrtr: Start MHI channels during init")
> Signed-off-by: Maxim Kochetkov <mkochetkov@airspan.com>
Reviewed-by: Hemant Kumar <quic_hemantk@quicinc.com>

  reply	other threads:[~2022-05-03  2:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-30 10:34 [PATCH] net: qrtr: start MHI channel after endpoit creation Maxim Kochetkov
2022-05-03  2:35 ` Hemant Kumar [this message]
2022-07-07  6:20   ` Maxim Kochetkov
2022-07-09  6:10     ` Manivannan Sadhasivam
2022-07-09  6:08 ` Manivannan Sadhasivam

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=642cccfd-6e70-9024-1a05-6df48a740156@quicinc.com \
    --to=quic_hemantk@quicinc.com \
    --cc=bbhatt@codeaurora.org \
    --cc=fido_max@inbox.ru \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mhi@lists.linux.dev \
    --cc=mkochetkov@airspan.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;
as well as URLs for NNTP newsgroup(s).