Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1742817lqs; Sun, 16 Jun 2024 02:39:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMxL3HbvPkHfntSC2tblFd5wlT4ZzI4HMFcol+S+6TvxwrsMRxL5hqyI24UW1OLuRLfqbAeVfz7L67KqruBF1aVYjzL3mPJ7dmCdNJWw== X-Google-Smtp-Source: AGHT+IFlLOd/IWLoWT60iEFjbwl8Ve5P0b3sFCMSB+De1YmFPYSDD3Qilfpd+nm02W72kFWh+/my X-Received: by 2002:a05:6358:6f83:b0:19f:5317:4984 with SMTP id e5c5f4694b2df-19fb501223cmr962549655d.21.1718530758673; Sun, 16 Jun 2024 02:39:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718530758; cv=pass; d=google.com; s=arc-20160816; b=yIHjVtRmF69rzxp+BniJgSfjx8k+q2BqLUx2M4mI9YpC8w7Xu61/AN4hafQTyruRb9 GWzdeVBk0/wPNJHuAG3ahXJrmtaLZh7uTH1qlWPI6b8vzQ8oEvd8JYcbAKRMHk8YG9Gl sVBbgcrZFuTkHAcnLgueAZXNjLPX2PGtoVrzAVCIFfLFS0J5XuTDglA/VUn/mUhRu/cb CWM48V8eFPoh2jxJ1gbEGlBm8RSDELLVyIgKM3FLiATMiYIhcYhboRNolIzySNsxQfc+ +Y5ludQvpkyz9tde0fPY76OWjWHIYptWTdLZG8fbwE/2ka4F6iz22dNv6yT+a+DyvAp4 nEGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kAZnTqax55Wjz2CBuGAYc20MbuOcHgLalijRLo3HDcQ=; fh=n4SyrTvbSM7zkOBfNdzN+iSi4vbVbQ/JS8tjuOqleSY=; b=S0veUGhQgXru6vx6uBKUJo05f3uW+Gi5R5ZI8pnYP4mxzq5OwhcR+xmKP+HqA9FC1N jsLIQqmG0Z6q74ehOHtQ18b6+F9HXiiHyd9bk39S+juk1Mn/Oe0DskKEOJhhZ7zYQGJt kSF/Ql2MtEKUD7cJtECz1p3kFMl/GWqfget9E7EvrHndQi1+myT0mWCCvTwa332YIb7v B8Crv+UnpoaiEZE6pDEHK7foz+4g0u85XOwpto5Oh5QKN73WmxrUOQMJ2+E6FoU3JJjJ AngUylVUusWmKdrWe60Alvqc0zxHj/X32bCSNoCZDe+fqzxRtpIsZu/bHQ0KzbCGv7Qm b3Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@dolcini.it header.s=default header.b=QGxeGZf7; arc=pass (i=1 spf=pass spfdomain=dolcini.it dkim=pass dkdomain=dolcini.it dmarc=pass fromdomain=dolcini.it); spf=pass (google.com: domain of linux-kernel+bounces-216216-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216216-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dolcini.it Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee5495b68si7345009a12.650.2024.06.16.02.39.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 02:39:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216216-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@dolcini.it header.s=default header.b=QGxeGZf7; arc=pass (i=1 spf=pass spfdomain=dolcini.it dkim=pass dkdomain=dolcini.it dmarc=pass fromdomain=dolcini.it); spf=pass (google.com: domain of linux-kernel+bounces-216216-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216216-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=dolcini.it Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3F7FC281E8C for ; Sun, 16 Jun 2024 09:39:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 758A81836E1; Sun, 16 Jun 2024 09:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dolcini.it header.i=@dolcini.it header.b="QGxeGZf7" Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AB585025E; Sun, 16 Jun 2024 09:39:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.194.8.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718530748; cv=none; b=dnGbhLUQPGZ799Y+3M/wAoSo/FltSvDvFpSo46ZoO0oowLxPf3pZTY6jRT63aVNQRksxz8BCYgSjO0005eFIWNRbO0iuivHYxxgCWQ8u7/cvSY5sMu1kKTKjzDO484rse/wDxpkAIVHTokKDHypyPIWxQTmgaDJYRJNqtfaQn7c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718530748; c=relaxed/simple; bh=6dA7/dibViLlVg0vuBTN+RMz0VQaAmKhfC47NLA+bFM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WhJo2iIYo8rfaxOb3KRIwyNpLhZ4WaZPj4cyhBt1dL1TZL6YgByLSSsMo+YBUTwHXAUBT1V78Fohx5tllcueJjt0aLCEKlU0hStL0jDDsBd3IAPfpBUcDgT9b+ikMGh0jAOg6ZgUqeoMQh85mldpJPYToyqP+oe89dQUTBSP0eM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it; spf=pass smtp.mailfrom=dolcini.it; dkim=pass (2048-bit key) header.d=dolcini.it header.i=@dolcini.it header.b=QGxeGZf7; arc=none smtp.client-ip=217.194.8.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=dolcini.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dolcini.it Received: from gaggiata.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id 1CFB61FA58; Sun, 16 Jun 2024 11:38:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dolcini.it; s=default; t=1718530735; bh=kAZnTqax55Wjz2CBuGAYc20MbuOcHgLalijRLo3HDcQ=; h=Received:Received:From:To:Subject; b=QGxeGZf7VFUIyjs7eMpMcP44kq7toXzmdvMApNC6/P9eAphWRKEAyDjfEPKZPSMoS GwjeVknER1jzSlW786B5EKaZTUlvrjfwSTgT3CzT+ry5AhqAJFs1viKp61YpgxpCgV q5vHwIRq+aPbrA01yiIlTyvKnWRpDMRSISGjgeO2JTHh3yA8HXrpzGGekrONWYWeeA s2sHMoRROf/638icUfjIAhIfVNmMcoyr7yNZ/A+mU8VuW0bf6RSZknfKLGTmCslQk3 cxntzqOYIBRanjOUOEOOsNPxIeMFnkrPlmA2ORuJlkIO8843irHR0CgoNAQWnD9CJK 29jpi+ZXF2OWQ== Received: from livingston (unknown [192.168.42.11]) by gaggiata.pivistrello.it (Postfix) with ESMTP id 89CC57F9AA; Sun, 16 Jun 2024 11:38:54 +0200 (CEST) Received: from pivi by livingston with local (Exim 4.96) (envelope-from ) id 1sImLe-0000xO-1H; Sun, 16 Jun 2024 11:38:54 +0200 Date: Sun, 16 Jun 2024 11:38:54 +0200 From: Francesco Dolcini To: Jonathan Cameron Cc: =?iso-8859-1?Q?Jo=E3o_Paulo_Gon=E7alves?= , Lars-Peter Clausen , =?iso-8859-1?Q?Jo=E3o_Paulo_Gon=E7alves?= , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Matti Vaittinen , stable@vger.kernel.org Subject: Re: [PATCH] iio: trigger: Fix condition for own trigger Message-ID: References: <20240614143658.3531097-1-jpaulo.silvagoncalves@gmail.com> <20240615115018.2b73d6b3@jic23-huawei> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240615115018.2b73d6b3@jic23-huawei> On Sat, Jun 15, 2024 at 11:50:18AM +0100, Jonathan Cameron wrote: > On Fri, 14 Jun 2024 11:36:58 -0300 > Jo?o Paulo Gon?alves wrote: > > > From: Jo?o Paulo Gon?alves > > > > The condition for checking if triggers belong to the same IIO device to > > set attached_own_device is currently inverted, causing > > iio_trigger_using_own() to return an incorrect value. Fix it by testing > > for the correct return value of iio_validate_own_trigger(). > > > > Cc: stable@vger.kernel.org > > Fixes: 517985ebc531 ("iio: trigger: Add simple trigger_validation helper") > > Signed-off-by: Jo?o Paulo Gon?alves Reviewed-by: Francesco Dolcini > > Ouch. Can you give an example of resulting user visible result? That > will help people decide whether to pick this up for their distro kernels > etc. In some cases, looks like we'll get garbage timestamps and in others > may get stale data (or garbage). This was noticed while me and Joao were working on the ads1119 driver you have been recently reviewing. We wanted to use iio_trigger_using_own() and it was not behaving the right way. We looked into it and found the bug. Given that I do not know the exact impact on the drivers that are using this function. > Odd no one has noticed this in the past whilst testing those dependent > features in particular drivers and I worry a little that we may have bugs > in the users as a result of iio_trigger_using_own() reporting the inverse > of the intended. I've take a quick look at the users and 'think' they are > ok, but would definitely like a few others to confirm. All the users of iio_trigger_using_own() are older than the commit that introduced the bug, it is safe to assume that they need the fix and are expecting the function to behave the same way is documented and it was before the bug was introduced. The broken commit is not that old and less than 10 IIO drivers are using this function. Given that I think that is not that odd that it took 1 year to find the bug. Francesco