From patchwork Sun Oct 29 21:20:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 117425 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1853957qgn; Sun, 29 Oct 2017 14:25:06 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rc3hYewN5n0/aJvbIZDdkH0b4vbkDAQS+U80nF792qbcnLxDRjnQ6bmbbD4dRsf5+FGFza X-Received: by 10.159.207.147 with SMTP id z19mr5490620plo.441.1509312305913; Sun, 29 Oct 2017 14:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509312305; cv=none; d=google.com; s=arc-20160816; b=AS2viLe/m/cRX1pTkfqTo4pKBuvVYoT+prNrqVAAzCO1nUwr5ScMVxNDLBVCM+KXJE 120pSSZpsIoUU0tPjQgPUoGs75ee38juGYXX64KBwmWthjyPlsRcizUdGAsQjZm/7E+4 XccTdApD/bCzdI2e5+UARuoLQW2N5zq0SCM8qn1lAGuLGY49oIGf3JtGtVXhHtogG62q zvBiWCufMAUyCjHD9vTkymVjpsfgtp8A0YeXbhqR830J0EtNYzw5JCCda64vZp+TINk+ 5d9yW0am+7SpChxdmr0yQFq6wEOGFu+Xec5kGERo9I+/uLa84qXF2879b1TIr7xBqTld aa8w== 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:dkim-signature:arc-authentication-results; bh=5S1uUXHbe+0/SB0Ecjm3ZzYvS+YgR0TJPCoWrlOIANQ=; b=Dh0ci65XN6b0SvdodS81sw2wsP7XPGn80/nVXk+k0vmA9f6rN0Ze8hB6nNO31mX8k5 Q1d+CvBYQmPUrkYfyf1sla5p/zM9RVnnGrYgudcfEumIgur31eCk5WEM4DfpWsX3UarX zJ6Lx3UkpkjRv9UxW+qNde31zNEsAhksDJcB/6srTkchBUxvgL0BqZKsL+acCkOl2+HW cbUx4LIFDFnaeBZLgSKXjmP8Xd9WllXATOX5K6o2Rcp2AVFVL0NtSZfMdJiybedDw83N Nvu2mcNrR2iGfH1lOBqPoNJtTATBQG/PiU9li83x0JdxRxOC63gbCiJ4V7aSu08UwGIz kffw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JYfcZYWo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s83si9336457pfg.506.2017.10.29.14.25.05; Sun, 29 Oct 2017 14:25:05 -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; dkim=pass header.i=@linaro.org header.s=google header.b=JYfcZYWo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932400AbdJ2VZC (ORCPT + 27 others); Sun, 29 Oct 2017 17:25:02 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:54614 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932342AbdJ2VZA (ORCPT ); Sun, 29 Oct 2017 17:25:00 -0400 Received: by mail-wr0-f196.google.com with SMTP id o44so10683132wrf.11 for ; Sun, 29 Oct 2017 14:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5S1uUXHbe+0/SB0Ecjm3ZzYvS+YgR0TJPCoWrlOIANQ=; b=JYfcZYWoWsH8vb6rHbJ9eBJLjfB6KdfmhDkNrvCSAqz24HnVAg/qZTSXKhTIqCBEgA 9NtKbWcFxIKLXM17XxnKZjcXfbhsjNpWztfLLCsGmgnCPjAwMQoSv3uZYsCE+SYy3vpJ eeWnNkXfgkh8I3vIHee0hZp84TRwderk9Mn3w= 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:in-reply-to :references; bh=5S1uUXHbe+0/SB0Ecjm3ZzYvS+YgR0TJPCoWrlOIANQ=; b=Y6KAdPLPHTDUcd5kf4TUVklWIACUbBnexfyby+SuCvk72vAC2HLPpA+FdXR+7Oqzln OJL4JX/TpU3IoESnSCdQDexAJalL+HGwI3FusjAhIZQpE7QHrxo8B9wz5pQDW3MVXHZx g4okoP5KKgO3oo7iITLLmf1nMj9REOqCUfOGWT0B/hgQQk4nXOA6aXHJAQWZyZZ/RbHf 7m9jdXe64NElqgfcNsnojy/Q+nv+aA75NuvTVt4VsdZPpxFCRiP9HDbJQbivPrkWmiIJ RRX7boa6CHToIsYHtWsdpzviGIGb4PXnpmIJDZ2dIAGGxUe6mGtUWbQqsrjqbq2YwhjM BpNw== X-Gm-Message-State: AMCzsaUSzAByIbNY44JXWDy9xYKU8Yy7QEzV4daUVEqKnOUk+/EBKNrq jJ6/ORu7w7QXUqgRypNhlN67dg== X-Received: by 10.223.184.230 with SMTP id c35mr5597965wrg.18.1509312298904; Sun, 29 Oct 2017 14:24:58 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:2c92:b7e6:9f71:ab86]) by smtp.gmail.com with ESMTPSA id z20sm10067264wrz.62.2017.10.29.14.24.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Oct 2017 14:24:58 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, daniel.lezcano@linaro.org Cc: linux-kernel@vger.kernel.org, Matt Redfearn Subject: [PATCH 16/17] clocksource/drivers/mips-gic-timer: Add fastpath for local timer updates Date: Sun, 29 Oct 2017 22:20:33 +0100 Message-Id: <1509312035-17368-16-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509312035-17368-1-git-send-email-daniel.lezcano@linaro.org> References: <1509312035-17368-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matt Redfearn Always accessing the compare register via the CM redirect region is (relatively) slow. If the timer being updated is the current CPUs then this can be shortcutted by writing to the CM VP local region. Signed-off-by: Matt Redfearn Signed-off-by: Daniel Lezcano --- drivers/clocksource/mips-gic-timer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c index 775dea0..a04808a 100644 --- a/drivers/clocksource/mips-gic-timer.c +++ b/drivers/clocksource/mips-gic-timer.c @@ -39,13 +39,18 @@ static u64 notrace gic_read_count(void) static int gic_next_event(unsigned long delta, struct clock_event_device *evt) { + int cpu = cpumask_first(evt->cpumask); u64 cnt; int res; cnt = gic_read_count(); cnt += (u64)delta; - write_gic_vl_other(mips_cm_vp_id(cpumask_first(evt->cpumask))); - write_gic_vo_compare(cnt); + if (cpu == raw_smp_processor_id()) { + write_gic_vl_compare(cnt); + } else { + write_gic_vl_other(mips_cm_vp_id(cpu)); + write_gic_vo_compare(cnt); + } res = ((int)(gic_read_count() - cnt) >= 0) ? -ETIME : 0; return res; }