Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2626254pxy; Mon, 3 May 2021 04:38:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe9rBjuALBEKNaDjJWNoCd286N/tzDtog/g3CW/Md5XqvA5sINN0p3arCdwNx95ntF5rnQ X-Received: by 2002:a17:906:3098:: with SMTP id 24mr15769484ejv.507.1620041895941; Mon, 03 May 2021 04:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620041895; cv=none; d=google.com; s=arc-20160816; b=cCTU+wCPJOumsv0F3Xgd7vpNa1dHKUtHP0+bi9JXh2Oq0gCqhWqvPYundVJS3aiaKw JnSuTYqKJ1ZjJPvgcSUtgDNgAzgC6YAvMPP4vHCRhJH3Mt5Z+jvcGl15If97MlrgiewO NDomtXOTbgpwX4pJ6h/BOztqYQsfNe0/6GLwEabTqtHQ0jaVMPx2ISeGBOeCjax9YrBW ZD/qFcFv5x+7WR8RLuRXvfvnedmpB+SpEPv6zJXhLIvDCZzoXnoq2YBfFoT6WP/dRznc WQZbg7OaObjsFwRDhHemAke0NuPMubzIQ35pwI+F4a1tEAokM8UFsV4RDh4hE24GAXLK Pj+Q== 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=Vi3I6lGcCPkqJLx9vyIUuepNUYH4mUFP9VXKzpP0ifc=; b=w51M7okEtOAgG6SXLmPHk1pE82nJ5J3r8zbeeNX6mUieQ2QzfXElWIZ5J6F2m3Z3lK mSLc6caOr4NX/dyUNyrJ//Wtn2ZaxG623+w91cKHzh0MSSn5Qj8C9nxXK3+k8W5mf6tG VD7jRCDMt1YC0ftK9sBxVZUqKvmY59zdabGv4lt1+6nB0eHxckYUpQYFf495T9Ks/rvU dRwWk8r+3Q78ywGtptoR9bsDlOZ53DBHmrlgNwQUlJiA+IY0LXeIcvdBjKGzPPN815GT ck1Jz7TPJtteLm69/rAFgb8luWuSXGtmMvMV3VPZONRmTn2x8abQQt2+TJ4D+wNuR3zv 4/vg== 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 n24si10580209eja.255.2021.05.03.04.37.52; Mon, 03 May 2021 04:38:15 -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 S232935AbhECLHg convert rfc822-to-8bit (ORCPT + 99 others); Mon, 3 May 2021 07:07:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:34988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhECLHf (ORCPT ); Mon, 3 May 2021 07:07:35 -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 CDC2561076; Mon, 3 May 2021 11:06:40 +0000 (UTC) Date: Mon, 3 May 2021 12:07:32 +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 , Alexandru Ardelean Subject: Re: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check Message-ID: <20210503120732.50f1aee0@jic23-huawei> In-Reply-To: <20210503120615.64b396bd@jic23-huawei> References: <20210428150815.136150-1-paul@crapouillou.net> <20210503120615.64b396bd@jic23-huawei> 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 +CC Alexandru Ardelean On Mon, 3 May 2021 12:06:15 +0100 Jonathan Cameron wrote: > 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á >