Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2044147ybl; Thu, 9 Jan 2020 06:03:43 -0800 (PST) X-Google-Smtp-Source: APXvYqybkKmZXar1cc2Gueo6UcyB9jswCPrRHmtZBEipVTFjkSb2ZrQRbLSBXYO4g6wfYp8cnjNs X-Received: by 2002:a05:6808:8d0:: with SMTP id k16mr3151013oij.68.1578578623769; Thu, 09 Jan 2020 06:03:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578578623; cv=none; d=google.com; s=arc-20160816; b=gjXCF4riBQwpwOjG64ITTN4DjrxKT3P10lCIOQ7ififsZ5kVutYm7JJM79ynRQd6Rf GwnqbQmLTWnYHK6k7yus0W+dKSHNxnzhZYrUVIEDRl/hsX363d6hfd51G44PvsNm2IIb 9dNs1GBXjRBpL4pcL1XkKb0JxhrBgbY7+YygEvVIZsTvEN/F3TYxfIoW4AMTmAyj+5bl q5NuPNBt4d6e9PpQs60P8OVWb5vLdVkEXjdgoOklCLTaVi4JOYaULDu0/XkHkz2h/ldW gf6MPUktG+4tjmDqIJ/mqPlp95d6P6xyUfpOkm7H4iQvs3RFl/PNVvVz3hs6h890c0As BF7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=2cfcFp/IBpHQ0DMEmTqAFJx0FUE+MFy8vpmzwBNv+BU=; b=tJYtfdIL85CEcVAscaBKVv2vw5oexVbi2QnSoH/GB82PxFvciWyfbRRr5vyZOKt21b GAZQaCyMcOJ1GyBc7JC1TTcz//w1N2vCsovcCD18fhvMvmGMg8L9YqQYfl7nzMzdG6fR zuk8P6smkw+p3jzw56VRLeKCLi+p5+Us/M7z5HhHpktF2fIZ2lR2GdMbgWCNBjl5jFRk GKeiQpgtXZImpiHA/NRw4PLebRvS7TSiiOwPIhP81l9N6ToKWo1M5swsZvClNvME12n4 iNXd1GvCstsa8J+fZZpecN5qxvs+663qkwDIR6zAcrh0q6RTHRPwBZF7Rfs/S6uBQNaL AsQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si3870629oth.175.2020.01.09.06.03.30; Thu, 09 Jan 2020 06:03:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730709AbgAILbz (ORCPT + 99 others); Thu, 9 Jan 2020 06:31:55 -0500 Received: from foss.arm.com ([217.140.110.172]:57524 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730701AbgAILbx (ORCPT ); Thu, 9 Jan 2020 06:31:53 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 04B3C328; Thu, 9 Jan 2020 03:31:53 -0800 (PST) Received: from [10.1.194.52] (e112269-lin.cambridge.arm.com [10.1.194.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B627A3F871; Thu, 9 Jan 2020 03:31:51 -0800 (PST) Subject: Re: [PATCH RFT v1 2/3] drm/panfrost: call dev_pm_opp_of_remove_table() in all error-paths To: Martin Blumenstingl , dri-devel@lists.freedesktop.org, alyssa@rosenzweig.io, tomeu.vizoso@collabora.com, robh@kernel.org Cc: airlied@linux.ie, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, robin.murphy@arm.com References: <20200107230626.885451-1-martin.blumenstingl@googlemail.com> <20200107230626.885451-3-martin.blumenstingl@googlemail.com> From: Steven Price Message-ID: <394ef595-198a-3cd1-968e-2182098da92a@arm.com> Date: Thu, 9 Jan 2020 11:31:50 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20200107230626.885451-3-martin.blumenstingl@googlemail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/01/2020 23:06, Martin Blumenstingl wrote: > If devfreq_recommended_opp() fails we need to undo > dev_pm_opp_of_add_table() by calling dev_pm_opp_of_remove_table() (just > like we do it in the other error-path below). > > Fixes: f3ba91228e8e91 ("drm/panfrost: Add initial panfrost driver") > Signed-off-by: Martin Blumenstingl Reviewed-by: Steven Price > --- > drivers/gpu/drm/panfrost/panfrost_devfreq.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > index 1471588763ce..170f6c8c9651 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c > +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c > @@ -93,8 +93,10 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) > cur_freq = clk_get_rate(pfdev->clock); > > opp = devfreq_recommended_opp(dev, &cur_freq, 0); > - if (IS_ERR(opp)) > + if (IS_ERR(opp)) { > + dev_pm_opp_of_remove_table(dev); > return PTR_ERR(opp); > + } > > panfrost_devfreq_profile.initial_freq = cur_freq; > dev_pm_opp_put(opp); >