[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <873458deo8.ffs@tglx>
Date: Wed, 17 Dec 2025 21:41:27 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Chao Xie <chao.xie@...aro.org>, linux-kernel@...r.kernel.org
Subject: Re: [irq-msi] questions about irq msi_desc usage
On Wed, Dec 17 2025 at 09:58, Chao Xie wrote:
> 1. To define my own private data structure, should I follow the PCI MSI
> approach and add a structure like struct my_private_intr_desc to
> the union?
No.
> I think I can make use of data.docckie.ptr to point to my private data
> structure, but I do not find any example in kernel, and not sure whether
> It is right or not.
Yes it is the right thing to do if you really need private data for your
driver. You did not explain what this data is used for and why it needs
to be accessible through msi_desc, so I can't tell.
> 2. If I use data.dcookie.ptr to point to my private data structure,
> should this association be initialized in msi_domain_ops.set_desc()?
prepare_desc() is probably the right place especially if you need access
to the domain itself.
> 3. The Type 1 interrupt of this bus is similar to MSI.
Why are hardware people insisting on repeating the same mistakes over
and over?
> In this case, when allocating msi_desc, should I follow the PCI MSI
> model where one msi_desc represents multiple interrupts
> (i.e.,set msi_desc.nvec_used = n)?
That's the only way you can guarantee consecutive Linux interrupt
numbers for the block you allocate.
> If this is the correct approach,
> is itfeasible to add a judgment similar to PCI MSI in
> msi_domain_get_virq() as follows:
> if (dev_is_pci(dev) && domid == MSI_DEFAULT_DOMAIN)
> devmsi = to_pci_dev(dev)->msi_enabled;
> +++ if (dev_is_my_private(dev) && domid == MSI_DEFAULT_DOMAIN)
> +++ devmsi = to_my_private_entity(dev)->is_type1;
No. This wants to be generalized.
Thanks,
tglx
Powered by blists - more mailing lists