archive mirror
 help / color / mirror / Atom feed
From: Jeffrey Hugo <>
To: Manivannan Sadhasivam <>,
Cc: <>, <>,
	<>, Dan Carpenter <>
Subject: Re: [PATCH] bus: mhi: ep: Change state_lock to mutex
Date: Mon, 23 Jan 2023 10:10:06 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 1/23/2023 12:50 AM, Manivannan Sadhasivam wrote:
> state_lock, the spinlock type is meant to protect race against concurrent
> MHI state transitions. In mhi_ep_set_m0_state(), while the state_lock is
> being held, the channels are resumed in mhi_ep_resume_channels() if the
> previous state was M3. This causes sleeping in atomic bug, since
> mhi_ep_resume_channels() use mutex internally.
> Since the state_lock is supposed to be held throughout the state change,
> it is not ideal to drop the lock before calling mhi_ep_resume_channels().
> So to fix this issue, let's change the type of state_lock to mutex. This
> would also allow holding the lock throughout all state transitions thereby
> avoiding any potential race.
> Cc: <> # 5.19
> Fixes: e4b7b5f0f30a ("bus: mhi: ep: Add support for suspending and resuming channels")
> Reported-by: Dan Carpenter <>
> Signed-off-by: Manivannan Sadhasivam <>

Looks sane.
Reviewed-by: Jeffrey Hugo <>

  reply	other threads:[~2023-01-23 17:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23  7:50 [PATCH] bus: mhi: ep: Change state_lock to mutex Manivannan Sadhasivam
2023-01-23 17:10 ` Jeffrey Hugo [this message]
2023-01-27  6:58 ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* 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).