Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2174780pxb; Thu, 4 Nov 2021 15:27:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7D3Yq8Xae5vN4RawphgP5Nr7dFdXkpx85K97K/gWjXU66/PbRDRL2/7fLSI/NSOlgL0wM X-Received: by 2002:a05:6402:6c8:: with SMTP id n8mr41456988edy.38.1636064822972; Thu, 04 Nov 2021 15:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636064822; cv=none; d=google.com; s=arc-20160816; b=NHIfteX9dvhl0UjthKqcg9ajmpYoP3HqmR0Qlkc4zOylaw/DCdT8RkYRbR1P0IHH/4 3U91B51jb0vt4MR4cXLbEREoMG8AijdF7Buu2p8k/iu+6CLfhGi3SXxLKEXdikJpItmc eIB0k4IuXeA1sS/YafBiNw3VwiSOR8MoYFRZcuh4iBX+GQ9jtbgU9yhG3cv4P0UXHsZU 5NNPOzFiC0JoX2wHoFTZ7O7QwTb8JCWrGnAA2f7Ob7OTZF/ApT4SiimbGZh43REpM6a3 HicYxgcYwDdBtqL4iCDoylR+XOoR9bXvd56nIhn6vrQ8Vfo+VPipfVygvJMp93eOQLo3 9Wng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SAjJe0L8rahemkypYUehC21SFtz7mEZThWWLPiWL/ro=; b=Hvmt3NubvtOxWyO0u6YQr7lhJ0lFhyKJuPlafxjmu+Dd1MMF1ELJyYBxmsztfwcvZN MUA1L59UpPDmaStWKq9rHbtC1oW7GwUqpi0lRFl6T4u6pURrQMCeKx/4sLJz9uMSPzL9 k2XjqwRcsp4+TchMdJs1WU0Iu2g7u5fs3BFOw7ltTk8iDWkwK5X0KGXbWYoYIefcJc7n OVY1AvGCpxRxRzMvC0sLd2eJNeN8q3RKQQdrZ78JOyZ+e51lXi1FY81VasKN4N2WVXop nf3q0B4TR5lA0GV1UwSn7fGEIiR5i8GYKHGYNkPwI5N33ZuCHYvmWQTR/7yjvk4gFULi w08w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NzCVs6lN; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qb36si7678551ejc.388.2021.11.04.15.26.39; Thu, 04 Nov 2021 15:27:02 -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=@gmail.com header.s=20210112 header.b=NzCVs6lN; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbhKDW01 (ORCPT + 99 others); Thu, 4 Nov 2021 18:26:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbhKDW00 (ORCPT ); Thu, 4 Nov 2021 18:26:26 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EAFFC061714; Thu, 4 Nov 2021 15:23:47 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id p18so9589445plf.13; Thu, 04 Nov 2021 15:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SAjJe0L8rahemkypYUehC21SFtz7mEZThWWLPiWL/ro=; b=NzCVs6lNdX69wDrb2nMBBzD34Y/tsJPVI6tZWsiJCOxvoDvtDSENn/huD6z7kv+08l G9iOj0TeqIBrea+YwDGMeZ6jbbr6sTnh9mgSUQMWl+dW/IdmeFiNEmCgQ8Pqt1R0hQpq 3O7JgIBvUhfdd1u1H5GDMGH2lCWjEGfPO5IJ/juwztKXa1cTmKsq9t2Xi3PsbeTpQn7G PBFafU3TixWAtSjq2EPHFSGH+7VcbMguCFwyUrOqDSYKOWOBKq1+Vby130DqEsBYIQZ2 BpFco6dKebNmDvklIAwbsYFRHGbf+QtFcJ0aNpdIKY1WTAgxy2h73o3bAx2X5ZgjbPuL SZlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SAjJe0L8rahemkypYUehC21SFtz7mEZThWWLPiWL/ro=; b=7+ve0Hl4duImEZLKOym26riL+dKyztpzF+aCu6YEXAjJp/sfvS2NeumCOqES9Cro8u MoXYa0GfaxYrNFoJvmYVBYrBdlci9qk2ph0LJ01gHEoRCbFr/+P51L4gbLj8PI4NIVte gpSH1uChxXriDzhvD7Qm3JYOTMxPQ6DV6i6C3zDZpyMf8ryZMMtnKo/ySZpCHWUvFLAk RFDNc6exVJkK+aUleyznDzie4tt0D6KU5igrYRWNQ63P2pdZkNWOtM5xJxwoveamwI+T //xLrzODchVpVA3uZLYcW3X8oB4Q6hZRUIPTdvI0wW6VH2GM5eUfvoPo1phUtuwD9z3j oUcA== X-Gm-Message-State: AOAM531SZueqmx09NtOCWdnao7cafVHO84qMOH9st4MBm8/S/E2dGMIi /Nnow2b8ZtnyYaYiHdWrkxk= X-Received: by 2002:a17:902:db01:b0:141:ea12:2176 with SMTP id m1-20020a170902db0100b00141ea122176mr28246520plx.44.1636064627091; Thu, 04 Nov 2021 15:23:47 -0700 (PDT) Received: from localhost ([2601:1c0:5200:a6:307:a401:7b76:c6e5]) by smtp.gmail.com with ESMTPSA id hg4sm8148128pjb.1.2021.11.04.15.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 15:23:45 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Rob Clark , Douglas Anderson , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm/msm/devfreq: Fix OPP refcnt leak Date: Thu, 4 Nov 2021 15:28:40 -0700 Message-Id: <20211104222840.781314-1-robdclark@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Clark Reported-by: Douglas Anderson Fixes: 9bc95570175a ("drm/msm: Devfreq tuning") Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_gpu_devfreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gpu_devfreq.c b/drivers/gpu/drm/msm/msm_gpu_devfreq.c index d32b729b4616..9bf8600b6eea 100644 --- a/drivers/gpu/drm/msm/msm_gpu_devfreq.c +++ b/drivers/gpu/drm/msm/msm_gpu_devfreq.c @@ -20,8 +20,6 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, struct msm_gpu *gpu = dev_to_gpu(dev); struct dev_pm_opp *opp; - opp = devfreq_recommended_opp(dev, freq, flags); - /* * If the GPU is idle, devfreq is not aware, so just ignore * it's requests @@ -31,6 +29,8 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, return 0; } + opp = devfreq_recommended_opp(dev, freq, flags); + if (IS_ERR(opp)) return PTR_ERR(opp); -- 2.31.1