Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2931589pxy; Mon, 3 May 2021 11:09:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk8blfIyyml4FWsWKABHJDhd0GwSJcroiJkX9wzABIrVKog4psuzE3C2HUGvUyEgt8RY6I X-Received: by 2002:a62:d44b:0:b029:28e:70a4:d069 with SMTP id u11-20020a62d44b0000b029028e70a4d069mr10241932pfl.37.1620065349114; Mon, 03 May 2021 11:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065349; cv=none; d=google.com; s=arc-20160816; b=GAejYMmRZIJt3j90XtUiY7YvqbqGSot6jPPSx6NjC6o2mgdDs7kgfnu0Mo2hXf3ly8 fLNBdlrynfIiqYsk7yu7+hAZYoIaHjVwKVg+lPceig0QEQHpmnmYuchU5IoOmaiBkzyj L1zKeclP2KIUcLrtzFfCgM/d0tyRW1YDYdBGZct9XHR3p097zcykbl3aRW23QWHFT8q2 2OXPIVXv+ciSIydz53TYJpJD8Acu6Tim1T2pjZ5ULRdKpQCdM0LHQbQZ9xIjTZsMHLx7 auzx7RENaXb2iBlpJAqc2HLvrWZqvKYYe0+r1LdxicDiSdDfiCJ713U7pWygHYn8K3jP NcLQ== 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=qdmklq/ZSIFVVj1esS5ZvjW9WOYyjru1icxhM6YhJUQ=; b=VRLBjQA/05KextAEKVjXtFMyMJjnNmu3/qlutna0WUGLirrFM8xywRYqu7u6pWj5Ff kjUdJPWlOoNIE1/mcgIjfXUABUaLoTzVj8hRvlaNEjz1kx3CAOhQ4Xl8m1M8L0cc5XvZ Ug5qAAKvKqObfziWQScpju+l+aUk3SSEAcpQ3drcqnYtavbUEHUkTstaTITUqsebCMJv V+dvn9IqTdMELLl0UauqOQdhunAwo9QpKevFI2ymH8c3IcCSDcX5mQSCxBIpxwoIXnFL gjk3QjFEeiBpKp0muwZfXvTV6q1Vi1ZgPM0+Q5q4oHLvd02WXjnD/uoF1kjm4JMldZOs cb1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="D/+37SgS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si404449plr.125.2021.05.03.11.08.56; Mon, 03 May 2021 11:09:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="D/+37SgS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229779AbhECOgX (ORCPT + 99 others); Mon, 3 May 2021 10:36:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbhECOgV (ORCPT ); Mon, 3 May 2021 10:36:21 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 985ACC06174A; Mon, 3 May 2021 07:35:28 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id t2-20020a17090a0242b0290155433387beso9876443pje.1; Mon, 03 May 2021 07:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qdmklq/ZSIFVVj1esS5ZvjW9WOYyjru1icxhM6YhJUQ=; b=D/+37SgSnff2GFO0SI78/vxfjcKS9VrzFdeP+eKBRDTCfIsHN8NiZugzLm59njStF3 o7gKXa+61nV4BbGpx5Meajnh3FvHIUVWV+QSo0x/GdqhM1Mof2r/Nwpsgu0sDH9D/7OV fO20/f5mJm3MB8rrvFtl949vduU/vhwyNE3codK0jXbIGUhN689bzfN/WWhmM9DhJbxm GkuJwPAhsceok2B+XrAnQhNTZ0Fc6sYViZnzLEox4Hy/+fFShK1Hrj1AZhg6/2KvRgDD ITO0mPlSbeWOu9av2ShwnDsIA/FxCkUHlweBueUwOKb8h1pFgtPE0YjvNckooMjpYhIT kGAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qdmklq/ZSIFVVj1esS5ZvjW9WOYyjru1icxhM6YhJUQ=; b=fdmumY40oyQ48gl9zGGhkC1C9Rbgm1dpBajLfPam/bgps7V4Om6Nu+rJu6YuANeo7Q HZjpotrESNd1rZ9FIsciJlutEDMGLFVIJgQDjTA8aURd8ZznD1zooELEYYIIDdRdAUln c6Wb2B1nIq/c34O+M+KfhLGiNAFgxgWmrK/Caa7pGIWiDbFey59ysOpOvQC6IKmw382r cmW69lXMV9S5x65T5BNfWr6qtxabfzkYFZJCLqaFFXwT2rkT8LA6uZjksXmArY9oosh+ fWcyDGyIkQ43Dm3B5QM8DS91a6pRJLtCoGuGa66UAafs8uPnIPwvSfrM4uf0Twh1JfOj DuIA== X-Gm-Message-State: AOAM5336f1DIACelHxuULNdGjooUmceaA+05HkDfib3JncILZLAv85p9 OfRcevY4vwFvfObH5G4tXvMVqVrwuOl8apaQuhs= X-Received: by 2002:a17:90a:690d:: with SMTP id r13mr12496726pjj.19.1620052528147; Mon, 03 May 2021 07:35:28 -0700 (PDT) MIME-Version: 1.0 References: <20210428150815.136150-1-paul@crapouillou.net> <20210503120615.64b396bd@jic23-huawei> In-Reply-To: From: Alexandru Ardelean Date: Mon, 3 May 2021 17:35:17 +0300 Message-ID: Subject: Re: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check To: Linus Walleij Cc: Jonathan Cameron , "Sa, Nuno" , Paul Cercueil , Lars-Peter Clausen , Peter Meerwald-Stadler , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 3, 2021 at 5:31 PM Linus Walleij wrote: > > On Mon, May 3, 2021 at 1:05 PM Jonathan Cameron wrote: > > > So, I did a bit of detective work on this one. Seems this change in error > > code was actually introduced as a side effect of Alex's recent rework of > > the IOCTLs. Prior to that we returned -ENODEV for this case and now > > we do indeed return EINVAL. > > > > So we may need to figure out how to fix that, or decide that such is life > > and modify this code to give the right error message as done in this patch... > > > > Linus / Alex, thoughts? It's always been a bit messy because we also > > return -ENODEV in the path where the ioctl hits a driver that is going away > > so it hasn't uniquely identified a lack of support for a long time, even > > if that is by far the most likely reason for this return code. > > Normally this would be ABI if any existing userspace can break because > of the wrong error code being returned. Linus (the other one) has > clearly stated that the ABI is a contract that cannot be broken. > > So I would just try to fix the errorpath to go back to returning -ENODEV. Same from my side. I was just looking through the code now. Will send a patch. Sorry for the breakage. > > Yours, > Linus Walleij