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 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 EFFD7C433DF for ; Wed, 26 Aug 2020 16:39:07 +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 AC07D206FA for ; Wed, 26 Aug 2020 16:39:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EU0QGWTS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZFZ8/xAS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC07D206FA 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TckwgbsnxzfpI8XwAu6MkGiQIwN3AfiOI7phMS+ItSo=; b=EU0QGWTScMdtZOp53gE8i0QqF k9TPIEU1JIdmR3dE166blHx6fgb7UYNPXZ94dJT0YtY7R860MeQNrp8MCIVL9usLxPxaHxBBaEwV6 5rGnxWw9Fwl5tt5jFq12x7WuB4bhfSQMCiPQiP54XE5fBZbhSN5PJ6pBmDupMe+W+APVDojnk6oZo NlQSGLby/IEK3a469jpkeQxO8o8z7IvvD8jAj6GdhVpLB1a0Q3lbBNFT09ZZOoQNDv3hgAIkPn2rh R/pMaAjYGuWRyk34wI5eDD2uQ/FDcb1T2SBr2E5enUSo0WO4raFNbSpn2wHTYUriJgrGyreU6DYqp AG5Y5HqAQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAyQa-0006te-93; Wed, 26 Aug 2020 16:37:36 +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 1kAyQX-0006sY-Cy for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2020 16:37:34 +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 4D666206FA; Wed, 26 Aug 2020 16:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598459852; bh=pBc8gM5KOX/QRk7tf+c7+MrN051X6wSwRL8XjLMwkpA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZFZ8/xASQAxvIcEud6yRT7vUyq4aWJI1IWNLpTVMDlYbIMy6fjnvfBTeXUdx//xYw V2YdkX+e4/z0cYtfxi5MXYXFYyWfVsAecZgNKOVo0AIyKG7Dldiu6GcpX4kvJA4pu6 JAGJW1Ier1tVZvfblXe2e3pC60/5zBEt6idCvOl4= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kAyQU-006uP9-GY; Wed, 26 Aug 2020 17:37:30 +0100 MIME-Version: 1.0 Date: Wed, 26 Aug 2020 17:37:30 +0100 From: Marc Zyngier To: Valentin Schneider Subject: Re: [PATCH 5/9] fsl-msi: Provide default retrigger callback In-Reply-To: References: <20200824102317.1038259-1-maz@kernel.org> <20200824102317.1038259-6-maz@kernel.org> User-Agent: Roundcube Webmail/1.4.8 Message-ID: <70107b944534c6a0eeff83e43b05865e@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 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_123733_760892_AE550433 X-CRM114-Status: GOOD ( 27.07 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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: 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); +#else + if (desc->irq_data.chip->irq_retrigger) + return desc->irq_data.chip->irq_retrigger(&desc->irq_data); + + 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 */ In general, introducing a irq_chip_retrigger_hierarchy() call shouldn't be problematic as long as we don't overwrite an existing callback. I'll have a look at respining the series with that in mind. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel