From patchwork Tue Jul 12 16:09:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 12915277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 94656C43334 for ; Tue, 12 Jul 2022 16:12:49 +0000 (UTC) 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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=7aJA/58JSU4Ao+mkm6iestlikxbgD3Pp+2U990T7AJg=; b=4KM2iCa0FWvQa5 YNytzAPyD++Px521KpINsmL2SHcrqPUZLTc51SLRob0bOgSYz6wc0eP/XxBUyXI3ZmA17uvhd3q6C utUau5/ye4E7czPQp27dtQdpDthVC5KHt4D6FACmFhj4xxPy7mveN4+cnORdt3CWOH1fTEY4pAosq a/mwyg8cxHbKUdhMPYMrEeGHird3VG1qKjAwcUvPCkY0cfOsx8E4RzPcLJImJeVzYXLnJ8efAcdUY gkphZBE9aF+0lpBrfrHDE6WRzAVSs6Hggg7whxzKaEy5WTz5TYmhiGqw9wZtTDYKJAJFRoocuiDct TwcslDdl98unUK29PfhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBIU5-00CafD-Jj; Tue, 12 Jul 2022 16:11:37 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBIU2-00CaRH-FY for linux-arm-kernel@lists.infradead.org; Tue, 12 Jul 2022 16:11:35 +0000 Received: by mail-ej1-x62d.google.com with SMTP id l23so15176363ejr.5 for ; Tue, 12 Jul 2022 09:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=21nZyc3bYwF/2+gU25HHeO3ZzKasf2bJUi7S16b1eWU=; b=pI3NbHHjeGT8cStUjzd57ZsN322xV+C9lha7C8b1wE3VuJJs/n+b0oyXQ7K8ezo7l3 XHaUVDbZP4V7OpXayTOBsSAyezSRgijjY5vbjgL2n7O4wTaSJxOhTkpQ0DyBbuxCUsO4 61TINg1OkvcpA+vrgA7tmlxbzRN0INNy8TVY8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=21nZyc3bYwF/2+gU25HHeO3ZzKasf2bJUi7S16b1eWU=; b=tUy7lPr4zH1EAR2/n7pnzkRYqjPUYLyRVjms27lguzrSWmTvYkPQbiNRd6ZPrRVMAv L4gvrjCBg2fUDfxrOGkQl1LvNSIHXy4iY90LAn6j1L45+P7yjmN5bwfZvODGvKcJkafo S06LR3iucwDUd+MHPvAcz4UHYd5n2zOtrFxjZL6d0e4VmmorqPYyt8+wYdxOQjXmREwk HU0YuI0D1hiWNXyiMc61lUs+nMAFtkgMQp7q/gPAwwNlfdJmRs1ehlR0Xj0s6DUCVQfR J8ymoBKmVdRe/zOVp55kQV87OF+Qn4SJTkIlU4CILtOS5I9k1nfn9GKcvzKOCg6C8gbj 2eEg== X-Gm-Message-State: AJIora9zih+XsrQyGr0huc83Vjjw1cgL36qmPsxxx9cLiJW+n0GJ1Np3 KgrUMo3C5r/FZRZSLVy3rHGt+Q== X-Google-Smtp-Source: AGRyM1ucFy54oRu/i+plCJT5SdHJrkvWY0f3+6DSn6RQToEjw/79AD1rdgrVryHUeqQjlsWOnkyOuA== X-Received: by 2002:a17:906:938a:b0:726:942a:54e8 with SMTP id l10-20020a170906938a00b00726942a54e8mr24075139ejx.225.1657642291745; Tue, 12 Jul 2022 09:11:31 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-80-116-90-174.retail.telecomitalia.it. [80.116.90.174]) by smtp.gmail.com with ESMTPSA id h4-20020a1709066d8400b00722ea7a7febsm3911498ejt.194.2022.07.12.09.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 09:11:31 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Michael Trimarchi , stable@vger.kernel.org, Fabio Estevam , NXP Linux Team , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Vinod Koul , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 1/2] dmaengine: mxs: use platform_driver_register Date: Tue, 12 Jul 2022 18:09:07 +0200 Message-Id: <20220712160909.2054141-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220712_091134_570843_425D7949 X-CRM114-Status: GOOD ( 17.70 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Driver registration fails on SOC imx8mn as its supplier, the clock control module, is probed later than subsys initcall level. This driver uses platform_driver_probe which is not compatible with deferred probing and won't be probed again later if probe function fails due to clock not being available at that time. This patch replaces the use of platform_driver_probe with platform_driver_register which will allow probing the driver later again when the clock control module will be available. Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi Cc: stable@vger.kernel.org --- Changes in v5: - Update the commit message. - Create a new patch to remove the warning generated by this patch. Changes in v4: - Restore __init in front of mxs_dma_probe() definition. - Rename the mxs_dma_driver variable to mxs_dma_driver_probe. - Update the commit message. - Use builtin_platform_driver() instead of module_platform_driver(). Changes in v3: - Restore __init in front of mxs_dma_init() definition. Changes in v2: - Add the tag "Cc: stable@vger.kernel.org" in the sign-off area. drivers/dma/mxs-dma.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 994fc4d2aca4..18f8154b859b 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -839,10 +839,6 @@ static struct platform_driver mxs_dma_driver = { .name = "mxs-dma", .of_match_table = mxs_dma_dt_ids, }, + .probe = mxs_dma_probe, }; - -static int __init mxs_dma_module_init(void) -{ - return platform_driver_probe(&mxs_dma_driver, mxs_dma_probe); -} -subsys_initcall(mxs_dma_module_init); +builtin_platform_driver(mxs_dma_driver); From patchwork Tue Jul 12 16:09:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 12915276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E257EC433EF for ; Tue, 12 Jul 2022 16:12:48 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=74ZT22LZNUB6dkHvk6pMiq0MAq2OLegzXyOiesem4wA=; b=oIGKf44BwMQdqv WkcHUm0V1nDbltSXpMn5ixEuWtMJrq5wOODMR4lpDvnK7HKxUz43hzdZcGpg2riOekQ0Rc/YkPi5R z4G5QM1O4egRASS0wiI2/ac/AU5uzkQU1WmW8YM/SbUudz4YhNDr05kKALkP8E6iey3AXX0n4FKXF QuWwud+tMnAg9skYY0QSdZE2T6FR0h69nuH+i96ywbBEkhVnshFHiJLGN+7knxggHRMlXbjTOzDVg I4uQtkrozhvN/TEYs6cV/G7reqt7vbC5EKy1L8mC/3EXgKH+osHGKc70u7PURory+CCLeTITm0WMB Dj08q5XK0zupw2I4iUfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBIUH-00Carm-Fo; Tue, 12 Jul 2022 16:11:49 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBIU2-00CaRn-UC for linux-arm-kernel@lists.infradead.org; Tue, 12 Jul 2022 16:11:36 +0000 Received: by mail-ej1-x631.google.com with SMTP id b11so15143314eju.10 for ; Tue, 12 Jul 2022 09:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NvLw5KU+55jz8ItVCImcVo81PfvmbTqj67db51rQx28=; b=qvnGgeO99cNBndr+zz3vZPBPjheS4AqDg5tJYJa9iR5ARJ8GPd50mYESF4pgF6HdFl m0VBCK+91GngOqkbtm49sDlQL4Jd82szEHwB5HnSf+wox0J90LlQarAzbvJqQQ2q+UtN iAWTSxgnzZ/RHK5tZkYBxrLflMZvalt6vu7lY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NvLw5KU+55jz8ItVCImcVo81PfvmbTqj67db51rQx28=; b=NWIOTKrKgAvastXKzmK33ZKQR4SObpr3hemdEl8zn4L6P1UfctfTOsEH7oN5fbTO7u QT5vJe43sv6xFWpQNkzIIh4pxMQmnYmVFCH6WSKsl90ibXVsuOyz76w3/BRU+Pai0ny2 fD7YsWXFghS9GMlVNsNEy3B8JGtsJsatrBMNQOfS0a/Rl5+2IYIfY+1RmIsdT9jJRBmZ 6mJD/ui9ffdcdipzgzJTiumxLxzhIRlUZX5bMHFULol5y2L5YoKm9Zt5vArv0k06B7uQ in4SsjRFj39eJKLImEKUYXEwt+bkHookc8EGm5n9rpWZhs9efGCdMau/3h8QF6fn22bE Py7w== X-Gm-Message-State: AJIora9FtXMT40TQ4qheCAFJOd+cAtula+3UMgwKeyGUWDO2Wi11XC3E +JtxViGG65YFBL4zeRJB6b1T+g== X-Google-Smtp-Source: AGRyM1vzGSUHcJzBp/hgiaDv/invRmw4l+YZl3HEKr2i8km6/o0VBKy7xDflf7yWj8fy9tbhieIS9w== X-Received: by 2002:a17:907:6e05:b0:72a:a141:962 with SMTP id sd5-20020a1709076e0500b0072aa1410962mr24563519ejc.545.1657642293037; Tue, 12 Jul 2022 09:11:33 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-80-116-90-174.retail.telecomitalia.it. [80.116.90.174]) by smtp.gmail.com with ESMTPSA id h4-20020a1709066d8400b00722ea7a7febsm3911498ejt.194.2022.07.12.09.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 09:11:32 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Michael Trimarchi , stable@vger.kernel.org, Fabio Estevam , NXP Linux Team , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Vinod Koul , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 2/2] dmaengine: mxs: fix section mismatch Date: Tue, 12 Jul 2022 18:09:08 +0200 Message-Id: <20220712160909.2054141-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220712160909.2054141-1-dario.binacchi@amarulasolutions.com> References: <20220712160909.2054141-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220712_091134_991974_2466E12D X-CRM114-Status: GOOD ( 15.13 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The patch was suggested by the following modpost warning: WARNING: modpost: vmlinux.o(.data+0xa3900): Section mismatch in reference from the variable mxs_dma_driver to the function .init.text:mxs_dma_probe() The variable mxs_dma_driver references the function __init mxs_dma_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi Cc: stable@vger.kernel.org --- (no changes since v1) drivers/dma/mxs-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 18f8154b859b..a01953e06048 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -834,7 +834,7 @@ static int __init mxs_dma_probe(struct platform_device *pdev) return 0; } -static struct platform_driver mxs_dma_driver = { +static struct platform_driver mxs_dma_driver __initdata = { .driver = { .name = "mxs-dma", .of_match_table = mxs_dma_dt_ids,