RE: [PATCHv3 5/9] dspbridge: add mmufault support

From: Guzman Lugo, Fernando
Date: Thu Jul 01 2010 - 13:54:42 EST




Hi Hari,

> -----Original Message-----
> From: Kanigeri, Hari
> Sent: Thursday, July 01, 2010 12:17 PM
> To: Guzman Lugo, Fernando; linux-omap@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Cc: ohad@xxxxxxxxxx; hiroshi.doyo@xxxxxxxxx; ameya.palande@xxxxxxxxx;
> felipe.contreras@xxxxxxxxx; Guzman Lugo, Fernando
> Subject: RE: [PATCHv3 5/9] dspbridge: add mmufault support
>
> Hi Fernando,
>
> > +int mmu_fault_isr(struct iommu *mmu)
> >
> > -/*
> > - * ======== mmu_check_if_fault =======
> > - * Check to see if MMU Fault is valid TLB miss from DSP
> > - * Note: This function is called from an ISR
> > - */
> > -static bool mmu_check_if_fault(struct bridge_dev_context *dev_context)
> > {
> > + struct deh_mgr *dm;
> > + u32 da;
> > +
> > + dev_get_deh_mgr(dev_get_first(), &dm);
> > +
> > + if (!dm)
> > + return -EPERM;
> > +
> > + da = iommu_read_reg(mmu, MMU_FAULT_AD);
> > + iommu_write_reg(mmu, 0, MMU_IRQENABLE);
>
> -- Isn't the MMU already enabled at this point when the function callback
> is called by iommu ?

This line is actually disabling the interrupts. I am writing "0x0" in the MMU_IRQENABLE.

>
> > + dm->err_info.dw_val1 = da;
> > + tasklet_schedule(&dm->dpc_tasklet);
>
> -- The iommu fault isr disables the IOMMU at the end of the fault handler,
> so by the time your tasklet is scheduled you might have the MMU in a
> disabled state. Looks to me either this requires change in iommu to remove
> the disable part or enable the MMU in the tasklet instead of doing it
> early in mmu_fault_isr.

I am returning 0 in the callback function, that means the callback function has managed the fault and the mmu_fault_isr does not do anything else


if (obj->isr)
err = obj->isr(obj);

if (!err)
return IRQ_HANDLED;

it is working for me without not modifications in the iommu_fault_handler function.

Thanks for the comments,
Fernando.

>
> Thank you,
> Best regards,
> Hari
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/