From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83E3EC433ED for ; Mon, 3 May 2021 11:06:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48FB1611CB for ; Mon, 3 May 2021 11:06:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232960AbhECLHh convert rfc822-to-8bit (ORCPT ); Mon, 3 May 2021 07:07:37 -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á >