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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D8EAEDE99A for ; Tue, 10 Sep 2024 15:59:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bYuy0gE/Csnq6CPjPynB+thwHl+NK+QDx3CCg79tANw=; b=cxgFilDw2z8VVnKWmIq96qPzVv L4BPyvj6b8p1VreMMST2zuvpCyVvWJPG+1OreOp2QTFQLx9ac2q+CW0SSzJtRcDYisk1MXVOZbuKy NDfBRnE9W+UsFVlyypxxGO/uUGl7QkJny5a5ZA8jHAPxx2u0NyZE3KIPS+J33xdR1snCUyGg0hkN7 e1MVpfkGo43TZhpgdcsRsvxkgli0DaJfTzDpD5OasD1PKaSAIOOR6qYXwDO6UoiNrcRu1iSoM4SJX Ru+7UqCVLQqfqCYOaFwEmfAc2SGVOayE1eA0bM7WQv7ZZg/B0Zm8C//VL/t+9OUwAzEx1ya6xPMEJ zIyLdCpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1so3H6-00000006G2J-2O5i; Tue, 10 Sep 2024 15:59:28 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1so3G0-00000006FmI-2kIY; Tue, 10 Sep 2024 15:58:24 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1725983896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bYuy0gE/Csnq6CPjPynB+thwHl+NK+QDx3CCg79tANw=; b=3YvGKIkulMjWSxMFtwlNIAzmYpBeHw1URc4C+ycSUDYGdD7pxLEXc2TowKAXLwT5dEjtNa BxO24vkHV9ZJ3ucu78nX1lVOgRX/F8a5bbW+3kykcbckVInhZ45OmFFv2CWKJwnMXGxg3i YWKNX2ZprZdXQD1B+hreQXeebltGuXPo/mMusaHNZu1RbA2KpuXnaKbs6Q9UrVZ7a7H10G SDWTc2wM7i1QWGTW+Gftr/SQujQNlUSYzBDX9dsaPJclyKdaCGPDDoyPurjD70hUfYbZPv 6sGlVTfnhOANxZxdP+n2f9Am6kHPAjEnTANBJPU0WLft8WIHS5OMApmbjXupnQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1725983896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bYuy0gE/Csnq6CPjPynB+thwHl+NK+QDx3CCg79tANw=; b=nOXDYXyK81ou96bJppft20Co7EtkQ9rWp78zV/nliuCMzMamIfannFVkrWzA+tpOrsUzs3 WgA9TSp9xOC4dICg== To: Stanimir Varbanov , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Broadcom internal kernel review list Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Jim Quinlan , Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , kw@linux.com, Philipp Zabel , Andrea della Porta , Phil Elwell , Jonathan Bell , Stanimir Varbanov Subject: Re: [PATCH v2 -next 03/11] irqchip: mip: Add Broadcom bcm2712 MSI-X interrupt controller In-Reply-To: <20240910151845.17308-4-svarbanov@suse.de> References: <20240910151845.17308-1-svarbanov@suse.de> <20240910151845.17308-4-svarbanov@suse.de> Date: Tue, 10 Sep 2024 17:58:16 +0200 Message-ID: <87o74va4br.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240910_085820_858896_BCC34683 X-CRM114-Status: GOOD ( 11.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 10 2024 at 18:18, Stanimir Varbanov wrote: > + > +struct mip_priv { > + /* used to protect bitmap alloc/free */ > + spinlock_t lock; > + void __iomem *base; > + u64 msg_addr; > + u32 msi_base; > + u32 num_msis; > + unsigned long *bitmap; > + struct irq_domain *parent; https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#struct-declarations-and-initializers And please read the rest of the document too. > +}; > + > +static void mip_mask_msi_irq(struct irq_data *d) > +{ > + pci_msi_mask_irq(d); > + irq_chip_mask_parent(d); > +} > + > +static void mip_unmask_msi_irq(struct irq_data *d) > +{ > + pci_msi_unmask_irq(d); > + irq_chip_unmask_parent(d); This is asymmetric vs. mask(), but that's just the usual copy & pasta problem. > +} > +static int mip_init_domains(struct mip_priv *priv, struct device_node *np) > +{ > + struct irq_domain *middle_domain, *msi_domain; > + > + middle_domain = irq_domain_add_hierarchy(priv->parent, 0, > + priv->num_msis, np, > + &mip_middle_domain_ops, > + priv); > + if (!middle_domain) > + return -ENOMEM; > + > + msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(np), > + &mip_msi_domain_info, > + middle_domain); > + if (!msi_domain) { > + irq_domain_remove(middle_domain); > + return -ENOMEM; > + } This is not much different. Please convert this to a proper MSI parent domain and let the PCI/MSI core handle the PCI/MSI part. See https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=irq-msi-2024-07-22 for reference. Thanks, tglx