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: 13024318 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.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 9F14A122AC for ; Fri, 28 Oct 2022 21:14:54 +0000 (UTC) Received: by mail-pf1-f169.google.com with SMTP id f140so5827935pfa.1 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=ZkZoC5qFlHtzm+aKDqVE7iEll2bbSxSkr6g2OcMCjs1vH9AuYKoNhahZ1GlOulSUBM 3Gu7dhyuGIemfI7CFK2iuPbR514nQacf/RCQU96CB8Wp8Zdyrusy5+hmPGZ4FCmsCKAb KgIPi4bjQqutGmCQ7s2Wmp1xS2iaq3/TM4jgZOzx978nDISFTrGfqUTiPFWjLa18gLEj N14+7bgtcxldVtFJM+QkuDCOk2Vbtl2eM1+jshhUJT7thqu4rkVhrKKANTNuQNDqxX9G RrYe1iNmD/s8Hh6uOwlDGZHMayibaTeFN32lD4LuXZ9Wl1Ym+jgb2VkX/275xlkFwaxz bZjg== X-Gm-Message-State: ACrzQf3thzteNeuo21Abg0/a6+erR2Dw82j0zF1uQGbx2aw6mC12Mciq AS3A56JnQMHtmsie1CRyAZieJw== X-Google-Smtp-Source: AMsMyM5dm4sViGbezswQdxIY0IxcARdKyR1X9ojMOI/nshFvgxzed7XYfToVM/XmU7i9nWrlmuElEQ== 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 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/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: 13024319 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.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 73AD41FDF for ; Fri, 28 Oct 2022 21:14:56 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id 20so5879166pgc.5 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=FOcLM2NGWXnZXgGNNYKsdkBGyBae8yJnlMx+qSzksvUYVI5UDEpcobuGkLcIgBrfVr SmSkocb7jSztEM4E3UVYhcL5nEUo9OCB74iUdXiY10kiguf6tfo2Gt67m9hRufoYQt2h 2idm8glCXDNKvKAiDWXihb4Z1fO+O+Gpw7hPw9KagpEePkCEGpZIWZ0AVdlJEPwbgs6Q yga84w+G/gZsjbgocJdTtG5BZyJ8fbp68y2I5MroCPdiA2AqJTiukWkbri7scr+ruQDY qVZrOciNuJ2zoweAkFRPWMpIBhetUNKhrfEXNeL78Yys56wd7plVNOzudGJJY9JuB//y 6rfA== X-Gm-Message-State: ACrzQf1K2+wzgSeJIUlCFbtVuXeUxW/fpqymwyb78UOo85TBoUum4yJA o3g6BvFOr5eBvo3Beb+PaSK5tg== X-Google-Smtp-Source: AMsMyM627qTuk0xQ3BfrSeQ3eIIkKsg3SThpR3lEHmzy3WNO0/wNh1VdWV0JXv/sB5TdAaF9gm2wNw== 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> 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 --- 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: 13024320 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 3755D1FDF for ; Fri, 28 Oct 2022 21:14:58 +0000 (UTC) Received: by mail-pf1-f170.google.com with SMTP id y13so5794337pfp.7 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=F4bpcZLjli0R2rwLJyCh7FvJzmsxEQNvZbqsSOq2y7P3lnoa6JiZmD31AbHMKSYnz8 dZoA2hQyRPNgX/fL5JFemZzGKsiv4F8PAOGObmQnwqtzvuHHZM9EktshB6l//M6NB4A8 uAAZxDZT5CCV96XH/wXh9qm37kxI6qXQNttDy5wMmFZvZ34zlR5s30qCWMnjZdBpYPdF 2VQvxivKqqHJy4GN8JvjDHg7jmv0n6UpU0B6Fk4R7Bp9biDUC2Em/jXEJtfblhsinASH M84GBT+DIKjpssNv5zpahap+xHJ89+Vq1p8UHGg8zrxWbHQPprIW194C5wunA3l+Blsq 1gYg== X-Gm-Message-State: ACrzQf3wtyrCjymkI42znDXZZ5vENyj2GMgIeGodSYQUtU7kazhbiSCL TLiLG+uqm9hOkW8j7y9SfCJGcw== X-Google-Smtp-Source: AMsMyM6zCYGK2VO/1jnIMbAxM6UrX9tbv4zJkSlVOMF9+ietep+0xrHrZNHpu8x7NqXFmgBwtWFoEw== 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> 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 --- 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: 13024321 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 163551FDF for ; Fri, 28 Oct 2022 21:14:59 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id d10so5800396pfh.6 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=26K7ZdvrvgzOet0+WqdKOxj0k13ltl7jdhcLIekZKHbOuu3j2xXxS+pSmphIQXKgSw h5w0Hlw67bS78IwZoP/LLibnW5lvpJgbglNsHsVPEvDowr5p5yrRy8T32szy9bG0Krry /AyReFtJNVFlxdGY3aFZ3N3EWkYL+pcFmbtSAQvyTpjt9ZvD8BOBCjq5RVZZGKQU/qqU avQDz/H+xQduwoQoIzwlylGiOBQMussDgq3j2UvOapOsgs95mgNFZczp2LYOgUGG/RKR D06Ss8OzU8MthlYsmChSJmfmHMKSm6h0Z9Jb9bdNqQI/nM+spDosDqBqjNItQOHBC8qj v0ag== X-Gm-Message-State: ACrzQf1PX2ImsQYSciG0P5aySRBZqM79RMtZRhhqUfMOywSGUJGrB1iE /vAGDRREA/QTVEX9ieA69hqtag== X-Google-Smtp-Source: AMsMyM6ePtsEr6bhRuJOE0O5l6NLMbLUbjQQgLCds/0zyy2pDwvRkeYSpVxPsE++pdwZHk+dQWXyEQ== 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> 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 --- 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: 13024322 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 EF48B1FDF for ; Fri, 28 Oct 2022 21:15:01 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id 130so5802916pfu.8 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=og2tqgqAsfHdDJ4DY00sKzezQtRHAqSdt4z2LiyagbWXmNQmEVC5DTGunDCii7WPXB VHUw6GjuwihZcD8gS0uduHIDiSEGSb48QyzO6iqBYEh1GGrQ+BvN7N/8axj3u6aqr8lE OrVSsa5x6jUfHEmvrhKj7hSc1gV+b34WPaBrc1gdKsrYoef8QzHaqsIg5E5sFbFcr1oK zR0YJHniuIx7TsmCSF3mb22krYhN4zNolr6JX8q9/E+hpK4vo1yupjEE2KI7+tN+ZZuc KhEr2PWfHb4GtskPcL8qBbflKR2QtAr5AWR3TE7I4hT0AawnE30Gzzx3mXQjhrQZXicu Yk8w== X-Gm-Message-State: ACrzQf2v+72MtAYnFzUbYPK/ZKQuWYZVCjQxNZrcnWKqdDlEKZBgIf7t 0/Mmw2CpKMB6gbTSZ9MOp/Nn/g== X-Google-Smtp-Source: AMsMyM7MS/OMYYDUX0lkL1LaQGX3qWIrIMDAcIQKUccoDumeeijHos49DBizdRWuNJAhXdV0+TDFsA== 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> 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 --- 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,