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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42C97C47089 for ; Thu, 1 Dec 2022 14:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231871AbiLAOR4 convert rfc822-to-8bit (ORCPT ); Thu, 1 Dec 2022 09:17:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231873AbiLAORW (ORCPT ); Thu, 1 Dec 2022 09:17:22 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B5A5AAFCE3; Thu, 1 Dec 2022 06:17:16 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1F40CED1; Thu, 1 Dec 2022 06:17:23 -0800 (PST) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0F8B3F73D; Thu, 1 Dec 2022 06:17:09 -0800 (PST) Date: Thu, 1 Dec 2022 14:17:07 +0000 From: Andre Przywara To: Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= Cc: Alexandre Belloni , Heiko Stuebner , Linus Walleij , Alexandre Torgue , dri-devel@lists.freedesktop.org, Douglas Anderson , Conor Dooley , Thierry Reding , Satya Priya , Pavel Machek , Guenter Roeck , Nobuhiro Iwamatsu , Fabio Estevam , linux-riscv@lists.infradead.org, linux-leds@vger.kernel.org, Jerome Brunet , chrome-platform@lists.linux.dev, Florian Fainelli , Samuel Holland , Sean Anderson , Kevin Hilman , Bartosz Golaszewski , Michal Simek , linux-stm32@st-md-mailman.stormreply.com, Hammer Hsieh , linux-rockchip@lists.infradead.org, Chen-Yu Tsai , Matthias Kaehlcke , Broadcom internal kernel review list , NXP Linux Team , Orson Zhai , linux-sunxi@lists.linux.dev, linux-pwm@vger.kernel.org, Maxime Coquelin , Martin Blumenstingl , Ray Jui , Sascha Hauer , Stephen Boyd , linux-gpio@vger.kernel.org, Fabrice Gasnier , linux-mediatek@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, Baolin Wang , Paul Walmsley , Matthias Brugger , linux-amlogic@lists.infradead.org, Benson Leung , linux-arm-kernel@lists.infradead.org, Scott Branden , Bjorn Andersson , Nicolas Ferre , Michael Walle , Palmer Dabbelt , Pengutronix Kernel Team , Chunyan Zhang , Shawn Guo , Claudiu Beznea Subject: Re: [PATCH v2 01/11] pwm: Make .get_state() callback return an error code Message-ID: <20221201141707.28af0d1d@donnerap.cambridge.arm.com> In-Reply-To: <20221201131604.beq4l22d42tjy6dm@pengutronix.de> References: <20221130152148.2769768-1-u.kleine-koenig@pengutronix.de> <20221130152148.2769768-2-u.kleine-koenig@pengutronix.de> <20221201102252.52ace284@donnerap.cambridge.arm.com> <20221201131604.beq4l22d42tjy6dm@pengutronix.de> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-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-gpio@vger.kernel.org On Thu, 1 Dec 2022 14:16:04 +0100 Uwe Kleine-König wrote: Hi Uwe, > Hello Andre, > > On Thu, Dec 01, 2022 at 10:22:52AM +0000, Andre Przywara wrote: > > Just one comment: I don't see a sunxi specific patch later in the series, > > though it seems we have at least one error error exit (see prescaler == 0 > > above). Plus potentially another exit if clk_get_rate() (at the very > > beginning) fails. > > Shall I send a patch for that? > > That would we very welcome. I mentioned that shortly in the cover > letter, I wasn't entirely sure how to handle that prescaler = 0 case. Ah right, sorry, I missed that. So the Allwinner manual somehow marks those prescaler encodings as reserved or invalid (it's just a "/" in there), and we never set those values in the driver (there is an explicit check). So it could only be a leftover from firmware/bootloader, or someone poking at this register behind our back. I am tempted to just return some -EINVAL. As the current code stands, we don't manipulate any state flags before that check, so it doesn't really matter, but would be best practise, at least. Cheers, Andre