Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2626170pxy; Mon, 3 May 2021 04:38:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU4+ic4jd8kKqq0zTOGFvrgbbOWMjleeZza+jjc4IlW6F7FXN1+AkLnIHTyN6+w8fKOqcJ X-Received: by 2002:a05:6402:5113:: with SMTP id m19mr19799793edd.78.1620041887904; Mon, 03 May 2021 04:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620041887; cv=none; d=google.com; s=arc-20160816; b=CCQH/Xzyvt8fxyvFsRSbIfdCWH9cGIdhsCf9yuFwNTBo5Kne1Ul/xrrC2BnoTtK9P+ RhEk5T2WCWEeS43Rdc/rNVGTTRbq920V0q80dwBSC69YPian89C7/rrKhw78ic2rwpCl tqgRHekvyie3iR+sDTqjULeQDtGpf1BK/CqQAxd/FBko03pVHJAehfiUCisHPwJIh3dD KaO0G6CsnNzQZy4tQIoUXwp+MtzjeWJ0VEpNFMbaV3DnTUKzY7t9aHy9/udO14Zv0iZX QKE1xpcC+iRA69lC/jccTV32jJ9K6BplNkRyonbil/2cMFNOcb3UN7lfUOBoFQawF+Xv Podw== 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; bh=orgUitK9nQ/+lsFzZ6vYZ7pCjOtC1p+qkWK4zGPc9/U=; b=D8Cd9tuFdECIHSc6G407ziYMbLSr1dbP9gViTNrmOtKUCZh8Z3Ql3urC8JeAm8ZhIR CMXg8w2bmbQyGaL+QJ2nEXzg487TDPQ2aAJ2S+FwM/mvGPPs4sE74hLSsmvp0E9eqgAk uLjuwR4NYEY2RV81jBYDrEFZWDk8V/WhRBxfrNPboMeOj76wxmW+1fOyb9/NnVXzzA1F jLRYRe+11Xhx0XddrnzTINeDw2StSNYFxgkRSYCqXi+MKy3jfet7OGl0F+k+kLfaZo40 /VKRWp6ogpMAk1HTOpadiihLD1BPhBkS33waDpuQ2a+kP1YeqM7HHeOF0cz0lU2SX/5c mzbQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si8815436edq.562.2021.05.03.04.37.44; Mon, 03 May 2021 04:38:07 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232712AbhECLGT convert rfc822-to-8bit (ORCPT + 99 others); Mon, 3 May 2021 07:06:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:33650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhECLGT (ORCPT ); Mon, 3 May 2021 07:06:19 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3AEC061208; Mon, 3 May 2021 11:05:24 +0000 (UTC) Date: Mon, 3 May 2021 12:06:15 +0100 From: Jonathan Cameron To: "Sa, Nuno" Cc: Paul Cercueil , Lars-Peter Clausen , Peter Meerwald-Stadler , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linus Walleij Subject: Re: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check Message-ID: <20210503120615.64b396bd@jic23-huawei> In-Reply-To: References: <20210428150815.136150-1-paul@crapouillou.net> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Apr 2021 15:33:21 +0000 "Sa, Nuno" wrote: > > From: Sa, Nuno > > Sent: Wednesday, April 28, 2021 5:31 PM > > To: Paul Cercueil ; Jonathan Cameron > > ; Lars-Peter Clausen ; Peter > > Meerwald-Stadler > > Cc: linux-iio@vger.kernel.org; linux-kernel@vger.kernel.org > > Subject: RE: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check > > > > > > > From: Paul Cercueil > > > Sent: Wednesday, April 28, 2021 5:08 PM > > > To: Jonathan Cameron ; Lars-Peter Clausen > > > ; Peter Meerwald-Stadler > > > > > > Cc: linux-iio@vger.kernel.org; linux-kernel@vger.kernel.org; Paul > > > Cercueil > > > Subject: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check > > > > > > > > > The ioctrl() call will return errno=EINVAL if the device does not > > > support the events interface, and not ENODEV. > > > > > > Signed-off-by: Paul Cercueil > > > > Reviewed-by: Nuno Sa > > > > I guess this should have a Fixes: tag... 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. Jonathan > > - Nuno Sá