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: 13230852 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA012C77B78 for ; Thu, 4 May 2023 07:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbjEDH6R (ORCPT ); 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-Google-Smtp-Source: ACHHUZ7gY/3ZiDJPcW+3n3j3tEcpRuOGxE+LoMhfUZ3u5a3xOaUJurgTz5pqCYWQNDsQQZTxvgFW7A== 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: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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, };