From patchwork Thu May 4 07:57:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 89973 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138362vqo; Thu, 4 May 2023 01:14:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hjFnyiqu3hFlQOC3qsK7mWPHykuojtHE66sH03Dmft4ptknNAOEImyJVc2tA4nQU8gr+4 X-Received: by 2002:a17:902:e88b:b0:1ab:1241:f671 with SMTP id w11-20020a170902e88b00b001ab1241f671mr3342205plg.29.1683188081936; Thu, 04 May 2023 01:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188081; cv=none; d=google.com; s=arc-20160816; b=wE4yKJHLSUboB30iWMygI+gJ4f2JSsIeODsV79k+dwaZiVdB26siZG6e+zykhmY9my vG97Et1rkd5M16z2fXjkkg9RAyNzE/a1ErnH6Qo5U8BatOC70gpbREw2/7gg6EV4Gjhc 3AhUjbshQoDDc4tPYsP9l5Htn6oHyCUDEtG8gk/MHuPRk+RKMwkdl2V9E4VYZKdlJrbJ oQfUu5JiPtoWCtw2FsCAZ4VQyAMMyqgrhtTaZh/dgpcSNkjEeolFTlUkp2JTvpcGwDvd LMNgRC475h4hrQ/IiVKAnbYxO6XBkj+V6gx++EjO7QO8K9qbEqmT90d7yMzxl1QTso21 F1Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=o9ZN5Kt7PzcLmeQSM4/6ILQKH7duKu8J3KsFC8gjMWY=; b=JT1UTNhJ8il24UflnC8ZjqTLYMTSrAerFCTJIQnRAeQ2lAncLH/h6pVs7qy+2Y4pPV QVI1Pk4A1cq+yrXqQp1GjB2Hc8qmbZyZh3EmuY2gOjKVJRO8xklj466MTT/dPYlxDC8R flyeF+ZFJkfKERF3ERDG5qfq0YFsWreVtvNg0n/emoLj4tXWr9AAznk4BFiE6w4a+Wlq EaBZ5VSKGCqZeqXMP8bVkUPU78b8Fb0YMwClj1PXGSPYAgYEL5qTtmjAbrQ8sRFnfJDy qyeK7NmmUiu4f27R+iG019MSAFGzT0+AuoxquuDtcVAgDZ2zDODqbfCb5RHqoMtlHu7X QsXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=JPYlVAlb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ju1-20020a170903428100b001aaedf8d047si9788614plb.354.2023.05.04.01.14.27; Thu, 04 May 2023 01:14:41 -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=@gmail.com header.s=20221208 header.b=JPYlVAlb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229829AbjEDH5b (ORCPT + 99 others); Thu, 4 May 2023 03:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229836AbjEDH52 (ORCPT ); Thu, 4 May 2023 03:57:28 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6D4B3C28; Thu, 4 May 2023 00:57:26 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2ac80ed7f26so1129701fa.1; Thu, 04 May 2023 00:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683187045; x=1685779045; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=o9ZN5Kt7PzcLmeQSM4/6ILQKH7duKu8J3KsFC8gjMWY=; b=JPYlVAlb7y9k2cIrdQjpuO+2COC4kNkXF6Hx1ptRVANh/ZvtZFxr23P/He+hDFSkiH SOGXfClMVcDWrriuiucKMoEzuLEnggFDg6bpr9kjXCQe/NCIQzT+H0I926Y/hmju98/I 49jqxUOZjL5qMKXPFLZcbNQ5Czo8JOCXTOnNKG7IMKcpQezGeFzhzCeu3FsetjNDGJl6 MWM6LU+8+Q52j+FjAqpwkCdipVCPayn0shXvUeD8qLS2RV0JIvgAYkF2gFd2cIHrKF0e /IyQ/QQnHn0d3cVtJwyGxT/KU+KVW3Gd3YzjBSMeeod+zLyIs2q81AlqZG86OqrigTGW mMgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187045; x=1685779045; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=o9ZN5Kt7PzcLmeQSM4/6ILQKH7duKu8J3KsFC8gjMWY=; b=gZWqsAPnHRN5OntHaxoEcirI2NLRiRgSeeYnmIMmEgeoulzURXk84HS6Igc97tA6n+ 8wf69H+UhY9fhB0yWtu3t9h4cVek0iIF7BrB5yz5Ye4v6bMe/94EsOIEpREKKMruWwLP +U69/i1hHeXl50I/FpzJNdwv12QUIy14xWTAfaXWSeXvf/uQb0o7U7w2J0qniiXJqFpW xnucdLetHpmhfYSoao1jADnnmGs6xFe5nbXqVnqxfsKf0UwFpWf0e0LNx7MYiJIgKD10 e/VmvOnMoiY93Wpx42rkAQWT6ni68CKOEGwuSbG9P94NJAQCJVAZIHVRvLRnuTIoCm8O 5yYw== X-Gm-Message-State: AC+VfDygrPtSAf0GIbp6BT31sK+IqLgXQ++sKhhLZ5DmXYABys68PBd+ P7hXVqLt+KOwlpGTbtYlX3E= X-Received: by 2002:a2e:7011:0:b0:2a8:c32d:1238 with SMTP id l17-20020a2e7011000000b002a8c32d1238mr699739ljc.15.1683187044986; Thu, 04 May 2023 00:57:24 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id u22-20020a2ea176000000b002ab1216de44sm5062166ljl.71.2023.05.04.00.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 00:57:24 -0700 (PDT) Date: Thu, 4 May 2023 10:57:13 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Matti Vaittinen , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/3] iio: bu27034: Probe asynchronously Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1764950626411327436?= X-GMAIL-MSGID: =?utf-8?q?1764950626411327436?= Devices which may take a while to initialize during probe and which have no strong reason to probe synchronously can request asynchronous probing as default probe strategy. This can speed-up start times on some platforms. The BU27034 gets probe delayed for at least two reasons. It enables the supply regulator, (which is likely to have ramp-up delay if it was disabled) and additionally it delays while the sensor itself is initializing. Changing to asynchronous probing may cause problems. Some of which are discussed in: https://lore.kernel.org/all/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk/ Enabling async probing for the ROHM BU27034 should be fairly safe to try though as there is no in-tree users for it yet. If the async probing appears to be an issue we can switch easily back to synchronous (or better yet, fix the actual problem). Enable asynchronous probing for BU27034. Signed-off-by: Matti Vaittinen --- I am unsure if this change is 100% safe - but I don't immediately see the harm. Please let me know if some of you have more experience on problems when using asynchronous probing with IIO devices. --- drivers/iio/light/rohm-bu27034.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/light/rohm-bu27034.c b/drivers/iio/light/rohm-bu27034.c index f85194fda6b0..183cf550af13 100644 --- a/drivers/iio/light/rohm-bu27034.c +++ b/drivers/iio/light/rohm-bu27034.c @@ -1500,6 +1500,7 @@ static struct i2c_driver bu27034_i2c_driver = { .driver = { .name = "bu27034-als", .of_match_table = bu27034_of_match, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe_new = bu27034_probe, }; From patchwork Thu May 4 07:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 89975 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138397vqo; Thu, 4 May 2023 01:14:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ51hqwr3T5xNd+Bn9S3hq0kw8oJBldHjGGn8xS+qRB0mclA3pTGyVpMUV7q/HrtQhNDI+3S X-Received: by 2002:a05:6a20:394b:b0:f0:50c4:4c43 with SMTP id r11-20020a056a20394b00b000f050c44c43mr1540891pzg.5.1683188085602; Thu, 04 May 2023 01:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188085; cv=none; d=google.com; s=arc-20160816; b=KAMvw763etDWwcO6aEH1D1OAB0H8+VqKSK7VAwO8UIZgD+dwxgMPL7GeTbh/9R1QLp dRU3GbRwAjMtjbdztvexk7CIuz4padDmBQy8gW+rhRXHCYvFQj1c03RXM/J35sB4d8JB u0PocPxfGFm0SQpyRrYcNkB920BI168a2sLcLQNayILXm7fxWPbOjclvxJObyiUcZZDS yG5CiBSvRtlK6owy5+i1VdwaUNW2cB9Qx33CN7bJVp7HlkqFFu74XrEhXQXk0C6sArxh 6GgLGySWUgo1VJTi8SnFPl9y/7bzmUGTKKkRsg5LW3JqwwlhTa71IzYs9TNEwuSTnb5m 1z4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0vDKtd+6SUBHcVfjrnZzqsHHwPGA/V8JOv73WPDoiE4=; b=HjYTJ0ZnmtjAhkJCTgCgotTGYBDQ1++d9yk1GXTn+w6eH7r5YG3i9hJhu2rhaRqXhu rJbjhQ7IFk2FYZYuvgKnQ0DdZvT44VjT4o0PsFnLUArL/hzM2QTHGEvfP/crFQ0Y39hX 2xmqrbvFAs9AT3Qyi67Kj9EZIRGolIavDrBoNqktHIdLK4gZT4r5nLAs0Z5sIF7kPfJe UpgNGHltEQq76zX8oNS5697HHkasPKcwiPFb+wGMoCWPhhO55jROojm3tjfg69AQrolI KDwwTmsnt45lvKlJwW3xMzVhu9tCu6u47zE8m2WhvbhC/7nGYihr5OK7OMyuEfoaPPSi mG9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=nA4WQdOO; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u130-20020a627988000000b006434d66782bsi2909056pfc.321.2023.05.04.01.14.31; Thu, 04 May 2023 01:14:45 -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=@gmail.com header.s=20221208 header.b=nA4WQdOO; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbjEDH6R (ORCPT + 99 others); Thu, 4 May 2023 03:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjEDH6Q (ORCPT ); Thu, 4 May 2023 03:58:16 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A1489D; Thu, 4 May 2023 00:58:15 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f13ef4ad91so175615e87.3; Thu, 04 May 2023 00:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683187093; x=1685779093; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0vDKtd+6SUBHcVfjrnZzqsHHwPGA/V8JOv73WPDoiE4=; b=nA4WQdOOsCPmalSFyKz+KFUzbknl9LGS6Eh4MVg/QET5MVLdgvLYiE34BQo1CcK19P OcK6Wfh1f/nmblaxU4LPSuoFk9RUw23nzy+1ILpO5+LKHrlP2okBc0xICCIh1CEoEYFA FcAat/zU8DWZ9WAoLy/YKGthRyKKRVP4dH5+nQPrP04UqlF7AJ8320dDdWjkkDpqxpcZ oFRBrqkSx2getWbylqCy88Ql5nWeq3kO2ULE3tNZ5uhrDcRMmJoQrw5G0QAQ+VSDZMKJ ltF31ZOUe4HSXKi46ii8BppG8cxs+LVXTQ7aYA+8Fv0xmQim1p5mVcuoOf7bGnJBFsxR 5sVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187093; x=1685779093; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0vDKtd+6SUBHcVfjrnZzqsHHwPGA/V8JOv73WPDoiE4=; b=UZZgrOBNt86mgbZmLxWNOPa1C9woaZCICXosV1L9SUf+4x3yzwhu3nbyRuGtjWHQVL hxR9Kl90Pj+Y4/LYU8LYpOO3i1X8xX1D9eH93rYznRvsOuBEKYxubOgnSuXwJ9+tWvtS bJoIevnd04q/NrLF9KfoNd4t13NrKSt0OJRapqBnrgb/3wfL1Hng5bs6bxGcNHyEStAc 13wsmgv8e1hPO0CSMgDE0SSUSmiSfZXFEEYqtPGamrP9quqspA+Grt6BT8Tt1oeYuVAz mVH/sTLXgQk5gnyrUsDWpA6fRtFbac6lAk+pMmdIOGjxVzp1lkbIw9xhYKl01+7IVaed za6g== X-Gm-Message-State: AC+VfDwTVPada46oCQC6jfsYEFSAMY3S5KQzwri4SrezVmdpIRVANRYo ohYrYdBhh2UZmP5t+fE99yw= X-Received: by 2002:a05:6512:3906:b0:4eb:2d47:602 with SMTP id a6-20020a056512390600b004eb2d470602mr1383002lfu.59.1683187093308; Thu, 04 May 2023 00:58:13 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id s5-20020ac25fa5000000b004e83f386878sm6392874lfe.153.2023.05.04.00.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 00:58:12 -0700 (PDT) Date: Thu, 4 May 2023 10:58:04 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Matti Vaittinen , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/3] iio: bu27008: Probe asynchronously Message-ID: <7cbc13bb62a0f6919366317991c5f451a0f8aa4e.1683185765.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1764950630059966045?= X-GMAIL-MSGID: =?utf-8?q?1764950630059966045?= Devices which may take a while to initialize during probe and which have no strong reason to probe synchronously can request asynchronous probing as default probe strategy. This can speed-up start times on some platforms. The BU27008 gets probe delayed for at least two reasons. It enables the supply regulator, (which is likely to have ramp-up delay if it was disabled) and additionally it delays while the sensor itself is initializing. Changing to asynchronous probing may cause problems. Some of which are discussed in: https://lore.kernel.org/all/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk/ Enabling async probing for the ROHM BU27008 should be fairly safe to try though as there is no in-tree users for it yet. If the async probing appears to be an issue we can switch easily back to synchronous (or better yet, fix the actual problem). Enable asynchronous probing for BU27008. Signed-off-by: Matti Vaittinen --- I am unsure if this change is 100% safe - but I don't immediately see the harm. Please let me know if some of you have more experience on problems when using asynchronous probing with IIO devices. --- drivers/iio/light/rohm-bu27008.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/light/rohm-bu27008.c b/drivers/iio/light/rohm-bu27008.c index c04d845062ba..628d17036bb4 100644 --- a/drivers/iio/light/rohm-bu27008.c +++ b/drivers/iio/light/rohm-bu27008.c @@ -982,6 +982,7 @@ static struct i2c_driver bu27008_i2c_driver = { .driver = { .name = "bu27008", .of_match_table = bu27008_of_match, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe_new = bu27008_probe, }; From patchwork Thu May 4 07:58:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 89966 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp138026vqo; Thu, 4 May 2023 01:13:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ70rCUyuEVbnEe5KRXb68HbfVKM5EeClUU+/R3p3pcaJbuJd+Xyy0vPuRNvEv86ElLvaRJm X-Received: by 2002:a17:902:e808:b0:1a9:8d57:6d6c with SMTP id u8-20020a170902e80800b001a98d576d6cmr3480352plg.24.1683188034561; Thu, 04 May 2023 01:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683188034; cv=none; d=google.com; s=arc-20160816; b=F5/kO04c0X98+7r4u45P9iFmQDAN7xTy5XpFv5VDOm25JrNUQ/2avcn7wv5uxjl2Ns jt4IPn/NWZNYh9pdhRHhfR1VlV/6MUTnaCZCU+r09/IfUs8otd9bEQHFFBxa3U6zyCFz Pn12P5agIVaGe9xNkUoX6BKzPtc/BUa8TlRBfsTy/Zd3gtX1D3JDrAMH8uUz6VBa7KVF QIvEaCXZJXrD4jrXWWbEf0pHg5vLSZlPfQz4E/SJWqCEpGdXZIu+K991WdNmmiBpn8M9 mqvlp6cH3G7M8hhJEytl7wwLTodXgDKVYjJNOOTV0394rZy92l2OL0vIa8KWoB4JdxPk JDQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BIF36cvrfg5bPNVRii+KXkGpKFjEd7XgQtb3zlxbdA8=; b=iM/V8Y8+FkR8G/UgC9DOIWu+6oCMz7W9UW6FpJKviMvAyIovEG60WBfXPpnu3cXgS9 k4sx0YuUrBMmLLyzCcgeqsJ7fUCQOd7WCoMyfpax6TnWD8LlHJgfERLx24SLP4Eag9qs Lhin29q+RSIueHH/6kw4opVzVSJMs+z23EvqLP7fxhOLE8xCGToPG9mDDPDHZImXKD/5 YIQlZWmpRly5vP55k4oo4IKXxz4OcpdNEA4aTgxlNXfH45ui5FgkiUbz1EozSvpUdSW7 5MDyo2Q1H967/y3mFwLBp9Lq/2ZAGgYPJr7AtJkJ/0RMhgJnirzZVczU+MevwM20vxaf ONyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=hx0RcCUd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a170902ce9100b001a9611cceb4si30920119plg.446.2023.05.04.01.13.39; Thu, 04 May 2023 01:13:54 -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=@gmail.com header.s=20221208 header.b=hx0RcCUd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229825AbjEDH7J (ORCPT + 99 others); Thu, 4 May 2023 03:59:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbjEDH7H (ORCPT ); Thu, 4 May 2023 03:59:07 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E124C9D; Thu, 4 May 2023 00:59:04 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4ec8eca56cfso184240e87.0; Thu, 04 May 2023 00:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683187143; x=1685779143; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BIF36cvrfg5bPNVRii+KXkGpKFjEd7XgQtb3zlxbdA8=; b=hx0RcCUdcJj3keFiQ1VmBrnDvoeRvWwOQYzCEHTk6t/7pQ1PC6VitbsB+dNluLDljq UWKNKhlOYILAvzzAEbs5AHJnKxsDEY5nHgsQ9a8KSpXhwNv+Zwcmp/zxgc9wZZ2Vmcun UpLbjyJltCgInvRAl+OEltTGfasLlL93JugGSFOT3zivvBwjMBps9XzApFAnjQKmfSaB GS+Lj/WdM+Rh1NyJqXCQQLRXlfjukBwxNBFI1GYcsaNvadAr4DbpnfmMGXZcQ7slEvEi 3VnoySHwewC615upD1zc/sCWY11+UwPbOSFeeuGR14my5ZrqeTGV3UM5uPxkb2XHRyfm WIRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683187143; x=1685779143; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BIF36cvrfg5bPNVRii+KXkGpKFjEd7XgQtb3zlxbdA8=; b=XDy/vc3XQdXM/ZCPm2p57tSsfLUMA0YKFiiycuVrqW9p5vw75nHMWpKHY3MPMlXeJA G32GOZMnBMQNPdL93i+eqlEtLzdkWccqCFZ4tbqElxBsbNG9OODFJIbJ1tZhnBsgNAbq AnXE73btmXzoq66RrpiiFVrKSflnC9uFoQFO99OZTBCByjSR5NEOnjGDqWuiiPb0LJvm Y9MUYK7tinLKAxWeuE1sEzQCLJmz4g0uLIuWqClD04DR4AOsj6Q5fXXoGwufYwvNX7S5 Pc229zFrmxspsE6FfCRTUlajphxP7auCd2PwQxHdQFkHmUlHSFSEz+JuWLFvcyP9NNSF dITQ== X-Gm-Message-State: AC+VfDwlFtHmbLAKP+gLHfrv8NzVl2LFZjnDRgMGGMIzqQ/S7XUJ2F4n iGwRkr1142v7+/5wl1drH04= X-Received: by 2002:ac2:562f:0:b0:4f1:44c0:b08d with SMTP id b15-20020ac2562f000000b004f144c0b08dmr229457lff.29.1683187143097; Thu, 04 May 2023 00:59:03 -0700 (PDT) Received: from fedora (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id y24-20020ac24478000000b004f11e965308sm2214506lfl.20.2023.05.04.00.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 00:59:02 -0700 (PDT) Date: Thu, 4 May 2023 10:58:52 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Matti Vaittinen , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 3/3] iio: kx022a: Probe asynchronously Message-ID: <24cea76c282a28b7a4dba297ab627176f8097907.1683185765.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1764950576164847803?= X-GMAIL-MSGID: =?utf-8?q?1764950576164847803?= Devices which may take a while to initialize during probe and which have no strong reason to probe synchronously can request asynchronous probing as default probe strategy. This can speed-up start times on some platforms. The KX022A gets probe delayed for at least two reasons. It enables the supply regulator, (which is likely to have ramp-up delay if it was disabled) and additionally it delays while the sensor itself is initializing. Changing to asynchronous probing may cause problems. Some of which are discussed in: https://lore.kernel.org/all/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk/ Enable asynchronous probing for KX022A. Signed-off-by: Matti Vaittinen --- I am unsure if this change is 100% safe - but I don't immediately see the harm. Please let me know if some of you have more experience on problems when using asynchronous probing with IIO devices. --- drivers/iio/accel/kionix-kx022a-i2c.c | 1 + drivers/iio/accel/kionix-kx022a-spi.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/accel/kionix-kx022a-i2c.c b/drivers/iio/accel/kionix-kx022a-i2c.c index e6fd02d931b6..ee982206e5dd 100644 --- a/drivers/iio/accel/kionix-kx022a-i2c.c +++ b/drivers/iio/accel/kionix-kx022a-i2c.c @@ -40,6 +40,7 @@ static struct i2c_driver kx022a_i2c_driver = { .driver = { .name = "kx022a-i2c", .of_match_table = kx022a_of_match, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe_new = kx022a_i2c_probe, }; diff --git a/drivers/iio/accel/kionix-kx022a-spi.c b/drivers/iio/accel/kionix-kx022a-spi.c index 9cd047f7b346..f45a46899a5f 100644 --- a/drivers/iio/accel/kionix-kx022a-spi.c +++ b/drivers/iio/accel/kionix-kx022a-spi.c @@ -46,6 +46,7 @@ static struct spi_driver kx022a_spi_driver = { .driver = { .name = "kx022a-spi", .of_match_table = kx022a_of_match, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, .probe = kx022a_spi_probe, .id_table = kx022a_id,