From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933069AbbI2IQp (ORCPT ); Tue, 29 Sep 2015 04:16:45 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37279 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932717AbbI2IQi (ORCPT ); Tue, 29 Sep 2015 04:16:38 -0400 Date: Tue, 29 Sep 2015 01:16:22 -0700 From: tip-bot for Robert Richter Message-ID: Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, marc.zyngier@arm.com, mingo@kernel.org, catalin.marinas@arm.com, rrichter@cavium.com, tchalamarla@cavium.com, jason@lakedaemon.net Reply-To: hpa@zytor.com, marc.zyngier@arm.com, mingo@kernel.org, catalin.marinas@arm.com, rrichter@cavium.com, tchalamarla@cavium.com, jason@lakedaemon.net, linux-kernel@vger.kernel.org, tglx@linutronix.de In-Reply-To: <1442869119-1814-4-git-send-email-rric@kernel.org> References: <1442869119-1814-4-git-send-email-rric@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] irqchip/gicv3-its: Read typer register outside the loop Git-Commit-ID: c14e36733b8a63894db9ca0b486ce14299ef2fda X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c14e36733b8a63894db9ca0b486ce14299ef2fda Gitweb: http://git.kernel.org/tip/c14e36733b8a63894db9ca0b486ce14299ef2fda Author: Robert Richter AuthorDate: Mon, 21 Sep 2015 22:58:36 +0200 Committer: Thomas Gleixner CommitDate: Tue, 29 Sep 2015 10:10:53 +0200 irqchip/gicv3-its: Read typer register outside the loop No need to read the typer register in the loop. Values do not change. This patch is basically a prerequisite for a follow-on patch that adds errata code for Cavium ThunderX. It moves the calculation of the number of id entries to the beginning of the function close to other setup values that are needed to allocate the its table. Now we have a central location to modify the setup parameters and the errata code can be implemented in a single block. Signed-off-by: Robert Richter Acked-by: Marc Zyngier Acked-by: Catalin Marinas Cc: Tirumalesh Chalamarla Cc: linux-arm-kernel@lists.infradead.org Cc: Jason Cooper Link: http://lkml.kernel.org/r/1442869119-1814-4-git-send-email-rric@kernel.org Signed-off-by: Thomas Gleixner --- drivers/irqchip/irq-gic-v3-its.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index d9052fd..549e716 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -815,6 +815,8 @@ static int its_alloc_tables(const char *node_name, struct its_node *its) int psz = SZ_64K; u64 shr = GITS_BASER_InnerShareable; u64 cache = GITS_BASER_WaWb; + u64 typer = readq_relaxed(its->base + GITS_TYPER); + u32 ids = GITS_TYPER_DEVBITS(typer); for (i = 0; i < GITS_BASER_NR_REGS; i++) { u64 val = readq_relaxed(its->base + GITS_BASER + i * 8); @@ -838,9 +840,6 @@ static int its_alloc_tables(const char *node_name, struct its_node *its) * For other tables, only allocate a single page. */ if (type == GITS_BASER_TYPE_DEVICE) { - u64 typer = readq_relaxed(its->base + GITS_TYPER); - u32 ids = GITS_TYPER_DEVBITS(typer); - /* * 'order' was initialized earlier to the default page * granule of the the ITS. We can't have an allocation