Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2814566ybl; Mon, 19 Aug 2019 07:54:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqWHHE6WCLynNiiYkNuIvqzJYDxRqgZ8nZWh7VvIolrYdmLNT59YnGV6lOk92R6ybthh0m X-Received: by 2002:a17:902:ab8f:: with SMTP id f15mr23161739plr.301.1566226486344; Mon, 19 Aug 2019 07:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566226486; cv=none; d=google.com; s=arc-20160816; b=REbdJIQr4awfOGuF66VuPoW7Uqt33xCIu5Vxf8nIiG9Tx4Ghk/zVvVJGm6woI9nAur Lw+OyLfKZbQ74gWKVv+1X1xKJxUKzcpEPxoWzFulHH8/C3h7sc2VMHt0A+moIGAIGt3j PuO3Ktxj4qfrQEx5dPdQNznk/XYT5DP3Jz8infbwmuRnV6AwyDlhfgaD5bR+3j6KgAu1 Zv5yVV5JrkiYvn654VMNChh6++RBS8uB9lKw91tYkK8bKAcr/iDtpsHMh+7PQiu37m2W LBqWlP1pUSX/Dwd65ybDaU5erUV0sP6aph52mYEFa0/TImulxemoqsiMHhjJ7WBaCSTU kNkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=xEQ4qCbjWIV/GHQQbLGp4WQwHoQbx8Ixl4gKO8xCir4=; b=Osct2TLXZe9iuKGcn7iI6UKFzlaglWkVfdoxT4AtX/5FBcvJYgLQnRghbgdeewA/BG OGPbGuSIxA8kasCwKhHLpYMq7rwCRnFCxDzAiai8kfuVNPKbyS8J3aY4WneY1WnKaf8u FZ2koG5Cf7A3takxqzUQDEUam11I2348q96dNxrJGq6eKBQKH3z8lybqYGoG/2Xl1MTV ksYFniIsG36h4/Bp30p9ahPv/6dDwyMwwWS3pdYgyeJlGtcrva4NBC9clTHIyVmJa9KD LxCDAExQYgtuk+xObz27SXEFatfSBBteBrCv1diPIAm07eg9K+w9UC14VUBqlsPYroBW rrmQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35si9954925plb.249.2019.08.19.07.54.30; Mon, 19 Aug 2019 07:54:46 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727341AbfHSOxP (ORCPT + 99 others); Mon, 19 Aug 2019 10:53:15 -0400 Received: from foss.arm.com ([217.140.110.172]:55902 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726808AbfHSOxO (ORCPT ); Mon, 19 Aug 2019 10:53:14 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1E76928; Mon, 19 Aug 2019 07:53:14 -0700 (PDT) Received: from [10.1.197.61] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9BB2D3F718; Mon, 19 Aug 2019 07:53:12 -0700 (PDT) Subject: Re: [PATCH v2 01/12] irqchip/gic: Rework gic_configure_irq to take the full ICFGR base To: Zenghui Yu Cc: Thomas Gleixner , Jason Cooper , Julien Thierry , Rob Herring , Lokesh Vutla , John Garry , linux-kernel@vger.kernel.org, Shameerali Kolothum Thodi , linux-arm-kernel@lists.infradead.org References: <20190806100121.240767-1-maz@kernel.org> <20190806100121.240767-2-maz@kernel.org> From: Marc Zyngier Organization: Approximate Message-ID: Date: Mon, 19 Aug 2019 15:53:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/08/2019 15:26, Zenghui Yu wrote: > Hi Marc, > > On 2019/8/6 18:01, Marc Zyngier wrote: >> gic_configure_irq is currently passed the (re)distributor address, >> to which it applies an a fixed offset to get to the configuration >> registers. This offset is constant across all GICs, or rather it was >> until to v3.1... >> >> An easy way out is for the individual drivers to pass the base >> address of the configuration register for the considered interrupt. >> At the same time, move part of the error handling back to the >> individual drivers, as things are about to change on that front. >> >> Signed-off-by: Marc Zyngier >> --- >> drivers/irqchip/irq-gic-common.c | 14 +++++--------- >> drivers/irqchip/irq-gic-v3.c | 11 ++++++++++- >> drivers/irqchip/irq-gic.c | 10 +++++++++- >> drivers/irqchip/irq-hip04.c | 7 ++++++- >> 4 files changed, 30 insertions(+), 12 deletions(-) >> >> diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c >> index b0a8215a13fc..6900b6f0921c 100644 >> --- a/drivers/irqchip/irq-gic-common.c >> +++ b/drivers/irqchip/irq-gic-common.c >> @@ -63,7 +63,7 @@ int gic_configure_irq(unsigned int irq, unsigned int type, >> * for "irq", depending on "type". >> */ >> raw_spin_lock_irqsave(&irq_controller_lock, flags); >> - val = oldval = readl_relaxed(base + GIC_DIST_CONFIG + confoff); >> + val = oldval = readl_relaxed(base + confoff); >> if (type & IRQ_TYPE_LEVEL_MASK) >> val &= ~confmask; >> else if (type & IRQ_TYPE_EDGE_BOTH) >> @@ -83,14 +83,10 @@ int gic_configure_irq(unsigned int irq, unsigned int type, >> * does not allow us to set the configuration or we are in a >> * non-secure mode, and hence it may not be catastrophic. >> */ >> - writel_relaxed(val, base + GIC_DIST_CONFIG + confoff); >> - if (readl_relaxed(base + GIC_DIST_CONFIG + confoff) != val) { >> - if (WARN_ON(irq >= 32)) >> - ret = -EINVAL; > > Since this WARN_ON is dropped, the comment above should also be updated. > But what is the reason for deleting it? (It may give us some points > when we fail to set type for SPIs.) The core code already warns in the case where irq_set_type() fails, and the duplication of warnings is pretty superfluous. Thanks, M. -- Jazz is not dead, it just smells funny...