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 C8D4CD1812E for ; Mon, 14 Oct 2024 16:33:22 +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=ow/UxrNjYbB9p7imk5iwLyMoJAD0hoXV5EJONRnoywA=; b=PpsmkG47Yokhj/CIsk5zFVDm5E 6gohIfazQmOiTrpxanvL6o4hAbCcHHsOFJ8dla4VzxdYhxhJ1eWRapG931j0I1YictECtR1ipUILb NoyVZQH/ZXUCHaPmpEm6SMtq9VtizXvF4TPVZNW4y4kzI5NVjVSgxLnTO3rGUMDG6i92dvNx0MQmf 6uUQXyPnPlZV9YAwblIvWHxIEbD3H2Ex12UPXDhjhPjKC87+M91huC2l0ASGgQRUEY9iMjT8X6iEC QNz9L2ufh3RZG/VTuAAcdLdkgI2fnZ2wQhtSrp9cMehTdk9CHJuLtNhk4HPqo5Q679tcjjRRnNcbH j8pse5Ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0O0N-00000005sO1-3Bh0; Mon, 14 Oct 2024 16:33:11 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0Nyp-00000005s1x-3EkQ; Mon, 14 Oct 2024 16:31:40 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728923492; 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=ow/UxrNjYbB9p7imk5iwLyMoJAD0hoXV5EJONRnoywA=; b=rrQud1Bmrb6k1OJO8EmZWxF/QUHGHoo6snHSxtVUgsEFeCxNzJ4q1QMFXvIBHiCXLrKOnp 5n2zfs4cjvMRW84uP2ReREOXB4GsDYWko8jIDJkr9l+9zdO8YwS26aL6ZSWCDjRud13enR KsHcpVLiarsShJnRVFn4EhH3D+c78VhqrZZnmHAwIZ55bCGCLkxhmQ/ki2Ny5NpX5G+FiT 4el9dkx2BNEHvetIh2DFvh54IORDpOroEmPDh5UZ/bgbVFpY3DjPUqwrOzaJX72HycQoPj jBUluAEhaic3IhLOaOiqXwD4Lzr/iEcOr5BdHwPnyX7HYGY6YL619CT/VYHswQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728923492; 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=ow/UxrNjYbB9p7imk5iwLyMoJAD0hoXV5EJONRnoywA=; b=wPq0vw4zgDf7pPyiwHAm5p05qXTlNkIJPC5VQTxfHidMe8ODXZEdfMPPimcsSbxLQli+/+ ZLuoGkIRW8RucaDg== 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 v3 03/11] irqchip: mip: Add Broadcom bcm2712 MSI-X interrupt controller In-Reply-To: <20241014130710.413-4-svarbanov@suse.de> References: <20241014130710.413-1-svarbanov@suse.de> <20241014130710.413-4-svarbanov@suse.de> Date: Mon, 14 Oct 2024 18:31:32 +0200 Message-ID: <87o73mfxy3.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-20241014_093136_045380_223F606F X-CRM114-Status: GOOD ( 10.80 ) 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 > Subject: irqchip: mip: is not a valid prefix Just make it: irqchip: Add Broadcom ..... > +static int mip_middle_domain_alloc(struct irq_domain *domain, unsigned int virq, > + unsigned int nr_irqs, void *arg) > +{ > + struct mip_priv *mip = domain->host_data; > + struct irq_fwspec fwspec = {0}; > + struct irq_data *irqd; > + unsigned int hwirq, irq, i; unsigned int hwirq, irq, i; struct irq_data *irqd; > + > +#define MIP_MSI_FLAGS_REQUIRED (MSI_FLAG_USE_DEF_DOM_OPS | \ > + MSI_FLAG_USE_DEF_CHIP_OPS | \ > + MSI_FLAG_PCI_MSI_MASK_PARENT | \ > + MSI_FLAG_PCI_MSIX) Why are you requiring MSI_FLAG_PCI_MSIX here? That's a supported flag, not a required one. > +#define MIP_MSI_FLAGS_SUPPORTED (MSI_GENERIC_FLAGS_MASK | \ > + MSI_FLAG_PCI_MSIX | \ So this does not support multi MSI, but your allocation function looks like it supports it (nr_irqs is not range checked). > + IRQ_DOMAIN_FLAG_MSI_PARENT) This is not a MSI flag and has no place here. > +static const struct msi_parent_ops mip_msi_parent_ops = { > + .supported_flags = MIP_MSI_FLAGS_SUPPORTED, > + .required_flags = MIP_MSI_FLAGS_REQUIRED, > + .bus_select_token = DOMAIN_BUS_PCI_MSI, > + .bus_select_mask = MATCH_PCI_MSI, > + .prefix = "MIP-MSI-", > + .init_dev_msi_info = msi_lib_init_dev_msi_info, > +}; > + > +static int mip_init_domains(struct mip_priv *mip, struct device_node *np) > +{ > + struct irq_domain *middle; > + > + middle = irq_domain_add_hierarchy(mip->parent, 0, mip->num_msis, np, > + &mip_middle_domain_ops, mip); > + if (!middle) > + return -ENOMEM; > + > + irq_domain_update_bus_token(middle, DOMAIN_BUS_PCI_MSI); That's the wrong token. DOMAIN_BUS_PCI_MSI is what the v2 global PCI/MSI domain uses. But that's not what this is about. This is the parent domain for PCI/MSI. DOMAIN_BUS_GENERIC_MSI or DOMAIN_BUS_NEXUS is what you want here. > + middle->dev = mip->dev; > + middle->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT; > + middle->msi_parent_ops = &mip_msi_parent_ops; > + Other than this, this looks good now. Thanks, tglx