From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FEE3C433E1 for ; Thu, 13 Aug 2020 13:03:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 440B1207DA for ; Thu, 13 Aug 2020 13:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597323831; bh=uosX7oOdedb0KLor00/iyCHrh6G2Bj9rDNwIyKdLSuo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=agxcxtVEoAgGUnp3abFH4Gm9xCEQP8O6kc97hDWPOfASMscIBbMUuaVUvwBgdFcy5 UOUoL0CJxIUcmrJEFHKvzg2cqmc/SbE17G498H8SbEv68xYwjORh7JLdHPBL9vGTge krK6hJuB3TYRiNSVRf3JHAY1cV255R6cvd82CGhs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbgHMNDt (ORCPT ); Thu, 13 Aug 2020 09:03:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:57048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgHMNDt (ORCPT ); Thu, 13 Aug 2020 09:03:49 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3B4782078D; Thu, 13 Aug 2020 13:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597323828; bh=uosX7oOdedb0KLor00/iyCHrh6G2Bj9rDNwIyKdLSuo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ofnbcP1AZ2+YJJLcKWRijpgnzeIiafm4To7Gyd88zHqHIDGq563wKxZSeFKH1XSVt 4iEW8OQVCuMRKUIatVJ4TvM9Gw0lAC/iXmvZl1uZvoGn6qP+NToQdG5gxNgW9zIX8F zhyR5nrx8aHQ9Zer6aGrWmXCJBmZ/x8oX5l/9I1Q= Date: Thu, 13 Aug 2020 14:03:43 +0100 From: Will Deacon To: Jordan Crouse Cc: linux-arm-msm@vger.kernel.org, Robin Murphy , Bjorn Andersson , iommu@lists.linux-foundation.org, freedreno@lists.freedesktop.org, Sai Prakash Ranjan , Greg Kroah-Hartman , Joerg Roedel , Krishna Reddy , Pritesh Raithatha , Sibi Sankar , Stephen Boyd , Thierry Reding , Vivek Gautam , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v12 13/13] iommu/arm-smmu: Add a init_context_bank implementation hook Message-ID: <20200813130342.GA10256@willie-the-truck> References: <20200810222657.1841322-1-jcrouse@codeaurora.org> <20200810222657.1841322-14-jcrouse@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200810222657.1841322-14-jcrouse@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 10, 2020 at 04:26:57PM -0600, Jordan Crouse wrote: > Add a new implementation hook to allow the implementation specific code > to tweek the context bank configuration just before it gets written. > The first user will be the Adreno GPU implementation to turn on > SCTLR.HUPCF to ensure that a page fault doesn't terminating pending > transactions. Doing so could hang the GPU if one of the terminated > transactions is a CP read. > > Signed-off-by: Jordan Crouse > --- > > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 16 ++++++++++++++++ > drivers/iommu/arm/arm-smmu/arm-smmu.c | 21 +++++++++++++-------- > drivers/iommu/arm/arm-smmu/arm-smmu.h | 5 +++++ > 3 files changed, 34 insertions(+), 8 deletions(-) We already have ->init_context(), so I'd prefer to use that instead of adding another callback. Could we stick a couple of fields in smmu_domain->cfg (e.g. sctlr_set, sctlr_clr) and handle those a bit like we do for the asid/vmid on cavium implementations? Will