All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Chao Xie <chao.xie@linaro.org>, linux-kernel@vger.kernel.org
Subject: Re: [irq-msi] questions about irq msi_desc usage
Date: Wed, 17 Dec 2025 21:41:27 +0100	[thread overview]
Message-ID: <873458deo8.ffs@tglx> (raw)
In-Reply-To: <C5C27FDB-1EF2-43A4-A736-D67CFAD443C6@linaro.org>

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

      reply	other threads:[~2025-12-17 20:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-17  1:58 [irq-msi] questions about irq msi_desc usage Chao Xie
2025-12-17 20:41 ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=873458deo8.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=chao.xie@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.