Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3559351ybt; Tue, 23 Jun 2020 05:29:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6xzqXVamjoChjAcmihqu2LfOYTjcLKE8c7jaILIOWtSpnMwFXbO61bxpfZTneYLGxEySJ X-Received: by 2002:a05:6402:30b2:: with SMTP id df18mr10362414edb.229.1592915387220; Tue, 23 Jun 2020 05:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592915387; cv=none; d=google.com; s=arc-20160816; b=kS2bnMKuUSydCnDKcQfZBAm5uNJkJlqhtZq6WWJGiaiB0HZh1zmlUnGwyen1eNqSKU zRyEDupGel7bRs+9moGmiPxl8UgqHhpy3Vdpa5a9h/+xD9ntSKDEGRIkglMsLF2+XuRr Nw3rT3s/MbHyYdy09G3rPZt6mGIxJ1YgYy/DhB+H8phgl678g9sSp+G2JmMsB/az6kWJ JIREBpEQyG8b6DGu+olbqs+f2kvlUPYmARJT7ZuLmqkPF6KS65AKDN4oJc9HOiBJHWG8 7y+Oa9moX2tf32RjEzq5YvqP19n+8qTJokdfjA/A+MXcGjU+Dk3D5/U+s2C8QSUrwbPs k+cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/mxJgXkpwkrXVLzjqF5kjYdPo9eAp3xBgryscNpKjzY=; b=r2S3l9g9DPE5UawH+/258zomBDOU5nZ9oEcS2v7aw77yYz0nXH+b5R+ENTpdg0V369 r+gNfL+vYcPj1bcfqrockL3cbeBIATP0tLFTWK0B5Am/s8KhTlk/wAonlDuBlSWHkFjo U2pI/0LPkSaZQtkCi7pzLxAGH8tlCFhzKEd7k5sk2AA7ysVIRui725D8210CMad508Jb 4cPjmbR8jjDl4dXzhjjjNIugL5ulze8jrMZ1pLBnkUjkpntPlTHtvT4bK7KykP3UhyfO T2wQOspp7ANRj/hVs5FzHT5DaKEUTz9gtzgnqlYFn68zzLm0AuUMirR0hzGkyL7U4Faa icbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=aHCKS8W1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id os21si3533901ejb.205.2020.06.23.05.29.23; Tue, 23 Jun 2020 05:29:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=aHCKS8W1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732591AbgFWMZ2 (ORCPT + 99 others); Tue, 23 Jun 2020 08:25:28 -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