From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [RFC 1/3] iommu/arm-smmu: Add support to opt-in to stalling Date: Wed, 11 Jan 2017 09:36:07 +0000 Message-ID: <20170111093606.GA12388@arm.com> References: <1483479056-15202-1-git-send-email-robdclark@gmail.com> <1483479056-15202-2-git-send-email-robdclark@gmail.com> <20170105115528.GG679@arm.com> <20170105154950.GM679@arm.com> <20170110175219.GK527@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Rob Clark Cc: "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , linux-arm-msm , Sricharan R , Jordan Crouse , Mark Rutland , Rob Herring , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: devicetree@vger.kernel.org On Tue, Jan 10, 2017 at 02:20:13PM -0500, Rob Clark wrote: > On Tue, Jan 10, 2017 at 12:52 PM, Will Deacon wrote: > > On Fri, Jan 06, 2017 at 11:26:49AM -0500, Rob Clark wrote: > >> Hmm, well we install the fault handler on the iommu_domain.. perhaps > >> maybe a combo of dts property (or deciding based on more specific > >> compat string), plus extra param passed in to > >> iommu_set_fault_hander(). The dts property or compat string to > >> indicate whether the iommu (and how it is wired up) can handle stalls, > >> and enable_stall param when fault handler is registered to indicate > >> whether the device itself can cope.. if either can't do stalling, then > >> don't set CFCFG. > > > > I thought about this some more, and I think you're right. Having > > iommu_set_fault_handler take a flags parameter indicating that, for example, > > the fault handler can deal with paging, is all we need to implement the > > per-master opt-in functionality for stalling faults. There's no real > > requirement to standardise a generic firmware property for that (but > > we still need *something* that says stalling is usable on the SMMU -- > > perhaps just the compatible string is ok). > > btw, it occurred to me that maybe it should be flags param to > iommu_attach_device() (just in case fault handler not installed?) > otoh stalling without a fault handler is silly, but I guess we need it > to infer whether stalling can be supported by other devices on same > iommu.. tbh I'm on a bit shaky ground when it comes to multiple > devices per iommu since the SoC's I'm familiar with do it the other > way around. But I guess you have thought more about the multi-device > case, so figured I should suggest it.. I don't think it works at attach time, because the stalling property belongs to the domain, rather than the individual devices within it. Similarly, I don't think we should allow this property to be toggled once devices have been attached. Will -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html