Skip to content

Commit 124262a

Browse files
sumanannajoergroedel
authored andcommitted
iommu/omap: Simplify omap2_iommu_fault_isr()
The function omap2_iommu_fault_isr() does an unnecessary recomputation of the return value. The logic relies on setting the same bit fields as the MMU fault error status bits, so simplify this function and remove the unneeded macros. These macros were originally exported to notify MMU faults to users prior to the IOMMU framework adaptation, but are now redundant. Signed-off-by: Suman Anna <s-anna@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent c2372aa commit 124262a

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

drivers/iommu/omap-iommu2.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@
5353
((pgsz) == MMU_CAM_PGSZ_64K) ? 0xffff0000 : \
5454
((pgsz) == MMU_CAM_PGSZ_4K) ? 0xfffff000 : 0)
5555

56-
/* IOMMU errors */
57-
#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0)
58-
#define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1)
59-
#define OMAP_IOMMU_ERR_EMU_MISS (1 << 2)
60-
#define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3)
61-
#define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4)
62-
6356
static void __iommu_set_twl(struct omap_iommu *obj, bool on)
6457
{
6558
u32 l = iommu_read_reg(obj, MMU_CNTL);
@@ -122,7 +115,6 @@ static void omap2_iommu_set_twl(struct omap_iommu *obj, bool on)
122115
static u32 omap2_iommu_fault_isr(struct omap_iommu *obj, u32 *ra)
123116
{
124117
u32 stat, da;
125-
u32 errs = 0;
126118

127119
stat = iommu_read_reg(obj, MMU_IRQSTATUS);
128120
stat &= MMU_IRQ_MASK;
@@ -134,19 +126,9 @@ static u32 omap2_iommu_fault_isr(struct omap_iommu *obj, u32 *ra)
134126
da = iommu_read_reg(obj, MMU_FAULT_AD);
135127
*ra = da;
136128

137-
if (stat & MMU_IRQ_TLBMISS)
138-
errs |= OMAP_IOMMU_ERR_TLB_MISS;
139-
if (stat & MMU_IRQ_TRANSLATIONFAULT)
140-
errs |= OMAP_IOMMU_ERR_TRANS_FAULT;
141-
if (stat & MMU_IRQ_EMUMISS)
142-
errs |= OMAP_IOMMU_ERR_EMU_MISS;
143-
if (stat & MMU_IRQ_TABLEWALKFAULT)
144-
errs |= OMAP_IOMMU_ERR_TBLWALK_FAULT;
145-
if (stat & MMU_IRQ_MULTIHITFAULT)
146-
errs |= OMAP_IOMMU_ERR_MULTIHIT_FAULT;
147129
iommu_write_reg(obj, stat, MMU_IRQSTATUS);
148130

149-
return errs;
131+
return stat;
150132
}
151133

152134
static void omap2_tlb_read_cr(struct omap_iommu *obj, struct cr_regs *cr)

0 commit comments

Comments
 (0)