linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] spi: of: do explicitly request modules for of-registered devices
@ 2015-03-25 20:32 Dmitry Torokhov
  2015-03-25 21:36 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2015-03-25 20:32 UTC (permalink / raw)
  To: Mark Brown; +Cc: Geert Uytterhoeven, Grant Likely, linux-spi, linux-kernel

Trying to register an SPI device asynchronously (via async_schedule() call)
results in an ugly complaint from request_module() warning about potential
deadlock (because request_module tries to wait for async works to
complete, the caller is also an async work in this case).

While we could try to switch to using request_module_nowait(), other buses,
as well as SPI itself when not using device tree, do not try to load
modules explicitly, but rather rely on the standard infrastructure (such as
udev) to execute module loading. There is no reason why SPI OF-described
devices should be treated differently.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

Mark,

I chatted with Grant who I believe added the code originally and he said
he does not recall a good reason for it to actually be there.

Thanks!

 drivers/spi/spi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index c64a3e5..102a9e6 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -16,7 +16,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/kmod.h>
 #include <linux/device.h>
 #include <linux/init.h>
 #include <linux/cache.h>
@@ -1359,7 +1358,6 @@ of_register_spi_device(struct spi_master *master, struct device_node *nc)
 	spi->dev.of_node = nc;
 
 	/* Register the new device */
-	request_module("%s%s", SPI_MODULE_PREFIX, spi->modalias);
 	rc = spi_add_device(spi);
 	if (rc) {
 		dev_err(&master->dev, "spi_device register error %s\n",
-- 
2.2.0.rc0.207.ga3a616c


-- 
Dmitry

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

* Re: [RESEND PATCH] spi: of: do explicitly request modules for of-registered devices
  2015-03-25 20:32 [RESEND PATCH] spi: of: do explicitly request modules for of-registered devices Dmitry Torokhov
@ 2015-03-25 21:36 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-03-25 21:36 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Geert Uytterhoeven, Grant Likely,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

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

On Wed, Mar 25, 2015 at 01:32:22PM -0700, Dmitry Torokhov wrote:
> Trying to register an SPI device asynchronously (via async_schedule() call)
> results in an ugly complaint from request_module() warning about potential
> deadlock (because request_module tries to wait for async works to
> complete, the caller is also an async work in this case).

Applied, thanks.

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

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

end of thread, other threads:[~2015-03-25 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-25 20:32 [RESEND PATCH] spi: of: do explicitly request modules for of-registered devices Dmitry Torokhov
2015-03-25 21:36 ` 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).