From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D6B11F7540; Tue, 3 Dec 2024 15:09:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238568; cv=none; b=edCLCio8HG2VvHHQdl3gY1dOg0zm3jo7Rn9sr5PYUOx4D6Xr8tNDPcCY7kH4bmFCbqT2WRES4cC8qHYav2Q+ioER99XVATgUqDglbDllL6Q4WM8uzbiEW9dN/ATDNLJa8xTTu/6LTI9FQg4RdeAD89PRlEwPKXH30PiiF6+9Y2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238568; c=relaxed/simple; bh=boSsZ5KS+dMxat4ZTPPEis6WHQYi/cxBmen1GhorAF4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ElRHi2DamebkK2o7dpCVVNbLt+Y+v69JlLVD4FOk1cApUuV8QQYH4m6GfCURg/r+iAod1AEdyCMy0IXXR6AnZrmI1YrMmCS4nP5m9eN/NZmysJBpVxrt9l0sFqRQNSMvVbdtpRsT9MfTy32WsRAze8idFrgjqALJgIaNGsU97hk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nRMDtkYL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nRMDtkYL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84ECFC4CECF; Tue, 3 Dec 2024 15:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733238565; bh=boSsZ5KS+dMxat4ZTPPEis6WHQYi/cxBmen1GhorAF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nRMDtkYLAzpJdHIwOVXAct/L0t2PEY9CdUMFHoEaeNNhkp4QVFPM5agCHJXrnHueq 62rCO1uSVnVIdpejI1nZF0F5OCzunONknGTyar41uIRtJyq17E92jhx5eYpGq/r8Uy +28vOxCWgD8OHKNhwOmDcM1rL4tOqK8Z1sv1HRVU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Adri=C3=A1n=20Larumbe?= , Steven Price , Liviu Dudau , Sasha Levin Subject: [PATCH 6.11 322/817] drm/panfrost: Add missing OPP table refcnt decremental Date: Tue, 3 Dec 2024 15:38:14 +0100 Message-ID: <20241203144008.388135577@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203143955.605130076@linuxfoundation.org> References: <20241203143955.605130076@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Adrián Larumbe [ Upstream commit 043e8afebf6c19abde9da1ac3d5cbf8b7ac8393f ] Commit f11b0417eec2 ("drm/panfrost: Add fdinfo support GPU load metrics") retrieves the OPP for the maximum device clock frequency, but forgets to keep the reference count balanced by putting the returned OPP object. This eventually leads to an OPP core warning when removing the device. Fix it by putting OPP objects as many times as they're retrieved. Also remove an unnecessary whitespace. Signed-off-by: Adrián Larumbe Fixes: f11b0417eec2 ("drm/panfrost: Add fdinfo support GPU load metrics") Reviewed-by: Steven Price Reviewed-by: Liviu Dudau Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20241105205458.1318989-1-adrian.larumbe@collabora.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 2d30da38c2c3e..3385fd3ef41a4 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -38,7 +38,7 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq, return PTR_ERR(opp); dev_pm_opp_put(opp); - err = dev_pm_opp_set_rate(dev, *freq); + err = dev_pm_opp_set_rate(dev, *freq); if (!err) ptdev->pfdevfreq.current_frequency = *freq; @@ -182,6 +182,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) * if any and will avoid a switch off by regulator_late_cleanup() */ ret = dev_pm_opp_set_opp(dev, opp); + dev_pm_opp_put(opp); if (ret) { DRM_DEV_ERROR(dev, "Couldn't set recommended OPP\n"); return ret; -- 2.43.0