Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1215132imj; Sun, 17 Feb 2019 00:23:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IbQE0bYAiyy6XzDv4fx2Fnp2WKaeuEeIND5AVHl6BicGFyTEWaWIArku5Bo1D2yPvYXVNTl X-Received: by 2002:a63:2706:: with SMTP id n6mr12990413pgn.352.1550391814568; Sun, 17 Feb 2019 00:23:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550391814; cv=none; d=google.com; s=arc-20160816; b=cU2zr6NfEO3pYFDgyuqY6Rb8wxALS80R3ff2RirCuX2no5hCUn9ojKzfb14dh3sEfI pijtIPb8hlcKmF2sLroFjkEF7TYwSgrORAWHGLFfBsU2KKE7QcS1bmmU/DcllBoaPJ6N gG43qNqVvvY7o0wkc6ywF5TKYUt9diuBr0PxQv7cyFpAuDjk60CwE89wAdeLzAoAB9gp giLE3B1F5blX7qLPqKWZrY5cqoc+VRQG0cOGrPoFsjKCByi0MRRf2kY7CrrpbJjYMs6O /Aw2WWtL/vz6YCkibD/dkMva1+1qK6OS5TNXExiXVxGHiHIrzK9b8xv+v3HU/O0QXWKu kttg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=+Gft5Rra5kYKWozT4T65fPErWGmIJWb30wOyy74dALI=; b=NUshfgSIjWGRXW1HeSzgCiRh8cEchz6hbSZqiXfhWKKqvk/bE97AiHIXNhv1fORQ8b HGRtNegoqNx0nfUh0NBpMKvJW4oiqFuYP5cS1uRdTe+C8Wh11PLOaXUd0sSkznpvseyL Z/GVSN8AJbOMy1k85DHk5zHMooZYWloYS811yoewg5W5hZatP80isLqAB0znxvLJISsY s4Q9zwuf+9vseLRYchT74h32822jVble5HPpAeLsQKa0/QKDqw29i+Q3+26DGrreJ8ST TUVr5yN2zZOapDSJz77KDMViI1zTVBsqw+dssnz3688i+m1VBdHZlTDqQBjyfNNYSyF4 yb9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f63si9748265pgc.473.2019.02.17.00.23.18; Sun, 17 Feb 2019 00:23:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729239AbfBQDzV (ORCPT + 99 others); Sat, 16 Feb 2019 22:55:21 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:3753 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727391AbfBQDzS (ORCPT ); Sat, 16 Feb 2019 22:55:18 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8D1E3C8E6C783A931EC5; Sun, 17 Feb 2019 11:55:15 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Sun, 17 Feb 2019 11:55:06 +0800 From: Xiongfeng Wang To: , , , , , CC: , , , , Subject: [PATCH v3 0/2] Work around for Hisilicon CPPC cpufreq Date: Sun, 17 Feb 2019 11:54:13 +0800 Message-ID: <1550375655-58007-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hisilicon chips do not support delivered performance counter register and reference performance counter register. But the platform can calculate the real performance using its own method. This patch provide a workaround for this problem, and other platforms can also use this workaround framework. We reuse the desired performance register to store the real performance calculated by the platform. After the platform finished the frequency adjust, it gets the real performance and writes it into desired performance register. OS can use it to calculate the real frequency. Changlog: v2 -> v3: Recontruct 'cppc_get_desired_perf'. Rename 'cppc_workaround_info' to 'cppc_workaround_oem_info' Drop 'get_rate' member from struct cppc_workaround_oem_info Change 'cppc_wa_get_rate' pointer to a flag to indicate whether we need to aplly the workaround. Move the new functions to the beginning of cppc-cpufreq.c Xiongfeng Wang (2): ACPI / CPPC: Add a helper to get desired performance cpufreq / cppc: Work around for Hisilicon CPPC cpufreq drivers/acpi/cppc_acpi.c | 39 +++++++++++++++++++++++++ drivers/cpufreq/cppc_cpufreq.c | 66 ++++++++++++++++++++++++++++++++++++++++++ include/acpi/cppc_acpi.h | 1 + 3 files changed, 106 insertions(+) -- 1.7.12.4