mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Raj, Ashok" <ashok.raj@intel.com>
To: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Alex Williamson <alex.williamson@redhat.com>,
	Joerg Roedel <joro@8bytes.org>, Ashok Raj <ashok.raj@intel.com>
Subject: Re: [PATCH] iommu/vt-d: clean up pr_irq if request_threaded_irq fails
Date: Wed, 6 Dec 2017 10:23:11 -0800	[thread overview]
Message-ID: <20171206182311.GA124624@otc-nc-03> (raw)
In-Reply-To: <20171206164959.23794-1-jsnitsel@redhat.com>

On Wed, Dec 06, 2017 at 09:49:59AM -0700, Jerry Snitselaar wrote:
> It is unlikely request_threaded_irq will fail, but if it does for some
> reason we should clear iommu->pr_irq in the error path. Also
> intel_svm_finish_prq shouldn't try to clean up the page request
> interrupt if pr_irq is 0. Without these, if request_threaded_irq were
> to fail the following occurs:

Looks good.

Reviewed-by: Ashok Raj <ashok.raj@intel.com>

Cheers,
Ashok

> 
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Joerg Roedel <joro@8bytes.org>
> Cc: Ashok Raj <ashok.raj@intel.com>
> Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> ---
>  drivers/iommu/intel-svm.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c
> index ed1cf7c5a43b..6643277e321e 100644
> --- a/drivers/iommu/intel-svm.c
> +++ b/drivers/iommu/intel-svm.c
> @@ -129,6 +129,7 @@ int intel_svm_enable_prq(struct intel_iommu *iommu)
>  		pr_err("IOMMU: %s: Failed to request IRQ for page request queue\n",
>  		       iommu->name);
>  		dmar_free_hwirq(irq);
> +		iommu->pr_irq = 0;
>  		goto err;
>  	}
>  	dmar_writeq(iommu->reg + DMAR_PQH_REG, 0ULL);
> @@ -144,9 +145,11 @@ int intel_svm_finish_prq(struct intel_iommu *iommu)
>  	dmar_writeq(iommu->reg + DMAR_PQT_REG, 0ULL);
>  	dmar_writeq(iommu->reg + DMAR_PQA_REG, 0ULL);
>  
> -	free_irq(iommu->pr_irq, iommu);
> -	dmar_free_hwirq(iommu->pr_irq);
> -	iommu->pr_irq = 0;
> +	if (iommu->pr_irq) {
> +		free_irq(iommu->pr_irq, iommu);
> +		dmar_free_hwirq(iommu->pr_irq);
> +		iommu->pr_irq = 0;
> +	}
>  
>  	free_pages((unsigned long)iommu->prq, PRQ_ORDER);
>  	iommu->prq = NULL;
> -- 
> 2.14.3
> 

  reply	other threads:[~2017-12-06 18:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 16:49 Jerry Snitselaar
2017-12-06 18:23 ` Raj, Ashok [this message]
2017-12-20 19:02 ` Alex Williamson

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=20171206182311.GA124624@otc-nc-03 \
    --to=ashok.raj@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=jsnitsel@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®