Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1189532pxx; Fri, 30 Oct 2020 04:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOL41vhHvQRuR5aHa/Vr68cjTo402bmz2iBYo15YRGuHjkfLpuqwYweP8k+CRt6R1v/Xaf X-Received: by 2002:a50:da8d:: with SMTP id q13mr1816301edj.370.1604057398444; Fri, 30 Oct 2020 04:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604057398; cv=none; d=google.com; s=arc-20160816; b=cw656rP77c2M/MgS6odqKiJEOSOHH+isB4E3Wb5mrT/rwvx6Hwdl8Gl8LeLuWehSVF X1fge+1FPvj3lRfFQxUp9+qeH4gSv6VcNL774hF46FtR79sYak9wekI2w/WOJeCdscQb ++vtXn2BWLEYgciBv9Zt2jAA3Dwa5nwRk2xgFA/jA8FetiDXoLMrnWC07EBS60U/FO4z ek+E4UmxvvK7BH3ONoobmRjzay8UjVMpWHvx7rdi3nIvqVEcz05kPKk4ppQoQexaZywE IU5Kku77pOuAP9lRUoL6eurbjMj674AU9Bid8NC8zsmbZAkNwAfCw988xG1krJMtgOut yWoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hxTRuwuwoz+yNxAP/6AWKELjPIZFSOzk04+9b9KVhAk=; b=o3lXrCxqAUxaiIyrWIqJCrB9WF5aRhMpGXO14DMH8rjbP5jf2IQEO61NF1OnW8tPjC +3MOFsHSJH/rAn8dOoTPidJC6MGM4jrUbacu5d2qBtn4UGhBt94bHZ/29+50PiyhzvX4 Sb9xN2Kt/MaRHSRc1tZz7YBoyuWxbs1qt01WPLzmJoYYFy5uqapv5h3HQkJFrzPKs/I8 B63QWubIUEEsFNL2wLPlVW6k6WbGTZyva9zlyd3DsUkUl77wICALdA60i5kLoBaGNvyR Z+8wNvu4BCLoWRVj6tpKfGdwo18KTJAFV7XeRTDMStN8bda0hH4dXbH30GLZ5zTiwTna ZcCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LrI15tSU; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si3906315ejz.76.2020.10.30.04.29.34; Fri, 30 Oct 2020 04:29:58 -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=@linaro.org header.s=google header.b=LrI15tSU; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726259AbgJ3L2H (ORCPT + 99 others); Fri, 30 Oct 2020 07:28:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgJ3L2G (ORCPT ); Fri, 30 Oct 2020 07:28:06 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2EB6C0613CF for ; Fri, 30 Oct 2020 04:28:06 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id y14so4979307pfp.13 for ; Fri, 30 Oct 2020 04:28:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=hxTRuwuwoz+yNxAP/6AWKELjPIZFSOzk04+9b9KVhAk=; b=LrI15tSUqq1g/++IsXJr71dx/QBn6k6L9Fbp9JFRnnkpYtM3Mid6lAljpFwTjKxdFI ryCb6zAG9h7WLR7zUbyXvcU3iMVHkzhzegveXZLDM94k/zDC5eyP1DvXuZN96JhsL9f7 FunARwjR38C8GhD/kf3V0y6EhoXB0bNklTa+fQhbyvKaC+uo4hjasdJZRF6szEGoCoKb 8lv1tO1aJdagIeVJpagB1zliwoXnLf9rigebiVErrPDhYBrbZdBdnBNmqwR5GD5iCKmy MQ8VS8FmeZybzY45j7a/cF3rThP0ZxGN5FQrEa7gI9BQh/8mhwYyvcZ8AWu52g8LiFEr ttuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=hxTRuwuwoz+yNxAP/6AWKELjPIZFSOzk04+9b9KVhAk=; b=MV/ZrFunxbFSWRvomZ1WYTQ0hkgWWyllVVqhgoAdWxSF0UYddadMe5otDKMRQfyDB3 8eIgy/M8Rz6wi99tHMczF0GxFfLHfC97ZF4Tz1kla4+PQaryl5681bz17QFrNiNE4A+e wZN7pbjYGhASMqZz5aG7niSoH8HEmMuWdt9lXfWtm96i23i2q6dJ+FNgsNEsHo6KC7tE C/S2HoWVgsNoXboZhyDjyvDbJgMm6ikle4MbEibBMJSq+vVqWqtSmkfntfBkzs1As3sn uU+7n+kGqQbiWhscPT2cT+wjxsUd8x9VutHQzSyOI6rirseSXZxBb/NUMnOcnDu3pXp9 DLjA== X-Gm-Message-State: AOAM530QgMY5KnIQ1KxhVz+G3ekF1JAWYD/Sk98sKXxO5oTu/b6aWR1V 9vK5rQk9QdgmM+IGTI02bTk/qQ== X-Received: by 2002:a17:90a:7bc5:: with SMTP id d5mr2184292pjl.99.1604057286210; Fri, 30 Oct 2020 04:28:06 -0700 (PDT) Received: from localhost ([122.181.54.133]) by smtp.gmail.com with ESMTPSA id 15sm5321549pgs.52.2020.10.30.04.28.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2020 04:28:05 -0700 (PDT) Date: Fri, 30 Oct 2020 16:58:02 +0530 From: Viresh Kumar To: Frank Lee Cc: Frank Lee , Rob Clark , Sean Paul , airlied@linux.ie, Daniel Vetter , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , jcrouse@codeaurora.org, eric@anholt.net, kholk11@gmail.com, emil.velikov@collabora.com, gustavoars@kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Linux Kernel Mailing List , Linux PM Subject: Re: [PATCH 2/3] opp: Add devres wrapper for dev_pm_opp_set_prop_name Message-ID: <20201030112802.bptlthpxl2qvbvr6@vireshk-i7> References: <20201012135517.19468-1-frank@allwinnertech.com> <20201012135517.19468-3-frank@allwinnertech.com> <20201028102942.zc5hgqpo2bfrn6in@vireshk-i7> <20201028144628.qm2t2hbzmouqkciy@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-10-20, 19:19, Frank Lee wrote: > GPU is also a relatively large number of opp consumers. I was talking about the number of files or locations from which this routine (the devm_* variant) is going to get called. And it is one right now. And I don't see if any of the other callers are going to use it for now. > Most of the time, the dev_pm_opp_set_* functions will only be set once. Right. > If don't need the driver to dynamically manage and release the opp, it > may be OK? Every call to dev_pm_opp_set_supported_hw() increases the ref count of the OPP table and if it isn't balanced with a call to dev_pm_opp_put_supported_hw(), then the OPP table will never get freed. So if the driver is a module and ends up creating an OPP table every time, then this will lead to leakage. The best way to fix this is by calling dev_pm_opp_put_supported_hw() from the right place and then we are good. -- viresh