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 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C92BFC433DF for ; Tue, 23 Jun 2020 12:25:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CBAA20781 for ; Tue, 23 Jun 2020 12:25:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="aHCKS8W1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732600AbgFWMZa (ORCPT ); Tue, 23 Jun 2020 08:25:30 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:8027 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732511AbgFWMZ0 (ORCPT ); Tue, 23 Jun 2020 08:25:26 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 23 Jun 2020 05:24:40 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 23 Jun 2020 05:25:26 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 23 Jun 2020 05:25:26 -0700 Received: from [10.26.75.236] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 23 Jun 2020 12:25:22 +0000 Subject: Re: [PATCH] [v4] dmaengine: tegra210-adma: Fix runtime PM imbalance on error To: Geert Uytterhoeven CC: Dinghao Liu , Kangjie Lu , "Laxman Dewangan" , Vinod Koul , Dan Williams , Thierry Reding , dmaengine , linux-tegra , Linux Kernel Mailing List References: <20200621054710.9915-1-dinghao.liu@zju.edu.cn> <44d7771e-5600-19c2-888a-dd226cbc4b50@nvidia.com> From: Jon Hunter Message-ID: Date: Tue, 23 Jun 2020 13:25:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1592915080; bh=/mxJgXkpwkrXVLzjqF5kjYdPo9eAp3xBgryscNpKjzY=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=aHCKS8W1gQCRe/AiErUzoJZrnE0vCWXqCiwH4pFs66T0K2DzlrPKMR5pIWRC+Nf7C +hVYiGlYPUipQ8Rvy7CnyPGW2RtyCaLbiKZUCbrQGaEuxUDthj0xBZCRo97Aq0YpiD QZV0zj6V8/TfDTfk2FZp0I2mpeSVg5fsFYTOYeocVkhzvUArcMPuBmd87Y7dzmJzpS tP9QWwSHEg1gfd7D/S/av6Z/7+k/O/54nvTUyebvv76/3R+XEosfOLJzZnNAUh4DqZ 0JFvG1Bq77fr74oJAY6eV5DPUQsQhuL6ocIsLwU2xFhX3h6eJ+Np2FN2GiJVBtkAiZ IZ6+6wHXOJpDA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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@mail.gmail.com/ 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