Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2286584rwb; Sun, 4 Sep 2022 12:25:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR7gG+Tu4pT7uWF+vfn1GaDawukt94b+7NFNKkuLY3MWbqo9lDQJ2rUpqSM2tpPt4EOsh4xt X-Received: by 2002:a17:907:75c1:b0:730:aa62:7f65 with SMTP id jl1-20020a17090775c100b00730aa627f65mr32312704ejc.355.1662319517086; Sun, 04 Sep 2022 12:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662319517; cv=none; d=google.com; s=arc-20160816; b=BDrMLf1QORtYBsNuuQRmHN6qGTx83+4kkJAOtkkMx+/FpmE0Uyd2La/uCbNGpb5kVk S6NMZfmX7C3DOrFojKCnkwlw5/+Y32roJxnXyHJkJcESxhrWzVWhYldxkSsMykr54u0Z Rvvvx/bcPNJV3WLWDpnCYRnDJuBsGKVmqbREBPUZqQ9a4kWSiudPIobd80gK5Ud3jYFU MoGiVoV6DnTUeMaopwfHc1daN5htnu4sDExyWlVigHb02wl5zUeh0AZ95eb8q5RTwGiJ 4Ez+15es03JJyXfjrZfcyaEvrUVt7MOggiBL93rIuHS2gGRZJx68QQH7A9Kgc3AoWYqe 2iqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ylmQbLNcXArcx2T18HQa+1UhiZ6tItjmMAQcUFUjyzo=; b=nNvrz9wXwR6NMGfabjBprnhkSD7omZvibPPScYWHVQvYXMnTt7+Ty+e1feuOcvLXMt tc5LTGd53Q0P/P0opMbTS3aogiuda8T/HEO81RvH6VMPT7BWQPV201CW09Aoi3yC00LW aOWpr4WBgM2U12zu3y3sbtnBp0ntG2O2lHS8OTWPIgSQRP/+uKVXURxyQmf0GW2qIxt6 Kc/0pvUgU2en2mFuhUmoepCmmEJqOj4pNgQMPGvLvAq5wu7UNzmgL7PQPl6fdsiALFmq AvP2t+rfTA4exxLHPYzXqV1QWNKkZ2fty0pofL0h/bESfuBoe5OIQJCyZRKgLqRo9PM3 VoBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=q57xgdVA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020a170906398900b007316ac034c1si5729544eje.496.2022.09.04.12.24.50; Sun, 04 Sep 2022 12:25:17 -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=20210112 header.b=q57xgdVA; 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 S233945AbiIDTUY (ORCPT + 99 others); Sun, 4 Sep 2022 15:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbiIDTUV (ORCPT ); Sun, 4 Sep 2022 15:20:21 -0400 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6994D1ADAC; Sun, 4 Sep 2022 12:20:20 -0700 (PDT) Received: by mail-qv1-xf2c.google.com with SMTP id kh8so5205691qvb.1; Sun, 04 Sep 2022 12:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=ylmQbLNcXArcx2T18HQa+1UhiZ6tItjmMAQcUFUjyzo=; b=q57xgdVAAEK8pSr9sj2gBRWm6w2UPOI5fYE65EZjXxlN5y61EkhZswF7TIlhFlv3Mh q3djfE/VzFg0LPVymHa4nmGocfJ+sd1QqkyIiSmus26uoLKk6PPkFdRKa9/1uTji0VHY 2A7vx8HZ1earBnJtNf0IaOjR05uoTsBvTLA+4o6vm319C6XKC2Z+QJa6s90JhzfdTQSf WI2R8Ba51PSueUW1dZ4yXNw7NOZzI6kb7S9CnQXTgPY7luVb9VfbaA4/SpVG6XocRtGF iHrd4WLVuIwCrjyzgXgRUzMSzULaWmxOph70b/WoBepH8OJcrrKBTXWVL+LZznmjxrrE ftxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=ylmQbLNcXArcx2T18HQa+1UhiZ6tItjmMAQcUFUjyzo=; b=4iOpRSViunezoUaxGyjbcapiwzGBEN9fmzoqszjGGZeXnbklv4yeudESnXFgPKnlhg 1MvYPrdi59wy9g1q27VfvbJxstpBuqsapXH+tGNI9t9fzAVQGane4KPU/9Lwgofonqeb bNa+JGbjtYCl902FSOxx/0qtnq2i9ZvVNrlw4qWd/EX81QDfe4wgfptJUTrCiUqTuvOk K4ooCEtgjV/v9eZcCkfEqzUtFfZJfbY8RonysULxyA56UFPq4Hu7CCog37SFM144ZRzV hVeeyFTEVTGnIiZZvV3wVn8dHXVmURBNIwHktQCqGBzDnRBtsyABICq3un3g7qXFxXrY 9T2Q== X-Gm-Message-State: ACgBeo2KQmKJPgk3WcIPvDLdC7ESgu0yuVUrFdlMvljgj0SyqujESED8 mC17UHcsdOAa9lfdpxHdzgPYaBlFoq1NAYcLNes= X-Received: by 2002:a05:6214:27ca:b0:499:95f:6379 with SMTP id ge10-20020a05621427ca00b00499095f6379mr28292109qvb.82.1662319219518; Sun, 04 Sep 2022 12:20:19 -0700 (PDT) MIME-Version: 1.0 References: <20220903222422.3426156-1-cmo@melexis.com> <20220904154923.33b79d83@jic23-huawei> <20220904165634.5cde87fd@jic23-huawei> In-Reply-To: <20220904165634.5cde87fd@jic23-huawei> From: Andy Shevchenko Date: Sun, 4 Sep 2022 22:19:43 +0300 Message-ID: Subject: Re: [PATCH v2 3/3] iio: temperature: mlx90632 Change return value of sensor measurement channel To: Jonathan Cameron Cc: Crt Mori , linux-iio , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" 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 On Sun, Sep 4, 2022 at 7:30 PM Jonathan Cameron wrote: > On Sun, 4 Sep 2022 17:27:28 +0200 > Crt Mori wrote: > > On Sun, 4 Sept 2022 at 17:23, Jonathan Cameron wrote: > > > On Sun, 4 Sep 2022 00:24:22 +0200 > > > cmo@melexis.com wrote: > > > > > > > From: Crt Mori > > > > > > > > The current EINVAL value is more applicable to embedded library, where > > > > user can actually put the fixed value to the sensor. In case of the > > > > driver if the value of the channel is invalid it is better in inform > > > > userspace that Channel was out of range as that implies more to internal > > > > driver error than invalid input. It also makes for easier debugging of > > > > where the error comes from during the development. > > > > > > > > Signed-off-by: Crt Mori > > > Hmm. That's an obscure return value - I think it's mostly going to confuse > > > anyone who ever gets it. So not sure this change is wise even though the > > > descriptive text for that one does seem very much suited to this usecase. > > > > > I did get it few times during the development due to read when sensor > > is not busy, but the measurement data not yet updated correctly due to > > powermode switch. I think I added enough delays all around to avoid > > hitting it and with proper power mode switching, but there might be a > > case, so it will be easier to spot in the source code in future. I > > would not remove it, if that is what you are proposing. > > I meant leave it as EINVAL. The users of ECHRNG are very very > few in number, so I don't have a good understanding of it's expected > uses.. The problem with EINVAL is that it happens in 95% of error cases and you really need to rebuild the module to get it where it occurs. I kinda tend to acknowledge the patch, because we still miss the JSON error reporting in the kernel which would fix most annoying problems with debugging kernel code. -- With Best Regards, Andy Shevchenko