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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A34A1C4332F for ; Sat, 5 Nov 2022 14:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XrNGmk9bU5elQPwQj5vHo4FqdF2fDRwvbOWTYG6sGz4=; b=XUmwtg2zUpZPx3 QiXB0rjo4PUq+NuS2VSVTK54d7yo8aEwIdsCYlInwdoI3yFCfkjHqt4tpvtSe1cdyRo5qTqsUCvUj Lq6kUe2JTduWhQoZKD8V/q5veSh4fk4ZARbcna/rXtmy72+qH278st9uC1HJzhp8pDCJMQGHbu5bR SLNI2jsnb7y5FXRllSU5UFEltrnlZLkhIkxiaH/P/yBhNMbISG8TjSKm6yBuTUzK4jzb7TFfZmHWL a55suUPN+kamIrXNQHjYxVlTrUCOFQ6NGlfvzLDxCTYoqmgMKLJa0B4ysmYLb7mHzlu5sITDh6ISq lTqSk457Os0+MVpLJVbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1orKQS-006jW7-W2; Sat, 05 Nov 2022 14:45:37 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orKQP-006jUc-Up for linux-arm-kernel@lists.infradead.org; Sat, 05 Nov 2022 14:45:35 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C9F57B80159; Sat, 5 Nov 2022 14:45:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF3EEC433C1; Sat, 5 Nov 2022 14:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667659530; bh=zAlUT2GD+IAN3kTMRHI/1fujPF44ZCbrcVuH6AXFD/0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dhI3VfiFN/dAdthxO4xV51tqwHD2MsUDxZPxw4p+dSFzYzeHC/6gQwVM4pmgV5td6 HCUcJ62ucvHaemxmyZ1LaajbPIsRO7YFLngMx/aSRvo+9Otw/uOymssV7VltoHUjvr JNIsQlhHAO4D4OHitLhrt7y10PkwR/vdoW35rnBI6hI7fmARngtUQP3BEWXhhqNTbr kyob0eauZduHXfAHOf9Us9PcO9nu+WqMoXTYEZqO2lSqrmEnFQzNW2QXZ/jLzyKh9s fdqHAEqOT9xZBTyuclM7ZhILD67R2E3VZBc0Aqh0fb1cSVP5aD3RnURHPIU3jJEWfb F1u9GPRqUXCyw== Date: Sat, 5 Nov 2022 14:45:18 +0000 From: Jonathan Cameron To: Matti Vaittinen Subject: Re: [RFT PATCH v3 10/10] iio: Don't silently expect attribute types Message-ID: <20221105144518.7fa63084@jic23-huawei> In-Reply-To: <41abe9f6-d633-664a-db93-0580b23e44e1@gmail.com> References: <63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com> <8ef99012-4959-a674-13c1-186b9c1c2cd4@gmail.com> <20221009183854.690e2780@jic23-huawei> <41abe9f6-d633-664a-db93-0580b23e44e1@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221105_074534_330893_82F1842D X-CRM114-Status: GOOD ( 34.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.belloni@bootlin.com, linux-iio@vger.kernel.org, gwendal@chromium.org, linux-kernel@vger.kernel.org, paul@crapouillou.net, miquel.raynal@bootlin.com, groeck@chromium.org, chrome-platform@lists.linux.dev, lars@metafoo.de, linmq006@gmail.com, u.kleine-koenig@pengutronix.de, alexandru.ardelean@analog.com, mihail.chindris@analog.com, Michael.Hennerich@analog.com, Cosmin Tanislav , nathan@kernel.org, andriy.shevchenko@linux.intel.com, bleung@chromium.org, linux-arm-kernel@lists.infradead.org, matti.vaittinen@fi.rohmeurope.com, Eugen.Hristev@microchip.com, Claudiu.Beznea@microchip.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 10 Oct 2022 12:36:54 +0300 Matti Vaittinen wrote: > On 10/9/22 20:38, Jonathan Cameron wrote: > > On Thu, 6 Oct 2022 15:53:52 +0300 > > Matti Vaittinen wrote: > > > >> Hi Claudiu, > >> > >> On 10/6/22 11:35, Claudiu.Beznea@microchip.com wrote: > >>> On 03.10.2022 11:13, Matti Vaittinen wrote: > >>>> The iio_triggered_buffer_setup_ext() and the > >>>> devm_iio_kfifo_buffer_setup_ext() were changed by > >>>> commit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") > >>>> to silently expect that all attributes given in buffer_attrs array are > >>>> device-attributes. This expectation was not forced by the API - and some > >>>> drivers did register attributes created by IIO_CONST_ATTR(). > >>>> > >>>> When using IIO_CONST_ATTRs the added attribute "wrapping" does not copy > >>>> the pointer to stored string constant and when the sysfs file is read the > >>>> kernel will access to invalid location. > >>>> > >>>> Change the function signatures to expect an array of iio_dev_attrs to > >>>> avoid similar errors in the future. > >>>> > >>>> Signed-off-by: Matti Vaittinen > >>> > >>> Tested-by: Claudiu Beznea > >>> > >>> on SAMA5D2 > >>> > >> > >> Thanks a ton for the testing! I do _really_ appreciate it :) I am now > >> slightly more confident regarding the fix here - and a lot more > >> confident that we do have an actual bug (as you explained in the reply > >> to the first RFT) :) > > > > You analysis was sound, so I've long been convinced ;) > > > > Anyhow, one more coming through... > > AD4130 v9 patch had same issue and so will also need updating with this > > patch if it lands before yours. > > > > Other than that static macro being ugly (which I can't improve on!) > > all looks good to me, but I'll let it sit a while longer. If nothing > > else I want to rebase the fixes-togreg tree on rc1 before putting the first > > part of this series on top of it then letting them soak in next for > > a few days, > > Thanks Jonathan. > > Can you please ping me if you want me to rebase/rework the series? (I > may combine this with the kx022a-series then, but naturally not all > patches in the series need to be applied at once. Eg, fixes can be taken > in faster, kx022a part can be iterated, iterated, iterated... ;] ). Applied the remainder of this series. As expected need to make the changes in patch 10 to your kx022a driver and the ad4130 ADC that also crossed with this series. +CC Cosmin for the ad4130. Please check the result in the testing branch of iio.git. Applied to the togreg branch of iio.git and pushed out initially as testing. This is a nice hardening of the code against future mistakes. Thanks, Jonathan > > Yours > -- Matti > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel