From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Hunter Subject: Re: [PATCH] [v4] dmaengine: tegra210-adma: Fix runtime PM imbalance on error Date: Tue, 23 Jun 2020 13:25:20 +0100 Message-ID: References: <20200621054710.9915-1-dinghao.liu@zju.edu.cn> <44d7771e-5600-19c2-888a-dd226cbc4b50@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Geert Uytterhoeven Cc: Dinghao Liu , Kangjie Lu , Laxman Dewangan , Vinod Koul , Dan Williams , Thierry Reding , dmaengine , linux-tegra , Linux Kernel Mailing List List-Id: linux-tegra@vger.kernel.org Hi Geert, On 23/06/2020 13:08, Geert Uytterhoeven wrote: > Hi Jon, > > More stirring in the cesspool ;-) Ha! Indeed. > On Tue, Jun 23, 2020 at 12:13 PM Jon Hunter wrote: >> On 21/06/2020 06:47, Dinghao Liu wrote: >>> pm_runtime_get_sync() increments the runtime PM usage counter even >>> when it returns an error code. Thus a pairing decrement is needed on >>> the error handling path to keep the counter balanced. >> >> So you have not mentioned here why you are using _noidle and not _put. >> Furthermore, in this patch [0] you are not using _noidle to fix the same >> problem in another driver. We should fix this in a consistent manner >> across all drivers, otherwise it leads to more confusion. >> >> Finally, Rafael mentions we should just use _put [0] and so I think we >> should follow his recommendation. >> >> Jon >> >> [0] https://lkml.org/lkml/2020/5/21/601 > > "_noidle() is the simplest one and it is sufficient." > https://lore.kernel.org/linux-i2c/CAJZ5v0i87NGcy9+kxubScdPDyByr8ypQWcGgBFn+V-wDd69BHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org/ Good to know. This detail should be spelled out in the changelog so that it is clear why we are using _noidle and not _put. I did take a look and it did seem to handle the usage_count OK, but I was concerned if there could be something else in the _put path that may get missed. Anyway, I am fine with the change, but with an updated changelog on why _noidle is being used. > You never know what additional things the other put* variants > will start doing in the future... Hopefully not, as that would be a breakage of the API itself. From what Rafael said that all _put calls should work and if at some point in the future they don't, then that seems like a regression. Jon -- nvpublic