All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [bug report] spi: Split bus and I/O locking
Date: Wed, 3 Aug 2016 13:28:38 +0300	[thread overview]
Message-ID: <20160803102838.GA2504@mwanda> (raw)

Hello Mark Brown,

The patch ef4d96ec4ad9: "spi: Split bus and I/O locking" from Jul 21,
2016, leads to the following static checker warning:

	drivers/spi/spi.c:1214 __spi_pump_messages()
	warn: inconsistent returns 'mutex:&master->io_mutex'.

drivers/spi/spi.c
  1155          mutex_lock(&master->io_mutex);
  1156  
  1157          if (!was_busy && master->auto_runtime_pm) {
  1158                  ret = pm_runtime_get_sync(master->dev.parent);
  1159                  if (ret < 0) {
  1160                          dev_err(&master->dev, "Failed to power device: %d\n",
  1161                                  ret);
  1162                          return;

goto out?

  1163                  }
  1164          }
  1165  
  1166          if (!was_busy)
  1167                  trace_spi_master_busy(master);
  1168  
  1169          if (!was_busy && master->prepare_transfer_hardware) {
  1170                  ret = master->prepare_transfer_hardware(master);
  1171                  if (ret) {
  1172                          dev_err(&master->dev,
  1173                                  "failed to prepare transfer hardware\n");
  1174  
  1175                          if (master->auto_runtime_pm)
  1176                                  pm_runtime_put(master->dev.parent);
  1177                          return;

Same.

  1178                  }
  1179          }
  1180  
  1181          trace_spi_message_start(master->cur_msg);
  1182  
  1183          if (master->prepare_message) {
  1184                  ret = master->prepare_message(master, master->cur_msg);
  1185                  if (ret) {
  1186                          dev_err(&master->dev,
  1187                                  "failed to prepare message: %d\n", ret);
  1188                          master->cur_msg->status = ret;
  1189                          spi_finalize_current_message(master);
  1190                          goto out;
  1191                  }
  1192                  master->cur_msg_prepared = true;
  1193          }
  1194  
  1195          ret = spi_map_msg(master, master->cur_msg);
  1196          if (ret) {
  1197                  master->cur_msg->status = ret;
  1198                  spi_finalize_current_message(master);
  1199                  goto out;
  1200          }
  1201  
  1202          ret = master->transfer_one_message(master, master->cur_msg);
  1203          if (ret) {
  1204                  dev_err(&master->dev,
  1205                          "failed to transfer one message from queue\n");
  1206                  goto out;
  1207          }
  1208  
  1209  out:
  1210          mutex_unlock(&master->io_mutex);
  1211  
  1212          /* Prod the scheduler in case transfer_one() was busy waiting */
  1213          if (!ret)
  1214                  cond_resched();
  1215  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2016-08-03 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03 10:28 Dan Carpenter [this message]
2016-08-03 10:43 ` [bug report] spi: Split bus and I/O locking Mark Brown

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=20160803102838.GA2504@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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.