From patchwork Tue Nov 1 22:22:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13027533 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26ED47B for ; Tue, 1 Nov 2022 22:22:50 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id b29so14711186pfp.13 for ; Tue, 01 Nov 2022 15:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=R2mYasaks6aptBfsPPyIC9J85cwXhD99E7+c00DwPbA=; b=Ajojwm8aTq5a5qEgs5TEi16nesN2y4q0kWSF7HGc3uXuKHbEjEOkTGVewj2Gmoepsc 8ntCNEufJHV8rY5YDEU3A6r/uN6PFBK/3pq4VVWumLluDO1VWMXbCMBDvfbEPcIn/DOz B6idaltMm4ZGPq7Mji80bHMyTPfYZUjClWXWw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R2mYasaks6aptBfsPPyIC9J85cwXhD99E7+c00DwPbA=; b=YqS6ZF4NMX2UCxMhwZGca+rpeOgWSZ2fo3X2PftKiAMANdAtyHdCcT3sa7DwdovBvn Orrkc6c7wg5GFItPS+9Gc2TinhV+RcuyT+nSs4ltavb4V3KaKFWNHsZ60DH1IkM3j371 MwWv+ByERYv7X1hcdWZrkhMWTxi3oGkhIr3ApVmgFikPL24mwl5DVVuO0j7F07KHEye7 ZIQvJbMf5X5hanHPIibwn+y0j5clnckPFZKkhrbOjwWA+IZvCjkGETg9JoDHzpY3diau Uug6Wyts6mEFRWu4JBasHSTQ8EHyPLQ8JDu39uVNSfbmAtFen4M/R5nX2Dtwg/5ulM7y ukBg== X-Gm-Message-State: ACrzQf2XA1Z0x9QFpe9lKAb94Toe0+12X4Wug7Ds5jDBQZ1KHMmxZM6r O/GoBhTLeWbU5tILEAfP3wrthA== X-Google-Smtp-Source: AMsMyM7z44U0WddjC7xZsKVbzAMfSn71Yqn/mU5tK6PR+vCLItR7s0tYh5Xrc+NUSoTYfVDlvmmr0w== X-Received: by 2002:a05:6a00:1706:b0:56d:3028:23f0 with SMTP id h6-20020a056a00170600b0056d302823f0mr18245554pfc.59.1667341369540; Tue, 01 Nov 2022 15:22:49 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:9c5f:7c8e:b8a2:3495]) by smtp.gmail.com with UTF8SMTPSA id f13-20020a170902f38d00b0017b264a2d4asm6862730ple.44.2022.11.01.15.22.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 15:22:49 -0700 (PDT) From: Brian Norris To: Benson Leung , Guenter Roeck Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, Brian Norris Subject: [PATCH v2 1/5] platform/chrome: cros_ec_lpc: Move mec_init to device probe Date: Tue, 1 Nov 2022 15:22:06 -0700 Message-Id: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Disregarding the weird global state hiding in this cros_ec_lpc_mec_*() stuff, it belongs in device probe. We shouldn't assume we can access hardware resources when the device isn't attached to the driver. Signed-off-by: Brian Norris --- Changes in v2: - drop cros_ec_lpc_mec_destroy() (removed in -next; was done wrong in my v1 anyway) drivers/platform/chrome/cros_ec_lpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index 6ef5e5d40ba4..48302183d62e 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c @@ -354,6 +354,9 @@ static int cros_ec_lpc_probe(struct platform_device *pdev) return -EBUSY; } + cros_ec_lpc_mec_init(EC_HOST_CMD_REGION0, + EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SIZE); + /* * Read the mapped ID twice, the first one is assuming the * EC is a Microchip Embedded Controller (MEC) variant, if the @@ -586,9 +589,6 @@ static int __init cros_ec_lpc_init(void) return -ENODEV; } - cros_ec_lpc_mec_init(EC_HOST_CMD_REGION0, - EC_LPC_ADDR_MEMMAP + EC_MEMMAP_SIZE); - /* Register the driver */ ret = platform_driver_register(&cros_ec_lpc_driver); if (ret) { From patchwork Tue Nov 1 22:22:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13027534 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E457D7B for ; Tue, 1 Nov 2022 22:22:51 +0000 (UTC) Received: by mail-pl1-f172.google.com with SMTP id d24so14876135pls.4 for ; Tue, 01 Nov 2022 15:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uhDBAUhO5scPlfZQJJkosTaLVirDeVVGs54DNXhKQpg=; b=U4JBkHwZ9YjBgtJFqGJIhTwVRG1U3DJ4XqLA9TnHH1CZp6GdyHKLYgQ+o5Y1u2QBPj fTJmP6U1Z+wznRqQT5hkSlw+EphKFYnQYZIvuC0uUkiVK5TUEWxPnwpd4m/RpbXlL0HC 4qwqxdROBnxcvdQzFKuAwLc0tcgH8e4nkt54U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uhDBAUhO5scPlfZQJJkosTaLVirDeVVGs54DNXhKQpg=; b=AYO/r822fEZofw5+fgyQeooS73PuN1OiVY21SZGwrATBGKtO2rLXnYbbe/ItM1nm5q JvT61x9D4772I4alHVW9V2rIaeS0xWRsUYgQUZr/HLEt7z9h/IqqmKZcb5P4dAGwXXwG rLYOQ8qxPk1Q5cey/4EW1QnQnLaybSds0NZ8FWaMoLw5HiT8OZRnItauKk4aNpQpoaHe 4JaOlhpO52KJ2gcDrFwlHMgihussyPc2BXVkZP152ecZ3evjgTuDRgfgQWw6CsAfdVs+ j/rpUQfFb4zQV/BopM9orC1YhCvTW+bV2kXyeS7A/FTNYQvMjBc7WurbR0JcIKdQV6DR UXxQ== X-Gm-Message-State: ACrzQf3omRnu6eOBEQ+oQzEs2IjYeGBWw2nozLIDu6OoWTQMzMif6tEx x6SmOpebL+GYVpDsxMTAGND+Qq7QiMpdTw== X-Google-Smtp-Source: AMsMyM4WLgDDjTjLX67kShDt6zODkWQSyOwZps+yLROfGu6JclUPAsRo+ohLF+F9J+909Trqzs+Ybw== X-Received: by 2002:a17:90b:1950:b0:212:de19:b3ce with SMTP id nk16-20020a17090b195000b00212de19b3cemr21874558pjb.16.1667341371422; Tue, 01 Nov 2022 15:22:51 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:9c5f:7c8e:b8a2:3495]) by smtp.gmail.com with UTF8SMTPSA id cp15-20020a170902e78f00b0017f5ba1fffasm6797659plb.297.2022.11.01.15.22.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 15:22:51 -0700 (PDT) From: Brian Norris To: Benson Leung , Guenter Roeck Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, Brian Norris Subject: [PATCH v2 2/5] platform/chrome: cros_ec_lpc: Mark PROBE_PREFER_ASYNCHRONOUS Date: Tue, 1 Nov 2022 15:22:07 -0700 Message-Id: <20221101152132.v2.2.Ib1036816e77aba71ebc16b71f7615c55d054689c@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> References: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This takes on the order of 60ms to probe on some systems, so let it probe asynchronously. It shouldn't have any dependencies that aren't handled cleanly. Signed-off-by: Brian Norris --- (no changes since v1) drivers/platform/chrome/cros_ec_lpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index 48302183d62e..2e4dba724ada 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c @@ -557,6 +557,7 @@ static struct platform_driver cros_ec_lpc_driver = { .name = DRV_NAME, .acpi_match_table = cros_ec_lpc_acpi_device_ids, .pm = &cros_ec_lpc_pm_ops, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe = cros_ec_lpc_probe, .remove = cros_ec_lpc_remove, From patchwork Tue Nov 1 22:22:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13027535 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7CF47B for ; Tue, 1 Nov 2022 22:22:53 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id k15so6686732pfg.2 for ; Tue, 01 Nov 2022 15:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ekHYZpDEhYvmgLl9ibVW1UrC0RjLNjOHWSwbS/YHNwk=; b=We4cGsIeIdDqNRSLbBZwM8NCXtOgrImcozpOe19X4k4kUy2sMr99BV6XbE2pW0sAnN XDqAKM5zWARWYRjot6ekw2J13Css968k2n72VBsT23O+oQGiaBdFn+yG/C1JJkM0dtF4 2RpMAYHLAqXHBI4BoJj+r4j9S9uCRZPfADNkU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ekHYZpDEhYvmgLl9ibVW1UrC0RjLNjOHWSwbS/YHNwk=; b=B05RyiHMwxOYEVlsrs5gIvmPBIggPy/bawTFhnlRMqEU8HO33kvWH+myw5sGXdq9Iw Q8Eox5ojr3+U1rZ5sV+Oz21zj5sVYa64KR9TuzIKozhZz9cX/gi7pJmoprJFQAn8AzCv RfmPJQjEfcoH3eBjAqyoaX6QUBZ+gibEo5spwv9v8Gh/2fI9JOgeGlfTPbXVtBwD2yKu 2T07aWU/1ZO281AJnd8JzMxWH60/iSVHRdejUtQUhu6+HI4J3URT6k0sCccv0wQKRD2P PRkGq+gK9d/XE1X6E4KlvCDYdqTP8b/JdwB7zY+Z9Ptr7JBPs0NhsGdO/xqqdYYgZ4Gn zpcQ== X-Gm-Message-State: ACrzQf1F3WfkdDimC8QSMzPfZPrylrsctOuRrVRseJyKWAUARdaHkgsD MGddXdUZ3eZ7cxjaBE1LuR63AQ== X-Google-Smtp-Source: AMsMyM6Z/kapNZXYi+y4YDi0ULoqmJ35hoYlfVuPSko31JNn1avbNlegyM4Sun4haQP8GrG47MPTeg== X-Received: by 2002:a63:2b10:0:b0:451:5df1:4b17 with SMTP id r16-20020a632b10000000b004515df14b17mr18480543pgr.61.1667341373216; Tue, 01 Nov 2022 15:22:53 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:9c5f:7c8e:b8a2:3495]) by smtp.gmail.com with UTF8SMTPSA id 9-20020a631749000000b0046f1e8cb30dsm6300322pgx.26.2022.11.01.15.22.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 15:22:52 -0700 (PDT) From: Brian Norris To: Benson Leung , Guenter Roeck Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, Brian Norris Subject: [PATCH v2 3/5] platform/chrome: cros_ec_debugfs: Set PROBE_PREFER_ASYNCHRONOUS Date: Tue, 1 Nov 2022 15:22:08 -0700 Message-Id: <20221101152132.v2.3.Ic9a4f378f73319da323cd55940012fa6b1de24f4@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> References: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver takes on the order of 40ms to start on some systems. It shouldn't have many cross-device dependencies to race with, nor racy access to shared state with other drivers, so this should be a relatively low risk change. This driver was pinpointed as part of a survey of top slowest initcalls (i.e., are built in, and probing synchronously) on a lab of ChromeOS systems. Signed-off-by: Brian Norris --- (no changes since v1) drivers/platform/chrome/cros_ec_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c index 4e63adf083ea..21d973fc6be2 100644 --- a/drivers/platform/chrome/cros_ec_debugfs.c +++ b/drivers/platform/chrome/cros_ec_debugfs.c @@ -521,6 +521,7 @@ static struct platform_driver cros_ec_debugfs_driver = { .driver = { .name = DRV_NAME, .pm = &cros_ec_debugfs_pm_ops, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe = cros_ec_debugfs_probe, .remove = cros_ec_debugfs_remove, From patchwork Tue Nov 1 22:22:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13027536 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 856A47B for ; Tue, 1 Nov 2022 22:22:55 +0000 (UTC) Received: by mail-pl1-f169.google.com with SMTP id j12so14873778plj.5 for ; Tue, 01 Nov 2022 15:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ra1DxUtw8duk3xgpznu2G+LVRe7hBZGi32jB2ilzSnQ=; b=iXQLCb7yS8xX4ME+5QdaSAHIGdXvLXPpDImW60Izftv/1EOP8FQUyGdvJSgy2CrcVA NDeh8roIFXnclEFuowwIJL6z1Gm7axBhj/DrnaQS+bUhWW+FUPndhk14geAqc9m4g0JE Eh2OQwEOKTVGH6lTQBJJFQFexxmdmHHHIgyi4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ra1DxUtw8duk3xgpznu2G+LVRe7hBZGi32jB2ilzSnQ=; b=MnCEdv+qpdHZDq/4d/GeaPpvexcOKcLL5I83jFsfWVxEEL0ROu8Vf8jzLU/2pfES67 ZeW9bJb+xKyxDQ/0mu9MCPqsC/kGvacF0EZkLTtp3MCGHKcJ2DQwUybAM/NOgHroGCbd GUrPwcNSjKW4W1wni1DyAGxznQ2wKkDbOJ5W0TkdM6Dkst8CkrdOlwJBkgZpyy6b0w/8 In7p60xdhPDmrggkhgoimKkEwr57+Q0Owymwvxcg/tmrhdeE19+pXIRE3yMqNEQng4/f Gy1dR38tZ++E9w/yLp6HyzgxaEVs5+Xa8BGkwEh7iLViCXnRzE2gs1/tshYI6JbdCSO6 YXZg== X-Gm-Message-State: ACrzQf0/b2677lIG6yYjBH+debGTXoQMLvOq7tT3999YAh9+ae5F52PL xyFs0ju27ONKcgOmkjL2kvPwJA== X-Google-Smtp-Source: AMsMyM7VzAAGq+6n5lYLKgnuYhLF2BBv6ZAjScDJ2lK/wn09iPkr186t67e0nbahn6C04vm8x20w0Q== X-Received: by 2002:a17:902:ed8e:b0:187:27b3:74e5 with SMTP id e14-20020a170902ed8e00b0018727b374e5mr10525835plj.90.1667341375079; Tue, 01 Nov 2022 15:22:55 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:9c5f:7c8e:b8a2:3495]) by smtp.gmail.com with UTF8SMTPSA id y22-20020aa79af6000000b0056be1581126sm7261255pfp.143.2022.11.01.15.22.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 15:22:54 -0700 (PDT) From: Brian Norris To: Benson Leung , Guenter Roeck Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, Brian Norris Subject: [PATCH v2 4/5] platform/chrome: cros_ec_lightbar: Set PROBE_PREFER_ASYNCHRONOUS Date: Tue, 1 Nov 2022 15:22:09 -0700 Message-Id: <20221101152132.v2.4.I565598102e0bfb03bdf8c090d3bfdf954d026bc5@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> References: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver takes on the order of 15ms to start on some systems. Even on systems where there is no lightbar support, it can take a few milliseconds just to probe the EC for support. It shouldn't have many cross-device dependencies to race with, nor racy access to shared state with other drivers, so this should be a relatively low risk change. This driver was pinpointed as part of a survey of top slowest initcalls (i.e., are built in, and probing synchronously) on a lab of ChromeOS systems. Signed-off-by: Brian Norris --- (no changes since v1) drivers/platform/chrome/cros_ec_lightbar.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c index 469dfc7a4a03..ff4d619cf924 100644 --- a/drivers/platform/chrome/cros_ec_lightbar.c +++ b/drivers/platform/chrome/cros_ec_lightbar.c @@ -601,6 +601,7 @@ static struct platform_driver cros_ec_lightbar_driver = { .driver = { .name = DRV_NAME, .pm = &cros_ec_lightbar_pm_ops, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe = cros_ec_lightbar_probe, .remove = cros_ec_lightbar_remove, From patchwork Tue Nov 1 22:22:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13027537 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 598467B for ; Tue, 1 Nov 2022 22:22:57 +0000 (UTC) Received: by mail-pj1-f51.google.com with SMTP id b1-20020a17090a7ac100b00213fde52d49so263527pjl.3 for ; Tue, 01 Nov 2022 15:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H/atQqeE7yew2f3NLAU7m28aDdmCRbd7A5xTuP3olaM=; b=Z/SVfi/W/l0ZbgH7VD2JPBlUzJN4/MyupL9V4lXL/QK1qKQT1oJDwbnPQRJF1Flhw3 RQgQVZ3rB3x2DDjEg+v2Fs7tYMStDaw4ahLmgdpZ1FuqcFmDO9Rn3/uADJGqGfEjlNC0 uhzcpvSIuDLiZCO+KiAGnCUuLzMTSInGH8NcM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H/atQqeE7yew2f3NLAU7m28aDdmCRbd7A5xTuP3olaM=; b=MLDh4NkPsnAfEREJbAQtLNhIo7CMucHD11hsa5CY93ellAMoV3t/UtZOUYVUb67irq kWTCuugqqet4pmZiTsvKGWt8/h8FSGUAeCUfMK2F6FF4XCNCD6w7W0tHbKf3ni0WafPI RnykSm/Y4ZyJEJ3ZQSoECoojfUl0kehurdUg1o+iQU3WNKFCo95/4g41U67Yo/tY/pyf ycgR32pQbT5MJUoAl6neWSARP02glmhqcmckwtv/1d+OvAE1dO6izQ+alcGqaS4y5tdw Z6z2gfqAxHxu8TtIcPMFNxUSNVps6vxKxVnCpAACT4VtztT+3yhtAuNWZBBkPgHIqefp IbvQ== X-Gm-Message-State: ACrzQf2gunl+0Z1I58FbiPR+3+gHgM9DAWgtDITTk5oe1qQ75FoZC/hG fXq9mIvxQMUrOG/pc6Jcq9AoHBqsi8+HcQ== X-Google-Smtp-Source: AMsMyM6tT1E2ZOGyLhi6joXexZS2tF424ZuU80HT1E8PlX5VEfgewkfgxiOERbPawxoJGiTPW3hzAQ== X-Received: by 2002:a17:90b:4c48:b0:214:25cd:96e3 with SMTP id np8-20020a17090b4c4800b0021425cd96e3mr1808035pjb.188.1667341376942; Tue, 01 Nov 2022 15:22:56 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:9c5f:7c8e:b8a2:3495]) by smtp.gmail.com with UTF8SMTPSA id m10-20020a170902f64a00b001769cfa5cd4sm6865385plg.49.2022.11.01.15.22.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 15:22:56 -0700 (PDT) From: Brian Norris To: Benson Leung , Guenter Roeck Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, Brian Norris Subject: [PATCH v2 5/5] platform/chrome: cros_ec_spi: Set PROBE_PREFER_ASYNCHRONOUS Date: Tue, 1 Nov 2022 15:22:10 -0700 Message-Id: <20221101152132.v2.5.Ia458a69e1d592bfa4f04cde7018bbc7486f91a23@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> References: <20221101152132.v2.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver often takes on the order of 10ms to start, but in some cases as much as 600ms [1]. It shouldn't have many cross-device dependencies to race with, nor racy access to shared state with other drivers, so this should be a relatively low risk change. This driver was pinpointed as part of a survey of top slowest initcalls (i.e., are built in, and probing synchronously) on a lab of ChromeOS systems. [1] 600ms was especially surprising to me, so I checked a little deeper. This driver is used to interface with Embedded Controllers besides just the traditional laptop power-state controller -- it also interfaces with some fingerprint readers, which may start up in parallel with the kernel, or which may not even be present on some SKUs, despite having a node for it. Thus, our time is wasted just timing out talking to it. At least we can do that without blocking everyone else. Signed-off-by: Brian Norris --- (no changes since v1) drivers/platform/chrome/cros_ec_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c index 7360b3ff6e4f..21143dba8970 100644 --- a/drivers/platform/chrome/cros_ec_spi.c +++ b/drivers/platform/chrome/cros_ec_spi.c @@ -834,6 +834,7 @@ static struct spi_driver cros_ec_driver_spi = { .name = "cros-ec-spi", .of_match_table = cros_ec_spi_of_match, .pm = &cros_ec_spi_pm_ops, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe = cros_ec_spi_probe, .remove = cros_ec_spi_remove,