From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ohad Sharabi <osharabi@habana.ai>,
Dani Liberman <dliberman@habana.ai>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/irq: allocate all possible msix interrupts
Date: Tue, 16 Jan 2024 16:25:58 +0200 [thread overview]
Message-ID: <87zfx5qrrd.fsf@intel.com> (raw)
In-Reply-To: <e50b9b13-9f98-4ed4-89e1-ac83153f5884@habana.ai>
On Tue, 16 Jan 2024, Ohad Sharabi <osharabi@habana.ai> wrote:
> On 16/01/2024 15:07, Dani Liberman wrote:
>
> For future platforms which will support msix, need to allocate all
> possible interrupts.
>
> Signed-off-by: Dani Liberman <dliberman@habana.ai><mailto:dliberman@habana.ai>
>
> Reviewed-by: Ohad Sharabi <osharabi@<mailto:gustavo.sousa@intel.com>habana.ai>
Please use plain text when replying on the public lists.
Thanks,
Jani.
>
>
> Cc: Ohad Sharabi <osharabi@habana.ai><mailto:osharabi@habana.ai>
> ---
> drivers/gpu/drm/xe/xe_irq.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
> index 907c8ff0fa21..62722809a01d 100644
> --- a/drivers/gpu/drm/xe/xe_irq.c
> +++ b/drivers/gpu/drm/xe/xe_irq.c
> @@ -662,7 +662,7 @@ int xe_irq_install(struct xe_device *xe)
> {
> struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
> irq_handler_t irq_handler;
> - int err, irq;
> + int err, irq, nvec;
>
> irq_handler = xe_irq_handler(xe);
> if (!irq_handler) {
> @@ -672,7 +672,18 @@ int xe_irq_install(struct xe_device *xe)
>
> xe_irq_reset(xe);
>
> - err = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI | PCI_IRQ_MSIX);
> + if (pdev->msix_cap) {
> + nvec = pci_msix_vec_count(pdev);
> + if (nvec <= 0) {
> + drm_err(&xe->drm, "MSIX: Failed getting count\n");
> + return -EINVAL;
> + }
> + } else {
> + /* device supports only msi */
> + nvec = 1;
> + }
> +
> + err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_MSIX);
> if (err < 0) {
> drm_err(&xe->drm, "MSI/MSIX: Failed to enable support %d\n", err);
> return err;
>
>
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-01-16 14:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 13:07 [PATCH] drm/xe/irq: allocate all possible msix interrupts Dani Liberman
2024-01-16 13:27 ` Ohad Sharabi
2024-01-16 14:25 ` Jani Nikula [this message]
2024-01-16 14:22 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-16 14:22 ` ✓ CI.checkpatch: " Patchwork
2024-01-16 14:23 ` ✓ CI.KUnit: " Patchwork
2024-01-16 14:30 ` ✓ CI.Build: " Patchwork
2024-01-16 14:30 ` ✓ CI.Hooks: " Patchwork
2024-01-16 14:32 ` ✓ CI.checksparse: " Patchwork
2024-01-16 14:55 ` ✓ CI.BAT: " Patchwork
2024-01-16 23:13 ` [PATCH] " Lucas De Marchi
2024-01-17 10:08 ` Dani Liberman
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=87zfx5qrrd.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=dliberman@habana.ai \
--cc=intel-xe@lists.freedesktop.org \
--cc=osharabi@habana.ai \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox