Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbdITFZV (ORCPT ); Wed, 20 Sep 2017 01:25:21 -0400 Received: from mail-sn1nam01on0044.outbound.protection.outlook.com ([104.47.32.44]:1085 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750924AbdITFZT (ORCPT ); Wed, 20 Sep 2017 01:25:19 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=George.Cherian@cavium.com; From: George Cherian To: devel@acpica.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: lv.zheng@intel.com, robert.moore@intel.com, jassisinghbrar@gmail.com, lenb@kernel.org, rjw@rjwysocki.net, pprakash@codeaurora.org, George Cherian Subject: [PATCH v4 0/2] Make cppc acpi driver aware of pcc subspace ids Date: Wed, 20 Sep 2017 05:24:45 +0000 Message-Id: <1505885087-5112-1-git-send-email-george.cherian@cavium.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0112.INDPRD01.PROD.OUTLOOK.COM (10.174.208.28) To CY1PR0701MB1710.namprd07.prod.outlook.com (10.163.21.12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99ff5522-2a5b-4e18-4c59-08d4ffe7fa80 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR0701MB1710; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0701MB1710;3:UvQNODWGAKO7Of24qHg/oXH+gBpMT+94DxtBFxoIlZa0LrEW/KI7CM1iXwA+DEDnNvUjBBUQmtRk0UGDHgFWZaf6a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I9w2dX5M0z5n56skc24BWTpwoTH00btZXHFEDwhpXZPgeZUW09ujw3kDxPtnapGuerET6Ym3wIfvSqRBhR2YnkbBqLoVdvIrFack3ScsghrGrRa9mXph2Xf3CFX4/oGlklOu5CNb8XEVcgJoav54tNMwRWFIUHUlU1/5ya6dSTJze/WkNwL24a/OQoNh2i+MaciyNYh4Ng5OS3+C3dzNpEsUUGfjtiPrN/toxNrUNJ3hQGp6D2S/jTgbHtIbhpeXv2s;4:2GrXnPnaC8csT5l53EfXaVbHMuwvI7Qc2Xd9EtXtDhlsh/2O+fDZwpPbHjUsWLepvtcRaBWkQTaitpFChq5vdjWJXuAq2Mrva20mRHS4MOKVRM7RA/EysXhhxsm3mqrBniNz8RpSPlysIwj6Td/cMKMJcrxF3lo8yZcQ0fW1SDWZ3iVe0NK5IWpGQxW3GWuq/SAtYn3sssB26g6QfkTp/TjJ1S4wEvbOoYLPtjAgoiEtgDiFHCiFFn8VIaOxYVCQ X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR0701MB1710;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR0701MB1710; X-Forefront-PRVS: 04362AC73B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(346002)(376002)(199003)(189002)(5009440100003)(36756003)(50986999)(3846002)(6116002)(86362001)(101416001)(48376002)(189998001)(47776003)(66066001)(50466002)(33646002)(53416004)(106356001)(50226002)(68736007)(105586002)(25786009)(97736004)(478600001)(72206003)(7736002)(6506006)(8676002)(6486002)(4326008)(305945005)(39060400002)(5003940100001)(53936002)(8936002)(81166006)(81156014)(6666003)(107886003)(16526017)(316002)(2906002)(5660300001)(6512007)(16586007)(69596002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR0701MB1710;H:ubuntu.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:3;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0701MB1710;23:qRDJlHIH10qWzQrmiVdgnpoVD8nFPD+g2xB9usR?= =?us-ascii?Q?R2JeiKV6nBL5KaVn/paQpWw27otZNS54BYINQvSahD9IegkvJB9MmnQWZhCL?= =?us-ascii?Q?kP0nyZ8cFnrsmY9AMRjkM0BlcsCIl/GvFq2QDgT7oIUacxYSfoXlv4mQhr+r?= =?us-ascii?Q?29OCJtXP9DvekezgUAh7MCefgsUOv34tUSyfrIXEO9fktYXNTK8KoPpdW762?= =?us-ascii?Q?oyCvbb6YjTbdy75e8srtYELFJ1Kskv5p20uefLd1LbLEavBAewJY1aUgM2ZU?= =?us-ascii?Q?t7uqT07UpdGCP+Ol5mggsbdcNcZhIavdl99mpImLp5ghI1jA1A9TGY4+Pbsi?= =?us-ascii?Q?HnKGma9Qtl1PZr/7neeN8SoXmSpjeMrqzz2U1311+ho772qBq5w65t+RRuYB?= =?us-ascii?Q?ewjupz07PcMFG/9USn9KrScyUyGGbnNYQG17MkcivPbHGTKkVUiG7VJYI7Rh?= =?us-ascii?Q?f+DkkWnj04dDLAOv9cWH0XkMbk6IPOqx8Wt817bzLcvNHiR5FEJwe0fDVPfn?= =?us-ascii?Q?G0ZPcUEpoVNbc3yxiRmswPjdyHYu6jKcx+hfNnaeabiJy7e5fSWS4sxFAMNi?= =?us-ascii?Q?QnRXRk0M0Z2wAN9C8RUlfGyqRxXE0ihr4ktl8fE5illqFxp26IJ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CWqhR6wxJdAgJ0TwYJDqOFHtjEuluzOWoQb+ZMDZjRwm0bMa5W4ysxY3rAmDhDbJMIE1kkgSVYj9FGhg88oyCeONkJqEZ5bGzQw7mZEfr7I49bLd52Y8feDNgv8fkcsSNve1LcvM=;24:ebw6Ihl1BcprydGnorA51oadfpGbToqq07MZGVghnBASF4zPbmxophrhDz8TQPmJ/b3xm6kczGxU9L0RvkrtcpLIFD2BADK116bvCYym+M0=;7:vMQnuj0jKOK6RxMP+prqC97jKaY4gF8KyHKGUw1iRUc34UsubIFtHlj6jpaa3K1V3MzgZy/GnizSw+9SoOuGFQivGc3hHqCJSOKiF5bdy0mpWPiU/+I/k9rVV35902kF7jWk0l49SaOEdscW/7wOPM32OEJsTQFZjtvauZ/pAkURJU5Llisl69d96el4bSjYGj1PfIrgbq52tmo5a+2IAazJbr/fsJRp/HHavon33xg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2017 05:25:13.9134 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1710 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1987 Lines: 47 The current cppc acpi driver works with only one pcc subspace id. It maintains and registers only one pcc channel even if the acpi table has different pcc subspace ids. As per ACPI 6.2 spec all PCC registers, for all processors in the same performance domain (as defined by _PSD), must be defined to be in the same subspace. The series tries to address the same by making cppc acpi driver aware of multiple possible pcc subspace ids. Patch 1 : In preparation to share the MAX_PCC_SUBSPACE definition with cppc acpi driver Patch 2 : Make the cppc acpi driver aware of multiple pcc subspace ids. Changes from v3: - Address Issue reported by kbuild-robot. Changes from v2: - Addressed Prashanth's comments on * Not to use local variables to update mpar_count, last_mpar_reset and last_cmd_cmpl_time * Add check for kzalloc failure in pcc_data_alloc() * Initialize pcc_subspace_id to -1 in acpi_cppc_processor_probe() * Check for pcc_subspace_id validity before registering pcc_channel Changes from v1: - Add last_cmd_cmpl_time, last_mpar_reset, mpar_count to the cppc_pcc_data to make it per subspace. - PCC per subspace dynamic allocation support added instead of static allocation - Added a new function pcc_data_alloc, In instances where CPU's with SMT support same PCC subspace would be used for all CPU's belonging to same physical core. This function adds the pcc_subspace refcounting and allocates the cppc_pcc_data per unique subspace idx. - Added cleanup in acpi_cppc_processor_exit. Free the mbox channel and free the cppc_pcc_data in case refcount is zero. George Cherian (2): mailbox: PCC: Move the MAX_PCC_SUBSPACES definition to header file ACPI / CPPC: Make cppc acpi driver aware of pcc subspace ids drivers/acpi/cppc_acpi.c | 243 +++++++++++++++++++++++++++++------------------ drivers/mailbox/pcc.c | 1 - include/acpi/pcc.h | 1 + 3 files changed, 154 insertions(+), 91 deletions(-) -- 2.1.4