iommu/AMD: Per-thread IOMMU Interrupt Handling
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Mon, 22 Apr 2013 21:32:34 +0000 (16:32 -0500)
committerJoerg Roedel <joro@8bytes.org>
Tue, 23 Apr 2013 12:34:26 +0000 (14:34 +0200)
commit3f398bc7762adcd860bd2acce18465a106f47325
tree120d9bde4c592f3561d1f218fbea00b11b631393
parentd3263bc29706e42f74d8800807c2dedf320d77f1
iommu/AMD: Per-thread IOMMU Interrupt Handling

In the current interrupt handling scheme, there are as many threads as
the number of IOMMUs. Each thread is created and assigned to an IOMMU at
the time of registering interrupt handlers (request_threaded_irq).
When an IOMMU HW generates an interrupt, the irq handler (top half) wakes up
the corresponding thread to process event and PPR logs of all IOMMUs
starting from the 1st IOMMU.

In the system with multiple IOMMU,this handling scheme complicates the
synchronization of the IOMMU data structures and status registers as
there could be multiple threads competing for the same IOMMU while
the other IOMMU could be left unhandled.

To simplify, this patch is proposing a different interrupt handling scheme
by having each thread only managing interrupts of the corresponding IOMMU.
This can be achieved by passing the struct amd_iommu when registering the
interrupt handlers. This structure is unique for each IOMMU and can be used
by the bottom half thread to identify the IOMMU to be handled instead
of calling for_each_iommu.  Besides this also eliminate the needs to lock
the IOMMU for processing event and PPR logs.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
drivers/iommu/amd_iommu.c
drivers/iommu/amd_iommu_init.c