Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2393101rwl; Sat, 1 Apr 2023 07:06:04 -0700 (PDT) X-Google-Smtp-Source: AKy350b5IeB1Z5p/lxMwN03vJgAy7qqo7QKtiSKk5wZpvp+zAv+TGT55Mw8qJCt0nOgRiNEhrpnF X-Received: by 2002:a17:902:f68c:b0:1a2:76b6:c26a with SMTP id l12-20020a170902f68c00b001a276b6c26amr15817361plg.28.1680357964713; Sat, 01 Apr 2023 07:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680357964; cv=none; d=google.com; s=arc-20160816; b=CJtKj1A7kDBJ1fw6IhmpP5KLGzvZXDuwP20tWevf3TLGCJ6tbcyslvDV40TG8lFHxr VNn98eaoYqXh7I//JCfptlKkkNWTuk1dcBwYuOKs/WJroaOIHHZgBavKjQEzcjvRPjus WBgmstw5odEf0Z/4Dzy3ISbR/3bNT5U88F4riKRgLudx7EpO9GSDrwuBr7wyvxbnxrhO x+7hrn2vbpRTEqSmFblrmPG89ItjTYgcHsg0PbNrJNICLq8p6MRBQf7KtncMrnoTZBCx XQCnmA15mLdpB4wt9RQJlMnUbcHgBM4pR6zDhh5e7m2+CYRzriZ/LlhoTQQptjKCkGK1 Besw== 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:subject:cc:to:from:date :dkim-signature; bh=OpZVMdYvkURnTCyalCBjb2vLr8HdcHMoZxzvnVZE1k4=; b=nqn1okiXg2FBrAxrB9bEzVL4c7zRgpNGEo5qAw+CdFMqI7aAzIPRL6dsmPVJLj+klb HQO6W3H6QDcGOzyxmBO1Co7j+NWkpRcB62HdeenKaYrPTBlRRCyqbL+IVoiy4gyUNoG/ 9lxY+hwFw2Bp//kKV4yNbu2o8WLUcYbrEDdWNO8J7NtmfDgIpKlVI6B4RtMTmc/1GI+d VMUP1goNjYOJtAEGpz+5EEeHtArmmuoOb2+dwX6hOPP4x3aukw9TnXOO5Nu8NG7EyJQf 05fleFKpHE24OF/p2eXbPGTn7zt4UCaIRPGjY+nrmZkL/z29vNQTW0oyFRVuJJN8+Ka/ XG6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qJ5NJPF9; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dw21-20020a17090b095500b0023b3401ef14si8687117pjb.62.2023.04.01.07.05.53; Sat, 01 Apr 2023 07:06:04 -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=@kernel.org header.s=k20201202 header.b=qJ5NJPF9; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbjDANgR (ORCPT + 99 others); Sat, 1 Apr 2023 09:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjDANgP (ORCPT ); Sat, 1 Apr 2023 09:36:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB5BF1B7EE; Sat, 1 Apr 2023 06:36:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A2053B80B4B; Sat, 1 Apr 2023 13:36:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EBD5C433EF; Sat, 1 Apr 2023 13:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680356172; bh=xWIPov0IQiaNQ96i3rNsCQsiBHiJ3C0LQ80p6KiqcNs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qJ5NJPF9v5QJKLs/1kJuHIUU/gx7mX7f91/idrdCE/ZihXnB8CVMykQ3+yVqzTUrY MG6U4/q1EC2SbaZGDa9BktQ2/CaVjjL4yVhMD9UTAnCFckBxqVnG3HRmDvlGXXNsnM wE+KVhb1nCxWz4PyhIZ3ic9bSxLkGxsOwhG8Datf1hUcJRWeH5rxQStR3nMd2UuaN9 Tryf5RPmtuIPWDRpxp1bnupY50o3F6l8gVNfkicHMll2x7ZP1/5i4iwqAEVkKkseKq rmedcPS9iqVBDXNCjmShRKN4+2HOvrRCRGYydco74MyNruu6AfoVfVEVv+qo4CuQ7L e44cdCZI6uDHA== Date: Sat, 1 Apr 2023 14:51:21 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: William Breathitt Gray , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] iio: addac: stx104: Migrate to the regmap API Message-ID: <20230401145121.1a64a113@jic23-huawei> In-Reply-To: References: <4ebc1b6b609a086846420954b893e914fd395384.1679867815.git.william.gray@linaro.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 > > > + do { > > + err = regmap_read(priv->aio_ctl_map, STX104_ADC_STATUS, &adc_status); > > + if (err) > > + return err; > > + } while (u8_get_bits(adc_status, STX104_CNV)); > > Hmm... Isn't it a potential infinite loop (e.g., ther hardware / firmware > is broken)? > > Why not using regmap_read_poll_timeout() (or its atomic variant, depends on > the case)? Just to shortcut things as I'm looking at this. That's currently handled in patch 2. Argument being this is a direct conversion of existing code, whereas changing to xxx_poll_timeout() is an improvement. I'm fine with it just being rolled into first patch with a note in the patch description though if that works better.