linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bug report] spi: Split bus and I/O locking
@ 2016-08-03 10:28 Dan Carpenter
  2016-08-03 10:43 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-08-03 10:28 UTC (permalink / raw)
  To: broonie-DgEjT+Ai2ygdnm+yROfE0A; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA

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

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

* Re: [bug report] spi: Split bus and I/O locking
  2016-08-03 10:28 [bug report] spi: Split bus and I/O locking Dan Carpenter
@ 2016-08-03 10:43 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2016-08-03 10:43 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

On Wed, Aug 03, 2016 at 01:28:38PM +0300, Dan Carpenter wrote:
> 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'.

None of the locking patterns here are new, why is the checker flagging
things as new here?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2016-08-03 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03 10:28 [bug report] spi: Split bus and I/O locking Dan Carpenter
2016-08-03 10:43 ` Mark Brown

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