Message ID | 20231207212441.6199-1-robdclark@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5076203vqy; Thu, 7 Dec 2023 13:32:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXfoRsEFdrUyHud9Ts91rpIUjazzCoCWpVw6fvHTlh7M3G7j25hejh5IS8fcZOZnOR2jG0 X-Received: by 2002:a05:6a20:7355:b0:190:2d3d:b08d with SMTP id v21-20020a056a20735500b001902d3db08dmr314061pzc.69.1701984722585; Thu, 07 Dec 2023 13:32:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701984722; cv=none; d=google.com; s=arc-20160816; b=zjvBOkgJoFK0yhUJ9PYyJ6Ot9eVxUqOfdugAKLX6WH4d1gCtrSuF1Q8i20JPSs/TM9 Zg5Mk+TDEWfVdtanxNbmIUuPzcByZyMWLwRJtjZx3lVcFbjLmnTGCPgUX1/hYUJ+aCWo jLoNq534JK6npeBWh0oHMT6AlDhjSPtcaWY6N9jR57ZVBbKMwhLUweFEpCIvAdPI6sAX k3W3FIz6aJ6p1Z8CU2j3ndWDxRyDY8DcAY+U4qVG7tNyqxEw87aGwK+xp1WXBzMmRl1J GDqflObZQfUyQijIpY7Nm7ni17RFYJu+r0plpITKLWOzNZC+i3ztwl+LVHu5qSDu7HHq 1XSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Px2TdaotpIYQ6sIN9yY8qaT1+HH5T+pH93w2l1LXKbY=; fh=N7CoJeZaXNQY20c20DFG+MtjVAUGq97nJ3/0Zqxt5nY=; b=zl7FP8uosPuIxKoJawEAzMFr6pkvadcZT+8KeI9uN6wW3NKBMWgR7N7J0wbdsisGnT +DHppROxw65mkipjgHCMAzi3aFDMzsMDUdpzWGyJpeOImOsXRwPhN2qqRxmtjUoQRuf8 aQ84p2HQ+MQpO/oIA03CniutQrYNTxAsxeLq7lYlJpwxqwI3gbd3oKYFNwAcx42UvBvE 4Krm+XxvCFisO60sHX3w34UjUL3a08QxJ4OTE/cwup4l7b40lFAvX28F9oCRNbTsdHnQ npweRtWm88kxizvCW2ziXpO2VfqqcjP/rg1VT1IL6NjSyjNN/6bMzl97eVepobcvNpEa VDwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OZSGChIK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b20-20020a056a000a9400b006ce9e6cbdf5si318411pfl.351.2023.12.07.13.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 13:32:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OZSGChIK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 25448816039F; Thu, 7 Dec 2023 13:32:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444006AbjLGVbn (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Thu, 7 Dec 2023 16:31:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444244AbjLGVav (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 7 Dec 2023 16:30:51 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A491B3AA9; Thu, 7 Dec 2023 13:27:07 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso1132074a12.3; Thu, 07 Dec 2023 13:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701984427; x=1702589227; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Px2TdaotpIYQ6sIN9yY8qaT1+HH5T+pH93w2l1LXKbY=; b=OZSGChIK/dU7FKvQLuwc5t3PiMcG5Aa+lpva/7j/L4uR6ZFY3459aMGruUCQHAImFt phW+Clv1rvlbkepWN3purRzhrVo1U0Ju2HeSVB3HbXLC/v+ZXpFUaYkUq3uM9Li9ORnL cZ7m3Gzn+xq8mPQydcScn4Qox9Wh0jnMTWNPznch9cVgmYYL2ZHE3mKfPVYesgsRCmMd O2+lPBwSLwHY1AZQU89KDdH0T2pAU3VKqfJjHN733j4vGr3pip5OyxSnZkP5+XQ3Y3Wq JJd9enr5lUWiIa4hniYc9NMht6VylsLpjrC8YeGaar39NsM4TRRoOMuGpZL4mkvbNiX4 0iMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701984427; x=1702589227; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Px2TdaotpIYQ6sIN9yY8qaT1+HH5T+pH93w2l1LXKbY=; b=soHuJWFsgMae5db+8tFpA30Gpur3B+1ZA5+U5SixtrgLHWEmTL3Hq31odbLtSCvwYL 4EscDfzxIEswGw3vVQ7jP5ZiQB9eEjKFEN79wM9ZLwbzU8VEqQLikTtrEGXsh2tPRydG cBOYfoMi9wz6V5GwW8tCgBmWOfPcc+kytFyuyGARLVEMuwoXIE4bzpODL/544qw9N7qA oG/lA1Rm1ftJunOR2agOHEfBxtjff0D5HreZJMNIgduRZdkprlcNA/rzZ3LXq+9Fo7yZ QwhgusEkoHyMQb7Ns5gh7LZ8ak9rXtLc1m7pSEhgOt3oaxbG3lzdK0pTsvmJKK2MRZqS KCSA== X-Gm-Message-State: AOJu0Yyp+W4WlKpBMpivlU3O1Ie9M7jdcgF5uxLe0Fd1Yx8p+lKHXdan o3VjnK/ZwgpJJdjwAmc6brE= X-Received: by 2002:a05:6a20:12ca:b0:187:df72:48ef with SMTP id v10-20020a056a2012ca00b00187df7248efmr3188889pzg.0.1701984426614; Thu, 07 Dec 2023 13:27:06 -0800 (PST) Received: from localhost ([100.84.200.15]) by smtp.gmail.com with ESMTPSA id q19-20020a056a00151300b006cdcfd814e9sm241008pfu.147.2023.12.07.13.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 13:27:05 -0800 (PST) From: Rob Clark <robdclark@gmail.com> To: iommu@lists.linux-foundation.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark <robdclark@chromium.org>, Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, Joerg Roedel <joro@8bytes.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Bjorn Andersson <quic_bjorande@quicinc.com>, Elliot Berman <quic_eberman@quicinc.com>, Richard Acayan <mailingradian@gmail.com>, Manivannan Sadhasivam <mani@kernel.org>, linux-arm-kernel@lists.infradead.org (moderated list:ARM SMMU DRIVERS), iommu@lists.linux.dev (open list:IOMMU SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] iommu/arm-smmu-qcom: Add missing GMU entry to match table Date: Thu, 7 Dec 2023 13:24:39 -0800 Message-ID: <20231207212441.6199-1-robdclark@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 07 Dec 2023 13:32:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784660332525958137 X-GMAIL-MSGID: 1784660332525958137 |
Series |
iommu/arm-smmu-qcom: Add missing GMU entry to match table
|
|
Commit Message
Rob Clark
Dec. 7, 2023, 9:24 p.m. UTC
From: Rob Clark <robdclark@chromium.org> We also want the default domain for the GMU to be an identy domain, so it does not get a context bank assigned. Without this, both of_dma_configure() and drm/msm's iommu_domain_attach() will trigger allocating and configuring a context bank. So GMU ends up attached to both cbndx 1 and cbndx 2. This arrangement seemingly confounds and surprises the firmware if the GPU later triggers a translation fault, resulting (on sc8280xp / lenovo x13s, at least) in the SMMU getting wedged and the GPU stuck without memory access. Signed-off-by: Rob Clark <robdclark@chromium.org> --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)
Comments
On Thu, Dec 07, 2023 at 01:24:39PM -0800, Rob Clark wrote: > From: Rob Clark <robdclark@chromium.org> > > We also want the default domain for the GMU to be an identy domain, > so it does not get a context bank assigned. Without this, both > of_dma_configure() and drm/msm's iommu_domain_attach() will trigger > allocating and configuring a context bank. So GMU ends up attached > to both cbndx 1 and cbndx 2. This arrangement seemingly confounds > and surprises the firmware if the GPU later triggers a translation > fault, resulting (on sc8280xp / lenovo x13s, at least) in the SMMU > getting wedged and the GPU stuck without memory access. This sounds like something that should be backported. Should you add a Fixes and CC-stable tag? > Signed-off-by: Rob Clark <robdclark@chromium.org> Johan
On 07/12/2023 9:24 pm, Rob Clark wrote: > From: Rob Clark <robdclark@chromium.org> > > We also want the default domain for the GMU to be an identy domain, > so it does not get a context bank assigned. Without this, both > of_dma_configure() and drm/msm's iommu_domain_attach() will trigger > allocating and configuring a context bank. So GMU ends up attached > to both cbndx 1 and cbndx 2. I can't help but read this as implying that it gets attached to both *at the same time*, which would be indicative of a far more serious problem in the main driver and/or IOMMU core code. However, from what we discussed on IRC last night, it sounds like the key point here is more straightforwardly that firmware expects the GMU to be using context bank 1, in a vaguely similar fashion to how context bank 0 is special for the GPU. Clarifying that would help explain why we're just doing this as a trick to influence the allocator (i.e. unlike some of the other devices in this list we don't actually need the properties of the identity domain itself). In future it might be nice to reserve this explicitly on platforms which need it and extend qcom_adreno_smmu_alloc_context_bank() to handle the GMU as well, but I don't object to this patch as an immediate quick fix for now, especially as something nice and easy for stable (I'd agree with Johan in that regard). Thanks, Robin. > This arrangement seemingly confounds > and surprises the firmware if the GPU later triggers a translation > fault, resulting (on sc8280xp / lenovo x13s, at least) in the SMMU > getting wedged and the GPU stuck without memory access. > > Signed-off-by: Rob Clark <robdclark@chromium.org> > --- > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > index 549ae4dba3a6..d326fa230b96 100644 > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > @@ -243,6 +243,7 @@ static int qcom_adreno_smmu_init_context(struct arm_smmu_domain *smmu_domain, > > static const struct of_device_id qcom_smmu_client_of_match[] __maybe_unused = { > { .compatible = "qcom,adreno" }, > + { .compatible = "qcom,adreno-gmu" }, > { .compatible = "qcom,mdp4" }, > { .compatible = "qcom,mdss" }, > { .compatible = "qcom,sc7180-mdss" },
diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c index 549ae4dba3a6..d326fa230b96 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -243,6 +243,7 @@ static int qcom_adreno_smmu_init_context(struct arm_smmu_domain *smmu_domain, static const struct of_device_id qcom_smmu_client_of_match[] __maybe_unused = { { .compatible = "qcom,adreno" }, + { .compatible = "qcom,adreno-gmu" }, { .compatible = "qcom,mdp4" }, { .compatible = "qcom,mdss" }, { .compatible = "qcom,sc7180-mdss" },