Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1060303ybl; Wed, 28 Aug 2019 09:05:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiEuPpGA/D2E4/uU0ZdvKLs9wQSoWOIu8//iKyiOO22pzAkHR9Fg8NO27edwh7D8xnTSRk X-Received: by 2002:a17:90a:650c:: with SMTP id i12mr4986441pjj.11.1567008325564; Wed, 28 Aug 2019 09:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567008325; cv=none; d=google.com; s=arc-20160816; b=QXwyGu8NC2LXCmmVoez4XxL6hLRPiROF8cowtGa6Mv7/umj4B3PWnSt5MkuGNyBaUX /t5cZu6eFwpKWKR7NidWZZ2cVsAZxtDTEWaYxXwI4i1PXKAyMA522aVTwpeXhzPdHRwU lfXQn5yW+sMBxUNLHaupyWBkyxWE3Axp9zK9w6MxUoLjburzom34+wkcnO1NnYGX0ngc TeoNl1FQhvadZ4Pme4QMNaZHskKl9u1L9cAVPr/W5XCL8mvxS0DCy3rRUdMOtEWpAMH2 axcu+iFiWp/S+vFj7RKqROtj8G52R+jXHijLQwNC3WqbQLO535ucu1rLDkjR7pBRvYhq 3BMA== 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=ukoxss8KPlg3kRzkoBxXo1UO40ntK/bqH/bZ8O9fU00=; b=cnfKC8jfZSGLfMfwCsXaF3XsD9oYq9AaQBReAYfIXehJdwwqhEjY5jY7opV/UbsmvC 7lAGO0Y0bvUntg1eKs/MaU7iZTQAkCnsFyU/BrxpSizMcrn3oSKv9Oflf0wEP7ySvs4J Hn1ex0k8myZ9YQh/QoIivReuvaVKYpyYWKQvbv7eA/LNCLXwW68BzsEvebVKUDmY1bJ9 6Nm/YGtSn56It03UIXM22W3MmWx1Tf7yWics3RW6XO4DzGPIBjHLTo3E/CmwcZIkh7xx 1RbDOnvywkHKfKO8afBwpJU3vntdWDQAQXV5/7ggcKRCLuPleN2wGct+0jgfcUY6xpYy kNYw== 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 w21si2158416pll.262.2019.08.28.09.05.08; Wed, 28 Aug 2019 09:05:25 -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 S1726923AbfH1QCW (ORCPT + 99 others); Wed, 28 Aug 2019 12:02:22 -0400 Received: from foss.arm.com ([217.140.110.172]:33666 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbfH1QCV (ORCPT ); Wed, 28 Aug 2019 12:02:21 -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 E32C028; Wed, 28 Aug 2019 09:02:20 -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 A84DE3F59C; Wed, 28 Aug 2019 09:02:19 -0700 (PDT) Subject: Re: [PATCH 04/13] irqchip: Add driver for Loongson-3 I/O interrupt controller To: Jiaxun Yang Cc: linux-mips@vger.kernel.org, chenhc@lemote.com, paul.burton@mips.com, tglx@linutronix.de, jason@lakedaemon.net, linux-kernel@vger.kernel.org, robh+dt@kernel.org, mark.rutland@arm.co, devicetree@vger.kernel.org References: <20190827085302.5197-1-jiaxun.yang@flygoat.com> <20190827085302.5197-5-jiaxun.yang@flygoat.com> <82c4b9ed-7270-74ce-6e10-165182e540dd@flygoat.com> <20190828075940.549e1983@why> <619b1d35-7bc2-999f-5a51-fb2efdc63f60@flygoat.com> From: Marc Zyngier Organization: Approximate Message-ID: <45615c1a-7af8-3496-5369-4b2f174a76e7@kernel.org> Date: Wed, 28 Aug 2019 17:02:17 +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: <619b1d35-7bc2-999f-5a51-fb2efdc63f60@flygoat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/08/2019 16:31, Jiaxun Yang wrote: > > On 2019/8/28 下午2:59, Marc Zyngier wrote: >> On Wed, 28 Aug 2019 08:27:05 +0800 >> Jiaxun Yang wrote: >> >>> On 2019/8/28 上午12:45, Marc Zyngier wrote: >>>> On 27/08/2019 09:52, Jiaxun Yang wrote: >>>>> + chained_irq_enter(chip, desc); >>>>> + >>>>> + pending = readl(priv->intc_base + LS3_REG_INTC_EN_STATUS) & >>>>> + readl(priv->intc_base + LS3_REG_INTC_STATUS); >>>> Reading the enabled status from the HW on each interrupt? I'm sure >>>> that's pretty cheap... >>> Seems expensive but to deal with a buggy hardware... That's worthy. >> How broken is it? You very much seem to rely on the HW being correct >> here, since you trust it exclusively. I'd expect the enable mask to be >> a SW construct if you didn't blindly trust it > Hi Marc > > Thanks for your answering. > > The vendor code did this and said there is a HW issue. I just don't have > the guts to remove this check. > Seems like sometimes masked interrupt may get ISR set wrongly. And that would just as well avoided by a SW managed mask. >> And if this is truly the right way to do it, please document the >> various problems with the controller so that we don't break it at a >> later time. > Thanks, will do. >> >> Then how comes this comes from the irqchip's DT node? This should be >> part of the endpoint's interrupt specifier. > > In theory it should be, However if we set different interrupt > lines/cores on that controller, interrupts may get lost. It means we can > only have single parent core/interrupt. > > So I'd prefer just set them uniformly by controller's dt-binding to > prevent confusing. And I disagree. You can document the restriction, and even maybe enforce it by validating the DT one way or another. But we're not putting what ends up being a routing table in the irqchip binding. M. -- Jazz is not dead, it just smells funny...