gitlab.arm.com will be in the maintainance mode on Wednesday June 29th 01:00 - 10:00 (UTC+1). Repositories is read only during the maintainance.

Commit c01c744d authored by Robin Murphy's avatar Robin Murphy
Browse files

iommu/arm-smmu: Polled IRQs



It's not just Marvin Gaye who wants to know what's going on.
Signed-off-by: Robin Murphy's avatarRobin Murphy <robin.murphy@arm.com>
parent 1e64f723
......@@ -55,6 +55,8 @@
#define MSI_IOVA_BASE 0x8000000
#define MSI_IOVA_LENGTH 0x100000
#define ARM_SMMU_TIMER_POLL ns_to_ktime(NSEC_PER_MSEC)
static int force_stage;
module_param(force_stage, int, S_IRUGO);
MODULE_PARM_DESC(force_stage,
......@@ -458,6 +460,16 @@ static irqreturn_t arm_smmu_global_fault(int irq, void *dev)
return IRQ_HANDLED;
}
static enum hrtimer_restart arm_smmu_timer_handler(struct hrtimer *hrtimer)
{
struct arm_smmu_device *smmu = container_of(hrtimer, struct arm_smmu_device, hrtimer);
arm_smmu_global_fault(0, smmu);
hrtimer_forward_now(hrtimer, ARM_SMMU_TIMER_POLL);
return HRTIMER_RESTART;
}
static void arm_smmu_init_context_bank(struct arm_smmu_domain *smmu_domain,
struct io_pgtable_cfg *pgtbl_cfg)
{
......@@ -1700,6 +1712,8 @@ static void arm_smmu_device_reset(struct arm_smmu_device *smmu)
/* Push the button */
arm_smmu_tlb_sync_global(smmu);
arm_smmu_gr0_write(smmu, ARM_SMMU_GR0_sCR0, reg);
hrtimer_start(&smmu->hrtimer, ARM_SMMU_TIMER_POLL, HRTIMER_MODE_REL);
}
static int arm_smmu_id_size_to_bits(int size)
......@@ -2213,6 +2227,8 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
return err;
}
}
hrtimer_init(&smmu->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
smmu->hrtimer.function = arm_smmu_timer_handler;
err = iommu_device_sysfs_add(&smmu->iommu, smmu->dev, NULL,
"smmu.%pa", &ioaddr);
......
......@@ -321,6 +321,7 @@ struct arm_smmu_device {
unsigned int *irqs;
struct clk_bulk_data *clks;
int num_clks;
struct hrtimer hrtimer;
spinlock_t global_sync_lock;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment