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: 13925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3245696wru; Tue, 1 Nov 2022 15:30:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LzBYBmiPFen0Npe2lrP9sJ2Fw5Hj9xZoeEzE+AhzNZIC4RnMB85M32fgRI8u5GsBjy+jl X-Received: by 2002:a17:907:948f:b0:7a8:6861:819a with SMTP id dm15-20020a170907948f00b007a86861819amr21006494ejc.30.1667341857549; Tue, 01 Nov 2022 15:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667341857; cv=none; d=google.com; s=arc-20160816; b=O/sMcgKT45PglvfUZPp04hUjcgm6FtQC4+WBLh7K2lOLPyHa+ofgtN41v6c9yosYI3 AUHmYbygNYaUDL6u5vk1wDRrsARVoTD5Xuo9RYHM+XjcO8L6fOi9RGotP4XwJU4Bnnei 9H7uk2EgnSJfnvpNaVnntm90PmNVBJX9DzQtfW6MyfMEW9jNpIZEtLZNCRILvk5cHe50 gr9ppHvbRBEB5ccPqP6Q9Qv0WmY93c7zk4r4b7NujRSC1dqJhDwuYauO6njMF2mBsbkg V+EepR1iPXQUX8Ic8JRkmrZxEWoVBEh2pb7m3ctmq2z6DOe4q3YyPrSw7k4zLHoCuXhl fibQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=R2mYasaks6aptBfsPPyIC9J85cwXhD99E7+c00DwPbA=; b=T0vFRx11tVUnSjVUySRljiCqbbzr6TuFc3HhAfrmPxsrNxBAb5X5IUodRpZOntJFLf HZMrGkUEoNqDaJ312BXW/Sb1GfWynqDmiRjmDDGQcE6/36QEKnoDGK++Tydz6eoBOHUn Gnjl2fJs5a19ru0QeFrKvAaNPASjGFd61BwHgjK/ekN09SEn7JWSsahXdO90KmT0oUSf lQ13rhEpBQ0AyuP3pfSH15dliZ+6LzqFYs20V7JMYnBBvUeWjnf6lTHl2Ef9g4Oi1W04 LFVsSSKwHFAwaETuniX1ouk8HuYl+WthPpGeouKC+psG/SgJK/1/irfGyqbnRBf96oVo 6ajA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ajojwm8a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v1-20020aa7d641000000b00457d6203a0bsi11311324edr.62.2022.11.01.15.30.33; Tue, 01 Nov 2022 15:30:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ajojwm8a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230184AbiKAWWw (ORCPT + 99 others); Tue, 1 Nov 2022 18:22:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiKAWWv (ORCPT ); Tue, 1 Nov 2022 18:22:51 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22D2619C13 for ; Tue, 1 Nov 2022 15:22:50 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id b185so14742229pfb.9 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=3XWr5nY9h283iKKL4YlPxKxk6aEX+zdkzNSD4+0eviHm9rYSwfSSy3utO+xwYSgLnK uUC2Ax937GMByLqRt4BdJd7SEFmpaA7cqtD5TisXIItGgbR33PzNJvXM38CEopy180F6 1Jj7AVteMdjFnQLFGj2as+8r66EWNTcYOEUAkfT7plKBShiW2X0bJGRtP4Vx7IBp7Q23 4AMssknSpBssLH4hn1h+i1rLUePOQ30Ck4e/6/lRD+SwHNTA5KVpZHQJwLL3tRfQbZlw Nte2+L3UuujnsvmVigoqd2/pFlUxU5PVISEIl6fSyFBsPCqfMOg9fgOxiFem0blRkzmT rUFA== X-Gm-Message-State: ACrzQf2v5oC6lh67SSYe+RLDy/z/nonMwFR3FECqE1v7mglgj3wQdywY r1DuUQrwFyojc7qhS34wQLlJ1w== 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 MIME-Version: 1.0 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748334655873126130?= X-GMAIL-MSGID: =?utf-8?q?1748334655873126130?= 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: 13926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3246167wru; Tue, 1 Nov 2022 15:31:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6dYh2LdgA+CnC/r4GgpWT1YSzgHz703tpPZX8Cq/b5dkr6x+Y662bp6Y8Q/UTvRMfC/eeJ X-Received: by 2002:a17:906:9bc8:b0:7ad:7e6a:50ac with SMTP id de8-20020a1709069bc800b007ad7e6a50acmr21163434ejc.66.1667341916438; Tue, 01 Nov 2022 15:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667341916; cv=none; d=google.com; s=arc-20160816; b=xJSKRKsIDRZ6iPFi+JOGZI6CK1FmnANZyE88QlBLhcf+hRhVedt/y8li8XjQfSQNfy ptTDNlwuJPB5AEGx5X1yPpuX4TpGo4KWmiiurw8Dl6ezAEt5IvNPNNdC2tXRVPkORtpN pviJu6R3ky/u6MLwWuAr4X/o/p9ZovP5AprPkruPSYvK9ndSb7VxVVC4CPGl63RPy9ks hY3CWDSvbWbrJwdH0mO+124W38+TevlKexNfomXz1w+NbxdyHjXu68rpE0V5raex3bqn UeeZOMU4ZNtoSCc1fjzyYF7GlaR7fP+mfeYL1/J7wA2cV9YwePKJubjuOV1XoRHseO8h /c0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uhDBAUhO5scPlfZQJJkosTaLVirDeVVGs54DNXhKQpg=; b=iANcYouyjy2rNBdpjjYRZ0h476jnCkkE8h8YQy2wesbtCica77wnYFItGc0rJSEe5v jnotnNyWWxQIrSGAMCliW0C9pG5sQemnjbiB8/JYLdyv/XPLXlq6C921r3J54lBok7aM c5136lPikYPB7d0uuLrSSMyqeKxzmJzpjWh4yQOFWJSczpVXO7YdCrMubpGO7b4SymdK S6S44cN3T4kTEZZ5KxWJ9vlAo6yZa0mAUeHP5bMz/1zGVzcyaMuN7thPVsip3kh+DGpw J4QtCepJMnMsUdVBUmcUCvOrevAzbeIgFTvTahXdQ1XOJtDHnXg93uUqnB0rwVDAqVwC Tv0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U4JBkHwZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw14-20020a1709066a0e00b0078da3cd3073si14925000ejc.628.2022.11.01.15.31.32; Tue, 01 Nov 2022 15:31:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U4JBkHwZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230280AbiKAWWz (ORCPT + 99 others); Tue, 1 Nov 2022 18:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230165AbiKAWWw (ORCPT ); Tue, 1 Nov 2022 18:22:52 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D499319C13 for ; Tue, 1 Nov 2022 15:22:51 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id v4-20020a17090a088400b00212cb0ed97eso256418pjc.5 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=IiAAYv9OsMzlSfgZZDILC9PVqp5vlvq0sW70OPiREE3T8L1/oigf9lt3of95d2zswy 3wMDCiLs0Bx/OxXWzFvKgg3/93XIUFKx+KVoJ0QsSgI5tviTPLCbNQsI+uuz0suBwEoA lkoWThmMYH/OyBq6cmuwyuUitnv0bZ5dbezrTVlSErXCyfwmLntFCdW4IFt4mt3UCAQe kh+iO5IsVGQ0dDY2rA024VVRPq8omDE9Hyv6ixppto3lWMzaFweTq7tGhZSyfsx8gGbe 4TKchYXYwONe0O+X5jf8Jrpf+Blq/6a/kxYzU1HoOw/5WHV3Yo4aEI0FjYQbwyDid4gv xoIA== X-Gm-Message-State: ACrzQf3CeZhtauquCZpN0TCyuWImgaZT2twNtEL3bE7SRB+HOO5s7IIs poVOVfbXGz2CHODp0LmXMseqLg== 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> MIME-Version: 1.0 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748334717117631280?= X-GMAIL-MSGID: =?utf-8?q?1748334717117631280?= 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: 13927 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3246297wru; Tue, 1 Nov 2022 15:32:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uD8LBPrx5cNG7u7iWilUTmKIWQ2LIWc7zo6E9cDzDax3kiH7Q2L6KXJvwl1fjooavGG5u X-Received: by 2002:a17:906:6a03:b0:7ad:b51d:3a38 with SMTP id qw3-20020a1709066a0300b007adb51d3a38mr18841398ejc.202.1667341930397; Tue, 01 Nov 2022 15:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667341930; cv=none; d=google.com; s=arc-20160816; b=l+gRhXXvoKGyCjdVo4F4YghU7He4yri/p/1cKlw5BDv8x50rAzfIiVKHXQL6zf/pNk RwHFX34tf42odLDASmZM6kFeY5SYkFkMfghC5gp/xU5NBM9Jh3af2K8E0Fs4fyUGFwMU Q44De4MRxBjeknajwI1BWhIZTmHJd48Tgq6BVccdfQbGL5qKVGJTwmbQshD7PfNTjIle x6V5+2kENrGhtFyS52SNTcoedlkBoLFdxU/zAeuCPnI1c0jHmJr2yA1Oyl5NYbu9DZeC xEuu3vQwz9cHk0HYEFzlM8HQlth1T8spmAJb6WrXRvZ2FdLVPKUVg1VAephNbVf+96cz wCwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ekHYZpDEhYvmgLl9ibVW1UrC0RjLNjOHWSwbS/YHNwk=; b=DNEx4bbOvHhAt2+tr2gloxEZ3+GWyvF+g/jm0H/uwHsrC7xBdzKj1z7FSbEQVxJpTX 0sD0BXN8qJ7JCrZzynZasKUIjQ2MJpiZfA6ZsWZ8JmmVY4SvBCMr8JVxZ2GpXEDl19HR /hbLf/I0U6srFdV6NIxZweaDT3Ydo1zemtc/BEyPXU9w1yjlVeSK1C2deMHIq7/a8Clx u1noH9HCg4R5xFxJg0jtDdeOFzt70zBGnCPTbRVTxfp0Yp9wLu8ciWdZTmNu9HkTH7mv IO6mh8rygXtXVRzc3KxZmHYZRKFQJ+SWj8BRV45PRB5YWgH/VChHndUJBy86fwLAHuip HFBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=We4cGsIe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb7-20020a1709076d8700b007add150c78asi9685924ejc.503.2022.11.01.15.31.46; Tue, 01 Nov 2022 15:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=We4cGsIe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230364AbiKAWW7 (ORCPT + 99 others); Tue, 1 Nov 2022 18:22:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbiKAWWy (ORCPT ); Tue, 1 Nov 2022 18:22:54 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD41D1A21B for ; Tue, 1 Nov 2022 15:22:53 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id g62so14734980pfb.10 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=WIHY+V5mxX5xj3IYmHuiTo7kfj+1s63YUbswlzMoCuQKzrt6gpIQ5v7PIsEfRAuwtf FM0a82TP3IV/ZXuTOg+bPtpk+hGvjVstRDCJ9BjltJKGw+7Fn99s/5fHNqz+Ri+bjLCi /u1yGIvBMBkj931DnSV7xYKJay8FhLgG+JojtXzpKXMilGhT6diKRdjAKF7QfZyTXbfa zxzmDCMQzR3DBzb4kdmzpgIaq6h1TfqGaHizpR3P191RFO96bjANI9wIyptRMS2EqJJj RmU5R/fVsZx2tgrbRfwDg6AhJqdEMr2Mo5i4SCakWAPE6qDMsTa+CV4lAAegckBgufne xdBg== X-Gm-Message-State: ACrzQf32nvxZWcxPx3IysTRnhi2CkbdgJN2NY3w79K9//8mU7ZE2tnML URcMOsdS/kwIeuNyiFWaqgngyUIMBhG4Wg== 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> MIME-Version: 1.0 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748334731875522992?= X-GMAIL-MSGID: =?utf-8?q?1748334731875522992?= 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: 13929 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3246686wru; Tue, 1 Nov 2022 15:33:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4nU9QUfGOEyt1WObyuNgl100YIQHHRwdbqBvveLqPlX6ZI8c9dGm8ulkJFJAKo1pdhCGfr X-Received: by 2002:a05:6402:3217:b0:461:d6d7:7f19 with SMTP id g23-20020a056402321700b00461d6d77f19mr21590903eda.109.1667341991644; Tue, 01 Nov 2022 15:33:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667341991; cv=none; d=google.com; s=arc-20160816; b=m7vZe0q2J3sMRGiFb1fSgZHg65AcFfNoq63NOkN7O/kAqPzGHKNQJidabe5lpeuD8b v72gYHN9urHpm6Q6CWyFiM9D69F09xP9PiNccpagHLH/9tFokXeRjTDNOhSjtDe+oEa0 IoAatGdkA6rShDbZ36EeZlWaECUygRwgZumOmPGKm7aBn8QcciwrimGcpyrYJBWkLH4R Mvu67NxjAWkSLBnzQSRhC1WynTaOjp7gNpKgyEztxwYABm7QQqanVDNvxPnOGYgKQAlq 2mOwooP/4aLznteQcseSS1Ogpn62WYRj+W/XYpKWff6xKJlDRDxU51hqFTw81jl5wFZe 9S9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ra1DxUtw8duk3xgpznu2G+LVRe7hBZGi32jB2ilzSnQ=; b=G0CWJrNTS4MEZfNxCWNfSfW6F3SqbqRw7BWD3qQ4X+gb/DC/SLo+1+P2XbQy0H9fvA vADBxNYufBMIbmL6qBXMg0rzf28fPFxsoDM8Ksi3Tpn+VRstysCs5k1anfwa9RvOxOjQ 04TNZ0AtZ0Akb5h7W7/BWs8Gto7X6Z8UVI2J7z/BS3i4DpWz54/CiJgdxjXdsQAiY0fg icbn8UT3RiMRK1o007iDt1uXjYnJ7WgfebI3jai28il6iJCHonbcVYXFD5oVAvzXpWbR o0tqfBr1hgHsjgbFB+biOZz/dwX0hkbTuNqrGgr3WmKU4+OW8lJF8CUHFtoIGlvwVja0 hL5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iXQLCb7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k20-20020a17090646d400b007acdb3fae5dsi10251842ejs.469.2022.11.01.15.32.48; Tue, 01 Nov 2022 15:33:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iXQLCb7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230448AbiKAWXF (ORCPT + 99 others); Tue, 1 Nov 2022 18:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230311AbiKAWW4 (ORCPT ); Tue, 1 Nov 2022 18:22:56 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856B81A805 for ; Tue, 1 Nov 2022 15:22:55 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id p21so11003866plr.7 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=g1s4tQIBTmS3CzhBRE83FkGAnhyk17p3f/7V6+sPm4fLLW9fmHh0J7YGJocb0H3/3A ZPwORF9LXwlBG09U4YM7Q8BX6LWCyg2KE8K/cw1Ip1BzrI4nwY3r1XtkgnOutI1WyGAD mYPcjyFJ30eC5a8sH6FhlgzfANuxilbgvLaS6zCkDRo+rNf6w1gzyRKtboGWQG5Q8HMI vYF8ucnG/wlH/3TCF34zcI3vexCf4JYr+uIIbEiB9EjCV0afeOjJEe8AaNc+6/08qsgj aNMtUO61E9e03KheUBDqcTdeDRFp2txixWydGTyQWvaypRWuKJrPbTy/qr/+obyua85p i1xQ== X-Gm-Message-State: ACrzQf0/i/gX9NqxpdyIOufN9KAIzTCWSDCxTVJg6vGS1fRvWdgbC46m OjREU+OcOzhmAsEhtLNeeQ1rNQ== 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> MIME-Version: 1.0 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748334796132398380?= X-GMAIL-MSGID: =?utf-8?q?1748334796132398380?= 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: 13928 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3246395wru; Tue, 1 Nov 2022 15:32:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4V9QbLpgwDLVH4a51nMWU/liZ3ljraC7dFmGb/DUfXN6/2FFZlSJwmusSoMroAAjsLd6kL X-Received: by 2002:a17:906:9b8e:b0:791:8f57:6845 with SMTP id dd14-20020a1709069b8e00b007918f576845mr20986063ejc.174.1667341947588; Tue, 01 Nov 2022 15:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667341947; cv=none; d=google.com; s=arc-20160816; b=gko3H9ME8N0iEG5KugZdGWDDg+XA9B7LfK21pc1T1RPboEArqN/oQJf7EQXBMgGwVl rCEfZoSkiSjfG2HJQtxYM4cejTOEAApsYxfyJyi1s7d2PWf0KE89mJoNzb9ZtzsZZhMD Ryq982d6sNUhfn745ydQwu+qtl1uBdZ14iQpjTV0a57n1v1xEs1m7etRiYPc+UqaPIXJ SNs2VGgPE0xgb5G39Kn4TFKum/T8fdTHLGBFsTYBlXp2o+yFry25z8sYealzpqBE8vWp GkqwbnDN0vmBpkZMjT0X0KDLf0QPf+zKq75+Z1QnSQc4NUydxmdeRAphE8GMXbSI+0kG Z0Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H/atQqeE7yew2f3NLAU7m28aDdmCRbd7A5xTuP3olaM=; b=tmNOppuEvkvpanhV5CscGVYnSIKcKaa8cWXEsJXEjg9TYTYolE95VV+3sr+SfqrygM 5UkXVORE4LZuFF/7yjn2WdiM3LB7x2PUKEzkFNUGD/v3AI7eYn9gKki7o7D+zmFkylG5 NylcXTqTjHnDiBZonY+ArUsT5n2Sxu4b12INRUseK9V1S4s83US7GytnWaBujeDnfnHY lF/pu3xnQrGDDodb81TbZO6FV87jYGSKhfE1SY5g1VP8o4mrH+mbuKwIVlVOSCm3QxaU ihGHHtZ/PvXQSAsbnMaabKt5JyrgN7bFlrI4aY/ccALH/bP3jXeZZ7EdkAYr6+2HhKwW whDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Z/SVfi/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae3-20020a17090725c300b007ab1b8b719csi15894792ejc.0.2022.11.01.15.32.03; Tue, 01 Nov 2022 15:32:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Z/SVfi/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230488AbiKAWXJ (ORCPT + 99 others); Tue, 1 Nov 2022 18:23:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230304AbiKAWXC (ORCPT ); Tue, 1 Nov 2022 18:23:02 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3415A1A811 for ; Tue, 1 Nov 2022 15:22:57 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id p21so11003932plr.7 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=38rlth+7NAx3RIAO2fM/n3os5umAZPEWJzMk/n/nkpaaGT1Qvb0sRPVj8EbvFFpZO8 P0hsl+96mFDGUMCQ3QhWERoiaVcvobBDZl6rOuUKM8PbKrnEgnFK6j1pDsLeSDN0W96E ATxrztTFVZ8jqlkm33JsxY0m9NEKVqb8eQ9+r2lV0LA2VCKULTapjSyGEI02eD6ahvus FvYKKO64TgQG9iNk/38aX/wfmFTziVUbdDpDXhBOSXn1ZQI+HMyP+OL8ysbDuCZHOtK3 AVyhvThUAs5Idx9y2KDv9MXDC0TYjYMLHntI1Q8DqP8m01OVs5BcXaKVx0EEVwGaUcIU 8Fbw== X-Gm-Message-State: ACrzQf20zGglE+PRRU4LgURsMvz3keqyek+mSasCzuzSm3yx4+I4Krb9 mPt4vb6oD7pbh+O9L0RDAkHeyQ== 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> MIME-Version: 1.0 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748334750062654630?= X-GMAIL-MSGID: =?utf-8?q?1748334750062654630?= 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,