Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2930963pxy; Mon, 3 May 2021 11:08:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk50x+pY+OFQ7+yi6iUnwxLGbh5nu67hXEFDTwYVwCJ75kHW/jz3MW4qP+7rwTSc/7siGS X-Received: by 2002:a17:90a:5a08:: with SMTP id b8mr33120173pjd.124.1620065311622; Mon, 03 May 2021 11:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065311; cv=none; d=google.com; s=arc-20160816; b=xPg1FnbLKTnfqpGXc8BVJeLKz5OUxuinLdX9Zy2e/q++fPw/qhpG+Z7RTP5u9TiYdK tHR7FdPvAtxz8Q8FdpIw8grf/gEeQbKzeYUEfljhjiqcr0K4HUJDA6pXI6FYSuiaUaA8 5vMxqyxqAJJz0xkkXv3Xs9IWbmZL+OIFkrNjg/1h4M1hMZEg7OuQ1Ro0wd2p1Ug/B2gw F99Vw/J1qjlf4IJSUFCfL5q8eYyfPMzsq0KQylTzi4P0UaqZhWdBIT12Szw+j4vkpRF1 A0tEz1Oj8hdiLp1Q8Btyd2KjsrMRJ0ngFXitiRSZSLrhGPLMmJwKsnMHi7NTiTqL4Iin 8HLA== 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=7Q+7uJXapdV8m314egEDhU1V6QX5TMcQtPenPurNvJI=; b=sKxf43yBurbbwjlDnQuh7esU30/CZ+Z3m2S/IGpBhhMoU054jbucMx1dNNvqWaNwUW 5fzdnmlz8Q/Gt65CB1tpFWXFodgwDDGVeDVTdEo7at3ZLm7hS7+U0bOdLR9OnGwSw920 Mi1dl+BEhXTM4YBTqkMHtGZtgn5aiQ2mzlDXe2hN58ng8+Sibpf8bIgyJwzD/4LgBLDA 8NcFVRwTqPaV6mvlx2+L2goJlIjhihsEzBzcpIZpORV+kyX1aeV9WvzkKpv53SIsU8pw rVf/SRvaWYeA3oI7n4um8fBSUuj/NEWxi9Gleumj6jtD/XEPhS/MybZWCPqxcOIxQjvD mlFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mB9ivoZ5; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lp2si15524284pjb.138.2021.05.03.11.08.17; Mon, 03 May 2021 11:08:31 -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=@linaro.org header.s=google header.b=mB9ivoZ5; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234475AbhECN5M (ORCPT + 99 others); Mon, 3 May 2021 09:57:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233269AbhECN5J (ORCPT ); Mon, 3 May 2021 09:57:09 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 292B5C061761 for ; Mon, 3 May 2021 06:56:14 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id s25so6910215lji.0 for ; Mon, 03 May 2021 06:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7Q+7uJXapdV8m314egEDhU1V6QX5TMcQtPenPurNvJI=; b=mB9ivoZ5UNR6sRV3Ovqt7vd7xn9D15y2o3MzdcFjXGmgf4bPp/mvmDOdDDjhhM1Cy9 ltvH9p9ujkHd/tUWQXTkc4sweaeYUbImuQE/c/WVZAV/yM2XUStBEa9RzyZ0JpAgS435 aBHieP5DMWq4tA3dk5SvEXu2jJHqg+L+7y3WVAeTCFKKJaEqFBo0HjruFvzsS4HjvhmK BnXZZDQIHrspQyrgfXHZ438/TNBQC0BHxB8BxuUIkaDE67InzMulYvSl9GQBITdGAn3I 9uUCkcX38acfp3EbBLihE7dPm55cemEEcGJiobDc07w05sa9IHaY/v4onAt8B/CrBVpv A9Zg== 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=7Q+7uJXapdV8m314egEDhU1V6QX5TMcQtPenPurNvJI=; b=pmb3clNOLOdDA4vMF6cFzDcY5fpJnOivr2metin7DJCs5MCjs2VTymiZrBVzG3fsnS deNWgBgvtLC6NnkgUdxV7iFFVEeeevsAswgDuasWQIdNHBAiQPCNtEqxxcmeKLC683lR fV+77Gb4BWreJ0+DoUvrAdYTxS8EWPkXTCqkm1zkl0wOboKHjlwhsADF0XBjh/s4Cl/o 34V7DT2WvbFtgNLaXQlKGzEntXGDYHTcq1gJVbVO+cbJJrYRDWK4Lhdi1Jz8Cdt3KrBq b6LJhpmM4FD5Zl+ikr3f/Q9SM1Qh09z9KaCRgJ8FFSygM4ckYc6EZUMmFmxbFVFjio5p znwA== X-Gm-Message-State: AOAM532KzYgSRnH+lb8ZJNbzjqBZpKypMPZWoKkmmQ8JwcHhvSMDP1/M NbfWl1j9M7nlZYIVcquFGGWt9IwAmiAFPSG4IYocxQ== X-Received: by 2002:a2e:889a:: with SMTP id k26mr4801339lji.438.1620050172462; Mon, 03 May 2021 06:56:12 -0700 (PDT) MIME-Version: 1.0 References: <20210428150815.136150-1-paul@crapouillou.net> <20210503120615.64b396bd@jic23-huawei> In-Reply-To: <20210503120615.64b396bd@jic23-huawei> From: Linus Walleij Date: Mon, 3 May 2021 15:56:01 +0200 Message-ID: Subject: Re: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check To: Jonathan Cameron Cc: "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 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. Yours, Linus Walleij