Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp237299rwb; Wed, 14 Dec 2022 16:40:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf7xkp4o2CWABx3EN1zNqkzXHZue0ZDkxLTDY2YskYgwMZHV4CYe735zyXeUJieUWVBiFW1A X-Received: by 2002:a17:90a:8a8a:b0:219:dc24:7595 with SMTP id x10-20020a17090a8a8a00b00219dc247595mr26646170pjn.19.1671064848547; Wed, 14 Dec 2022 16:40:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671064848; cv=none; d=google.com; s=arc-20160816; b=JKHb8qsqXTJfS/cNmNRN10ed0rBPl03IXMa8WEhS7uUf9YyDTSBf+cUg7qHOPxkvcV eyQbnPSW1KXTOATZ6SBtUr8YT1FtNgwn+QrjVXjx4os0ZuBHQBZDeTreisgsTEmMfiG7 qCjIUYxE6J4ZaNHNmwROVrW+YLf3bx1pFigRYnW48JBcmkdYR9Owxs2mO7yY4dsu5h3S kTzlEc/uhoARGvWLBKAdya1olZTNKkvidXVFXf5bm0dQdsKk3M8wdETUaBKMoCk/zIE4 WxOfTzgiGkG7Z+A0371demrmJ0iuiJDdlScxT9TeaWEzFjpFJFfl1xL8+gF2WjyCRmrU 61Ew== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f+S0aF5a+7hF5YKK8JcfIbek6Mnxo9VvBbC5nrJJVEU=; b=b1t9XR6bY7HvBGwXq2k79VEA+WuGxcp8n2jJP6zlpAS3neBHyvg2UQsHOgBMeLh5aI xQSiJiSrSywnnaoQAAzGhiMbzR1TYQmtEwYK3+IV0Pe1xtlxdqQjIqGzKRHyrk+BDdQ1 x7Jt5iCQLkZzEC3+lV8ZIitNx4MaUhdr7GblY3KlPc/PJT0aLwMLcL46jYAbWYSR/56+ lritvHX34WlbAN2UnMgzGyHXd5wjayCHArAGLE2aR5Yk11+DqKmeWy8J32N0TQka0262 I/mqHf8oxzU55HQlLTJJS+dR1qjSv66XBHtQ/xlJNHtcpgKHBcdCw4io6dZy607IKYnd s76w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b=Q7bsogMH; 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=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 195-20020a6302cc000000b004404162e5e0si1217581pgc.593.2022.12.14.16.40.37; Wed, 14 Dec 2022 16:40:48 -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=@baikalelectronics.ru header.s=post header.b=Q7bsogMH; 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=REJECT sp=REJECT dis=NONE) header.from=baikalelectronics.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbiLNXy0 (ORCPT + 69 others); Wed, 14 Dec 2022 18:54:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbiLNXxQ (ORCPT ); Wed, 14 Dec 2022 18:53:16 -0500 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B24B548753; Wed, 14 Dec 2022 15:53:15 -0800 (PST) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id ED302E0ED5; Thu, 15 Dec 2022 02:53:14 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= baikalelectronics.ru; h=cc:cc:content-transfer-encoding :content-type:content-type:date:from:from:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=post; bh=f+S0aF5a+7hF5YKK8JcfIbek6Mnxo9VvBbC5nrJJVEU=; b=Q7bsogMHIx/s FIHwz8qZ4diLtfbtNkknIvWf4BVghrhNMn8ZwLR59HzPmM8lNRGcaWDHBgM3zyFj rftRrMrg88qdfopWyuyWHmOr+jOy6UDYonE9nsdCYjdVU9mjhTaurG4KVrMeJ6bo DkXcImvOEnKlJ9XSALxIcoK64GmRoiA= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id E011CE0E6B; Thu, 15 Dec 2022 02:53:14 +0300 (MSK) Received: from localhost (10.8.30.6) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 15 Dec 2022 02:53:14 +0300 From: Serge Semin To: Gustavo Pimentel , Vinod Koul , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Cai Huoqing , Robin Murphy , Jingoo Han , Frank Li , Manivannan Sadhasivam CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , caihuoqing , Yoshihiro Shimoda , , , , Gustavo Pimentel Subject: [PATCH v7 10/25] dmaengine: dw-edma: Fix DebugFS reg entry type Date: Thu, 15 Dec 2022 02:52:50 +0300 Message-ID: <20221214235305.31744-11-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221214235305.31744-1-Sergey.Semin@baikalelectronics.ru> References: <20221214235305.31744-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.8.30.6] X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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 debugfs_entries structure declared in the dw-edma-v0-debugfs.c module contains the DebugFS node' register address. The address is declared as dma_addr_t type, but first it's assigned with virtual CPU IOMEM address and then it's cast back to the virtual address. Even though the castes sandwich will unlikely cause any problem since normally DMA address is at least of the same size as the CPU virtual address, it's at the very least redundant if not to say logically incorrect. Let's fix it by just stop casting the pointer back and worth and just preserve the address as a pointer to void with __iomem qualifier. Fixes: 305aebeff879 ("dmaengine: Add Synopsys eDMA IP version 0 debugfs support") Signed-off-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Tested-by: Manivannan Sadhasivam Acked-by: Vinod Koul --- drivers/dma/dw-edma/dw-edma-v0-debugfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c index 5226c9014703..8e61810dea4b 100644 --- a/drivers/dma/dw-edma/dw-edma-v0-debugfs.c +++ b/drivers/dma/dw-edma/dw-edma-v0-debugfs.c @@ -14,7 +14,7 @@ #include "dw-edma-core.h" #define REGS_ADDR(name) \ - ((void __force *)®s->name) + ((void __iomem *)®s->name) #define REGISTER(name) \ { #name, REGS_ADDR(name) } @@ -48,12 +48,13 @@ static struct { struct debugfs_entries { const char *name; - dma_addr_t *reg; + void __iomem *reg; }; static int dw_edma_debugfs_u32_get(void *data, u64 *val) { - void __iomem *reg = (void __force __iomem *)data; + void __iomem *reg = data; + if (dw->chip->mf == EDMA_MF_EDMA_LEGACY && reg >= (void __iomem *)®s->type.legacy.ch) { void __iomem *ptr = ®s->type.legacy.ch; -- 2.38.1