From patchwork Mon Jul 9 15:45:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 141446 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2816918ljj; Mon, 9 Jul 2018 08:45:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcK1+E1ECcV7yjyD7ynF7gCywMSLzZW5szutV2f1ZssjOuPVqrcf1u+FNhJjdPEgQTuAcTN X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr20986145pli.108.1531151152980; Mon, 09 Jul 2018 08:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531151152; cv=none; d=google.com; s=arc-20160816; b=oPwalfJvs3NJgLj83XSrGVOOtRbsBhK2vZGJQnv0N2wuare6Qghq57yV3Lqj1CcAKF 0/akspTUPCmj+3xR0rIyq5Qo42IcE4uWutr0qod/BA/mEErOpqmsILzLDQrsSKSPw6Mq dj6KR7laMWhi4pmK+vB200qgu0xCudf2zicavbh4eSAtaI5aesd83P3zIbpqFgATe2nc 68sJibr/mycM1XbMAnSkLe/ORQ2SYrfBlU9nVYTCFvX9z8RdSVHTdrvZ3nwYRpa8Cp3C YWhXblRhAhILZEZw4EbAgFX3Ag81HoBp8abR0o+iL7EVZ4+E/6V+n/p3IxC2EBfd9GQd DrHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=JT38rt7GM69P8B5IbX5eMi040baiKV9GZIoNPH91iHc=; b=RiCCqJ5H+3NYyrPGOWwXfBRCfZ+jQ1MGtnXWn0QAU9y8n9zNwIq351D5u+DHdOQcAr xsv7HhbAJr/AOZs03j56cs7i50+W/4U09UfNTeVAsqsww1xF3bOaoNQskZlBK41zeoJ8 XxtdaRQMIZ+xnX8ZDneL5yHEhgHNGbrxu7RkM7PzbknkxtjBTDkYjrxxiOtIxcC0JDrA j1JBEqf8YAlcLPNctG4izDWZguOF+MRz18/gDpaF46TB6dD3/GckQKw6Fev25t9J2Hzr gzHAfv5iFctfMJdIpziwplS/VbQygtcL0QlTUeZ0chfK4XSfZvVCvySt+ZC8+PrjpVf4 YjYw== 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 67-v6si14042742pgi.456.2018.07.09.08.45.52; Mon, 09 Jul 2018 08:45:52 -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 S933501AbeGIPpv (ORCPT + 30 others); Mon, 9 Jul 2018 11:45:51 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33426 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932688AbeGIPpr (ORCPT ); Mon, 9 Jul 2018 11:45:47 -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 E1426ED1; Mon, 9 Jul 2018 08:45:46 -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 82E293F589; Mon, 9 Jul 2018 08:45:45 -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 Subject: [PATCH 1/2] Revert "tick: Prefer a lower rating device only if it's CPU local device" Date: Mon, 9 Jul 2018 16:45:35 +0100 Message-Id: <1531151136-18297-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 1332a90558013ae4242e3dd7934bdcdeafb06c0d. The original issue was not because of incorrect checking of cpumask for both new and old tick device. It was incorrectly analysed was due to the misunderstanding of the comment and misinterpretation of the return value from tick_check_preferred. The main issue is with the clockevent driver that sets the cpumask to cpu_all_mask instead of cpu_possible_mask. Cc: Thomas Gleixner Signed-off-by: Sudeep Holla --- kernel/time/tick-common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Hi Thomas, As mentioned in the other thread, this needs to be reverted. Sorry for the misunderstanding the original issue and producing wrong fix. Regards, Sudeep -- 2.7.4 Tested-by: Kevin Hilman Tested-by: Martin Blumenstingl diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index b7005dd21ec1..14de3727b18e 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -277,8 +277,7 @@ static bool tick_check_preferred(struct clock_event_device *curdev, */ return !curdev || newdev->rating > curdev->rating || - (!cpumask_equal(curdev->cpumask, newdev->cpumask) && - !tick_check_percpu(curdev, newdev, smp_processor_id())); + !cpumask_equal(curdev->cpumask, newdev->cpumask); } /* 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;