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=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 BD258C433F5 for ; Mon, 20 Sep 2021 17:00:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8856B61A7D for ; Mon, 20 Sep 2021 17:00:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8856B61A7D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HecyewmijcfhgDKiOTogrfu9GhqSqkHWW4uaI7Yg8Ec=; b=1aj/iWmpLGXkNs SzKILJ5ar0IKXxNPhd4oKeVFU1WcI+7BeDuzo5uE8HrM/bFGfK0bQh0iXDPJzHElfIp7iCGIVSGoR I02VqzmyMyMqlnYZ72WcGyAcp62D2htFSWwddpOmTapnPB4VidkKSJwkmTATDzLmu8ZPghNgoUOhp H9UqI8I2iQq3tK08LPBVzUmEP9mBUBI3RV9Bwclwleta/CE8BiooBDrSAxgUOKJFv1MWGBHNvb0mI N/Js/FvAkYpHm4cPdfL/FAhtH1PJZQzhTtVYkygTNGvMSKBXEbv3pB4hYIzrIMltC97qWOzRSG899 OX132h7k7VA8b+ILn4Zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSMdd-002VhL-Kx; Mon, 20 Sep 2021 16:59:29 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSMdY-002Vga-Ec for linux-arm-kernel@lists.infradead.org; Mon, 20 Sep 2021 16:59:26 +0000 Received: by mail-pf1-x42a.google.com with SMTP id y4so15304762pfe.5 for ; Mon, 20 Sep 2021 09:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Znx150GeQHqCUDq1R5d3pbprQ1CNmBnhDQEfjRdzInA=; b=pLmoJql/uGd9y5YWMAaw23mJ/vvCcu2k97DZKvIRYqbFMrYUm4dT4kQ4Q/XPnZvNC+ oOxZBB/3kgNwkvpjvXgXm+QwBLSStHjRTqnRkp8ZZfgsuCGqwjUPVMZaG+iKm/Kb5qlR 0SaSi98FfWbkAWnKUagCCoqsQASzkdigyscJfhv3hy32ZIy/g2QTMISwJIuPxPlPqdRO nMEQDXZzD6hM6bjCSbyVXTUD1XHKnbU96X5PfWR3h5b8/rjdqqbSa1nKZ5rwbbYGz2gp bu9qaDDjmkiOXJx4LNxm1JOGQ9ZZ0WRGz+i02B8nuhAbIEoGhDCH+w0XHwBR90Ac9jZj L9rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Znx150GeQHqCUDq1R5d3pbprQ1CNmBnhDQEfjRdzInA=; b=RRZgslgmnns5lXQBg9vL8jIrYWyC5aSZjqZ3XXZkQlzCuRcXALW8uZjPjRj1uQ5yco da6SyF/jKWuSJxhq+rLaZzZEqXCTLvujNBRqXSScvU2R861iIeYkKqgpltiQthbch5wV 1mCI6tBe4hK8VYvAx5N/o8AQ6Sagcu5/pAEw+5RfbHI1svK5W1R2I+kRJ2fD8qYySBJS FfVNsd8HxPvHWXaXRswIoX5x8sg8etiS1GcR4qI5wSTukN/RJkmf5t5+vh3Zy4TCKUK6 dy4eznbWp1dH6LE1oDuF/yPTP6PuFJ75iQo2jqpwgCqcaLTI5LwB6nmSL2tVBcagGkEX twbw== X-Gm-Message-State: AOAM532rq1W9AB2srUaSeAOp/qSt22L1QiEWAX4l1O3nTRrqbJA8kdKA NIcL8BvdmtuHbYkSAwmQ4npEEg== X-Google-Smtp-Source: ABdhPJy+qOdkSC9jNqC3UEqmCXYsNkb5VXxTMgrzHv1FNEw0Rc2NO4A+eMxQtG3Q0T82v9bvnKTcuQ== X-Received: by 2002:a05:6a00:22d5:b0:440:3750:f5f4 with SMTP id f21-20020a056a0022d500b004403750f5f4mr26496924pfj.64.1632157163696; Mon, 20 Sep 2021 09:59:23 -0700 (PDT) Received: from p14s (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id k127sm15590110pfd.1.2021.09.20.09.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 09:59:22 -0700 (PDT) Date: Mon, 20 Sep 2021 10:59:20 -0600 From: Mathieu Poirier To: "Peng Fan (OSS)" Cc: ohad@wizery.com, bjorn.andersson@linaro.org, o.rempel@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, aisheng.dong@nxp.com, Peng Fan Subject: Re: [PATCH V4 3/6] remoteproc: imx_rproc: fix TCM io memory type Message-ID: <20210920165920.GC2023964@p14s> References: <20210910090621.3073540-1-peng.fan@oss.nxp.com> <20210910090621.3073540-4-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210910090621.3073540-4-peng.fan@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210920_095924_609770_C3983CAF X-CRM114-Status: GOOD ( 28.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 10, 2021 at 05:06:18PM +0800, Peng Fan (OSS) wrote: > From: Dong Aisheng > > is_iomem was introduced in the commit 40df0a91b2a5 ("remoteproc: add > is_iomem to da_to_va"), but the driver seemed missed to provide the io > type correctly. > This patch updates remoteproc driver to indicate the TCM on IMX are io > memories. Without the change, remoteproc kick will fail. If the kick fails on all these platforms, why was patch 40df0a91b2a5 ever submitted at all? To me this is a serious problem that should have been caught before it got sent to the mailing list. I have applied this patch but based on the blatant problems this patchset underscores, how can I trust future patches coming from NXP? > > Cc: Bjorn Andersson > Cc: Mathieu Poirier > Cc: Peng Fan > Reviewed-and-tested-by: Peng Fan > Fixes: 79806d32d5aa ("remoteproc: imx_rproc: support i.MX8MN/P") > Signed-off-by: Dong Aisheng > Signed-off-by: Peng Fan > --- > drivers/remoteproc/imx_rproc.c | 35 ++++++++++++++++++++-------------- > 1 file changed, 21 insertions(+), 14 deletions(-) > > diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c > index d88f76f5305eb..71dcc6dd32e40 100644 > --- a/drivers/remoteproc/imx_rproc.c > +++ b/drivers/remoteproc/imx_rproc.c > @@ -71,6 +71,7 @@ struct imx_rproc_mem { > /* att flags */ > /* M4 own area. Can be mapped at probe */ > #define ATT_OWN BIT(1) > +#define ATT_IOMEM BIT(2) > > /* address translation table */ > struct imx_rproc_att { > @@ -117,7 +118,7 @@ struct imx_rproc { > static const struct imx_rproc_att imx_rproc_att_imx8mn[] = { > /* dev addr , sys addr , size , flags */ > /* ITCM */ > - { 0x00000000, 0x007E0000, 0x00020000, ATT_OWN }, > + { 0x00000000, 0x007E0000, 0x00020000, ATT_OWN | ATT_IOMEM }, > /* OCRAM_S */ > { 0x00180000, 0x00180000, 0x00009000, 0 }, > /* OCRAM */ > @@ -131,7 +132,7 @@ static const struct imx_rproc_att imx_rproc_att_imx8mn[] = { > /* DDR (Code) - alias */ > { 0x10000000, 0x40000000, 0x0FFE0000, 0 }, > /* DTCM */ > - { 0x20000000, 0x00800000, 0x00020000, ATT_OWN }, > + { 0x20000000, 0x00800000, 0x00020000, ATT_OWN | ATT_IOMEM }, > /* OCRAM_S - alias */ > { 0x20180000, 0x00180000, 0x00008000, ATT_OWN }, > /* OCRAM */ > @@ -147,7 +148,7 @@ static const struct imx_rproc_att imx_rproc_att_imx8mn[] = { > static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { > /* dev addr , sys addr , size , flags */ > /* TCML - alias */ > - { 0x00000000, 0x007e0000, 0x00020000, 0 }, > + { 0x00000000, 0x007e0000, 0x00020000, ATT_IOMEM}, > /* OCRAM_S */ > { 0x00180000, 0x00180000, 0x00008000, 0 }, > /* OCRAM */ > @@ -159,9 +160,9 @@ static const struct imx_rproc_att imx_rproc_att_imx8mq[] = { > /* DDR (Code) - alias */ > { 0x10000000, 0x80000000, 0x0FFE0000, 0 }, > /* TCML */ > - { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN }, > + { 0x1FFE0000, 0x007E0000, 0x00020000, ATT_OWN | ATT_IOMEM}, > /* TCMU */ > - { 0x20000000, 0x00800000, 0x00020000, ATT_OWN }, > + { 0x20000000, 0x00800000, 0x00020000, ATT_OWN | ATT_IOMEM}, > /* OCRAM_S */ > { 0x20180000, 0x00180000, 0x00008000, ATT_OWN }, > /* OCRAM */ > @@ -199,12 +200,12 @@ static const struct imx_rproc_att imx_rproc_att_imx7d[] = { > /* OCRAM_PXP (Code) - alias */ > { 0x00940000, 0x00940000, 0x00008000, 0 }, > /* TCML (Code) */ > - { 0x1FFF8000, 0x007F8000, 0x00008000, ATT_OWN }, > + { 0x1FFF8000, 0x007F8000, 0x00008000, ATT_OWN | ATT_IOMEM }, > /* DDR (Code) - alias, first part of DDR (Data) */ > { 0x10000000, 0x80000000, 0x0FFF0000, 0 }, > > /* TCMU (Data) */ > - { 0x20000000, 0x00800000, 0x00008000, ATT_OWN }, > + { 0x20000000, 0x00800000, 0x00008000, ATT_OWN | ATT_IOMEM }, > /* OCRAM (Data) */ > { 0x20200000, 0x00900000, 0x00020000, 0 }, > /* OCRAM_EPDC (Data) */ > @@ -218,18 +219,18 @@ static const struct imx_rproc_att imx_rproc_att_imx7d[] = { > static const struct imx_rproc_att imx_rproc_att_imx6sx[] = { > /* dev addr , sys addr , size , flags */ > /* TCML (M4 Boot Code) - alias */ > - { 0x00000000, 0x007F8000, 0x00008000, 0 }, > + { 0x00000000, 0x007F8000, 0x00008000, ATT_IOMEM }, > /* OCRAM_S (Code) */ > { 0x00180000, 0x008F8000, 0x00004000, 0 }, > /* OCRAM_S (Code) - alias */ > { 0x00180000, 0x008FC000, 0x00004000, 0 }, > /* TCML (Code) */ > - { 0x1FFF8000, 0x007F8000, 0x00008000, ATT_OWN }, > + { 0x1FFF8000, 0x007F8000, 0x00008000, ATT_OWN | ATT_IOMEM }, > /* DDR (Code) - alias, first part of DDR (Data) */ > { 0x10000000, 0x80000000, 0x0FFF8000, 0 }, > > /* TCMU (Data) */ > - { 0x20000000, 0x00800000, 0x00008000, ATT_OWN }, > + { 0x20000000, 0x00800000, 0x00008000, ATT_OWN | ATT_IOMEM }, > /* OCRAM_S (Data) - alias? */ > { 0x208F8000, 0x008F8000, 0x00004000, 0 }, > /* DDR (Data) */ > @@ -341,7 +342,7 @@ static int imx_rproc_stop(struct rproc *rproc) > } > > static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da, > - size_t len, u64 *sys) > + size_t len, u64 *sys, bool *is_iomem) > { > const struct imx_rproc_dcfg *dcfg = priv->dcfg; > int i; > @@ -354,6 +355,8 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da, > unsigned int offset = da - att->da; > > *sys = att->sa + offset; > + if (is_iomem) > + *is_iomem = att->flags & ATT_IOMEM; > return 0; > } > } > @@ -377,7 +380,7 @@ static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *i > * On device side we have many aliases, so we need to convert device > * address (M4) to system bus address first. > */ > - if (imx_rproc_da_to_sys(priv, da, len, &sys)) > + if (imx_rproc_da_to_sys(priv, da, len, &sys, is_iomem)) > return NULL; > > for (i = 0; i < IMX_RPROC_MEM_MAX; i++) { > @@ -553,8 +556,12 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, > if (b >= IMX_RPROC_MEM_MAX) > break; > > - priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, > - att->sa, att->size); > + if (att->flags & ATT_IOMEM) > + priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, > + att->sa, att->size); > + else > + priv->mem[b].cpu_addr = devm_ioremap_wc(&pdev->dev, > + att->sa, att->size); > if (!priv->mem[b].cpu_addr) { > dev_err(dev, "failed to remap %#x bytes from %#x\n", att->size, att->sa); > return -ENOMEM; > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel