Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2] drm/xe/irq: allocate all possible msix interrupts
Date: Mon, 22 Jan 2024 16:35:31 +0530	[thread overview]
Message-ID: <f20cbdaa-61d7-4174-92ed-c677ba792a73@intel.com> (raw)
In-Reply-To: <20240121090214.2072923-1-dliberman@habana.ai>

[-- Attachment #1: Type: text/plain, Size: 1632 bytes --]


On 21-01-2024 14:32, Dani Liberman wrote:
> If platform supports MSIX, driver needs to allocate all possible
> interrupts.
>
> v2:
>    - drop msix_cap and use the api return code instead.
>    - fix commit message.
>
> Cc: Ohad Sharabi<osharabi@habana.ai>
> Cc: Lucas De Marchi<lucas.demarchi@intel.com>
> Signed-off-by: Dani Liberman<dliberman@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..7a23d25c1062 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);
> +	nvec = pci_msix_vec_count(pdev);
> +	if (nvec <= 0) {
> +		if (nvec == -EINVAL) {
> +			/* MSIX capability is not supported in the device, using MSI */
> +			nvec = 1;
> +		} else {
> +			drm_err(&xe->drm, "MSIX: Failed getting count\n");
> +			return nvec;
> +		}
> +	}
> +
> +	err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_MSIX);

Shouldn't the parameter be only PCI_IRQ_MSI in case nvec == EINVAL ?
>   	if (err < 0) {
>   		drm_err(&xe->drm, "MSI/MSIX: Failed to enable support %d\n", err);
>   		return err;

[-- Attachment #2: Type: text/html, Size: 2434 bytes --]

  parent reply	other threads:[~2024-01-22 11:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-21  9:02 [PATCH v2] drm/xe/irq: allocate all possible msix interrupts Dani Liberman
2024-01-21  9:06 ` ✓ CI.Patch_applied: success for drm/xe/irq: allocate all possible msix interrupts (rev2) Patchwork
2024-01-21  9:06 ` ✓ CI.checkpatch: " Patchwork
2024-01-21  9:07 ` ✓ CI.KUnit: " Patchwork
2024-01-21  9:14 ` ✓ CI.Build: " Patchwork
2024-01-21  9:14 ` ✓ CI.Hooks: " Patchwork
2024-01-21  9:16 ` ✓ CI.checksparse: " Patchwork
2024-01-21  9:42 ` ✗ CI.BAT: failure " Patchwork
2024-01-22  9:00 ` ✓ CI.Patch_applied: success for drm/xe/irq: allocate all possible msix interrupts (rev3) Patchwork
2024-01-22  9:00 ` ✓ CI.checkpatch: " Patchwork
2024-01-22  9:01 ` ✓ CI.KUnit: " Patchwork
2024-01-22  9:08 ` ✓ CI.Build: " Patchwork
2024-01-22  9:08 ` ✗ CI.Hooks: failure " Patchwork
2024-01-22  9:10 ` ✓ CI.checksparse: success " Patchwork
2024-01-22  9:33 ` ✓ CI.BAT: " Patchwork
2024-01-22 11:05 ` Ghimiray, Himal Prasad [this message]
2024-01-23  7:00   ` [PATCH v2] drm/xe/irq: allocate all possible msix interrupts Dani Liberman
2024-01-23  7:06 ` ✗ CI.Patch_applied: failure for drm/xe/irq: allocate all possible msix interrupts (rev4) Patchwork
2024-01-23 16:37 ` [PATCH v2] drm/xe/irq: allocate all possible msix interrupts Lucas De Marchi
2024-01-23 17:34   ` Dani Liberman
2024-01-24 20:34     ` Lucas De Marchi

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=f20cbdaa-61d7-4174-92ed-c677ba792a73@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox