Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9098445pxu; Mon, 28 Dec 2020 06:36:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPlDTRdOVL8nnm+p3hbjyZTwxQlYBTO5CWWhgM9kOL/Y2z+TIAKUd1MnuK9N62sLj7K9JF X-Received: by 2002:a05:6402:845:: with SMTP id b5mr43219181edz.38.1609166161891; Mon, 28 Dec 2020 06:36:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166161; cv=none; d=google.com; s=arc-20160816; b=ZZRiDpP9gGwjbM3kflvgNNBqhQSlbEIKZn7LcCD+ZglK7xx+dgQA9FXxR3a7DSBNuS xFOlAKWEIqHPxdLAdSV89RjCGY4r+Gl9bDVwoUOFu0WtEyKp7x2DDDB4vjFjXWsSghRo 4A1Klr5IveztuZGKV83vdtFtPimnZmk2mtZIDBceNoHCg4cmFTWUDEdnraTsHvabNOAs ra9kDOe9Uso3r4xN1YPOwZZ5VuLdF/Skim30x5eHAFwWWGt++VMnWAH386Lg8eX0x4n4 DT+0y56v6MQ856Q10hX51c/D6yN0pDKqI5U7PApKlXZUmtPVWg9Fx2KH8IBy14ZpFNTQ YAgg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kOWDYsRyO+yAj3cDvB/s8nKvumGixp2A/4I5/JWebO8=; b=ATVJbLr4SWFpXEQvvA61Ql8gfzeSyrJ6roGn+IJiDNInnmSttCEIFNthvr9vyQiQvO TZf2EeXw6ORHchD0hV8KA367naqocxYFbBAQYKsU8VBLaMq1qZI4e9NF0y/uRM+ZnpNx e6PgRG6fXGkASHg/43egfzMfLOMKJNZFKz8r9eYRsA1uWVS+TY6WDYFJ+GceXEE/A59j JV+uFGGZdfLv4DqexXc+N481HSCQtcT2V8whNzFOmEcNTAjOxTChZ4g0MJQIUfYl+wVQ xAHJZpxf2Q+h4tr+MRX125SVV7SrCRKSrQnwoUVizKkFdPACbOObk3BWZhiztUPqPOfc dlJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kL+2l2lF; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si18263612eji.436.2020.12.28.06.35.39; Mon, 28 Dec 2020 06:36:01 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=kL+2l2lF; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505071AbgL1Odk (ORCPT + 99 others); Mon, 28 Dec 2020 09:33:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:40806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504892AbgL1OdH (ORCPT ); Mon, 28 Dec 2020 09:33:07 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E85EA20791; Mon, 28 Dec 2020 14:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165972; bh=NLBOJ7ONeQ7FS3seacVnL5lTNHis3Wlm3OSNc+Z3HUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kL+2l2lFOeMEm+M3hIxwjb/LJqlj0g1DDyFtabzEvi/Xn1IO5oUgBRe3bQyN85jk3 34T78RJk3YWpyd89W7T7ufY2d74Zqo/Yrc6aCxXrfZYiMdrcWlFg3GVPTQLr29P8K3 ObppNX8tKKoOOXVxuMYwbMMFXhfVTcN4mKHhfFWA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhuguangqing , Viresh Kumar , Daniel Lezcano Subject: [PATCH 5.10 713/717] thermal/drivers/cpufreq_cooling: Update cpufreq_state only if state has changed Date: Mon, 28 Dec 2020 13:51:51 +0100 Message-Id: <20201228125055.162854872@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhuguangqing commit 236761f19a4f373354f1dcf399b57753f1f4b871 upstream. If state has not changed successfully and we updated cpufreq_state, next time when the new state is equal to cpufreq_state (not changed successfully last time), we will return directly and miss a freq_qos_update_request() that should have been. Fixes: 5130802ddbb1 ("thermal: cpu_cooling: Switch to QoS requests for freq limits") Cc: v5.4+ # v5.4+ Signed-off-by: Zhuguangqing Acked-by: Viresh Kumar Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20201106092243.15574-1-zhuguangqing83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/thermal/cpufreq_cooling.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -438,13 +438,11 @@ static int cpufreq_set_cur_state(struct if (cpufreq_cdev->cpufreq_state == state) return 0; - cpufreq_cdev->cpufreq_state = state; - frequency = get_state_freq(cpufreq_cdev, state); ret = freq_qos_update_request(&cpufreq_cdev->qos_req, frequency); - if (ret > 0) { + cpufreq_cdev->cpufreq_state = state; cpus = cpufreq_cdev->policy->cpus; max_capacity = arch_scale_cpu_capacity(cpumask_first(cpus)); capacity = frequency * max_capacity;