From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2387166F3D; Sun, 29 Sep 2024 12:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727614575; cv=none; b=GDc83ugMl/d0OSyMMed6qx8P9jaKrdvg2S9rAqRIz0A+V9pmg7t+JCh7S0PVdq/z4CVuJbKDNTCANr4Tf3s1TlnS+ufBJeLkjsdIf1vXcbk1Nt+c5IvEU+FRP5XGuxEegp+UN5g+hULBCvsJj1vRZgWzeN1D/9M3u7NqfkwHdsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727614575; c=relaxed/simple; bh=OfJqlFNVcOO6gyMyiuZtizh6vUe7XaDZBBLuSJQG+II=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YJDjyYTjQPnJtQUAX+wfIB6memwQyu/1+5p8JwEndd+/P+9x7+g/X9vMP7PRwhX8KF0vvArD5wThnyGX9U6Z97cxnxlZM6x11lG/ng3ayVy/V2lv4LyMslpMpU/7/Cpb2AJPnW0iegrFsINCHzcozm9JTbEVtcvfuLxqJotXxUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BW96i+yJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BW96i+yJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69E7BC4CEC5; Sun, 29 Sep 2024 12:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727614575; bh=OfJqlFNVcOO6gyMyiuZtizh6vUe7XaDZBBLuSJQG+II=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BW96i+yJ7/gJrIhP2a6zLCQyS1oGaZH7JMGSnLoMdqBqRriseT4Ipxv6KWwbnmx3a 91+JerPM9z4ZjPQCGHjfE8DD1X5UA/PlRKeyAS775KeQ+LM/t7zukeugXot0gGUS/P GV8s5Bd1HSxjCERvZx6Y+UZzkECyp6KvMKvgsPH1G75LjLTPV/w7vC4nFtH3KozVVo oQBOBVhD7fOAXO2jAt58fuIOVliTtZ52KretLnwCDsTykeDJTGxc23c18zdUV+NVzy A79DZ7iuvs0yTbNX6SnwG6Vu56hJNUAjYO0FDbuBz30QiHcUfhIfskmWzmzgZfePDi +tsWxA3VAzrlg== Date: Sun, 29 Sep 2024 13:56:03 +0100 From: Jonathan Cameron To: Guillaume Stols Cc: Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , Jonathan Corbet , Michal Marek , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, aardelean@baylibre.com, dlechner@baylibre.com, jstephan@baylibre.com Subject: Re: [PATCH v2 10/10] iio: adc: ad7606: Disable PWM usage for non backend version Message-ID: <20240929135603.0ceb6cfc@jic23-huawei> In-Reply-To: <20240920-ad7606_add_iio_backend_support-v2-10-0e78782ae7d0@baylibre.com> References: <20240920-ad7606_add_iio_backend_support-v2-0-0e78782ae7d0@baylibre.com> <20240920-ad7606_add_iio_backend_support-v2-10-0e78782ae7d0@baylibre.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 20 Sep 2024 17:33:30 +0000 Guillaume Stols wrote: > Since the pwm was introduced before backend, there was an example use > whit triggered buffers. However, using it may be dangerous, because if > the PWM goes too fast, a new conversion can be triggered before the > transmission is over, whit the associated mess in the buffers. > Until a solution is found to mitigate this risk, for instante CRC > support, the PWM will be disabled. > > Signed-off-by: Guillaume Stols Whilst I can see the logic introducing it in two steps, maybe shout a bit more about that in the original patch as otherwise some foolish unnamed maintainer might pick up part of this series leaving things in a bad state for a kernel release. The earlier patch 'recommends' it isn't used which is a bit week. Say support is going to be removed later. > --- > drivers/iio/adc/ad7606.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c > index f710445bdc22..0c12ca237ee9 100644 > --- a/drivers/iio/adc/ad7606.c > +++ b/drivers/iio/adc/ad7606.c > @@ -599,7 +599,6 @@ static int ad7606_buffer_postenable(struct iio_dev *indio_dev) > struct ad7606_state *st = iio_priv(indio_dev); > > gpiod_set_value(st->gpio_convst, 1); > - ad7606_pwm_set_swing(st); > > return 0; > } > @@ -609,7 +608,6 @@ static int ad7606_buffer_predisable(struct iio_dev *indio_dev) > struct ad7606_state *st = iio_priv(indio_dev); > > gpiod_set_value(st->gpio_convst, 0); > - ad7606_pwm_set_low(st); > > return 0; > } > @@ -838,6 +836,12 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address, > indio_dev->setup_ops = &ad7606_pwm_buffer_ops; > } else { > init_completion(&st->completion); > + > + /* Reserve the PWM use only for backend (force gpio_convst definition) */ > + if (!st->gpio_convst) > + return dev_err_probe(dev, -EINVAL, > + "No backend, connect convst to a GPIO"); > + > ret = devm_request_threaded_irq(dev, irq, > NULL, > &ad7606_interrupt, >