Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1253338rwb; Fri, 13 Jan 2023 09:44:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXsS3kti/JEJuGc2N49sUcMHf/8OR3uCmespPg65/yHUBps2EYa48UP9QXrmDih40OsYmWpL X-Received: by 2002:a17:902:d50e:b0:191:4378:ec06 with SMTP id b14-20020a170902d50e00b001914378ec06mr14951718plg.61.1673631853128; Fri, 13 Jan 2023 09:44:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673631853; cv=none; d=google.com; s=arc-20160816; b=Gi8SnlJ786901Zw5y9CNAQu9BfRB4EmXPFcgXdu9hl4FY16KYNXVT/Wfv36Jbizxrr 46mtHFmlMHhiZGupYaMoac+iBqcJTwg0yLCHC1hLqzwao/N83RgdQr+K7UbDLG42cuQj +/HS500Fh/C09fdmkkuKKQCMX/tu1OXLiR/wQUKBn1M93BqX6/UTCI+74wRkMkTE1EV7 SeJoBUqEq15dNp9q+9hoJOYdyC71iE6VeNnuNaMZhCVmaZQdf5ilwIpGAUfFb3qiwfEC U/i28nx1Xp9BVcOJ76U/Qqz7h5dQm6NI0trgLblRCQipQTfE+7wyQE1i6b8nvgBuzJqH hZBQ== 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=rm52EHXk9zhos3pIhkdkgojTWB1rvHu/gaPCXIP5N28=; b=ZHqnjuEMU7uL0p99Sy3eYL38nMtVAAqXUO+yGJ60qbbsnEPF6RaUh4R5LLBJPMAkRW eeAbNx1GttazWtA1SBL2AOrXlD9kjJO6h5g1RONKgq4651mikcr72oo/qlO1nI0TDXyw cRulasf9ddkzCuprppkmZtqOfua+Qo4/37poWuWVtqMgxjcnWkh7BXfEXTjWUqT6yKlG L2+r31CrxGKvWRreFsTqGDHaTX+yhzOSk15pIMll7kXm0X/gmuU/kWJFJJakx73Cst13 futYvxElLKNKOlSHqBMR5fdf//8f8bx0Zd0tpaVemXVkaqcsT2HJ/5o3EycbhQe+pU8t ta9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=post header.b=IPfoHI89; 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 c1-20020a170903234100b001928c9d771asi22593303plh.517.2023.01.13.09.44.07; Fri, 13 Jan 2023 09:44:13 -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=IPfoHI89; 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 S229849AbjAMRZQ (ORCPT + 53 others); Fri, 13 Jan 2023 12:25:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbjAMRXu (ORCPT ); Fri, 13 Jan 2023 12:23:50 -0500 Received: from post.baikalelectronics.com (post.baikalelectronics.com [213.79.110.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 09E71A4C6B; Fri, 13 Jan 2023 09:14:41 -0800 (PST) Received: from post.baikalelectronics.com (localhost.localdomain [127.0.0.1]) by post.baikalelectronics.com (Proxmox) with ESMTP id 6D88AE0F2C; Fri, 13 Jan 2023 20:14:35 +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=rm52EHXk9zhos3pIhkdkgojTWB1rvHu/gaPCXIP5N28=; b=IPfoHI89mz3y /MFaBu/EMBq/52KRvwChKUlr0gcaenuxYT53xM/CDHTFLrROZ9dhW4Kq4VAqXd5J zpYSShfcafeTNelt7DOSuXpmhxFuDrT41bX+5g/M5XQLpsoqfl+C0dCnxvMFL9md i0Johe6qodxuQ0eYCiAbusdNFMJpX5k= Received: from mail.baikal.int (mail.baikal.int [192.168.51.25]) by post.baikalelectronics.com (Proxmox) with ESMTP id 56807E0F13; Fri, 13 Jan 2023 20:14:35 +0300 (MSK) Received: from localhost (10.8.30.26) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 13 Jan 2023 20:14:34 +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 , , , Subject: [PATCH v9 21/27] dmaengine: dw-edma: Replace chip ID number with device name Date: Fri, 13 Jan 2023 20:14:03 +0300 Message-ID: <20230113171409.30470-22-Sergey.Semin@baikalelectronics.ru> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113171409.30470-1-Sergey.Semin@baikalelectronics.ru> References: <20230113171409.30470-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.8.30.26] 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 Using some abstract number as the DW eDMA chip identifier isn't really practical. First of all there can be more than one DW eDMA controller on the platform some of them can be detected as the PCIe end-points, some of them can be embedded into the DW PCIe Root Port/End-point controllers. Seeing some abstract number in for instance IRQ handlers list doesn't give a notion regarding their reference to the particular DMA controller. Secondly current DW eDMA chip id implementation doesn't provide the multi-eDMA platforms support for same reason of possibly having eDMA detected on different system buses. At the same time re-implementing something ida-based won't give much benefits especially seeing the DW eDMA chip ID is only used in the IRQ request procedure. So to speak in order to preserve the code simplicity and get to have the multi-eDMA platforms support let's just use the parental device name to create the DW eDMA controller name. Signed-off-by: Serge Semin Reviewed-by: Manivannan Sadhasivam Tested-by: Manivannan Sadhasivam Acked-by: Vinod Koul --- Changelog v2: - Slightly extend the eDMA name array. (@Manivannan) --- drivers/dma/dw-edma/dw-edma-core.c | 3 ++- drivers/dma/dw-edma/dw-edma-core.h | 2 +- drivers/dma/dw-edma/dw-edma-pcie.c | 1 - include/linux/dma/edma.h | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c index 040a88cfe070..e3671bfbe186 100644 --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -973,7 +973,8 @@ int dw_edma_probe(struct dw_edma_chip *chip) if (!dw->chan) return -ENOMEM; - snprintf(dw->name, sizeof(dw->name), "dw-edma-core:%d", chip->id); + snprintf(dw->name, sizeof(dw->name), "dw-edma-core:%s", + dev_name(chip->dev)); /* Disable eDMA, only to establish the ideal initial conditions */ dw_edma_v0_core_off(dw); diff --git a/drivers/dma/dw-edma/dw-edma-core.h b/drivers/dma/dw-edma/dw-edma-core.h index e3ad3e372b55..0ab2b6dba880 100644 --- a/drivers/dma/dw-edma/dw-edma-core.h +++ b/drivers/dma/dw-edma/dw-edma-core.h @@ -96,7 +96,7 @@ struct dw_edma_irq { }; struct dw_edma { - char name[20]; + char name[32]; struct dma_device dma; diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c index f530bacfd716..3f9dadc73854 100644 --- a/drivers/dma/dw-edma/dw-edma-pcie.c +++ b/drivers/dma/dw-edma/dw-edma-pcie.c @@ -222,7 +222,6 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev, /* Data structure initialization */ chip->dev = dev; - chip->id = pdev->devfn; chip->mf = vsec_data.mf; chip->nr_irqs = nr_irqs; diff --git a/include/linux/dma/edma.h b/include/linux/dma/edma.h index 380a0a3e251f..9d44da4aa59d 100644 --- a/include/linux/dma/edma.h +++ b/include/linux/dma/edma.h @@ -76,7 +76,6 @@ enum dw_edma_chip_flags { */ struct dw_edma_chip { struct device *dev; - int id; int nr_irqs; const struct dw_edma_core_ops *ops; u32 flags; -- 2.39.0