summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi-nor
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2020-09-03 02:00:40 +0300
committerVignesh Raghavendra <vigneshr@ti.com>2020-09-29 16:13:15 +0300
commit03edda0e1edaa3c2e99239c66e3c14d749318fd6 (patch)
tree3b782f6f9f61c8a153bfe52ab2f513d4ac9e24f2 /drivers/mtd/spi-nor
parentba4f184e126b751d1bffad5897f263108befc780 (diff)
downloadlinux-03edda0e1edaa3c2e99239c66e3c14d749318fd6.tar.xz
mtd: spi-nor: Prefer asynchronous probe
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> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Link: https://lore.kernel.org/r/20200902160002.1.I658d1c0db9adfeb9a59bc55e96a19e192c959e55@changeid
Diffstat (limited to 'drivers/mtd/spi-nor')
-rw-r--r--drivers/mtd/spi-nor/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 0369d98b2d12..2add4a01fce2 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3451,6 +3451,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,
},