From patchwork Wed Sep 21 17:05:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2375 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4934B3F1F7 for ; Wed, 21 Sep 2022 19:06:46 +0200 (CEST) Received: by mail-ed1-f70.google.com with SMTP id y14-20020a056402440e00b0044301c7ccd9sf4837630eda.19 for ; Wed, 21 Sep 2022 10:06:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663780006; cv=pass; d=google.com; s=arc-20160816; b=yhsmiS/69+ecwmOMrKx866pIhhCzWPXgbNrTyvrP8nSFdopimacJBWS9aTyhvS8fRG bEIeLUqGjd+lLIP+nXzLRIkJ1SK3DDHxpmpAUoy3RYVxYw2FqAKguH8hGYGRGoTJthgy w0rBDbGeBuq2D6BQs5ucity5WfwaHv0GiJaetz4vYSrcPJwQwXbCye9aKNvGs/QR6FNR yIBiU/hYEzRm6rMTvEv2Cj+pNZT5w256XH2MkfkhIIkH+aFX3gnTNoCnQzBhIundFTEV KggspaO8SoRpYVxO3Ph/gBT6/qHvsmak2LkkANN95HQZqL0S/q8hDI3ot8PWkRN0qXYs jbWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=kajEZqHsVPTE4c95VBiPWGiOz55Rar6f5RC/zoGmdzo=; b=C/1SIR0VWUvUWYQ9MbR4+2n8UScfypjpJVjkcRNMRrlqJWzwnz0sFMauFulVSxl3Pd nz64kLSG1lTQnZ1MdDFKHBpldWjWyrLYFHX7pKhDcg1O0Bt21qdizZwAHHCHaTb/9oFF kgCBHXwOs2JlD4VTZ5rRhMzHnqWc8b2rxFPvHVa0T5aSvBpGD0xU02jq4+wi2kQs+4Ve bN/BbNkyQlKHw1BGcmQhKgkdccoCLbqtS5j0l6n3Uhw2i5eDCO8e7kVoz/pMqkobrExA HnzhTyR/Ty+z4Kfj4f9p2EuFgW2rSXPbM2CYxP3ZvZJwfWnVqrxX3kFWdzBzPpbCQpE6 UHXA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=K08ArTlV; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date; bh=kajEZqHsVPTE4c95VBiPWGiOz55Rar6f5RC/zoGmdzo=; b=RwRgtdfuwD4hd56yiDoIRu7Rqfp8ijuVs/yPobFxW2aercvdIwX75bK+0hVvg6XS6Q 9XRF1hhXeRp5zmCVZqHt/OxrEJ4PcxywmFvraFSSE27NIHfPJey6UkEqO6nmCzZhlK9w h1CsrKgwxTrdZq/zyoAEwRT600LEKoDi9Ee9w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=kajEZqHsVPTE4c95VBiPWGiOz55Rar6f5RC/zoGmdzo=; b=HO7Mv3pKenEfHO5PyKGjClwZJNWdhkQqhuqrTYvMgtF7NKDzdPNvu5URSHb6ape3+e +K0/F+nBd2sTSnVTLKv/OFnJebAoC1X+Tcb530bdd+jKMs2oye3wZ+FksPzC/h8v4PC3 cDizuZ33x4f8MheH/r6zm/14/E+EfHo9Ai5ZqUsxX/Z208bIcez04WO+PXQFPKPj+oN8 DeaYEnLIZH6UDmCKHLvoUjefcPYFIrbmXB4YE6qGc4cOo8XYWtqoI14LtQCvtrQyxr4L bNAPydhhw8YoO5k8Vf31O8jKh2OcRALMa51qz6lbbklGFsjwh5RWd93Z7IrLwdQYnRox MxPA== X-Gm-Message-State: ACrzQf0UbhZ8L5EDye2Ktmg6B9UuKHKRPWR3HDW8CF+BkO3OXFbLkJAm d1fkBEIRMXSQLovXWQUDgfMmzFw3 X-Google-Smtp-Source: AMsMyM5zeke1P/fr+HY6KXB9iXLG6JfZpi4AmJfDHwhUNgwKXYT3ALdEjVO6x8SsT8jIGXjao+35CA== X-Received: by 2002:a17:907:2710:b0:773:dd39:6344 with SMTP id w16-20020a170907271000b00773dd396344mr21405674ejk.411.1663780005918; Wed, 21 Sep 2022 10:06:45 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:520a:b0:448:77f2:6859 with SMTP id s10-20020a056402520a00b0044877f26859ls2689113edd.3.-pod-prod-gmail; Wed, 21 Sep 2022 10:06:44 -0700 (PDT) X-Received: by 2002:a05:6402:3215:b0:451:4ce5:d7b8 with SMTP id g21-20020a056402321500b004514ce5d7b8mr26035243eda.223.1663780004700; Wed, 21 Sep 2022 10:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663780004; cv=none; d=google.com; s=arc-20160816; b=ip4t7LQoA81t5Z3m7QX0ZgBiE/FIy+om3AAOo+JgnngFb8W9B6uR0t5nMUCC0h8Nl3 EB10fn6JlzUm16bvXrBVnarm4aNHhPIE0762eBxpFLwmlPDFOztqvYQ4c2AoJzOHevIA ytn93Mt7aJj8rJyxRiWLXo3lfhONXBGfV2zPo6BxxSYIz4F5a9dk/Sw3koyjvptBIt+6 QC0hwpHW6pI2LzeasHb4C7Af/BygRChmR23loYcl66ucdzqQLs+AWRXCjgAP8PuL4nne 5SQt0+xYgTEYWzJobmjjrDhauSZZXqGUQW5JXiGwJyae+kjTZnL05zjgFZX5HUKLkrXy WlBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=13KrUn/vK4OvwOsT1GyfzamKvbOZHawCA5zcRq7muWw=; b=FpRdON/lRozahsmQThOajvpf/Bbdiyy3CVom8KFLADSpOwLNclue0NZrNfSd7Drfl+ C2KeW3QGq8JZh++pyKnb8BrJlXzXZrlqtbhggaonzaP7VfX/K3BLWPSoj8e1HUlozjUt FYhg6ygW8Oe4fy2UFEfJwgJzvZU1xop4CxTvnAAk/XXaWeZEV6KZZ/YyB9tmQWmwgBMS EBtI0W+sG9/kZAooPlhh+7HA2Bjjc4xiM3HmfYLcZ60oxmaPpKzdlDMY/iZRIRz53v/8 /jvTBFQ/0fC2PVrb4A4t53wahvP22MyYTwQwaue2Gq22cM32u1MwktDDUVxmIeWah5Gb gxaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=K08ArTlV; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id u5-20020a50a405000000b00447c5ecabbesor2164403edb.20.2022.09.21.10.06.44 for (Google Transport Security); Wed, 21 Sep 2022 10:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6402:d05:b0:425:b5c8:faeb with SMTP id eb5-20020a0564020d0500b00425b5c8faebmr25420939edb.273.1663780004402; Wed, 21 Sep 2022 10:06:44 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id t15-20020a170906608f00b0077a8fa8ba55sm1468940ejj.210.2022.09.21.10.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 10:06:43 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Michael Trimarchi , linux-amarula@amarulasolutions.com, Robin Murphy , Marco Felsch , Dario Binacchi , Sascha Hauer , stable@vger.kernel.org, Fabio Estevam , NXP Linux Team , Pengutronix Kernel Team , Shawn Guo , Vinod Koul , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6] dmaengine: mxs: use platform_driver_register Date: Wed, 21 Sep 2022 19:05:56 +0200 Message-Id: <20220921170556.1055962-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=K08ArTlV; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. The __init annotation has been dropped because it is not compatible with deferred probing. The code is not executed once and its memory cannot be freed. 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 Acked-by: Sascha Hauer Cc: stable@vger.kernel.org --- Changes in v6: - Drop __init annotation. - Drop the "dmaengine: mxs: fix section mismatch" patch. - Update the commit message. - Add Sascha Hauer's Acked-by tag. Changes in v5: - Update the commit message. - Add the patch "dmaengine: mxs: fix section mismatch" to remove the warning raised 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 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 994fc4d2aca4..dc147cc2436e 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -670,7 +670,7 @@ static enum dma_status mxs_dma_tx_status(struct dma_chan *chan, return mxs_chan->status; } -static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma) +static int mxs_dma_init(struct mxs_dma_engine *mxs_dma) { int ret; @@ -741,7 +741,7 @@ static struct dma_chan *mxs_dma_xlate(struct of_phandle_args *dma_spec, ofdma->of_node); } -static int __init mxs_dma_probe(struct platform_device *pdev) +static int mxs_dma_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; const struct mxs_dma_type *dma_type; @@ -839,10 +839,7 @@ 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);