Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78B45C433F5 for ; Fri, 7 Jan 2022 18:53:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231304AbiAGSxy (ORCPT ); Fri, 7 Jan 2022 13:53:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiAGSxx (ORCPT ); Fri, 7 Jan 2022 13:53:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57BD5C061574; Fri, 7 Jan 2022 10:53:53 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBF5860C08; Fri, 7 Jan 2022 18:53:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F2DFC36AE0; Fri, 7 Jan 2022 18:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641581632; bh=foOMKyQ7PGZKwf86IMQUEEvCUUdpdeI7caXXChqQ+Lw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qlEmySjN1PoChrh9Gf4yY0T1w4ss/KdXpzpvt5Ldks1IzeRRtdHV/xevjYsBY3pu4 t/k4EiMlsTbzT9n2Y3N1WqQIYDnXJB5X/4iejp+n7NWKVFmljTgNITWCGdtgxZkJrU m5SjfxC8nNhyQaX3t3HmqH2MJ73/6Y2uUvcgZj5n/Jjw0x8nlh/AWuPGWkQ+kRIVfh 2QCg8p5LWkQi5tqdB6Pae7JUuRy0Mm13jbzLJvHY+7qFSh5u1bPSCWsc8jPJ1eOPgh 18Vd78fx4yPvLZEotV1P5eUWoWVKxEEH8t3wKeTc+90yMwGmRl5CtKCFnXxVv+nvPV aBI81sF3/qmaw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1n5uN4-00GdIn-D6; Fri, 07 Jan 2022 18:53:50 +0000 Date: Fri, 07 Jan 2022 18:53:50 +0000 Message-ID: <87wnjbtm0x.wl-maz@kernel.org> From: Marc Zyngier To: Pali =?UTF-8?B?Um9ow6Fy?= Cc: Marek =?UTF-8?B?QmVow7pu?= , Lorenzo Pieralisi , Bjorn Helgaas , Rob Herring , Thomas Petazzoni , Krzysztof =?UTF-8?B?V2lsY3p5xYRza2k=?= , Russell King , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 10/11] PCI: mvebu: Implement support for legacy INTx interrupts In-Reply-To: <20220107115053.k5d2uv7yrftrpcez@pali> References: <20220105150239.9628-1-pali@kernel.org> <20220105150239.9628-11-pali@kernel.org> <87bl0ovq7f.wl-maz@kernel.org> <20220106154447.aie6taiuvav5wu6y@pali> <878rvsvoyo.wl-maz@kernel.org> <20220106162047.vqykmygs75eimfgy@pali> <877dbcvngf.wl-maz@kernel.org> <20220106182044.3ff0828c@thinkpad> <874k6gvkhz.wl-maz@kernel.org> <20220107115053.k5d2uv7yrftrpcez@pali> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: pali@kernel.org, kabel@kernel.org, lorenzo.pieralisi@arm.com, bhelgaas@google.com, robh+dt@kernel.org, thomas.petazzoni@bootlin.com, kw@linux.com, rmk+kernel@armlinux.org.uk, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 07 Jan 2022 11:50:53 +0000, Pali Roh=C3=A1r wrote: >=20 > On Thursday 06 January 2022 17:31:36 Marc Zyngier wrote: > > On Thu, 06 Jan 2022 17:20:44 +0000, > > Marek Beh=C3=BAn wrote: > > >=20 > > > On Thu, 06 Jan 2022 16:27:44 +0000 > > > Marc Zyngier wrote: > > > > You are completely missing my point. I'm talking about data > > > > structures, you're talking about interrupts. You have this: > > > >=20 > > > > struct mvebu_pcie_port { > > > > // Tons of stuff > > > > struct irq_chip intx_chip; > > > > }; > > > >=20 > > > > What I want you to do is: > > > >=20 > > > > struct mvebu_pcie_port { > > > > // Tons of stuff > > > > }; > > > >=20 > > > > static struct irq_chip intx_chip =3D { > > > > .name =3D "INTx", > > > > .irq_mask =3D mvebu_pcie_intx_irq_mask, > > > > .irq_unmask =3D mvebu_pcie_intx_irq_unmask; > > > > }; > > > >=20 > > > > That's it. No more, no less. > > > >=20 > > > > M. > > > >=20 > > >=20 > > > Hmm, but struct irq_chip contains a dynamic member, > > > struct device *parent_device; > > > Isn't that used? Or are you planning to kill it? > >=20 > > Indeed, and I am definitely planning to kill it. This is the wrong > > place for this stuff, and I want it gone. There are thankfully very > > few users of this misfeature. >=20 > Ok, so what about this change? >=20 > @@ -1458,7 +1617,17 @@ static int mvebu_pcie_remove(struct platform_devic= e *pdev) > mvebu_writel(port, cmd, PCIE_CMD_OFF); > =20 > /* Mask all interrupt sources. */ > - mvebu_writel(port, 0, PCIE_MASK_OFF); > + mvebu_writel(port, ~PCIE_INT_ALL_MASK, PCIE_INT_UNMASK_OFF); > + > + /* Clear all interrupt causes. */ > + mvebu_writel(port, ~PCIE_INT_ALL_MASK, PCIE_INT_CAUSE_OFF); > + > + /* Remove IRQ domains. */ > + if (port->intx_irq_domain) > + irq_domain_remove(port->intx_irq_domain); > + > + if (irq > 0) > + irq_set_chained_handler_and_data(irq, NULL, NULL); You really want this to be done *before* you remove the domain, as there still could be interrupts in flight at this point. M. --=20 Without deviation from the norm, progress is not possible.