<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:monospace">Hi Robin,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 18 May 2021 at 00:35, Robin Murphy <<a href="mailto:robin.murphy@arm.com" target="_blank">robin.murphy@arm.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2021-05-17 10:27, Joerg Roedel wrote:<br>
> On Fri, Apr 30, 2021 at 08:20:10PM +0800, Kevin Tang wrote:<br>
>> Cc  Robin & Joerg<br>
> <br>
> This is just some GPU internal MMU being used here, it seems. It doesn't<br>
> use the IOMMU core code, so no Ack needed from the IOMMU side.<br>
<br>
Except the actual MMU being used is <span class="gmail_default" style="font-family:monospace"></span>drivers/iommu/sprd_iommu.c - this is</blockquote><div><br></div><div><div class="gmail_default" style="font-family:monospace">Yes, it is using <span class="gmail_default"></span><span style="font-family:Arial,Helvetica,sans-serif">drivers/iommu/sprd_iommu.c.</span></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
just the display driver poking directly at the interrupt registers of <br>
its associated IOMMU instance. </blockquote><div><br></div><div><div class="gmail_default" style="font-family:monospace">Actually the display driver is poking its own interrupt registers in which some interrupts are caused by using IOMMU, others are purely its own ones:</div>+/* <span>Interrupt</span> control & status bits */<br>+#define BIT_DPU_INT_DONE               BIT(0)<br>+#define BIT_DPU_INT_TE                 BIT(1)<br>+#define BIT_DPU_INT_ERR                        BIT(2)<br>+#define BIT_DPU_INT_UPDATE_DONE                BIT(4)<br>+#define BIT_DPU_INT_VSYNC              BIT(5)<br>+#define BIT_DPU_INT_MMU_VAOR_RD                BIT(16)<br>+#define BIT_DPU_INT_MMU_VAOR_WR                BIT(17)<br>+#define BIT_DPU_INT_MMU_INV_RD         BIT(18)<br><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif">+#define BIT_DPU_INT_MMU_INV_WR         BIT(19)</span></div></div><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div class="gmail_default" style="font-family:monospace"><span style="font-family:Arial,Helvetica,sans-serif">From what I see in the product code, along with the information my colleagues told me, these _INT_MMU_ interrupts  only need to be dealt with by client devices(i.e. display). IOMMU doesn't even have the INT_STS register for some early products which we're trying to support in the mainstream kernel.</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I still think this is wrong, and that it <br>
should be treated as a shared interrupt, with the IOMMU driver handling <br>
its own registers and reporting to the client through the standard <br>
report_iommu_fault() API, especially since there are apparently more <br>
blocks using these IOMMU instances than just the display.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:monospace">For the next generation IOMMU, we will handle interrupts in IOMMU drivers like you say here.</div></div><div class="gmail_default" style="font-family:monospace">But like I explained above, we have to leave interrupt handling in the client device driver since the IOMMU we 're using in this display device doesn't have an INT_STS register in the IOMMU register range.</div><div class="gmail_default" style="font-family:monospace"><br></div><div class="gmail_default" style="font-family:monospace">Thanks for the review,</div><div class="gmail_default" style="font-family:monospace">Chunyan</div><div class="gmail_default" style="font-family:monospace"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Robin.<br>
</blockquote></div></div>