From patchwork Fri Oct 28 21:14:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1050462wru; Fri, 28 Oct 2022 14:24:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7yU9hF3iov08dCom03Cgi1d+EBf9V3VFUR9aXyEPjGAdD5zAmcVJGQI4Jo2DvyRFXYDNno X-Received: by 2002:a17:902:8a93:b0:17f:66ae:b6c with SMTP id p19-20020a1709028a9300b0017f66ae0b6cmr1024719plo.94.1666992278373; Fri, 28 Oct 2022 14:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666992278; cv=none; d=google.com; s=arc-20160816; b=WolzGERJzxWIEBarHM9S5bdgbWZeEv+btNx6jHwS11AHLM+VZi5GO0ZHvAAr8OZnEc UcMW4uH2wCFFgFMdSy5dGVP8+AVybzj9dK5QOGklcN3mssdeee8alqT60gG3Raku3y7o W+9BC4XuTNPfYKuJwMSvDnTB9Aig2c/anp1TTEQiORgCs7Ir9UlHEaJVKru/lAPr4bjl yyCXONtlZ+zanl0K0VpgNyw/hTG9iqIrwqHm+7ZEeGjhdgQBK5OJ0UUNlnPJkX0lTegb tTxjAC9Ay4IbDBQHMb35z4o9nz/NrTWGq9R+paSfltq+FzwmvmMMSQrC8IPOxegUGUtC eJeQ== 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=M+RiQTpwuN97JRf0F9V4tVIm2v8ZxHlLZa7P/ilnDGY=; b=cM9WxXBgznI6i+sOfg6ZKI8GZKsvzrjIlHxqOF+73Aa/Y5RU2v39JDepnal9GLw2/J XVJgmGSXI4EHELP3FP+nzUiuCPlak+8ciTJG98tPaqhB4MwBCdYHcsYJIJjH2zb7P0eV IECcjLBm4+4ccLn84J1uvfCQqGtTxXVDYi0oBjTwtb7H/Uz+ExO3szdKx7RSr3BnIZaw QcLj+qHJhPfAgj489aaep4/W3ecb6ooU/pBc1HqswtO0iAi8zdUhJxrj7oCokXq8R6Fp 3lFCMTeUOFe8MeJ1s5/69JTo5NCsynm689ZBAStGr64w4o5m22PJtRitKrFHDNTBT1oZ lgFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Yj9XXzuU; 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 i5-20020a170902cf0500b00186905ef969si6510406plg.90.2022.10.28.14.24.25; Fri, 28 Oct 2022 14:24:38 -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=Yj9XXzuU; 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 S229752AbiJ1VPE (ORCPT + 99 others); Fri, 28 Oct 2022 17:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbiJ1VO6 (ORCPT ); Fri, 28 Oct 2022 17:14:58 -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 A27292317C for ; Fri, 28 Oct 2022 14:14:54 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id v28so5621616pfi.12 for ; Fri, 28 Oct 2022 14:14:54 -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=M+RiQTpwuN97JRf0F9V4tVIm2v8ZxHlLZa7P/ilnDGY=; b=Yj9XXzuUNOrCtA5zzryZJ10G9E2xQzsOg4wGDQ7XvEREUd7J5u5VTSx/QNQIdwbo24 Q594O7/zX76xEh9Gc0iNGrU4TqZtcazJZ2+Pt0GrlTPqOU1rG0zSAjw8Ls7Qt1TBcVFR Wjei+HXIwy07bZT+qPsUiKi1PlGLFN8O2EUOQ= 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=M+RiQTpwuN97JRf0F9V4tVIm2v8ZxHlLZa7P/ilnDGY=; b=0wYZMVY51Aa/raO0IMkr5ihkjl0cZAe7rksty0AmIcR9Y7wPAwdhtAmqsOJAxOeSdH hjB5b3GHwLSpsjHXmcJfpwS5Jm4NCNqlOTHTmFwOan2WhodfMseWMqRfhCemZggbYzqz 7VrQHz0nwj8akg4dWIyw1l+bYa6U6AJgGVwylG6q5Pk01mn7Wer6h7iZb4jKk+qQVFNz 5QkKR2xxS/+Li+0nVRU5dx+vAd5/7geAmczSAGZxg54RSMcPDep3NFhZ+qM/pftS9vgI Y1bFE+UsqW6o/RRfNZOo635gygZvLjgtNupsUvHQuEcxtF6JEH+WD5TySIHcIqy8popo Va4A== X-Gm-Message-State: ACrzQf1h+RnkWUK8otbkFux8A/ras9NfOZrxC206EnnghgFVtNgjMQfV H0ynS/YvGN0DhRy2z3l/35d5rjID3Kf9wQ== X-Received: by 2002:a63:6f8a:0:b0:439:36bc:89f9 with SMTP id k132-20020a636f8a000000b0043936bc89f9mr1288835pgc.100.1666991694115; Fri, 28 Oct 2022 14:14:54 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id e11-20020a170902784b00b001730a1af0fbsm3488563pln.23.2022.10.28.14.14.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 14:14:53 -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 1/5] platform/chrome: cros_ec_lpc: Move mec_init/destroy to device probe/remove Date: Fri, 28 Oct 2022 14:14:45 -0700 Message-Id: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 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?1747968095115515140?= X-GMAIL-MSGID: =?utf-8?q?1747968095115515140?= Disregarding the weird global state hiding in this cros_ec_lpc_mec_*() stuff, it belongs in device probe/remove. We shouldn't assume we can access hardware resources when the device isn't attached to the driver. Signed-off-by: Brian Norris --- drivers/platform/chrome/cros_ec_lpc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index 7677ab3c0ead..0b6c7c912ec7 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 @@ -456,6 +459,8 @@ static int cros_ec_lpc_remove(struct platform_device *pdev) cros_ec_unregister(ec_dev); + cros_ec_lpc_mec_destroy(); + return 0; } @@ -586,9 +591,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) { @@ -615,7 +617,6 @@ static void __exit cros_ec_lpc_exit(void) if (!cros_ec_lpc_acpi_device_found) platform_device_unregister(&cros_ec_lpc_device); platform_driver_unregister(&cros_ec_lpc_driver); - cros_ec_lpc_mec_destroy(); } module_init(cros_ec_lpc_init); From patchwork Fri Oct 28 21:14:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1050495wru; Fri, 28 Oct 2022 14:24:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6v3fBrUBJx3I2ZD5fO6+wKex27+og/bGG66klF/Dve3MD2GsTaKmzHFyUy1wgyoYPo6TvZ X-Received: by 2002:a17:90a:df04:b0:213:1cf1:435d with SMTP id gp4-20020a17090adf0400b002131cf1435dmr1327990pjb.210.1666992283639; Fri, 28 Oct 2022 14:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666992283; cv=none; d=google.com; s=arc-20160816; b=HkmPTlWaQv1sqoQcqr3dgl63vfcN8cwRemfQrajcCCzI7pvuEm6CprlqpyFSGeTa+5 cXGQUn5hBfsTYu8QsBv8kPxUjzg+PeIzYiqQiltPZ7MHZgXDgxhQmH463dk5hhJwM3Yf rRS4WxRpkvANz7VsIL7hx/rYS/HPfvqxyZJFqTnIgzGUMCaLf3cWayH3bf8+0t/vqJJI VSeWnVwNUa+FZzCNRHrRYzqUc0Dx+wFC4jI2lvfG4+LpHx45How/IbnZPcJ0cYbeJuT0 jmHT/Ad0iSZ37FOIa7FzLXKLAbr4Wa2pFAGkq0ioEMCOkomyQi3nnTXiOQ238zxPnRBA Nm2g== 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=Ujrrf0uboQfvYL+QX/6R/v6yRcsPGzo+vWDkIBpQC3U=; b=uqkq+kM2fTYR+TZG8JmytQYVNb9StG7VgRiQrIgY9LpRWp8OI9XOB9xv/MwN0YJou9 MH2RdQdgqtkyIhCWvVMmaIMQqKzhpI6smOryBc+waZezx+QAyoJyDKaerbZkPl18k+lU GdBsd3LAEjrUWrCAGXDhH49bi4Km8rLfq/F+sFSNwqriTEJKURoUv1EjEdvyx56SWUxN Q2qfPu62GqvleTlIMry9jU9R3BiipZYElo9X+eyrqX0cVQOfwpR0iQZtp0Si0ZJg4LsF lK7itXUEg84us/J2y2dQrBcmho5VxiudOHjbXPKw4OqQWKyWUSr/iPXNlWnlPULNl2UR M+1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hAMboiNX; 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 b20-20020a63cf54000000b0042aff6e2846si6111665pgj.251.2022.10.28.14.24.30; Fri, 28 Oct 2022 14:24:43 -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=hAMboiNX; 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 S229943AbiJ1VPK (ORCPT + 99 others); Fri, 28 Oct 2022 17:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbiJ1VO6 (ORCPT ); Fri, 28 Oct 2022 17:14:58 -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 00C7626106 for ; Fri, 28 Oct 2022 14:14:56 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id g62so5786903pfb.10 for ; Fri, 28 Oct 2022 14:14:56 -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=Ujrrf0uboQfvYL+QX/6R/v6yRcsPGzo+vWDkIBpQC3U=; b=hAMboiNXGwzfogwxNxk25ISfrCRUAyN7N3a6mSeDYroLEWBaazVzLEC+zF5fvgia4K F6xKEvTkHf3OzZ/LX7vRLmZOMCPETGhoptAdqfilrdBTeqytGpy25zvj2XOaBvJB6tNq zLwTDQjHsulpSbhRPP7Qx9mrR80jZr3sO4Tzw= 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=Ujrrf0uboQfvYL+QX/6R/v6yRcsPGzo+vWDkIBpQC3U=; b=Kqm1cf7xxS+x+Dkd5CbSxFpLDOeS0VFl0H3H+s9Sodf0gHGY8pdMous6GoSSU8fOiV KoiSyhHgVz6cnG84+d9cB5H6u7w4TQwhHlutw0UFJKsMOxgFPeV6ew2j3DJVmZhL5NwT iFP4u0G7Hp4sWfWxpOyJDKSbXJtTihLo1+UjSy4PoP3HXX6nRMtYJGVpt20kd3sTfp0u nvMgmqkPMMRIp0dEYzrLu1efZFyFJl7tZqDEXlFkXwKzpDojfw7xSnfVQY3bq1guG2VI dl5yiQn3niRM+Arrvr3jn8iAoNeaon6HOJbWu131Xnu1+zE7TOsH0K/hl4DsjLfOzI2I cmCw== X-Gm-Message-State: ACrzQf1KQvpZBoy4xV9WPEcEmbg2Og5RN0pH7vU7jzc93MH9KU0sGAB1 EiqKAjcz02JKV3YCZynNtM5/M9ciPgRD8w== X-Received: by 2002:a05:6a02:306:b0:46e:de86:8b24 with SMTP id bn6-20020a056a02030600b0046ede868b24mr1229478pgb.385.1666991695906; Fri, 28 Oct 2022 14:14:55 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id b15-20020a170902650f00b00186c54188b4sm3442109plk.240.2022.10.28.14.14.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 14:14:55 -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 2/5] platform/chrome: cros_ec_lpc: Mark PROBE_PREFER_ASYNCHRONOUS Date: Fri, 28 Oct 2022 14:14:46 -0700 Message-Id: <20221028141411.2.Ib1036816e77aba71ebc16b71f7615c55d054689c@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> References: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 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?1747968100683510315?= X-GMAIL-MSGID: =?utf-8?q?1747968100683510315?= 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 --- 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 0b6c7c912ec7..527092ffdecb 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c @@ -559,6 +559,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 Fri Oct 28 21:14:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1050467wru; Fri, 28 Oct 2022 14:24:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Rk1RcxK7pD9ij14/Am2IkVq8ET2ca0pvh1UujSL4eEONxw+9rcEuhiZBqhI6oR4NGKNKU X-Received: by 2002:a17:903:186:b0:182:ecf9:6227 with SMTP id z6-20020a170903018600b00182ecf96227mr1048316plg.70.1666992278782; Fri, 28 Oct 2022 14:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666992278; cv=none; d=google.com; s=arc-20160816; b=M2ilDX9b09X6v1Ezi9g8u/QxEXq40G7caHkBWjBKfAKGhQ7fvxrNH7EYlFJyyBtiWB Z+CIzlL0eojKTeCxD5CDlxw0gbzj92pPYnFDUGQcLVdBtX+lTRZtaMvNsl5z4jmUR3Xt enHzm29N/nz7CELITTVN6ZFv7vKvxNNM4P5WAZqdC5pBw84vqrwHvedmDLdFSwcdA8Yb oaMh9raosgUbY5i1dYINaQqMMlDL07tV37JvW3VYJomWA1sA37hPsoCAMsz2uCjfhLSu MaXIyuvaaBBMOFW2CncN1Xgw00DF0exYokfuZcAPWyL1TXELq+hmG40sf96YNOJ+5hLf HlLw== 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=f26SHUDCKkAMIj7hIK8sG1Pls1nziet6vydLGNnOxd0=; b=0h/RxwqXHhI8odFcoWr4Vd6xnvMj5DYVAyt7MAB2Rpk6g4XtEO6p8GMd1Hmh27Ud9D 3t36MS3bkfrBS2ZXms3QgSfLcXe2iSQwS/x2dNCoF6Sn/M6wGyX3/Xv72NpnNLQXttyh lViqE9Pke2QuShasfsFm11vVpDPZCRBDMnk0vrytGXP5Rovfg/ZdruBWsrjWWu7TpZtW kKoiYB2Zhy8I+Qin5gltUtl+l59LU3WbE8O3j5uxCTM6+rbERECUuxLWvqCcbfGcDK14 VtxxvHyrLXo/QCPHZLunC6ZAhEKc9SrZ9z+yC+M/OkDXDHb+BcIhSu6S+2h8/bLOsEuN ubkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="dnA/a83r"; 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 w4-20020a170902e88400b00176b26d519dsi7398062plg.350.2022.10.28.14.24.26; Fri, 28 Oct 2022 14:24:38 -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="dnA/a83r"; 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 S229911AbiJ1VPG (ORCPT + 99 others); Fri, 28 Oct 2022 17:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiJ1VO7 (ORCPT ); Fri, 28 Oct 2022 17:14:59 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFDB71E3C3 for ; Fri, 28 Oct 2022 14:14:58 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id 20so5879220pgc.5 for ; Fri, 28 Oct 2022 14:14:58 -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=f26SHUDCKkAMIj7hIK8sG1Pls1nziet6vydLGNnOxd0=; b=dnA/a83rQeSZKqvN0pDy35114DLlbheKhA+37bGgVqAQUo/ykSu5Dq90/g3KNXN3SA qUf7BV73LW1eznwf0UQAlYOhfp//Utzl95cSmthb0sq/HG4YonuX1S4YCSmzrn4Par2v EVCCwvkjD24A6toOel1z6pvMXJvqQCpaumndY= 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=f26SHUDCKkAMIj7hIK8sG1Pls1nziet6vydLGNnOxd0=; b=IOkY/UU3aY0TTjh40K4LUrKXlfTwaS77khvFIJYRD4rZqM+YyoqVrVkruHprwUS1l7 SF8u7W0BykeAysiNbHKl6mJCG7oYosbv7/ZOwU5INvN9T2iLsFLx8ePwjLqaoZHT4zpN ksXGoKC59mQpUjjqQ4p9PFepHMi8b//Txub0MhJzypkzoO6p1Rpl/Bx5DXzhV6X/YQ3q +5LFwshnXBstr596tA9sxhivLaVD2v922LFe66PDfJFqOZifjL6iVVyNmtqfpa8PyvGn NuMuUdSunSckW2onixJ2BfLWCiVUZb5CPe4PXzGPGODZ9N89bzCytTRcH4/D2RsY/N9B Jalw== X-Gm-Message-State: ACrzQf1mzf858+kZeYDCoGcIpEjczvGI4sAUMD4NaK5VgfJ7J4Zsa8B8 4ZXcxmU7YUDk/j9DgbpEy5Zep603L1nSnA== X-Received: by 2002:a63:2b53:0:b0:439:34d9:5d47 with SMTP id r80-20020a632b53000000b0043934d95d47mr1252271pgr.283.1666991697681; Fri, 28 Oct 2022 14:14:57 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id m2-20020a170902db0200b001868ba9a867sm3498561plx.303.2022.10.28.14.14.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 14:14:57 -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 3/5] platform/chrome: cros_ec_debugfs: Set PROBE_PREFER_ASYNCHRONOUS Date: Fri, 28 Oct 2022 14:14:47 -0700 Message-Id: <20221028141411.3.Ic9a4f378f73319da323cd55940012fa6b1de24f4@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> References: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 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?1747968095814389586?= X-GMAIL-MSGID: =?utf-8?q?1747968095814389586?= 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 --- 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 Fri Oct 28 21:14:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1057107wru; Fri, 28 Oct 2022 14:43:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JP43agSrbv2Eca/KuO25szLdRZSpWuzFwpkUaNSAm1lly2gSxXfh7QyRbalIKUg0yx2oI X-Received: by 2002:a17:907:6e09:b0:78d:a326:49c6 with SMTP id sd9-20020a1709076e0900b0078da32649c6mr1242660ejc.507.1666993380039; Fri, 28 Oct 2022 14:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666993380; cv=none; d=google.com; s=arc-20160816; b=zXBKP+6imX2NFoMg+g8Hs2UOuKu+JVhvujz2AOMPzbUKHJV3KpWuCyP1Ctlp5ePssO r82Ix1FXfaYGcdnq7KWbSYrJO4dDnrzFUJFFWAx6K7sJa0QICbpxw9MEJ/i4JORJptfk 1CyJwSc39mc8xuvCVfDA6s8ERVP2e6oqemLbLTGUjETzvRAqRaoD0fGWZDpS9WqBLAXm 5VXEWAupsp+uoBa4THk1OtyDgw6h1oBz+M8BdyTOg3NJzUNua6SEXdNO5yDDkXv7lYDB iJfftm0RC/AEuMPS2f1ncEjAGGCDsNsRffTKF3sQeUxs8fCEqrVKnW9OUV4gfogTGwzq zs4Q== 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=ZPP9pF7fIvV/nLcvOx6oDjBVViuf9MAG5n+X6Tj0h3Y=; b=rsemwTIiVmrcPSE+A3E9TGq+zIf3Mm2m4O4rnJeItvxIYe89fpvK0nhboTRGRHk06u Bk7e2jcCJ+U9NMqiW8PsymXDVENpen4U5gl2WdF2/MBpDPVQLT71GoS8r/4cO2l7UgOb /3cmMzuOOTZh+3XZ8JzSDpEEqdZ64v2IC8ZCr6eD37Ep+aG1d7IMu3Mora2LdTXxlwL+ teYgKQssdbcEzOsC6jA5u1gX8PgJvBNQ4r2+SXv7bVWtCUYVFJeKl7rsDPChcf5Pdnup aGjXOapf9KVmLXuWkdx4qzhzcfyB0scj7JXdUgXwGuBccfEaO0sy0IjGF2WjHifrkggf 5o2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="ZW9XW/Gf"; 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 s3-20020a17090699c300b0078c5f3569aesi6717989ejn.69.2022.10.28.14.42.35; Fri, 28 Oct 2022 14:43:00 -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="ZW9XW/Gf"; 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 S229971AbiJ1VPP (ORCPT + 99 others); Fri, 28 Oct 2022 17:15:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbiJ1VPA (ORCPT ); Fri, 28 Oct 2022 17:15:00 -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 D5A4313F22 for ; Fri, 28 Oct 2022 14:14:59 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id g62so5787012pfb.10 for ; Fri, 28 Oct 2022 14:14:59 -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=ZPP9pF7fIvV/nLcvOx6oDjBVViuf9MAG5n+X6Tj0h3Y=; b=ZW9XW/GfmujrJzDszG++/tJuCMwJBY7sSL2UrozY9KqH2Q0vlWzgUTXD7vpYtObRm/ 61xOuFMG+ZzrULCo/W9z8JasQoFrm6Dg6gHxExJyQU1D1f4QjBpE7oLrC23Jqd63ycbX obYJUiuItCe8/7dqWy6i77dDUD6hvr7XAIWsQ= 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=ZPP9pF7fIvV/nLcvOx6oDjBVViuf9MAG5n+X6Tj0h3Y=; b=YPEHVvdYGe/Z0i+QPmsIYp9thfrOQXkImjVIiYCDfqVl12TxkwkTcDW7+pIMWu9SJg PYSYylEf8o4QukVP4MLbHQaVdbGOS7o6f4aZQ7ERTfkGqP+EcajKnkr920ZHCFUWvKaL y8osxWLCuzIu0z0L6GMmGX08ngdaHMo5YAE1L2Nxiuqqt5hb6gbQ/2/TLPUyd2m9Vz0b ESnIbxW/Gse7ZpuA7klhUAo4KcyrnqLm/vZ5EeE4GzEu0APuk8Yte7Rpp2K9bUdrsdtm nf89Xzz2LJWxsVr6/wsV/uSa6tA5GyUxTb03GLfKMKZgngpwg1RYLD93o+LI68hV+D9+ Xj7g== X-Gm-Message-State: ACrzQf2xjOI2KZyty2KB0nLT2PjIUYsOPAiXqG86yRFn8WGeHjEpyu/3 auzSRzU4BcHi8syagT+X4DsIHg== X-Received: by 2002:a05:6a00:1749:b0:563:8346:12e9 with SMTP id j9-20020a056a00174900b00563834612e9mr1125101pfc.68.1666991699582; Fri, 28 Oct 2022 14:14:59 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id jc19-20020a17090325d300b00186ae20e8dcsm3415829plb.271.2022.10.28.14.14.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 14:14:59 -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 4/5] platform/chrome: cros_ec_lightbar: Set PROBE_PREFER_ASYNCHRONOUS Date: Fri, 28 Oct 2022 14:14:48 -0700 Message-Id: <20221028141411.4.I565598102e0bfb03bdf8c090d3bfdf954d026bc5@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> References: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 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?1747969250657565029?= X-GMAIL-MSGID: =?utf-8?q?1747969250657565029?= 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 --- 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 Fri Oct 28 21:14:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 12568 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1056504wru; Fri, 28 Oct 2022 14:41:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68+jMf7dsKF/IQBB1ZrcU7kaciC3ZyNmLW6CcjZ5DU1Ev8wnl9IRJf4FB+qjACY8oLxu2K X-Received: by 2002:a17:907:60c7:b0:78e:1cc:57de with SMTP id hv7-20020a17090760c700b0078e01cc57demr1238247ejc.33.1666993274152; Fri, 28 Oct 2022 14:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666993274; cv=none; d=google.com; s=arc-20160816; b=gVZ0q/wt1aXcUcRotLmzme1mbY2rp/v37emR9KXKjicNEdrvEWwzo3PQ/S+1Jyv2t7 YW2s1hpII7Bm33yCWIZcWN9wQRb3PomoUFaqgv4al/tHMhB+fRGvOfp3w1hjCraVDnPF fRJQzyZjTDwE1ECtbew+8C7YY8De//V8hd8x4I6Izv3RO1jkF7JaythoMFAn7tnD41mr nHT0xLeyc8Fr1vInup+SGqd//jc31lNFqdHTqWcmvnRkS1dJoyDDfUG7um1akwtZyfgw S7RB5yktihbk78v/2t4R96uUmW27ow9W0y7dpGy6ODN6nKXp21zdgFW5AMCHhSWIs059 6iIA== 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=kCN7I+EqjmDeqN4ZcXaijeJfrEMHUPCGCQAvUPZS81M=; b=c4qh+nU1ddL4HH88iFBcWrjWnbaKl9iVTMEkNGc8adSuBN8Vy8uo4kvku+/nIE95Ok 97Ak7Q/hUmldTykOM6IlrjCt+fPh4WaKrPKpKkay6y7XOtiJFgpOAT4nvb6umHTCY3J1 TOj/cMHCkBab8UFlSQgeH/+T6KlnDlfg1YyLWrGBc19kDfj6FxLwdpFHd5VkfJklDvYb Qd5mcULf4+62dhqZkIBbnxpWWggwbDR6n0rQLLzTcvLSj4eC/qoirGhQVlZ/vuBRekQs YGeWnYI5ZvO4UYQ1iPYkO1VJAT9qmuUy/kLMc5E0ChHAsGCdB7gLpYcHQpzlYXWUoPhI sIug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MRFIWNNI; 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 y18-20020a056402271200b0046125ddf5easi6311690edd.185.2022.10.28.14.40.50; Fri, 28 Oct 2022 14:41:14 -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=MRFIWNNI; 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 S229954AbiJ1VPS (ORCPT + 99 others); Fri, 28 Oct 2022 17:15:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbiJ1VPD (ORCPT ); Fri, 28 Oct 2022 17:15:03 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E92813FEC6 for ; Fri, 28 Oct 2022 14:15:01 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id s196so5882130pgs.3 for ; Fri, 28 Oct 2022 14:15:01 -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=kCN7I+EqjmDeqN4ZcXaijeJfrEMHUPCGCQAvUPZS81M=; b=MRFIWNNIgKHBvh4unQXvkUv/KnK3shaSHRyNpOREhOzFu8iGl+9o5tQiSQV4eDXNOM uaH8au+EGSgrOD9dvOLB1t/fra8RMeTVP8KcZgWLqIY6XBnXZky8nl+td/g4Yi3osJ4v SxOLmmOQIFljRPJ9HF6N0fH5sqhc4YdW8B48s= 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=kCN7I+EqjmDeqN4ZcXaijeJfrEMHUPCGCQAvUPZS81M=; b=2Sgr4qNROKvbW4wqxtHfHzYv6TRP3aY0jCu9tu0aC424NimBp/UcUb7gNo/M6xQ7XD SiR8RsU2ZW4SaaS/k0BaIBQIgOT1klVsAqyKBN2jYTpK+udgjW37LzY1P/qllryeSSM0 SZvzWTDkDydxMbk+Tx9KS7uQsuKBL/AtxT2CXxJm8/dHizfNZI6pWfjgDCsYbKQd0JKJ 1oLJDkDzSu3gykMOS4WTv1rsyEZKtqD3u1z3VezSgioR8ROsIqckteSxC4Fq9X/2FWQ7 UX/WFP0jeoBZ1uHmwJXjKiIy1hKnCLgih8hz8iGG4wTdBGyCCD0a14oHqpcAaKi7MAsM j24g== X-Gm-Message-State: ACrzQf1NMwc+OpfRMltMaG6CCRcu4Y3dHDxplvgrUyGcwWlUjI62jb72 XKuTy0zz36t2NFprd4a3XVYXBg== X-Received: by 2002:aa7:838a:0:b0:536:101a:9ccf with SMTP id u10-20020aa7838a000000b00536101a9ccfmr1065977pfm.18.1666991701429; Fri, 28 Oct 2022 14:15:01 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with UTF8SMTPSA id b15-20020a170902650f00b00186c54188b4sm3442174plk.240.2022.10.28.14.15.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Oct 2022 14:15:01 -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 5/5] platform/chrome: cros_ec_spi: Set PROBE_PREFER_ASYNCHRONOUS Date: Fri, 28 Oct 2022 14:14:49 -0700 Message-Id: <20221028141411.5.Ia458a69e1d592bfa4f04cde7018bbc7486f91a23@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> References: <20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 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?1747969139568282860?= X-GMAIL-MSGID: =?utf-8?q?1747969139568282860?= 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 --- 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,