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 C4CF61170E for ; Mon, 11 Sep 2023 13:53:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49FC1C433CB; Mon, 11 Sep 2023 13:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694440433; bh=W7mm8T6UfHC+3SK1+zxYOchzzLb+JmGWeEiZ7rGTWwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=glF9XOal2dsAcg1Pp2Nf219IoPoLm2/yPFvh0OpPzlKYFK5MnbySOvhjQerIeKuKA HNzI3OAZg8rz9KRfEAOrINeRmBInGEbjTIIHHlPsfndu3yiXJxEni2SuOn1zp4V20l CeWRSrdx+8BrCGuHX7M5e+wNwWD8cxwyjEh88jAY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Liao Chang , Viresh Kumar , Sasha Levin Subject: [PATCH 6.5 060/739] cpufreq: powernow-k8: Use related_cpus instead of cpus in driver.exit() Date: Mon, 11 Sep 2023 15:37:39 +0200 Message-ID: <20230911134652.789806956@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134650.921299741@linuxfoundation.org> References: <20230911134650.921299741@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-Transfer-Encoding: 8bit 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Liao Chang [ Upstream commit 03997da042dac73c69e60d91942c727c76828b65 ] Since the 'cpus' field of policy structure will become empty in the cpufreq core API, it is better to use 'related_cpus' in the exit() callback of driver. Fixes: c3274763bfc3 ("cpufreq: powernow-k8: Initialize per-cpu data-structures properly") Signed-off-by: Liao Chang Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/powernow-k8.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index d289036beff23..b10f7a1b77f11 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -1101,7 +1101,8 @@ static int powernowk8_cpu_exit(struct cpufreq_policy *pol) kfree(data->powernow_table); kfree(data); - for_each_cpu(cpu, pol->cpus) + /* pol->cpus will be empty here, use related_cpus instead. */ + for_each_cpu(cpu, pol->related_cpus) per_cpu(powernow_data, cpu) = NULL; return 0; -- 2.40.1