From patchwork Mon Jul 9 15:45:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 141447 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2816961ljj; Mon, 9 Jul 2018 08:45:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeEMWAkBgvbdksVorHrgtgEo4Wfu96oFp0yH0+SltER7XlqXFlW7+4/FB2pQWL9I72/7khQ X-Received: by 2002:a17:902:7446:: with SMTP id e6-v6mr21442900plt.161.1531151155375; Mon, 09 Jul 2018 08:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531151155; cv=none; d=google.com; s=arc-20160816; b=nN/HdpNRmckZnyqy7qEvJbxLlmFNSxGtouZJG4qTpG5764OvLU0m2IRySjnzkfG7Ep K7vNsFeN1T5oA6vTYPwYdOUrovhrM7PZ6KtpLYWyZu7iS+JNE+4Puv+dUyrifpexmHsa O42JdcCyR73+BclYch3vkWRZO2pMRHayMdq7i0mGRdi0WPq7cpLHJAvLJecLMs+uzmDY PKmzZ7YX1IoD6WLT8K6TK8RsghyliBSIvzRVcBBwZnMFbF5GCdEZmNkybbVJy5CBk7Fq rLedRaA1lzBNIgFcfSRVOIleFsCKL+2GcUyjOLTqF1zmB+gdh5V/TGRrptoX72+TyuoP TJ8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=PUsp3Gws3TKfFD2SNayi8IBdfEXjaPOOwN45SkXtZo4=; b=coIRVEe/PSFOXQiWIpSBiyIlMBH19XAiNArDBpX4IsQv2NnL3LKo4ufhFwlEJ+0xOr /A9VZcYC7fMUDmUPR944p/K2kqyfluuf2uvrMxNROalw8wjm9U1lWFjyUReELGFdW/Lb y30IyQf0fj9233HBtILJQ8TrFHxwMrHq6NkfZwMGUPX6tgppmY61t8LxDc5WX9K2cf56 vyAk0+hnUeP4BZCyNvTyLYqXQIlTRZGPfz2peDdb25Vs9uQnkeppJpuMTpk9HaKyhn/F dygiHtJ25pL2sfwL8nj3S3pTI7UZz7rWNodMDVbxA7COqfeo5ekF/gBtWCPy+ufSY4vM C99w== 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 h9-v6si4790574pfh.240.2018.07.09.08.45.55; Mon, 09 Jul 2018 08:45:55 -0700 (PDT) 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 S933563AbeGIPpy (ORCPT + 30 others); Mon, 9 Jul 2018 11:45:54 -0400 Received: from foss.arm.com ([217.140.101.70]:33458 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932688AbeGIPpw (ORCPT ); Mon, 9 Jul 2018 11:45:52 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 20C061682; Mon, 9 Jul 2018 08:45:52 -0700 (PDT) Received: from usa.arm.com (e107155-lin.cambridge.arm.com [10.1.211.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9D5163F589; Mon, 9 Jul 2018 08:45:50 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sudeep Holla , Marc Zyngier , Thomas Gleixner , Kevin Hilman , Martin Blumenstingl , Mark Rutland Subject: [PATCH 2/2] clocksource: arm_arch_timer: set arch_mem_timer cpumask to cpu_possible_mask Date: Mon, 9 Jul 2018 16:45:36 +0100 Message-Id: <1531151136-18297-2-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531151136-18297-1-git-send-email-sudeep.holla@arm.com> References: <1531151136-18297-1-git-send-email-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, arch_mem_timer cpumask is set to cpu_all_mask which should be fine. However, cpu_possible_mask is more accurate and if there are other clockevent source in the system which are set to cpu_possible_mask, then having cpu_all_mask may result in issue. E.g. on a platform with arm,sp804 timer with rating 300 and cpu_possible_mask and this arch_mem_timer timer with rating 400 and cpu_all_mask, tick_check_preferred may choose both preferred as the cpumasks are not equal though they must be. This issue was root caused incorrectly initially and a fix was merged as commit 1332a9055801 ("tick: Prefer a lower rating device only if it's CPU local device"). Cc: Mark Rutland Cc: Marc Zyngier Signed-off-by: Sudeep Holla --- drivers/clocksource/arm_arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Hi, There are few more drivers that set cpu_all_mask, should they also be changed ? It should be fine as long as it's not compared against someother non per-CPU timer with shorter cpumask. Regards, Sudeep -- 2.7.4 diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 57cb2f00fc07..d8c7f5750cdb 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -735,7 +735,7 @@ static void __arch_timer_setup(unsigned type, clk->features |= CLOCK_EVT_FEAT_DYNIRQ; clk->name = "arch_mem_timer"; clk->rating = 400; - clk->cpumask = cpu_all_mask; + clk->cpumask = cpu_possible_mask; if (arch_timer_mem_use_virtual) { clk->set_state_shutdown = arch_timer_shutdown_virt_mem; clk->set_state_oneshot_stopped = arch_timer_shutdown_virt_mem;