Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2528027lqo; Tue, 14 May 2024 01:04:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFPvTHx6V9Nwf30wZ1OdfFJqYrNEQszNJwUxysgulIt4aLy1IJk/rn6Bo0uoNJU4wPv+YUc7xQs27CCKgJceHK6acvov3Git15MbQxTw== X-Google-Smtp-Source: AGHT+IHylku7GSXNo5aUnok+wI3jUS19gunJgnBlllXq/5AcjqDzBkoBOYqtMY2OWrkcCDl1Pv+W X-Received: by 2002:a17:907:26c9:b0:a59:ba2b:5913 with SMTP id a640c23a62f3a-a5a2d66b525mr994248066b.62.1715673878970; Tue, 14 May 2024 01:04:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715673878; cv=pass; d=google.com; s=arc-20160816; b=gXXxmtYziXv/oeMyv3rlAEJDDAo92DN9Me/0WWhvBJGIWLxIX0T5dZTViROhKDDgwX zsDWAmdRx/G8ZDFoBvMqSg7gdr03cXS7frSU/FKaegtnC3DhO5xf/C324cTHFqQ32GtC 1hFoZzJkPCv+lDgEamBtPC0Z6WEA+ES1H6oulMv1fcVbhodoJljhscUqd35fGw4cSQYL tLCWYOjoVBx6oNIzxA7bkDWAB/lck4qfhqKebolDEEbEvU7PjeWUTN3yQPbaumr6Z4T1 12exYZtRcFoNM+YqIgX+7z4QZuwYT5JasZfuumCTNijo2lAysnFd8b7H10VbRdMU628T JfLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :domainkey-signature:dkim-signature; bh=cVfJiralSHBKIpiyuDV08+v4xxv00fj5z+EYp8KEzMQ=; fh=73ftXUimv7vxhso+rt9nIW5svND5ZCPjNG9CoDzBB+E=; b=D/cTTr6MX4TpkVBW6M5ipZZaEknRJPXGrSrzG36fVwHPyyzjoKomc+Cgzt3K4ws6sW D+xcUPQgugbP7ZLTPLbQkZnKb8IGKZmiZieATm/ev2tRfg3FFzm8BHWg5uasGLqCZNbs D4WiEUdFRl98hpta1McXeVmyw2t8qgMHORHqE/KsQ0HT9uwYO4R8EncTpKX/QijW2Une vubE/A6azXVU0FPl6JUM7BTIEHJl+SboSyPKDR7HBB1h4zTnHcoWXq306Iy0fq/1PuoG Gcdk8hYN57LnIvfaBQqOcM3Qci909gQ71ZBZ1Hmg7ylORMZfjmhra33Z2A6hNVxdTP9N 6rLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-space.org header.s=s1 header.b=0LsLUgiA; dkim=pass header.i=@kernel-space.org header.s=s1 header.b=x9uFUQS4; arc=pass (i=1 spf=pass spfdomain=kernel-space.org dkim=pass dkdomain=kernel-space.org dkim=pass dkdomain=kernel-space.org dmarc=pass fromdomain=kernel-space.org); spf=pass (google.com: domain of linux-kernel+bounces-178423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kernel-space.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17b555a1si639548266b.483.2024.05.14.01.04.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 01:04:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-space.org header.s=s1 header.b=0LsLUgiA; dkim=pass header.i=@kernel-space.org header.s=s1 header.b=x9uFUQS4; arc=pass (i=1 spf=pass spfdomain=kernel-space.org dkim=pass dkdomain=kernel-space.org dkim=pass dkdomain=kernel-space.org dmarc=pass fromdomain=kernel-space.org); spf=pass (google.com: domain of linux-kernel+bounces-178423-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178423-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kernel-space.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 86FC01F22773 for ; Tue, 14 May 2024 08:04:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7573517C7C; Tue, 14 May 2024 08:04:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kernel-space.org header.i=@kernel-space.org header.b="0LsLUgiA"; dkim=pass (1024-bit key) header.d=kernel-space.org header.i=@kernel-space.org header.b="x9uFUQS4" Received: from mail.kernel-space.org (mail.kernel-space.org [195.201.34.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A1D617C77; Tue, 14 May 2024 08:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.201.34.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715673869; cv=none; b=FnjzPxDxBYhli2hPsNIAxfurlMy5Wz4Gf+YaXibWcJ9yfuTMvfOXwh5DI1UJbcIX+P5XNGJw9oDHu+4QZs8bbN4IQyg1uzKIErbt2u5PKG9nwQAYxmddKVlWs4ZPCjG2tSmlrfBiiM5SmoOQCy73o3UUM5BtVzFmJQN6tTV+JUI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715673869; c=relaxed/simple; bh=MnavwG4xDe+bT4+m8GUFgKzjxbVWJw55qnBENhgJS0M=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qQE8OibYSkUed8nyuzauQWYW/8GI0hEr/0DwgODilpzbqirHtHL1W55kRSRyDWAb+QIi1N+U7xEHjgj2yXTSmDRRNKd6epXhjQLbHIh1KlfwHphqrs6GIwKOWErP7E4wS70Me80FrykgKT3lhPUI7ZygLPsWE5wvb1tJSlVhzhw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kernel-space.org; spf=pass smtp.mailfrom=kernel-space.org; dkim=pass (1024-bit key) header.d=kernel-space.org header.i=@kernel-space.org header.b=0LsLUgiA; dkim=pass (1024-bit key) header.d=kernel-space.org header.i=@kernel-space.org header.b=x9uFUQS4; arc=none smtp.client-ip=195.201.34.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kernel-space.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel-space.org Received: from kernel-space.org (localhost [127.0.0.1]) by kernel-space.org (OpenSMTPD) with ESMTP id 4843119d; Tue, 14 May 2024 07:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=kernel-space.org; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s=s1; bh=ca B5PwAVnllql880/2faREzf2Ig=; b=0LsLUgiAZbsT7UjlYhX67sWHogfPBaoFAV VKo6wbZyR1SAtA+ecojae0TgNq1Vmroif1x5M1p4Bz0ZcxCmR7npQqcsumsjQMqy FAtWqZUYOlGZGD4R4HJlRW73a5B2xd4zxtXBnwwirTJJnWUXqUmqkLnLqJPBtEQA jrbCEwprc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=kernel-space.org; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; q=dns; s=s1; b= afULTwWiVL1PXZxYXhzIFxGe9Q4UA8RjXOAi+kLxw5+uZmq7WGvaVB5rpZr6nTHb iSLejFPX1x+YIHqsFVI+fabNOdkQUNKNK8ScnGTthRASLod3uDYAu8tzLVpMQuKV Pj4X5Bbwh21k5CnAfvkjRazh7Am7UzfQ2jEPveoiTrw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-space.org; s=s1; t=1715673395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cVfJiralSHBKIpiyuDV08+v4xxv00fj5z+EYp8KEzMQ=; b=x9uFUQS4YkhuSngcZiX5OrkWmQ4LWw3Cly9Yhsir+BX0rxEfMm0vTdFL0LwRWaoTpBcyMP skgLMtymBLzgHo6SDLYMDG4K4XsAJ/3CKLzAAAcaz0nzxC/kdVAf52wRqDxlTxBjSfaV9t Z8uY3yr835+iEhfcqOTnqREVOFXG+n8= Received: from [192.168.0.2] (host-79-16-6-145.retail.telecomitalia.it [79.16.6.145]) by kernel-space.org (OpenSMTPD) with ESMTPSA id 5a079902 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 14 May 2024 07:56:35 +0000 (UTC) Message-ID: Date: Tue, 14 May 2024 09:57:09 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] dmaengine: fsl-edma: merge mcf-edma into fsl-edma driver To: Geert Uytterhoeven , Frank Li Cc: Vinod Koul , "open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM" , open list , "open list:FREESCALE eDMA DRIVER" , Greg Ungerer , linux-m68k References: <20240509193517.3571694-1-Frank.Li@nxp.com> Content-Language: en-US From: Angelo Dureghello In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, On 13/05/24 8:12 PM, Geert Uytterhoeven wrote: > CC coldfire > > On Thu, May 9, 2024 at 9:35 PM Frank Li wrote: >> MCF eDMA are almost the same as FSL eDMA driver. Previously link to two >> kernel modules, fsl-edma.ko and mcf-edma.ko. These are not problem because >> mcf-edma is for m68k ARCH and FSL eDMA is for arm/arm64 ARCH. But often >> build both at PPC ARCH. It also makes sense to build two drivers at the >> same time. It causes many build warning because share a fsl-edma-common.o. >> such as: >> >> powerpc64le-linux-ld: warning: orphan section `.stubs' from `drivers/dma/fsl-edma-common.o' being placed in section `.stubs' >> powerpc64le-linux-ld: warning: orphan section `.stubs' from `drivers/dma/fsl-edma-trace.o' being placed in section `.stubs' >> >> Merge mcf-edma into fsl-edma driver. So use one driver (fsl-edma.ko) for >> MCF and FSL eDMA. >> >> mcf-edma.ko should be replaced by fsl-edma.ko in modules, minimizing user >> space impact because MCF eDMA remains confined to legacy ColdFire mcf5441x >> production and mcf5441x has been in production for at least a decade and >> NXP has long ceased ColdFire development. when i developed mcf-edma, i tried to modify fsl-edma first. Modules are similar but there are various edma IP versions, and i remember minimal differences in the CF version too, some register bits and, of course, endianness. If a merge is possible, welcome, i have here mcf5441x, can give a try to this patch as soon as i can. >> Update Kconfig to make MCF_EDMA as feature of FSL_EDMA and change Makefile >> to link mcl-edma-main.o to fsl-edma.o. >> >> Create a common module init/exit functions, which call original's >> fsl-edma-init[exit]() and mcf-edma-init[exit](). >> >> Reported-by: kernel test robot >> Closes: https://lore.kernel.org/oe-kbuild-all/202405082029.Es9umH7n-lkp@intel.com/ >> Signed-off-by: Frank Li >> --- >> drivers/dma/Kconfig | 8 ++++---- >> drivers/dma/Makefile | 5 ++--- >> drivers/dma/fsl-edma-common.c | 28 ++++++++++++++++++++++++++++ >> drivers/dma/fsl-edma-common.h | 5 +++++ >> drivers/dma/fsl-edma-main.c | 6 ++---- >> drivers/dma/mcf-edma-main.c | 6 ++---- >> 6 files changed, 43 insertions(+), 15 deletions(-) >> >> diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig >> index 002a5ec806207..45110520f6e68 100644 >> --- a/drivers/dma/Kconfig >> +++ b/drivers/dma/Kconfig >> @@ -393,14 +393,14 @@ config LS2X_APB_DMA >> It does not support memory to memory data transfer. >> >> config MCF_EDMA >> - tristate "Freescale eDMA engine support, ColdFire mcf5441x SoCs" >> + bool "Freescale eDMA engine support, ColdFire mcf5441x SoCs" >> depends on M5441x || COMPILE_TEST >> select DMA_ENGINE >> select DMA_VIRTUAL_CHANNELS >> help >> - Support the Freescale ColdFire eDMA engine, 64-channel >> - implementation that performs complex data transfers with >> - minimal intervention from a host processor. >> + Support the Freescale ColdFire eDMA engine in FSL_EDMA driver, >> + 64-channel implementation that performs complex data transfers >> + with minimal intervention from a host processor. >> This module can be found on Freescale ColdFire mcf5441x SoCs. >> >> config MILBEAUT_HDMAC >> diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile >> index 802ca916f05f5..0000922c7cbfe 100644 >> --- a/drivers/dma/Makefile >> +++ b/drivers/dma/Makefile >> @@ -33,11 +33,10 @@ obj-$(CONFIG_DW_EDMA) += dw-edma/ >> obj-$(CONFIG_EP93XX_DMA) += ep93xx_dma.o >> fsl-edma-trace-$(CONFIG_TRACING) := fsl-edma-trace.o >> CFLAGS_fsl-edma-trace.o := -I$(src) >> +mcf-edma-main-$(CONFIG_MCF_EDMA) := mcf-edma-main.o >> obj-$(CONFIG_FSL_DMA) += fsldma.o >> -fsl-edma-objs := fsl-edma-main.o fsl-edma-common.o ${fsl-edma-trace-y} >> +fsl-edma-objs := fsl-edma-main.o fsl-edma-common.o ${fsl-edma-trace-y} ${mcf-edma-main-y} >> obj-$(CONFIG_FSL_EDMA) += fsl-edma.o >> -mcf-edma-objs := mcf-edma-main.o fsl-edma-common.o ${fsl-edma-trace-y} >> -obj-$(CONFIG_MCF_EDMA) += mcf-edma.o >> obj-$(CONFIG_FSL_QDMA) += fsl-qdma.o >> obj-$(CONFIG_FSL_RAID) += fsl_raid.o >> obj-$(CONFIG_HISI_DMA) += hisi_dma.o >> diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c >> index 3af4307873157..ac04a2ce4fa1f 100644 >> --- a/drivers/dma/fsl-edma-common.c >> +++ b/drivers/dma/fsl-edma-common.c >> @@ -888,4 +888,32 @@ void fsl_edma_setup_regs(struct fsl_edma_engine *edma) >> } >> } >> >> +static int __init fsl_edma_common_init(void) >> +{ >> + int ret; >> + >> + ret = fsl_edma_init(); >> + if (ret) >> + return ret; >> + >> +#ifdef CONFIG_MCF_EDMA >> + ret = mcf_edma_init(); >> + if (ret) >> + return ret; >> +#endif >> + return 0; >> +} >> + >> +subsys_initcall(fsl_edma_common_init); >> + >> +static void __exit fsl_edma_common_exit(void) >> +{ >> + fsl_edma_exit(); >> + >> +#ifdef CONFIG_MCF_EDMA >> + mcf_edma_exit(); >> +#endif >> +} >> +module_exit(fsl_edma_common_exit); >> + >> MODULE_LICENSE("GPL v2"); >> diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h >> index ac66222c16040..dfbdcc922ceea 100644 >> --- a/drivers/dma/fsl-edma-common.h >> +++ b/drivers/dma/fsl-edma-common.h >> @@ -488,4 +488,9 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan); >> void fsl_edma_cleanup_vchan(struct dma_device *dmadev); >> void fsl_edma_setup_regs(struct fsl_edma_engine *edma); >> >> +int __init fsl_edma_init(void); >> +void __exit fsl_edma_exit(void); >> +int __init mcf_edma_init(void); >> +void __exit mcf_edma_exit(void); >> + >> #endif /* _FSL_EDMA_COMMON_H_ */ >> diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c >> index 391e4f13dfeb0..a1c3c4ed869c5 100644 >> --- a/drivers/dma/fsl-edma-main.c >> +++ b/drivers/dma/fsl-edma-main.c >> @@ -724,17 +724,15 @@ static struct platform_driver fsl_edma_driver = { >> .remove_new = fsl_edma_remove, >> }; >> >> -static int __init fsl_edma_init(void) >> +int __init fsl_edma_init(void) >> { >> return platform_driver_register(&fsl_edma_driver); >> } >> -subsys_initcall(fsl_edma_init); >> >> -static void __exit fsl_edma_exit(void) >> +void __exit fsl_edma_exit(void) >> { >> platform_driver_unregister(&fsl_edma_driver); >> } >> -module_exit(fsl_edma_exit); >> >> MODULE_ALIAS("platform:fsl-edma"); >> MODULE_DESCRIPTION("Freescale eDMA engine driver"); >> diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c >> index 78c606f6d0026..d97991a1e9518 100644 >> --- a/drivers/dma/mcf-edma-main.c >> +++ b/drivers/dma/mcf-edma-main.c >> @@ -284,17 +284,15 @@ bool mcf_edma_filter_fn(struct dma_chan *chan, void *param) >> } >> EXPORT_SYMBOL(mcf_edma_filter_fn); >> >> -static int __init mcf_edma_init(void) >> +int __init mcf_edma_init(void) >> { >> return platform_driver_register(&mcf_edma_driver); >> } >> -subsys_initcall(mcf_edma_init); >> >> -static void __exit mcf_edma_exit(void) >> +void __exit mcf_edma_exit(void) >> { >> platform_driver_unregister(&mcf_edma_driver); >> } >> -module_exit(mcf_edma_exit); >> >> MODULE_ALIAS("platform:mcf-edma"); >> MODULE_DESCRIPTION("Freescale eDMA engine driver, ColdFire family"); >> -- >> 2.34.1 Regards, angelo