From nobody Thu Apr 2 18:03:53 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4542FECAAD8 for ; Wed, 21 Sep 2022 17:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229911AbiIURGu (ORCPT ); Wed, 21 Sep 2022 13:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiIURGr (ORCPT ); Wed, 21 Sep 2022 13:06:47 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FFEA95682 for ; Wed, 21 Sep 2022 10:06:46 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id m3so9631695eda.12 for ; Wed, 21 Sep 2022 10:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=13KrUn/vK4OvwOsT1GyfzamKvbOZHawCA5zcRq7muWw=; b=K08ArTlVGsyc0SAIljgyi30InRUPlMtrNCxpDmu1hgp81UAVnxk/nCuUHorbHVEIwR 6S29osbtR09bB8cVoWs/j3VPhB4VSJ4E57HIk3O9wj/CaNvmV/GbulyUmDtlEn5gNZ4k hZFUYg6ISBFf1gJp8MwoTnpoQdlhjnm8v9Rlo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=13KrUn/vK4OvwOsT1GyfzamKvbOZHawCA5zcRq7muWw=; b=hU0omLJny+nEiSbRFeThqjMQkKRmfOqRt6xYFz5tEVAOZaOKyUD5ipUZ3+ikCfjzWh NPQPaYbuEpEFMM67wxRSxapSg+xm8GK+qrNFkk14ITW52MN7q6dj4HKOGrQd7jXIy1eC Ui+11OYTxtjNNLG0nsl/c6AaZdvx7utuhS0R4J9rXgrU31gcDmVjPUfH/Keke7Bndhgn Wdo1J7rhN1hlRVyAe68tSEycbqE7eIJTj4fs9NtAXRy/U3dTGDxU7wUUtI1ItdZ4Gu1B ZD7DQxTBT8A/4LTizZ3zn26YqXXB+KUyMjUKyM0QUVrvXMOlzNhBSGIXS3xwDiRts0X5 Qflg== X-Gm-Message-State: ACrzQf3vzbD20Dp6lcao6lP7LVtQihfSN6nCpH8AFCAWd5tSbewGMKes 91G/xzBhDmFssiG0djfp36tzAT6I4HLZPA== X-Google-Smtp-Source: AMsMyM5LostbLMrQ/ZLX3Zv+Rf1hWT+t6mpBiz9T0uqd2GeK3MULwy/v1qfzz59wqxZEro4/2cgLcg== 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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_cha= n *chan, return mxs_chan->status; } =20 -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; =20 @@ -741,7 +741,7 @@ static struct dma_chan *mxs_dma_xlate(struct of_phandle= _args *dma_spec, ofdma->of_node); } =20 -static int __init mxs_dma_probe(struct platform_device *pdev) +static int mxs_dma_probe(struct platform_device *pdev) { struct device_node *np =3D pdev->dev.of_node; const struct mxs_dma_type *dma_type; @@ -839,10 +839,7 @@ static struct platform_driver mxs_dma_driver =3D { .name =3D "mxs-dma", .of_match_table =3D mxs_dma_dt_ids, }, + .probe =3D mxs_dma_probe, }; =20 -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); --=20 2.32.0