Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp469672pxb; Thu, 17 Feb 2022 07:55:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSGhv9Obe0R2JB54LrY2Tc7qt0LmQ0VI0QV2L9oLXsus67n6krXJCyFP32CLD238bzj2Y0 X-Received: by 2002:a17:907:a06c:b0:6c9:408e:cec with SMTP id ia12-20020a170907a06c00b006c9408e0cecmr2823973ejc.510.1645113333123; Thu, 17 Feb 2022 07:55:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645113333; cv=none; d=google.com; s=arc-20160816; b=pl26HfGkG6oZrZTQi9AqaC4F8+TYMdMKVSZnzfy99pnO7H2pTRD/rTo5iJuvU+IVZw 1f95yFK+KcAG0IOrXGKd6QtieNJmsc9NIeMMuxgNFilw8+s6My04jIO9CowgN3ff6mWO RQ5rs7ePzaomGk8YiYlEdpmFTgdthm3yjtLSWYPRZHBFFOKuCd87mwoj3e65FsIDzX/K Z853rUDzMtNBCQlA6an4kOaWbM11UUelvsgBrtv2Dis8PVF34aWNBGKWsQZE4QqBaxI+ HNrjStCP1d2PIkZSTeIiN0L1ONN8V1KwcSVZoR7iI2/3DRt2FyJbFhm7IN+6xVEsTe3Q iXmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KPSOV7E1cCp09mBA24F86eRu79Z5SrhdYm5Xeli+dsA=; b=PhimrNJhNwFQj9xjx4Few+wFqxUsJcwz2dpPKDsOKDmj30ziqQjOLy7lbnw8BSDzDv SWYvBx3J9b5lprzqasYsH1vMx3ejNK7duGlKqVJellOKH+/IiS05l6+BE2CGypnBb6Ut fxBGV9twwiiguzOLMXdTc7n0U04JNs3Fs/cZIk/bk3M8cyn8tRGe4HiGf0E5S1Dau9/h wJc5gCcRXUu8TkHCw535yRgA54ZNDzhygrqYsF8gUIWTnNliLaABdkYIz3uciMVgAfWJ cOF6DcYz8YHYdB1HMS9TWAyvf4svNjhRM1Gi48qD8jKaL441RvwxSpIOdkBmZlrRUX+C 1jXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PILuS0Fj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18si4890722edb.552.2022.02.17.07.55.02; Thu, 17 Feb 2022 07:55:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PILuS0Fj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239246AbiBQKkx (ORCPT + 99 others); Thu, 17 Feb 2022 05:40:53 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239244AbiBQKkw (ORCPT ); Thu, 17 Feb 2022 05:40:52 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39848284D1C for ; Thu, 17 Feb 2022 02:40:38 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 581411F4560C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1645094437; bh=a4kVXcts5RYYnYTz5xCDykmha1OtLX+CuQebEarzxD4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=PILuS0FjWxb32OJHPC9LFsuDVR2N2f8T1T47E8XjDZYH4g/Qdf9Ys1kjJL1nPJFZf 0HCZnyJ2jttRNd/7uL54TZOwi8FNIoQxm/rHjQdH7o+aSkXC2rNq11KKxzp7fDiLRd j0MNWb2YrLuAIzsbfjoXnM4UmnCw4SCXlXhGRAL0DiaIPR/rDn0115FZAhoDauUl7c XJCJCEJJfeS+r1AuvnwXPyAc+WGolhB/mO8sgBUfFSASYRVKk4Khj2wvlZWOpa8DSU hCDnCYyLXHXuUbZU9hyrcoYc7KjABQL1sEyOpI6AXMRSlrzaGRN2JDOLh7uSjDIWwF pnJ2kUPw5uxgQ== Message-ID: Date: Thu, 17 Feb 2022 11:40:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v2] soc: mediatek: mtk-infracfg: Disable ACP on MT8192 Content-Language: en-US To: Alyssa Rosenzweig , linux-mediatek@lists.infradead.org Cc: Matthias Brugger , Chun-Jie Chen , Robin Murphy , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nick Fan , Nicolas Boichat , Stephen Boyd References: <20220215184651.12168-1-alyssa.rosenzweig@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220215184651.12168-1-alyssa.rosenzweig@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 15/02/22 19:46, Alyssa Rosenzweig ha scritto: > MT8192 contains an experimental Accelerator Coherency Port > implementation, which does not work correctly but was unintentionally > enabled by default. For correct operation of the GPU, we must set a > chicken bit disabling ACP on MT8192. > > Adapted from the following downstream change to the out-of-tree, legacy > Mali GPU driver: > > https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2781271/5 > > Note this change is required for both Panfrost and the legacy kernel > driver. Hello Alyssa, the v2 note should not get inside the commit message, even though they should be on the patch to provide context. Look at the example... > > v2: Move the change from clk-mt8192.c to mtk-infracfg.c (Robin). > Although it does not make sense to add this platform-specific hack to > the GPU driver, it has nothing to do with clocks. We already have > mtk-infracfg.c to manage other infracfg bits; the ACP disable should > live there too. > > Co-developed-by: Robin Murphy > Signed-off-by: Robin Murphy > Signed-off-by: Alyssa Rosenzweig > Cc: Nick Fan > Cc: Nicolas Boichat > Cc: Chen-Yu Tsai > Cc: Stephen Boyd > Cc: AngeloGioacchino Del Regno > --- v2: Move the change from clk-mt8192.c to mtk-infracfg.c (Robin). ^^^ put it here, after the "---" :) Anyway, Tested-by: AngeloGioacchino Del Regno > drivers/soc/mediatek/mtk-infracfg.c | 19 +++++++++++++++++++ > include/linux/soc/mediatek/infracfg.h | 3 +++ > 2 files changed, 22 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-infracfg.c b/drivers/soc/mediatek/mtk-infracfg.c > index 0590b68e0d78..2acf19676af2 100644 > --- a/drivers/soc/mediatek/mtk-infracfg.c > +++ b/drivers/soc/mediatek/mtk-infracfg.c > @@ -6,6 +6,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -72,3 +73,21 @@ int mtk_infracfg_clear_bus_protection(struct regmap *infracfg, u32 mask, > > return ret; > } > + > +static int __init mtk_infracfg_init(void) > +{ > + struct regmap *infracfg; > + > + /* > + * MT8192 has an experimental path to route GPU traffic to the DSU's > + * Accelerator Coherency Port, which is inadvertently enabled by > + * default. It turns out not to work, so disable it to prevent spurious > + * GPU faults. > + */ > + infracfg = syscon_regmap_lookup_by_compatible("mediatek,mt8192-infracfg"); > + if (!IS_ERR(infracfg)) > + regmap_set_bits(infracfg, MT8192_INFRA_CTRL, > + MT8192_INFRA_CTRL_DISABLE_MFG2ACP); > + return 0; > +} > +postcore_initcall(mtk_infracfg_init); > diff --git a/include/linux/soc/mediatek/infracfg.h b/include/linux/soc/mediatek/infracfg.h > index d858e0bab7a2..fcbbd0dd5e55 100644 > --- a/include/linux/soc/mediatek/infracfg.h > +++ b/include/linux/soc/mediatek/infracfg.h > @@ -229,6 +229,9 @@ > #define INFRA_TOPAXI_PROTECTEN_SET 0x0260 > #define INFRA_TOPAXI_PROTECTEN_CLR 0x0264 > > +#define MT8192_INFRA_CTRL 0x290 > +#define MT8192_INFRA_CTRL_DISABLE_MFG2ACP BIT(9) > + > #define REG_INFRA_MISC 0xf00 > #define F_DDR_4GB_SUPPORT_EN BIT(13) > -- AngeloGioacchino Del Regno Software Engineer Collabora Ltd. Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK Registered in England & Wales, no. 5513718