public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Fenghua Yu <fenghua.yu@intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Francois Isabelle <Francois.Isabelle@ca.kontron.com>,
	iommu@lists.linux-foundation.org,
	Grant Grundler <grundler@parisc-linux.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] pciehp_driver.c: PCIe hot plug for Intel iommu - call IOMMU API in hot remove
Date: Fri, 2 Oct 2009 23:50:19 +0200	[thread overview]
Message-ID: <20091002215019.GB23379@8bytes.org> (raw)
In-Reply-To: <20091002211844.GA14352@linux-os.sc.intel.com>

On Fri, Oct 02, 2009 at 02:18:44PM -0700, Fenghua Yu wrote:
> IOMMU API iommu_detach_devcie() is called to hot remove a PCIe device.
> 
> A hot added device will be added into an IOMMU domain when it first does IOMMU
> op. So there is no need to add more code for hot add. 
> 
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> 
> ---
> 
>  drivers/pci/pci-driver.c |    8 ++++++++
>  1 files changed, 8 insertions(+)
> 
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index e5d47be..b8f0592 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -17,6 +17,7 @@
>  #include <linux/slab.h>
>  #include <linux/sched.h>
>  #include <linux/cpu.h>
> +#include <linux/iommu.h>
>  #include "pci.h"
>  
>  struct pci_dynid {
> @@ -390,6 +391,13 @@ static int pci_device_remove(struct device * dev)
>  	 */
>  
>  	pci_dev_put(pci_dev);
> +
> +	/*
> +	 * Remove this pci device from its iommu domain.
> +	 */
> +	if (iommu_found())
> +		iommu_detach_device(NULL, dev);
> +
>  	return 0;
>  }

NACK!

This breaks with AMD IOMMU driver.
Just implement a VT-d specific notifier callback for device removal on
the pci bus.

	Joerg


  reply	other threads:[~2009-10-02 21:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <72D8A09E39A89147BE9CFBB6F0C73C306073445396@rrsmsx501.amr.corp.intel.com>
     [not found] ` <6E2431EDEB6AE64F827F8A1B0D0DA1A603C322CF@azsmsx501.amr.corp.intel.com>
     [not found]   ` <72D8A09E39A89147BE9CFBB6F0C73C30607344552A@rrsmsx501.amr.corp.intel.com>
2009-10-02 21:18     ` [PATCH 2/2] pciehp_driver.c: PCIe hot plug for Intel iommu - call IOMMU API in hot remove Fenghua Yu
2009-10-02 21:50       ` Joerg Roedel [this message]
2009-10-03  0:01         ` Fenghua Yu
2009-10-06 18:23         ` [PATCH] PCIe hot plug for Intel iommu Fenghua Yu
2009-10-22  7:07           ` Yinghai Lu

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=20091002215019.GB23379@8bytes.org \
    --to=joro@8bytes.org \
    --cc=Francois.Isabelle@ca.kontron.com \
    --cc=dwmw2@infradead.org \
    --cc=fenghua.yu@intel.com \
    --cc=grundler@parisc-linux.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jbarnes@virtuousgeek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox