mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
iommu/vt-d: Convert missing apic.c intr-remapping call to remap_ops
Convert these calls too: * Disable of remapping hardware * Reenable of remapping hardware * Enable fault handling With that all of arch/x86/kernel/apic/apic.c is converted to use the generic intr-remapping interface. Signed-off-by: Joerg Roedel <[email protected]> Acked-by: Yinghai Lu <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Alex Williamson <[email protected]> Signed-off-by: Suresh Siddha <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
This commit is contained in:
parent
736baef447
commit
4f3d8b67ad
6 changed files with 47 additions and 23 deletions
|
|
@ -764,7 +764,7 @@ int __init ir_dev_scope_init(void)
|
|||
}
|
||||
rootfs_initcall(ir_dev_scope_init);
|
||||
|
||||
void disable_intr_remapping(void)
|
||||
static void disable_intr_remapping(void)
|
||||
{
|
||||
struct dmar_drhd_unit *drhd;
|
||||
struct intel_iommu *iommu = NULL;
|
||||
|
|
@ -780,7 +780,7 @@ void disable_intr_remapping(void)
|
|||
}
|
||||
}
|
||||
|
||||
int reenable_intr_remapping(int eim)
|
||||
static int reenable_intr_remapping(int eim)
|
||||
{
|
||||
struct dmar_drhd_unit *drhd;
|
||||
int setup = 0;
|
||||
|
|
@ -818,4 +818,7 @@ struct irq_remap_ops intel_irq_remap_ops = {
|
|||
.supported = intel_intr_remapping_supported,
|
||||
.hardware_init = dmar_table_init,
|
||||
.hardware_enable = intel_enable_intr_remapping,
|
||||
.hardware_disable = disable_intr_remapping,
|
||||
.hardware_reenable = reenable_intr_remapping,
|
||||
.enable_faulting = enable_drhd_fault_handling,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -74,3 +74,27 @@ int __init intr_hardware_enable(void)
|
|||
|
||||
return remap_ops->hardware_enable();
|
||||
}
|
||||
|
||||
void intr_hardware_disable(void)
|
||||
{
|
||||
if (!remap_ops || !remap_ops->hardware_disable)
|
||||
return;
|
||||
|
||||
remap_ops->hardware_disable();
|
||||
}
|
||||
|
||||
int intr_hardware_reenable(int mode)
|
||||
{
|
||||
if (!remap_ops || !remap_ops->hardware_reenable)
|
||||
return 0;
|
||||
|
||||
return remap_ops->hardware_reenable(mode);
|
||||
}
|
||||
|
||||
int __init intr_enable_fault_handling(void)
|
||||
{
|
||||
if (!remap_ops || !remap_ops->enable_faulting)
|
||||
return -ENODEV;
|
||||
|
||||
return remap_ops->enable_faulting();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,15 @@ struct irq_remap_ops {
|
|||
|
||||
/* Enables the remapping hardware */
|
||||
int (*hardware_enable)(void);
|
||||
|
||||
/* Disables the remapping hardware */
|
||||
void (*hardware_disable)(void);
|
||||
|
||||
/* Reenables the remapping hardware */
|
||||
int (*hardware_reenable)(int);
|
||||
|
||||
/* Enable fault handling */
|
||||
int (*enable_faulting)(void);
|
||||
};
|
||||
|
||||
extern struct irq_remap_ops intel_irq_remap_ops;
|
||||
|
|
|
|||
Loading…
Reference in a new issue