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 DC535C25B46 for ; Mon, 23 Oct 2023 13:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230137AbjJWNe0 (ORCPT ); Mon, 23 Oct 2023 09:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbjJWNeZ (ORCPT ); Mon, 23 Oct 2023 09:34:25 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C254D7F for ; Mon, 23 Oct 2023 06:34:22 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4083dbc43cfso24218955e9.3 for ; Mon, 23 Oct 2023 06:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698068060; x=1698672860; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ufOU/q/Ep1kAY17X99uhm7aprCNDlkkpHRrj3TivtTs=; b=sDrgsBPE4bZH4M/PKfy4fQVZVgIVp8rCzYqRM+ZnS7bqcF40tY2FyVgTLRDmGICji+ gnXeF5b3difY7SUw0rJoX/AfumLTEYKR8uhgw6vWHVtWYliETIT25l6qf3O4b+oy3PKZ YNKVFnxYFVVpY3R80WZP6nKHg/5gOKOlYv1kUojlwVdRTBKwR0el+6GKUlUXIp+dzxUT wcigzZPhsroIZHW2ZgNwxsjNiVODQ+TyMwqp6eE3KM7vxG1WD7EwkXexfpjlKS8EVIpU f1qv4zivizP49ofivbaVDeBo0HCaF/xpIOB6llezMy+4D+OtzpgUgtyJF/FLPNWjY6yi LsiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698068060; x=1698672860; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ufOU/q/Ep1kAY17X99uhm7aprCNDlkkpHRrj3TivtTs=; b=HWMdRMSiQRX3LaYr8PAYI6Wnvsdvua+2lzYpgC2jimeAs3v1mbJBcCfSLJcm0DYh6J bAVq1ROIGImj6b0uxAugF5sbHIOM9NJZwAeYzdg7IdGMFgNSNodr7nXrXNTQ9ko9LvTq LIJwZhU+pQJiACO+Bd4e2GQeSOq0KBNvNzsjqg25OYkDqw5P5I+UkrP5+TkS0f4Rm+Ro s07VyEVvsVDTjaBCprNT2+eGErFcjgIeFy6pFHT2a+BycyraE/uZnKfEdJlmSDSjnOmF yjpnOWRNEEiIBZHCBh12A+0qt8K+8JEenG013RBkye67prLWOPSE4+y8PIe8egTMXgKp QxcQ== X-Gm-Message-State: AOJu0Yy3+JjbJVA415C20NEAmrrn4OUzipQhlWxmTLCzL9LGMciBdFo6 nxYc5155KTl+ExZNSIe9+CEixA== X-Google-Smtp-Source: AGHT+IHwl+E4YFajmY7IWxRpWgtSmDl22RT8PM7nnOAmIYDUhgS2AbK4FuptOkLbmHVvg59kegsf/Q== X-Received: by 2002:a05:600c:35c5:b0:405:4002:825a with SMTP id r5-20020a05600c35c500b004054002825amr7494266wmq.13.1698068059941; Mon, 23 Oct 2023 06:34:19 -0700 (PDT) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id 1-20020a05600c028100b004077219aed5sm14125564wmk.6.2023.10.23.06.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:34:19 -0700 (PDT) Date: Mon, 23 Oct 2023 14:34:17 +0100 From: Daniel Thompson To: Sean Young Cc: Hans de Goede , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-media@vger.kernel.org, linux-pwm@vger.kernel.org, Ivaylo Dimitrov , Thierry Reding , Jonathan Corbet , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Javier Martinez Canillas , Jean Delvare , Guenter Roeck , Support Opensource , Dmitry Torokhov , Pavel Machek , Lee Jones , Mauro Carvalho Chehab , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Mark Gross , Liam Girdwood , Mark Brown , Jingoo Han , Helge Deller , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-hwmon@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH v3 1/3] pwm: make it possible to apply pwm changes in atomic context Message-ID: <20231023133417.GE49511@aspen.lan> References: <90728c06-4c6c-b3d2-4723-c24711be2fa5@redhat.com> <20231019105118.64gdzzixwqrztjir@pengutronix.de> <01a505ac-320f-3819-a58d-2b82c1bf2a86@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org On Sun, Oct 22, 2023 at 11:46:22AM +0100, Sean Young wrote: > Hi Hans, > > On Sat, Oct 21, 2023 at 11:08:22AM +0200, Hans de Goede wrote: > > On 10/19/23 12:51, Uwe Kleine-König wrote: > > > On Wed, Oct 18, 2023 at 03:57:48PM +0200, Hans de Goede wrote: > > >> On 10/17/23 11:17, Sean Young wrote: > > > I think it's very subjective if you consider this > > > churn or not. > > > > I consider it churn because I don't think adding a postfix > > for what is the default/expected behavior is a good idea > > (with GPIOs not sleeping is the expected behavior). > > > > I agree that this is very subjective and very much goes > > into the territory of bikeshedding. So please consider > > the above my 2 cents on this and lets leave it at that. > > You have a valid point. Let's focus on having descriptive function names. For a couple of days I've been trying to resist the bikeshedding (esp. given the changes to backlight are tiny) so I'll try to keep it as brief as I can: 1. I dislike the do_it() and do_it_cansleep() pairing. It is difficult to detect when a client driver calls do_it() by mistake. In fact a latent bug of this nature can only be detected by runtime testing with the small number of PWMs that do not support configuration from an atomic context. In contrast do_it() and do_it_atomic()[*] means that although incorrectly calling do_it() from an atomic context can be pretty catastrophic it is also trivially detected (with any PWM driver) simply by running with CONFIG_DEBUG_ATOMIC_SLEEP. No objections (beyond churn) to fully spelt out pairings such as do_it_cansleep() and do_it_atomic()[*]! 2. If there is an API rename can we make sure the patch contains no other changes (e.g. don't introduce any new API in the same patch). Seperating renames makes the patches easier to review! It makes each one smaller and easier to review! Daniel. [*] or do_it_nosleep()... etc.