Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754810AbbGFMLC (ORCPT ); Mon, 6 Jul 2015 08:11:02 -0400 Received: from foss.arm.com ([217.140.101.70]:58941 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754156AbbGFMK7 (ORCPT ); Mon, 6 Jul 2015 08:10:59 -0400 Message-ID: <559A7050.4060404@arm.com> Date: Mon, 06 Jul 2015 13:10:56 +0100 From: Marc Zyngier Organization: ARM Ltd User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Robert Richter , Thomas Gleixner , Jason Cooper CC: Tirumalesh Chalamarla , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Robert Richter Subject: Re: [PATCH 1/4] irqchip, gicv3-its: Read typer register outside the loop References: <1435673643-31676-1-git-send-email-rric@kernel.org> <1435673643-31676-2-git-send-email-rric@kernel.org> In-Reply-To: <1435673643-31676-2-git-send-email-rric@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1777 Lines: 49 On 30/06/15 15:14, Robert Richter wrote: > From: Robert Richter > > No need to read the typer register in the loop. Values do not change. > > Signed-off-by: Robert Richter > --- > 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 1b7e155869f6..c5ce21277920 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -803,6 +803,8 @@ static int its_alloc_tables(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); > @@ -825,9 +827,6 @@ static int its_alloc_tables(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 > The TYPER value certainly don't change, but there is also only one device table per ITS instance, so we only read it once. What do we gain here? Thanks, M. -- Jazz is not dead. It just smells funny... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/