All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: Prefer asynchronous probe
@ 2020-09-02 23:00 ` Douglas Anderson
  0 siblings, 0 replies; 18+ messages in thread
From: Douglas Anderson @ 2020-09-02 23:00 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Douglas Anderson, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-kernel, linux-mtd

On my system the spi_nor_probe() took ~6 ms at bootup.  That's not a
lot, but every little bit adds up to a slow bootup.  While we can get
this out of the boot path by making it a module, there are times where
it is convenient (or even required) for this to be builtin the kernel.
Let's set that we prefer async probe so that we don't block other
drivers from probing while we are probing.

This is a tiny little change that is almost guaranteed to be safe for
anything that is able to run as a module, which SPI_NOR is.
Specifically modules are already probed asynchronously.  Also: since
other things in the system may have enabled asynchronous probe the
system may already be doing other things during our probe.

There is a small possibility that some other driver that was a client
of SPI_NOR didn't handle -EPROBE_DEFER and was relying on probe
ordering and only worked when the SPI_NOR and the SPI bus were
builtin.  In that case the other driver has a bug that's waiting to
hit and the other driver should be fixed.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/mtd/spi-nor/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 65eff4ce6ab1..756da93f0f16 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3470,6 +3470,7 @@ static struct spi_mem_driver spi_nor_driver = {
 		.driver = {
 			.name = "spi-nor",
 			.of_match_table = spi_nor_of_table,
+			.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		},
 		.id_table = spi_nor_dev_ids,
 	},
-- 
2.28.0.402.g5ffc5be6b7-goog


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

end of thread, other threads:[~2020-10-05 14:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02 23:00 [PATCH] mtd: spi-nor: Prefer asynchronous probe Douglas Anderson
2020-09-02 23:00 ` Douglas Anderson
2020-09-30  8:34 ` Vignesh Raghavendra
2020-09-30  8:34   ` Vignesh Raghavendra
2020-10-03 15:06 ` Michael Walle
2020-10-03 15:06   ` Michael Walle
2020-10-03 16:27   ` Doug Anderson
2020-10-03 16:27     ` Doug Anderson
2020-10-03 16:54     ` Michael Walle
2020-10-03 16:54       ` Michael Walle
2020-10-03 17:00       ` Doug Anderson
2020-10-03 17:00         ` Doug Anderson
2020-10-04 14:10         ` Michael Walle
2020-10-04 14:10           ` Michael Walle
2020-10-05 14:53           ` Doug Anderson
2020-10-05 14:53             ` Doug Anderson
2020-10-05  9:06       ` Vignesh Raghavendra
2020-10-05  9:06         ` Vignesh Raghavendra

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.