Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp872848pxk; Thu, 17 Sep 2020 19:55:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqFI8Yhox4z5XCJ8gU8vjPLYOT3dtI+k4HfFDl2mp0icr7uwJ784w2784djjdaKu8F9XiZ X-Received: by 2002:a17:907:948b:: with SMTP id dm11mr10589677ejc.399.1600397713794; Thu, 17 Sep 2020 19:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397713; cv=none; d=google.com; s=arc-20160816; b=lim3v/Z1T/nIjLctO5Xmswg6OI3+C1XNMVvN088p3fxI52eXtCMe8zqGmUlowAG/Jt 5R9i0g18VCTbuFyEjNOHGCadFMKYdHTNgYQMcX76QXABAoNgBCz9O2XMf5rm/td3redC EkUWN4MIJJdfeKY00fTnbtD8q6H0p5kPT2N4iS85US8kwsRzQkHjkvvtyBgawES5un6B /5Pcck6xk2zluHamHV0F6V7LHM7nLszdth3L9zh1knUgqyINmR6YVjclyKOyYe0pZAjV w88ibey516ApJd5v4pulxtET4fugIHimrd4IM+nTIQ0ZQnqiHPnfVULUzfaf4vvYPiIn jAng== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DJ1/YGkKDMzvruBdD5jIj3CWnIiQETigBaZewY/SUBA=; b=L80AsKfvnWQd893K8rCgSNuDpz/AWcLi+pAytcm6dS9nksFhmPXE7bburSAOndc+xt pc0bzEtHTDi4a77CrqECYl2cLHHOcAL3jS2wHpjXJVwy7Lj53a5XF1osVTdSVpIcl0ol wUC1tCFaTppk6U4WQtY+ClMZCJU6lUv9dmjP/UV3Y+Oq3lDxLjvR7NQkC0LM6I0mCiut SWwApsKTdfhPS/tLOd9t56PwLkIEk5UwpTuxWEbiYJnkCYiYHDkKqz5pjMTxtrlCqYQN l9V6+pBpSiGn5BTQ1yXyPs3Bj4Mk2q/XPFdhBqdlc5glUGxDHCcaudmPMzrlyDABtAre yJ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="kVxYH2/X"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si1187949ejr.748.2020.09.17.19.54.50; Thu, 17 Sep 2020 19:55:13 -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=@kernel.org header.s=default header.b="kVxYH2/X"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727725AbgIRCxI (ORCPT + 99 others); Thu, 17 Sep 2020 22:53:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:58616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727339AbgIRCHy (ORCPT ); Thu, 17 Sep 2020 22:07:54 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8DAF52389E; Fri, 18 Sep 2020 02:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394874; bh=8MljDeggPdi9vFj6AXRrmOaExwKwArRNdb/1KDKnZxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kVxYH2/Xpko9lsr7U60YsKMn2dXQlBbUJ7LKweI1YsRHkfDBOqs8HzVELn7xXaM/B chITWNPfkd+fa32LfqjATK7CHUmbx7aZztSfqUhqudEPDctjZcZp/hgfCWGqSOv7eg 1EkqWeIR39HKr1pW5t78oMWIHNuYncx1Pe/7OJ6c= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Walter Lozano , Viresh Kumar , Sasha Levin Subject: [PATCH AUTOSEL 5.4 325/330] opp: Increase parsed_static_opps in _of_add_opp_table_v1() Date: Thu, 17 Sep 2020 22:01:05 -0400 Message-Id: <20200918020110.2063155-325-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Walter Lozano [ Upstream commit 6544abc520f0fff701e9da382110dc29676c683a ] Currently, when using _of_add_opp_table_v2 parsed_static_opps is increased and this value is used in _opp_remove_all_static() to check if there are static opp entries that need to be freed. Unfortunately this does not happen when using _of_add_opp_table_v1(), which leads to warnings. This patch increases parsed_static_opps in _of_add_opp_table_v1() in a similar way as in _of_add_opp_table_v2(). Fixes: 03758d60265c ("opp: Replace list_kref with a local counter") Cc: v5.6+ # v5.6+ Signed-off-by: Walter Lozano [ Viresh: Do the operation with lock held and set the value to 1 instead of incrementing it ] Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/opp/of.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/opp/of.c b/drivers/opp/of.c index 9cd8f0adacae4..249738e1e0b7a 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -733,6 +733,10 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table) return -EINVAL; } + mutex_lock(&opp_table->lock); + opp_table->parsed_static_opps = 1; + mutex_unlock(&opp_table->lock); + val = prop->value; while (nr) { unsigned long freq = be32_to_cpup(val++) * 1000; -- 2.25.1