From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752090AbdCPI6D (ORCPT ); Thu, 16 Mar 2017 04:58:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53082 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbdCPI6A (ORCPT ); Thu, 16 Mar 2017 04:58:00 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 040E7C05680F Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eric.auger@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 040E7C05680F Subject: Re: [RFC PATCH 11/33] irqchip/gic-v3-its: Split out pending table allocation To: Marc Zyngier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu References: <1484648454-21216-1-git-send-email-marc.zyngier@arm.com> <1484648454-21216-12-git-send-email-marc.zyngier@arm.com> Cc: Thomas Gleixner , Jason Cooper , Christoffer Dall From: Auger Eric Message-ID: <29671afa-60a3-d099-0fd5-78229724d8da@redhat.com> Date: Thu, 16 Mar 2017 09:57:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1484648454-21216-12-git-send-email-marc.zyngier@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 16 Mar 2017 08:57:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On 17/01/2017 11:20, Marc Zyngier wrote: > Just as for the property table, let's move the pending table > allocation to a separate function. > > Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger Thanks Eric > --- > drivers/irqchip/irq-gic-v3-its.c | 29 ++++++++++++++++++++--------- > 1 file changed, 20 insertions(+), 9 deletions(-) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index 14305db1..dce8f8c 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -1188,6 +1188,24 @@ static int its_alloc_collections(struct its_node *its) > return 0; > } > > +static struct page *its_allocate_pending_table(gfp_t gfp_flags) > +{ > + struct page *pend_page; > + /* > + * The pending pages have to be at least 64kB aligned, > + * hence the 'max(LPI_PENDBASE_SZ, SZ_64K)' below. > + */ > + pend_page = alloc_pages(gfp_flags | __GFP_ZERO, > + get_order(max(LPI_PENDBASE_SZ, SZ_64K))); > + if (!pend_page) > + return NULL; > + > + /* Make sure the GIC will observe the zero-ed page */ > + gic_flush_dcache_to_poc(page_address(pend_page), LPI_PENDBASE_SZ); > + > + return pend_page; > +} > + > static void its_cpu_init_lpis(void) > { > void __iomem *rbase = gic_data_rdist_rd_base(); > @@ -1198,21 +1216,14 @@ static void its_cpu_init_lpis(void) > pend_page = gic_data_rdist()->pend_page; > if (!pend_page) { > phys_addr_t paddr; > - /* > - * The pending pages have to be at least 64kB aligned, > - * hence the 'max(LPI_PENDBASE_SZ, SZ_64K)' below. > - */ > - pend_page = alloc_pages(GFP_NOWAIT | __GFP_ZERO, > - get_order(max(LPI_PENDBASE_SZ, SZ_64K))); > + > + pend_page = its_allocate_pending_table(GFP_NOWAIT); > if (!pend_page) { > pr_err("Failed to allocate PENDBASE for CPU%d\n", > smp_processor_id()); > return; > } > > - /* Make sure the GIC will observe the zero-ed page */ > - gic_flush_dcache_to_poc(page_address(pend_page), LPI_PENDBASE_SZ); > - > paddr = page_to_phys(pend_page); > pr_info("CPU%d: using LPI pending table @%pa\n", > smp_processor_id(), &paddr); >