All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: mani@kernel.org
Cc: mhi@lists.linux.dev
Subject: [bug report] bus: mhi: ep: Add support for suspending and resuming channels
Date: Tue, 17 Jan 2023 17:17:02 +0300	[thread overview]
Message-ID: <Y8at3oH+T0wd2NR+@kili> (raw)

Hello Manivannan Sadhasivam,

The patch e4b7b5f0f30a: "bus: mhi: ep: Add support for suspending and
resuming channels" from Apr 5, 2022, leads to the following Smatch
static checker warning:

	drivers/bus/mhi/ep/main.c:1141 mhi_ep_resume_channels()
	warn: sleeping in atomic context

drivers/bus/mhi/ep/main.c
    1129 void mhi_ep_resume_channels(struct mhi_ep_cntrl *mhi_cntrl)
    1130 {
    1131         struct mhi_ep_chan *mhi_chan;
    1132         u32 tmp;
    1133         int i;
    1134 
    1135         for (i = 0; i < mhi_cntrl->max_chan; i++) {
    1136                 mhi_chan = &mhi_cntrl->mhi_chan[i];
    1137 
    1138                 if (!mhi_chan->mhi_dev)
    1139                         continue;
    1140 
--> 1141                 mutex_lock(&mhi_chan->lock);
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is called from mhi_ep_set_m0_state().  The mhi_ep_set_m0_state()
function takes a spinlock so we can't take a mutex if we're holding a
spinlock.

Enable CONFIG_DEBUG_ATOMIC_SLEEP for more information.

regards,
dan carpenter


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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 14:17 Dan Carpenter [this message]
2023-01-23  7:53 ` [bug report] bus: mhi: ep: Add support for suspending and resuming channels 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=Y8at3oH+T0wd2NR+@kili \
    --to=error27@gmail.com \
    --cc=mani@kernel.org \
    --cc=mhi@lists.linux.dev \
    /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.