From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D954C433E1 for ; Wed, 26 Aug 2020 17:54:36 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1CFE2078D for ; Wed, 26 Aug 2020 17:54:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YlNT4OAX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="oGt4PCbs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1CFE2078D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:To:From: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SY2/5qLwVP1vUKF/NECobm2PeF5jHIM93ZhYBMKyRW0=; b=YlNT4OAXG0nzPO/76Z/3UXqAG pV1sxxfbbTvuqlKUAZyEiWym7/8D3Vpc/PibeM5QtU360bVhkYRhUPCM/shQPou2x/vD4Pjh04DG2 8RmCyOixHbM6v2vCmVgjDKMwZbGFyrt6F1dkCxKgonsGaatGkBCU5iiiHlT8i/uK+k0ICx/pNbEyG VEfSUVZmS28M7Q3aIGDVIP2nfWJwa4XpUmji43kZmKBNhmxb6BSLjGDoO9FMNf3Wb1FVghdksfWHg aiVyfdjVDLpV4apFdiX7tzXSw1Q8by18sShkB072DQ1qv0SSAeoIhYM67FHpBG3ZlmsYAJoPocdEZ ENEdvKjNw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAzbW-0007vX-PZ; Wed, 26 Aug 2020 17:52:58 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAzbU-0007v5-CL for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2020 17:52:57 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 72EF020737; Wed, 26 Aug 2020 17:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598464375; bh=Zd24Yb4vjHVqZMcBZUg6fD4NfTY3pGvnVh3ocrW4duI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oGt4PCbs/J/rOYxOmxVGNKn7rv/v0UjhddU8AUqIHs964IXq8BnhDLiJ8XBgsLFx1 fDs78zRjxBJ5BWor2KAViU/xDWDheyIrw+P6gipyU7fSHwO4aM88Xcdj50rMQZX/ZH UqTBYKrd/AAdlTV6iOrNrXmua3DyfNFcLED9v+Q0= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAzbR-006vbP-Jg; Wed, 26 Aug 2020 18:52:53 +0100 Date: Wed, 26 Aug 2020 18:52:46 +0100 Message-ID: <87lfi170r5.wl-maz@kernel.org> From: Marc Zyngier To: Valentin Schneider Subject: Re: [PATCH 5/9] fsl-msi: Provide default retrigger callback In-Reply-To: <70107b944534c6a0eeff83e43b05865e@kernel.org> References: <20200824102317.1038259-1-maz@kernel.org> <20200824102317.1038259-6-maz@kernel.org> <70107b944534c6a0eeff83e43b05865e@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: valentin.schneider@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, gregory.clement@bootlin.com, jason@lakedaemon.net, laurentiu.tudor@nxp.com, tglx@linutronix.de X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200826_135256_603901_ACAED397 X-CRM114-Status: GOOD ( 38.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Cooper , linux-pci@vger.kernel.org, Gregory Clement , linux-kernel@vger.kernel.org, Bjorn Helgaas , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 26 Aug 2020 17:37:30 +0100, Marc Zyngier wrote: > > Hi Valentin, > > On 2020-08-26 12:16, Valentin Schneider wrote: > > Hi Marc, > > > > Many thanks for picking this up! > > Below's the only comment I have, the rest LGTM. > > > > On 24/08/20 11:23, Marc Zyngier wrote: > >> Signed-off-by: Marc Zyngier > >> --- > >> drivers/bus/fsl-mc/fsl-mc-msi.c | 2 ++ > >> 1 file changed, 2 insertions(+) > >> > >> diff --git a/drivers/bus/fsl-mc/fsl-mc-msi.c > >> b/drivers/bus/fsl-mc/fsl-mc-msi.c > >> index 8edadf05cbb7..5306ba7dea3e 100644 > >> --- a/drivers/bus/fsl-mc/fsl-mc-msi.c > >> +++ b/drivers/bus/fsl-mc/fsl-mc-msi.c > >> @@ -144,6 +144,8 @@ static void fsl_mc_msi_update_chip_ops(struct > >> msi_domain_info *info) > >> */ > >> if (!chip->irq_write_msi_msg) > >> chip->irq_write_msi_msg = fsl_mc_msi_write_msg; > >> + if (!chip->irq_retrigger) > >> + chip->irq_retrigger = irq_chip_retrigger_hierarchy; > > > > AFAICT the closest generic hook we could use here is > > > > msi_create_irq_domain() -> msi_domain_update_chip_ops() > > > > which happens just below the fsl-specific ops update. > > > > > > However, placing a default .irq_retrigger callback in there would > > affect any > > and all MSI domain. IOW that would cover PCI and platform MSIs > > (covered by > > separate patches in this series), but also some x86 ("dmar" & > > "hpet") and > > TI thingies. > > > > I can't tell right now how bad of an idea it is, but I figured I'd > > throw > > this out there. > > The problem with this approach is that it requires the resend path to be > cooperative and actually check for more than the top-level irq_data. > Otherwise you'd never actually trigger the HW resend if it is below > the top level. > > But I like the idea though. Something like this should do the trick, and > is admittedly a bug fix: Well, not quite. > > diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c > index c48ce19a257f..d11c729f9679 100644 > --- a/kernel/irq/resend.c > +++ b/kernel/irq/resend.c > @@ -86,6 +86,18 @@ static int irq_sw_resend(struct irq_desc *desc) > } > #endif > > +static int try_retrigger(struct irq_desc *desc) > +{ > +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY > + return irq_chip_retrigger_hierarchy(&desc->irq_data); This only checks the parent, so we still need to evaluate the top-level. Something like this: diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c index c48ce19a257f..8ccd32a0cc80 100644 --- a/kernel/irq/resend.c +++ b/kernel/irq/resend.c @@ -86,6 +86,18 @@ static int irq_sw_resend(struct irq_desc *desc) } #endif +static int try_retrigger(struct irq_desc *desc) +{ + if (desc->irq_data.chip->irq_retrigger) + return desc->irq_data.chip->irq_retrigger(&desc->irq_data); + +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY + return irq_chip_retrigger_hierarchy(&desc->irq_data); +#else + return 0; +#endif +} + /* * IRQ resend * @@ -113,8 +125,7 @@ int check_irq_resend(struct irq_desc *desc, bool inject) desc->istate &= ~IRQS_PENDING; - if (!desc->irq_data.chip->irq_retrigger || - !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) + if (!try_retrigger(desc)) err = irq_sw_resend(desc); /* If the retrigger was successfull, mark it with the REPLAY bit */ With that, I believe we can drop most of the patches in this series and only keep the GIC ones. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel