From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AE88C43381 for ; Thu, 28 Feb 2019 11:54:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 279042083D for ; Thu, 28 Feb 2019 11:54:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oxUBlSnr"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="NkZvSkH9"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="P7aEEG1Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 279042083D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=aF/Ty42pkFqnCNu1fjv+9A10DRJeqAU3Dq2kdk8WqJs=; b=oxU BlSnrC7bW6AtcKnP8ZYeo4MW634oUhFLlNBt5BVlRTPWesDWOKxwNeMCCA/UKLOLXUb3bzx2HU5k8 U17mLJTD+eUXEigu+kcqQaBmgRBYO8LG2DbSZaWNiH6bdS+ivVJCD/z0wkAzBcB9rwG1zYS2tS171 RMKf43jSlr9wAZdn+TTAJ0qWUW6cqGq5UtVj0IqAu/JH3Li3x8GdMyNZjhLlexn3CjHJTS9B65tJt gQtFLe7+sGUcrD1shh4PTP71lzj9FUyItBtQzQE18fVxcpfbkLVEV2n8gcLZXMeHhjRxTCDIm9+EL piX/qJQOTedC/YiAU2MslwPjMlUMugw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzKGg-0005bK-Eu; Thu, 28 Feb 2019 11:54:26 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzKGd-0005az-EN for linux-arm-kernel@lists.infradead.org; Thu, 28 Feb 2019 11:54:24 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9340D60DAA; Thu, 28 Feb 2019 11:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551354862; bh=CSCCdtxZS56lrNPM8PJ19FKIo9nuVoJnK/SzeqZdvkA=; h=From:To:Cc:Subject:Date:From; b=NkZvSkH922+XLTDYGiAkYRjIhMLsN27SBfWJIOl79uTMh9Va+DW++ahMPcF8/qqVi 88KljvhsyyDERD6ZD/Zxw/xQeKdyKdu6SLHqi3fWFb5Afwf6rOQ9odXmSzDCGxhB2A qMM4xOF3b9Rdoh7O2J5JS8N3iUggoWSeN5GmMrDA= Received: from lingutla-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: clingutla@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8C6B760A05; Thu, 28 Feb 2019 11:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551354860; bh=CSCCdtxZS56lrNPM8PJ19FKIo9nuVoJnK/SzeqZdvkA=; h=From:To:Cc:Subject:Date:From; b=P7aEEG1QxljyQxwf5/3o0ymOcmJm7H4cOaw8glNowaeRJz3rR3uhL903CN1B1nmSK bzf9KQLxQNONdaWdrpk5LJkHQyYZZradgbciAcdeW2H5jKcZvxofzeWD9aHPkGTxTs zwTHu4UkN+I6NPC5HUzoxLTsCFFXMNgcNTmfmwN0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8C6B760A05 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=clingutla@codeaurora.org From: Lingutla Chandrasekhar To: will.deacon@arm.com, sudeep.holla@arm.com, catalin.marinas@arm.com, dietmar.eggemann@arm.com Subject: [PATCH] arch_topology: Update user supplied capacity to possible cpus in cluster Date: Thu, 28 Feb 2019 17:23:58 +0530 Message-Id: <1551354838-29902-1-git-send-email-clingutla@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190228_035423_502576_E1F2DEBF X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lingutla Chandrasekhar , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org With commit '5bdd2b3f0f8 ("arm64: topology: add support to remove cpu topology sibling masks")', when cpu hotplugged out, it resets the cpu information in its sibling CPUs. If user changes capacity of any cpu, then the new capacity applied to all online cpus in the cluster. If any hot plugged out cpu in the same cluster comes back to online, then that would have different/stale capacity value. Fix it by applying user supplied capacity to all possible cpus in the cluster. Signed-off-by: Lingutla Chandrasekhar diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index edfcf8d..dadc5d8 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -61,6 +61,7 @@ static ssize_t cpu_capacity_store(struct device *dev, int i; unsigned long new_capacity; ssize_t ret; + struct cpu_topology *icpu_topo, *this_topo = &cpu_topology[this_cpu]; if (!count) return 0; @@ -72,8 +73,15 @@ static ssize_t cpu_capacity_store(struct device *dev, return -EINVAL; mutex_lock(&cpu_scale_mutex); - for_each_cpu(i, &cpu_topology[this_cpu].core_sibling) + + for_each_possible_cpu(i) { + icpu_topo = &cpu_topology[i]; + + if (icpu_topo->package_id != this_topo->package_id) + continue; topology_set_cpu_scale(i, new_capacity); + } + mutex_unlock(&cpu_scale_mutex); schedule_work(&update_topology_flags_work); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel