From patchwork Mon Mar 5 16:03:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 130646 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2853284lja; Mon, 5 Mar 2018 08:06:47 -0800 (PST) X-Google-Smtp-Source: AG47ELu/KsY5FjPGpZLbsQXei8P7ox4bouVTd9B5o8p2QYzsZGG2xqXBmaAtD8SEsxrlpp90HB+N X-Received: by 10.36.34.11 with SMTP id o11mr14855038ito.60.1520266007371; Mon, 05 Mar 2018 08:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520266007; cv=none; d=google.com; s=arc-20160816; b=VARKmSwGNZO8zPtGGwLlH3TnOib/qtAeewU05wMTcWzwXBYm3IpHnkWxhuKmjaAKO3 lly2fhZ4gtKERBvH++YI5Q8Pg4Kavo4QW8spZLk1f7WaQWRFelIqiWnpnU11GFShAfPX GPclgyFEfz6TiLOzwLXpQXTie+zT5aLmgussbgBDsR4wdoKt3b2LdiFuxnp1zxSnaOBn PZy2EFIb42puQgS9atUDTY9zYO2N1pcmF7XN34pKT2XMwq4GB6PfDKu3TClCeGArtfEA o/2FUegp9PNwciXIQWxD/SnFYY4WfI9N5+Hx15qh36PzmCsgwn/Zaem9scGokGGSJEtk kxrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=UtWZffQA/vxd6rDN+g3Qm/UQ2KOhosBrwXPt2xUCE98=; b=q1jugvFjzZ1+opYHHq9rkZA/V5XjSW/spdaIDAWMpnWnMdrFWnn9dJTst8wZYd+WZP mdCEXaTIH9di1jLEg519MLJ3svkdXaCEU2mQKa3sHfSw98z3e2giwd2Bm8GBmSYdoaUL i9sxn2YGSFpzBhqrQ3F0uiulhw47japsh8Ui/0ukAeRl97MKjadCUWYB6eGdaiyELoUt VRbcnu2iTjL58f+gScJGfN+Dcyo0v53znp+DNtj7R7zahT+p6uOFaeC2MZcqlvNorSF9 4qLJ4R6i0zb0L1kXPIq7etXo/B3Q6th23qBvLkIB9BA/JCvTqKL9zR9QKhQpqofbIVRm JR5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=J3CUzQSc; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id h25si6129553iti.115.2018.03.05.08.06.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:06:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=J3CUzQSc; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1essbT-0007T6-TO; Mon, 05 Mar 2018 16:04:43 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1essbT-0007RF-1P for xen-devel@lists.xenproject.org; Mon, 05 Mar 2018 16:04:43 +0000 X-Inumbo-ID: c286119b-208e-11e8-ba59-bc764e045a96 Received: from mail-wr0-x241.google.com (unknown [2a00:1450:400c:c0c::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id c286119b-208e-11e8-ba59-bc764e045a96; Mon, 05 Mar 2018 17:03:36 +0100 (CET) Received: by mail-wr0-x241.google.com with SMTP id k9so17804120wre.9 for ; Mon, 05 Mar 2018 08:04:41 -0800 (PST) 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=+hVHZe2+wSalqmOo1TCU+udcVPctdycZTTMkSObIsOc=; b=J3CUzQScZe9anPLoHqvWrcaA9c6bV7rxIfIWkslkBlUi250z0IQTjQFaoAbQ7VIVAD hh0Nzkrdd/cpsCYgVB7Jf137+L/LWVu37bCBveTsSMneytZF0rMWkVvDZc+OkfzYV7TT SDXPs8amoh+uEeCrwio5FBenP5gLwUaEVHVIw= 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=+hVHZe2+wSalqmOo1TCU+udcVPctdycZTTMkSObIsOc=; b=cNOwPz56yCH/86AfDBgDcsQDqLudOTGR1lWE2pEVXs8+mSkAIEJYgQQSEliSRRt5WI kpjU0F8xk0A9NvHmmhscVgaumQboXGfCPm/ALcsHxATBL4ppdMtKJonfzWcHZCM/YnyY LJjkVFsTpz6vzhPxAqwOb4wRHN+Wzj3m9iazLUoZkwkXKNpObWC8fFbrwAY9exBYfZF5 +i7seWbC6tTx2x3mOn6wSU3NEO8iUXtjA6VlqKaep5gvOHkUCJUAYFozrFCI7/5ZHf2k GwOLb2wKfCDhQOoKI4mw8hiVjaGdyE2WhNSqYbo+tbzvQZEVegCmZGotnQbaM2z+Edgs 95iw== X-Gm-Message-State: APf1xPAaMEegsDdKERLR+yZte3O3ce3caHIf8j1g6vk3xYOR1B4YR4hT wLACN+8s+iwL1XAKpGg/DtX54g== X-Received: by 10.223.156.208 with SMTP id h16mr14044541wre.123.1520265880888; Mon, 05 Mar 2018 08:04:40 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id y6sm6574381wmy.14.2018.03.05.08.04.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Mar 2018 08:04:40 -0800 (PST) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Mon, 5 Mar 2018 16:03:36 +0000 Message-Id: <20180305160415.16760-19-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180305160415.16760-1-andre.przywara@linaro.org> References: <20180305160415.16760-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 18/57] ARM: GICv2: introduce gicv2_poke_irq() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The GICv2 uses bitmaps spanning several MMIO registers for holding some interrupt state. Similar to GICv3, add a poke helper functions to set a bit for a given irq_desc in one of those bitmaps. At the moment there is only one use in gic-v2.c, but there will be more coming soon. Signed-off-by: Andre Przywara Reviewed-by: Julien Grall --- Changelog RFC ... v1: - new patch xen/arch/arm/gic-v2.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c index 7938a42591..618dd94120 100644 --- a/xen/arch/arm/gic-v2.c +++ b/xen/arch/arm/gic-v2.c @@ -235,6 +235,11 @@ static unsigned int gicv2_read_irq(void) return (readl_gicc(GICC_IAR) & GICC_IA_IRQ); } +static void gicv2_poke_irq(struct irq_desc *irqd, uint32_t offset) +{ + writel_gicd(1U << (irqd->irq % 32), offset + (irqd->irq / 32) * 4); +} + static void gicv2_set_irq_type(struct irq_desc *desc, unsigned int type) { uint32_t cfg, actual, edgebit; @@ -509,7 +514,6 @@ static unsigned int gicv2_read_apr(int apr_reg) static void gicv2_irq_enable(struct irq_desc *desc) { unsigned long flags; - int irq = desc->irq; ASSERT(spin_is_locked(&desc->lock)); @@ -517,20 +521,19 @@ static void gicv2_irq_enable(struct irq_desc *desc) clear_bit(_IRQ_DISABLED, &desc->status); dsb(sy); /* Enable routing */ - writel_gicd((1u << (irq % 32)), GICD_ISENABLER + (irq / 32) * 4); + gicv2_poke_irq(desc, GICD_ISENABLER); spin_unlock_irqrestore(&gicv2.lock, flags); } static void gicv2_irq_disable(struct irq_desc *desc) { unsigned long flags; - int irq = desc->irq; ASSERT(spin_is_locked(&desc->lock)); spin_lock_irqsave(&gicv2.lock, flags); /* Disable routing */ - writel_gicd(1u << (irq % 32), GICD_ICENABLER + (irq / 32) * 4); + gicv2_poke_irq(desc, GICD_ICENABLER); set_bit(_IRQ_DISABLED, &desc->status); spin_unlock_irqrestore(&gicv2.lock, flags); }