Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4781649ybl; Wed, 22 Jan 2020 04:41:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwJdsr39t4i/FN5KlHOAFugilTWLuZLTfF2IFdAsML7K/0nGacU8oxvUwyDV8QJr4OwQo5h X-Received: by 2002:a9d:66ca:: with SMTP id t10mr7049680otm.352.1579696869697; Wed, 22 Jan 2020 04:41:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579696869; cv=none; d=google.com; s=arc-20160816; b=dTgKGNv37lQk7TTc61AczUeFwN6RUmOSi/ubhCxt+/Bwnz+/LngPCMDxHWgZixSEzg nt89ttWoVemLZ8ZuILPmbID0ScR7JKaTMnCeWR+/pr8LGDhMsnXTViKwvHvhhLEmln89 Bkin9v/pbP/7XFYnp+HQ3iH8d+yK1CnUhH3+JbS52seDDu/jxrBLFmw/13QrhhPziT8f A9yifKz17p0LfYlb20u3yDgg0/NCxUuApbJsJsBva5My4N2wajGfy8PV7hF9oF+ztpX6 qEWoMEPG1wOK5SqOoIw8Ciwvdez3WG9Yiou52Q5LVbbVv7TrROufZY542BIOW+PSr7mz 5nMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1VxX43mS0iWUpbkE5n95NgX2FTZO3NdGDZP/Z4S/IGE=; b=W4rarTpikfMrX3jO6mGQExFJr36Yh8SvKiFS3O3fAVWXPYLMHFOfBUs5SWs4IWVKOv SQBd3YAH+1UTLHps+gjbBUDry2A2SY6OzbQX/Es5/fWUddtnnLCQi9h9rQTsxUcx+2DV OluA60MVVf0edbrCJfgpDIMEpBDtpGApeeuSeWyjUN64pHs9kNJU7Kg1lP1P8I2ZbJ5x 207xTBJ0odXWwqIlN6SeTu4lhhSx1NvAOZT9+ScmVvSruhFxnWu7JHv04rV9e9po7wf8 ml6MzM5I9W4TagytI14XkUkZqGn1dlFFHhpHpUqifsg6Z4hvxwmY2PGOz8Hpyz6mrERJ yaZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndmsystems-com.20150623.gappssmtp.com header.s=20150623 header.b=Fb5pQoU1; 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 a15si23252432otq.83.2020.01.22.04.40.56; Wed, 22 Jan 2020 04:41:09 -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; dkim=pass header.i=@ndmsystems-com.20150623.gappssmtp.com header.s=20150623 header.b=Fb5pQoU1; 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 S1729019AbgAVMkC (ORCPT + 99 others); Wed, 22 Jan 2020 07:40:02 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43094 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbgAVMkB (ORCPT ); Wed, 22 Jan 2020 07:40:01 -0500 Received: by mail-wr1-f66.google.com with SMTP id d16so7072930wre.10 for ; Wed, 22 Jan 2020 04:39:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndmsystems-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1VxX43mS0iWUpbkE5n95NgX2FTZO3NdGDZP/Z4S/IGE=; b=Fb5pQoU1ctZ9lPR9YUEJPAibeMCFTCP8VrleQodfeto8e/z9pbKmbymipTUPDjyZid l+rWGRxRAAh8RoeDMZIk30KoclIWAZh5UqmBzPiesZmToJp3OJ6dxtkQqkH6Ljb2g7m5 1B/5b6FgTRfwK1Bwk6NEBrR2iw78BxWZiLC5V9g+dR+ypODibZSNR7aNvxgu2INGXuGs UNnyT9iRE6M/Tu/k4oASO9I+pPC+2R3j4pK8fiiTlcYYDHFb58cp6tDr97X8H7rOpF05 R0I4DpZRpM3s11WHuBss9pb8T/MzuSSp3LMqhMLpVVo5pDhoANDpIYJohQ3QlJS7uIrw F/wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1VxX43mS0iWUpbkE5n95NgX2FTZO3NdGDZP/Z4S/IGE=; b=MmoOk/f2vmgolwWeqLnmiVjA53zflPr7HPRNVAJ6HJsmForwga3xJN1qqa/sgQHYFg NNmfDVeZcZjx/v/7aoYe1wuvi+czNaav1XHR0KPZOjA3tPwf7CTKn6NXYdtHoXMtazcc zJ8Iq5O2TGFYR7dD9BqLIOuXSuSNwdLGMAROp0WmcI9BTfUSjK1Jk521kCVuXMcW04hq ynjaL6wiH8v4JnENCYr7xsQ3RfyQjfVyvemgv9e6LVUJT6aYK/TtMpLc/VUVKTbGTlQ1 p1t1lY+L4wrPy183HiqaQhHzVFNjnVx2JqAlLdIPs2WApMpWsWhVQnuUPm5IHMON1FGy Kf3Q== X-Gm-Message-State: APjAAAXV23HeLxD3jBe4qGkMZovv+7i2PCByOOxKbKti6bjhkowKTsza +gmfro5tkurb9awTBjSo7NQneA== X-Received: by 2002:adf:ec4c:: with SMTP id w12mr11534785wrn.124.1579696799115; Wed, 22 Jan 2020 04:39:59 -0800 (PST) Received: from cbox-EPYC.ndm9.net ([2a01:4f8:13b:67::2]) by smtp.googlemail.com with ESMTPSA id g25sm4833490wmh.3.2020.01.22.04.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 04:39:58 -0800 (PST) From: Sergey Korolev To: linux-mips@vger.kernel.org Cc: s.korolev@ndmsystems.com, Ralf Baechle , Paul Burton , James Hogan , linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: sync-r4k: do slave counter synchronization with disabled HW interrupts Date: Wed, 22 Jan 2020 15:39:08 +0300 Message-Id: <20200122123909.8188-1-s.korolev@ndmsystems.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org synchronise_count_slave() called with an enabled in mips_clockevent_init() timer interrupt which may decrease synchronization precision. Signed-off-by: Sergey Korolev --- arch/mips/kernel/sync-r4k.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c index f2973ce87f53..abdd7aaa3311 100644 --- a/arch/mips/kernel/sync-r4k.c +++ b/arch/mips/kernel/sync-r4k.c @@ -90,6 +90,9 @@ void synchronise_count_master(int cpu) void synchronise_count_slave(int cpu) { int i; + unsigned long flags; + + local_irq_save(flags); /* * Not every cpu is online at the time this gets called, @@ -113,5 +116,7 @@ void synchronise_count_slave(int cpu) } /* Arrange for an interrupt in a short while */ write_c0_compare(read_c0_count() + COUNTON); + + local_irq_restore(flags); } #undef NR_LOOPS -- 2.20.1