Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp213649imm; Fri, 21 Sep 2018 13:01:56 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbniu3dAMNF635ZSfQ0S1ya/uK8IYI30oMUoOjMlStQfV4eS4EeyymSqkRL9wPlkFv07Qlp X-Received: by 2002:a63:e60c:: with SMTP id g12-v6mr43464005pgh.308.1537560116799; Fri, 21 Sep 2018 13:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537560116; cv=none; d=google.com; s=arc-20160816; b=qndysgK1I8FzySBC6bZLqlZJx9SYojaf++E7HzmoG+IK/U3ux3C3+A9zyxQL9r/Fhd QtYZwhMYdVgZH1lNJGedm1QivKmoDDbGwacVPKZeSBMA++kuxM7hhmEGsaqgMTBC2frY HWZG6pCVaipjn8hQXEeDVbE/6qFMx8GxISr5Z+/ZEChNdXxhTejfBi/3iLSxHGG+eoTm Kh2MNINRMXppLg7u2Va+6T8cCS9RjsTJJP0C434+7BPPZg7c+vQOAfpi2pEVTThXkgnE jWMWdDUGS20p6SEOrQKuX49WnmTJWF/Fs2MerRlkndG0plRqw6HNwjeJBstoQULvEUFN bcXg== 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; bh=KzhfJzVvSBydWMiaLaonOeFXSycJhr8C25Q2NOuAmao=; b=oSf+raCue1Sk+tJAVsqfTwxScDoVXliLo5kdPmGgayqy62rP0JnSvDNRcyqUjI1F/q SqYcDy/Hv9R91stH0VEiN+bgjjNkt6z3PUmMJh+0cUYuB2rcgac+8sLM01V9BM3fkwTi z3fpKab0vMGx5i6K8bsKfOHti5yuPveVk3+81AcdRb7CS0AVirgA7rEoSiN5S+w6uIYs 9Gl3vZ3ze+xl86OOTku3ZdU0E8TZW8cv5VJoL7pM1gECDcOULvt1wsW1UNpE9Jh9UNQt HXrmrU2Uo5Cjym+gGqUMLx1UwFcqNQ3f+OPBKj+Z7IepCpu0/Uc4KdJauJ7z+akPfoLt nMQw== ARC-Authentication-Results: i=1; mx.google.com; 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 c5-v6si27387984pgi.211.2018.09.21.13.01.41; Fri, 21 Sep 2018 13:01:56 -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; 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 S2391430AbeIVBuo (ORCPT + 99 others); Fri, 21 Sep 2018 21:50:44 -0400 Received: from foss.arm.com ([217.140.101.70]:41298 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391371AbeIVBun (ORCPT ); Fri, 21 Sep 2018 21:50:43 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A17A315BF; Fri, 21 Sep 2018 13:00:19 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AA3EA3F5BD; Fri, 21 Sep 2018 13:00:18 -0700 (PDT) From: Marc Zyngier To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , Jeremy Linton , Jeffrey Hugo , Thomas Gleixner , Jason Cooper Subject: [PATCH 03/10] irqchip/gic-v3-its: Split property table clearing from allocation Date: Fri, 21 Sep 2018 20:59:47 +0100 Message-Id: <20180921195954.21574-4-marc.zyngier@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180921195954.21574-1-marc.zyngier@arm.com> References: <20180921195954.21574-1-marc.zyngier@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As we're going to reuse some pre-allocated memory for the property table, split out the zeroing of that table into a separate function for later use. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index ed6aab11e019..7ef6baea2d78 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1597,6 +1597,15 @@ static void its_lpi_free(unsigned long *bitmap, u32 base, u32 nr_ids) kfree(bitmap); } +static void gic_reset_prop_table(void *va) +{ + /* Priority 0xa0, Group-1, disabled */ + memset(va, LPI_PROP_DEFAULT_PRIO | LPI_PROP_GROUP1, LPI_PROPBASE_SZ); + + /* Make sure the GIC will observe the written configuration */ + gic_flush_dcache_to_poc(va, LPI_PROPBASE_SZ); +} + static struct page *its_allocate_prop_table(gfp_t gfp_flags) { struct page *prop_page; @@ -1605,13 +1614,7 @@ static struct page *its_allocate_prop_table(gfp_t gfp_flags) if (!prop_page) return NULL; - /* Priority 0xa0, Group-1, disabled */ - memset(page_address(prop_page), - LPI_PROP_DEFAULT_PRIO | LPI_PROP_GROUP1, - LPI_PROPBASE_SZ); - - /* Make sure the GIC will observe the written configuration */ - gic_flush_dcache_to_poc(page_address(prop_page), LPI_PROPBASE_SZ); + gic_reset_prop_table(page_address(prop_page)); return prop_page; } -- 2.18.0