Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp106979pxk; Wed, 2 Sep 2020 16:05:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzkYmW7aax9O6FFGjqZhhLpMqty9ckgBbrC8tnmJpWCfCjAJOTMWF3uD4fvcbuK+YYwFT8 X-Received: by 2002:a50:d9c1:: with SMTP id x1mr152043edj.283.1599087924407; Wed, 02 Sep 2020 16:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599087924; cv=none; d=google.com; s=arc-20160816; b=cxFsMk6A8enFwiamVLfNCkzx9+3EpoUqKoHu/3B4dQWPGnREl2r69WpZ4shZ7fd3tC VRxrGJMmGQmdqgE4YVE3VkxFjOTO45Pmz6/VpgDS3LN/x6AMLrNjd8s8cMnTofPtjfsD kdFl5xV3RiEtOy0FB9cMk9YVFMYeLAXd6N4eWdRsLlHd7k2HaxZRw/PqW9UaGEU1rNZa awR+tESQvsWFOEU0joUJJL0WND1/IaeCr3rk3cfjvUdGLVToYwlyQRMBP0GtB/lsFcc0 wMBYQ2RkGMl0T1E4xETcWR9a/QfxY2n5XpCe2W45s/eF9ffz9JTTwqlQUKaQhRth4SjM eRTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rckbD9u1Jvs+TO4H1QTBgAqxZmJHaw52NI12SCf1ONE=; b=o6hSnEkTw+rOU7Aw7cpZTRPc5lD2sjoCB3uouKNf5Kq1S/LhaYtNRpMeLykatdAFqk orARgU8FnweLj4WUFCU2ygiE6/zzHW3Q1ZjaBvMMvRAIgijCXv6eaZaccAYzG4bz2mUp XlmP2l4sMZJohPx/lnftCQlz0Tnxhe5I5c8K4Wk04eRNpjYK58L1lxPaMHSfHY30GzvW O0g07DmF8JgkSYeTMLg+Je+7ycXKYDWmyFmTvR+7i7FcaZtkT1FvFHxmWZ4+enAgrhmL N1t0OvZEKCduk1CYtPnqY/KBoutPVmTLDt/njR78B5b2cRzL9KC7ARtZOlkR6xAn11Rf FsLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZHQCfge9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si443904edw.331.2020.09.02.16.05.01; Wed, 02 Sep 2020 16:05:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZHQCfge9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727855AbgIBXBJ (ORCPT + 99 others); Wed, 2 Sep 2020 19:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbgIBXBI (ORCPT ); Wed, 2 Sep 2020 19:01:08 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A8A4C061244 for ; Wed, 2 Sep 2020 16:01:08 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id mm21so513396pjb.4 for ; Wed, 02 Sep 2020 16:01:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rckbD9u1Jvs+TO4H1QTBgAqxZmJHaw52NI12SCf1ONE=; b=ZHQCfge9W0rq1an4zjkDijL2d94hOEcsp54D7D1XkAj+MpNlBj3TQqpLnSitIdXXv1 hdS7rRtTpLagXWGJvssRy511yVf2YiGxvh3k6UnOGOr72OCURZmG9PDAxHiOkc3L/FaV cYE+BvmQntdfWGfxc3njqOhjaxw4yxOaPLZIQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rckbD9u1Jvs+TO4H1QTBgAqxZmJHaw52NI12SCf1ONE=; b=MoqokPHa8AKmvrygADt8ZysWPr6E5NGMXkWOHILnSQH9yxPEluX4Usm3if5UvckBMS mlioGxnsNfPKyBtrMU6AEScvsBrkEQ8nnJHXQpMs70fwJlBLeST3kmMFgDg6Ykofmp/+ Qf83gL4f8QKzY0QJtjYA4b8SQA34v6hQVk+ktKwCqEkbpFdHTOOJY9jZusm7Gz8lPSOy XRUDBFOAB4tdFq+FzPOfAy3GMjQZYODUMoPdpqOlqYWAVp3eV/q4qbF8NAwrUEv6LuJ3 d8WkUhbtpOjBefw76zykER2Ib1q1rqpcx+pEKqH1kJv+voB2o8csW/irKji8S7k0D1SM kPuQ== X-Gm-Message-State: AOAM531KQVE/KyfACbYBolrJLEsTovhIAch2fum6OokO/SqpW6oPf5ce Y9be8A4/RzyOtNS3qiXqCKIjA59GHLHGnA== X-Received: by 2002:a17:90b:360a:: with SMTP id ml10mr44063pjb.198.1599087667564; Wed, 02 Sep 2020 16:01:07 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:42b0:34ff:fe3d:58e6]) by smtp.gmail.com with ESMTPSA id z1sm419825pjn.34.2020.09.02.16.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 16:01:06 -0700 (PDT) From: Douglas Anderson To: Tudor Ambarus Cc: Douglas Anderson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH] mtd: spi-nor: Prefer asynchronous probe Date: Wed, 2 Sep 2020 16:00:40 -0700 Message-Id: <20200902160002.1.I658d1c0db9adfeb9a59bc55e96a19e192c959e55@changeid> X-Mailer: git-send-email 2.28.0.402.g5ffc5be6b7-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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