All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] bus: mhi: ep: Add support for suspending and resuming channels
@ 2023-01-17 14:17 Dan Carpenter
  2023-01-23  7:53 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-01-17 14:17 UTC (permalink / raw)
  To: mani; +Cc: mhi

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-23  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17 14:17 [bug report] bus: mhi: ep: Add support for suspending and resuming channels Dan Carpenter
2023-01-23  7:53 ` Manivannan Sadhasivam

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.