| Message ID | 20220607095829.1035903-1-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBCQ4XFG47UFRBT6C7SKAMGQEOQBBC7I@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6CEFE3F066 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 7 Jun 2022 11:58:40 +0200 (CEST) Received: by mail-wr1-f69.google.com with SMTP id bw25-20020a0560001f9900b002175d64fd29sf1811430wrb.9 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 07 Jun 2022 02:58:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654595920; cv=pass; d=google.com; s=arc-20160816; b=h6zRGVRHP4CaPA9M1LheMiWJborKFM4fxAjZRT/otnzUgILFFm+M6xj9cpmZlk1rdp p4N7Vu0a7wQOitBhMSlQx4AaHM3Q0oOesxVdMnWdTeBoGkrSe6yTlVK9c1Pd9dKwFswK XYeUTTOgBXxEHcDCKTaIt+ds3rdoq7qWzmD8MRGKrepBHpieti0LbvkvytMA4jMPBbm0 t82lTn05/3tP2MwEnYdYM3xMETSQCF8CewMOb9FoBH2CK/Y7yctBc89Ewv2TbLI5sApY jjB0eOTD2p2DmOlQNvp74qOAAcLRH8Q7PWVK1hQy4M2/r/+F7RkK08u2uu3FYVsenskK lwHA== 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=br6yLSqkjxiooBvz18M48yePWfVrS4zxVPqtRjfTIew=; b=h5M3UXxpqhMqRe157GEGZuAa/2+U0My5WnlNak5+szGw2SKpz8zElT34jUOWcV7Ao+ 0vOP7SWR4Z/62sRCwFvGcvMScxe6oqtUuwK2/l0utL+qrv7BPZz0z0eX1BsfNA03gztK cE1+RsMoJu2vr3GuOFs1z/O3f9Zyex1wjz8vMZC2MSjmvBOnO99zFQLcbuv1DrkIatJE xDerY7Pseqrh4h+TOb3k5O6kNL2bowrlzUWzFXBZOeH0FXggcKGiMOt3zikoOEBy7yFP XleZ/YFvkD6RhNW3q4KO2gzSJujbEMu/t5uFNhQiW051S5xomKQMJjLX9wABinZGc13/ JooA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=E7D78HbC; 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=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=br6yLSqkjxiooBvz18M48yePWfVrS4zxVPqtRjfTIew=; b=R3FrYJDNVKENauB/L9OxEp1JuutDXU5TbO4jEM3O+pDTodIuFzu4clz8k2KQyFd6ZI p/acxf4Bq0UML7FJ4rErFwne56hvwVmb8VKeXhzLMUxqN66BnvoJuSxaUK/aUUpDuzgA EvRyxbjM63Igk9fG69yKd7DPtAGlC55MVML3w= 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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=br6yLSqkjxiooBvz18M48yePWfVrS4zxVPqtRjfTIew=; b=5jdwh3wyP0gfYt0g9iWaKti/H7n8CGe/h+pgmbr+U4Y75e7klazEVVYaY02j0x+KxX zaNZBAiCJRTDLDlfgfpJwYHGg4gwYFO2OELD8XR1o/qb+rFcnaHv+/ZDaIHGbzzosHRL AFDQSCeI+yQJYDI4qCkpD27OOpoAbef/4SlzrcDTHJfSFIDcv94b2fSd429M5PyryMi2 l7hhrUOWOjRunLekInaCMHlwdwiNe73avXSD9E4EfO2TG07z8WRS6of9N84t9ubocSrp BEt42Tgi2ojtd+lBP+EiosdYI93WQDH9ZM3VHh1IRvRXWywOa9fwiL6sDDwfhPbCXz8X Izqw== X-Gm-Message-State: AOAM533v7sfzBmw3nBDjCcG2FU6og8qIq+HW6E6Mmy4XNt8KhVY1UW6D 7EWqGxmjF1VSLbN0mOK517JDAbzi X-Google-Smtp-Source: ABdhPJwdvO8dmokCGcgCDd3kmgsBMedCnLkyS2MofI2khW7MNRxVozxG1CiA88neoM2Sqt6Aw0lB7w== X-Received: by 2002:a05:600c:4e51:b0:39c:4f18:4c29 with SMTP id e17-20020a05600c4e5100b0039c4f184c29mr10500140wmq.101.1654595920141; Tue, 07 Jun 2022 02:58:40 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:6dab:0:b0:212:d9db:a98 with SMTP id u11-20020a5d6dab000000b00212d9db0a98ls4196871wrs.3.gmail; Tue, 07 Jun 2022 02:58:39 -0700 (PDT) X-Received: by 2002:adf:e347:0:b0:217:6f4b:f3d6 with SMTP id n7-20020adfe347000000b002176f4bf3d6mr12983110wrj.73.1654595919099; Tue, 07 Jun 2022 02:58:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654595919; cv=none; d=google.com; s=arc-20160816; b=H3c/5OKoYestlNJyuPOmaq7Vkpa5oL4If5LwqGkgxJLMY5LPFo3Wlq0DLcpWOMnSO3 kiVLIXsJb4rgSiCglQqrZLh1arYo1kkHRhTuJMW53nQCwaE3lpcslhDLW6/CU5U2VA2h T7T8iphHL/K06f9nnQoOigXKoKKy3BT/oj0xmyz3QoLPFN4hko8ljXOfMW/vk/ujnAgg 8YSFTgaexo8gXWeSw5jp4vEHUexu4bP1A8eW6d2X9/HRUl4Kh6N/Km3nSec+1pF6LlNs hfO3HIHo+kFdi5OkMk0nd1RSehBvbE7WSvrFIZKH131h/wTGKLC5JBvaNYqgYDBh1WFn XYjw== 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=r8WAmC01JdwEuRA91bKXEDq+9uWVDhRFE7DDNgirVT8=; b=cQUi7lmE4fbu3omCnmoixOkwBHtHlqfJ6J7obnX5eU4+zp9ce8PBO41mKkdn0L3N9P sQG5Lfx4EL2MvJKgATZShIFyB04uAaAOwu4Fzqc7fhMyK1hYSJS4UezVuqL2cg6lcFwY 1RppFdmD3HaOD0vbENe5DpEqNVHitmKG2zxbc8cb2s9NVXsFJOiTsVmfitoYT3q2xaYt 212XUYabC6aPuI0Gu0jYz+pI1t+kryaGi2fS0bHk5go2xyVfpEQmyklvHteLZ/3Flm4d SKdzx06/uXvPyR7QMbHg/imF/emwWWIiOsVNhnDQdml0/Jh9NHExaDO/IcKz/qrf7OO2 xLmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=E7D78HbC; 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 k2-20020a5d66c2000000b0020ffb15ca7asor10294554wrw.57.2022.06.07.02.58.39 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 07 Jun 2022 02:58:39 -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:6000:1d86:b0:218:3cfc:4ca2 with SMTP id bk6-20020a0560001d8600b002183cfc4ca2mr10765322wrb.133.1654595918844; Tue, 07 Jun 2022 02:58:38 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (mob-5-90-137-51.net.vodafone.it. [5.90.137.51]) by smtp.gmail.com with ESMTPSA id c186-20020a1c35c3000000b0039bc95cf4b2sm19958382wma.11.2022.06.07.02.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:58:38 -0700 (PDT) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: Amarula patchwork <linux-amarula@amarulasolutions.com>, michael@amarulasolutions.com, Dario Binacchi <dario.binacchi@amarulasolutions.com>, stable@vger.kernel.org, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, Sascha Hauer <s.hauer@pengutronix.de>, Shawn Guo <shawnguo@kernel.org>, Vinod Koul <vkoul@kernel.org>, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RESEND PATCH v2] dmaengine: mxs: fix driver registering Date: Tue, 7 Jun 2022 11:58:29 +0200 Message-Id: <20220607095829.1035903-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=E7D78HbC; 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: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
[RESEND,v2] dmaengine: mxs: fix driver registering
|
|
Commit Message
Dario Binacchi
June 7, 2022, 9:58 a.m. UTC
Driver registration fails on SOC imx8mn as its supplier, the clock
control module, is not ready. Since platform_driver_probe(), as
reported by its description, is incompatible with deferred probing,
we have to use platform_driver_register().
Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28")
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: stable@vger.kernel.org
---
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(-)
Comments
On 07-06-22, 11:58, Dario Binacchi wrote: > Driver registration fails on SOC imx8mn as its supplier, the clock > control module, is not ready. Since platform_driver_probe(), as > reported by its description, is incompatible with deferred probing, > we have to use platform_driver_register(). > > Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > Cc: stable@vger.kernel.org > > --- > > 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..b8a3e692330d 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) why drop __init for these...? > { > 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); > +module_platform_driver(mxs_dma_driver); > -- > 2.32.0
Hi On Thu, Jun 9, 2022 at 7:48 AM Vinod Koul <vkoul@kernel.org> wrote: > > On 07-06-22, 11:58, Dario Binacchi wrote: > > Driver registration fails on SOC imx8mn as its supplier, the clock > > control module, is not ready. Since platform_driver_probe(), as > > reported by its description, is incompatible with deferred probing, > > we have to use platform_driver_register(). > > > > Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") > > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > Cc: stable@vger.kernel.org > > > > --- > > > > 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..b8a3e692330d 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) > > why drop __init for these...? > I think that you refer to the fact that it can not be compiled as a module, am I right? Michael > > { > > 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); > > +module_platform_driver(mxs_dma_driver); > > -- > > 2.32.0 > > -- > ~Vinod
On 09-06-22, 08:01, Michael Nazzareno Trimarchi wrote: > Hi > > On Thu, Jun 9, 2022 at 7:48 AM Vinod Koul <vkoul@kernel.org> wrote: > > > > On 07-06-22, 11:58, Dario Binacchi wrote: > > > Driver registration fails on SOC imx8mn as its supplier, the clock > > > control module, is not ready. Since platform_driver_probe(), as > > > reported by its description, is incompatible with deferred probing, > > > we have to use platform_driver_register(). > > > > > > Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") > > > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > Cc: stable@vger.kernel.org > > > > > > --- > > > > > > 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..b8a3e692330d 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) > > > > why drop __init for these...? > > > > I think that you refer to the fact that it can not be compiled as a > module, am I right? It is still declared as a module_platform_driver... From changelog I can understand that you are changing init level from subsys to module (in fact clocks should be moved up as arch level and dmaengine users as module) ... But why remove __init declaration from these? Whatever purpose that may solve needs to be documented in changelog and perhaps a different patch > > Michael > > > > { > > > 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); > > > +module_platform_driver(mxs_dma_driver); > > > -- > > > 2.32.0 > > > > -- > > ~Vinod
Hi Vinod On Thu, Jun 9, 2022 at 8:07 AM Vinod Koul <vkoul@kernel.org> wrote: > > On 09-06-22, 08:01, Michael Nazzareno Trimarchi wrote: > > Hi > > > > On Thu, Jun 9, 2022 at 7:48 AM Vinod Koul <vkoul@kernel.org> wrote: > > > > > > On 07-06-22, 11:58, Dario Binacchi wrote: > > > > Driver registration fails on SOC imx8mn as its supplier, the clock > > > > control module, is not ready. Since platform_driver_probe(), as > > > > reported by its description, is incompatible with deferred probing, > > > > we have to use platform_driver_register(). > > > > > > > > Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") > > > > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > Cc: stable@vger.kernel.org > > > > > > > > --- > > > > > > > > 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..b8a3e692330d 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) > > > > > > why drop __init for these...? > > > > > > > I think that you refer to the fact that it can not be compiled as a > > module, am I right? > > It is still declared as a module_platform_driver... From changelog I can > understand that you are changing init level from subsys to module (in > fact clocks should be moved up as arch level and dmaengine users as > module) ... The way the driver was using to register was: platform_driver_probe(&driver, driver_probe); The function try to register the driver, one time and if the dependences is not satisfied, then there will not a next try, so the driver initialized that way can not depends to anything apart himself, or all the dependencies should be ready at the time the driver_probe is called > > But why remove __init declaration from these? Whatever purpose that may > solve needs to be documented in changelog and perhaps a different patch > I was thinking that driver can be compiled as module as other driver but is bool and not tristate Michael > > > > > Michael > > > > > > { > > > > 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); > > > > +module_platform_driver(mxs_dma_driver); > > > > -- > > > > 2.32.0 > > > > > > -- > > > ~Vinod > > -- > ~Vinod
On 09-06-22, 08:18, Michael Nazzareno Trimarchi wrote: > Hi Vinod > > On Thu, Jun 9, 2022 at 8:07 AM Vinod Koul <vkoul@kernel.org> wrote: > > > > On 09-06-22, 08:01, Michael Nazzareno Trimarchi wrote: > > > Hi > > > > > > On Thu, Jun 9, 2022 at 7:48 AM Vinod Koul <vkoul@kernel.org> wrote: > > > > > > > > On 07-06-22, 11:58, Dario Binacchi wrote: > > > > > Driver registration fails on SOC imx8mn as its supplier, the clock > > > > > control module, is not ready. Since platform_driver_probe(), as > > > > > reported by its description, is incompatible with deferred probing, > > > > > we have to use platform_driver_register(). > > > > > > > > > > Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") > > > > > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > > Cc: stable@vger.kernel.org > > > > > > > > > > --- > > > > > > > > > > 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..b8a3e692330d 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) > > > > > > > > why drop __init for these...? > > > > > > > > > > I think that you refer to the fact that it can not be compiled as a > > > module, am I right? > > > > It is still declared as a module_platform_driver... From changelog I can > > understand that you are changing init level from subsys to module (in > > fact clocks should be moved up as arch level and dmaengine users as > > module) ... > > The way the driver was using to register was: > platform_driver_probe(&driver, driver_probe); > > The function try to register the driver, one time and if the > dependences is not satisfied, > then there will not a next try, so the driver initialized that way can > not depends to anything > apart himself, or all the dependencies should be ready at the time the > driver_probe is called There are two ways to solve this, you lowered the init level of this driver but your consumers are going to have same issue... > > > > > But why remove __init declaration from these? Whatever purpose that may > > solve needs to be documented in changelog and perhaps a different patch > > > > I was thinking that driver can be compiled as module as other driver > but is bool and not tristate Ok, but why drop __init()
HI On Fri, Jun 10, 2022 at 3:48 PM Vinod Koul <vkoul@kernel.org> wrote: > > On 09-06-22, 08:18, Michael Nazzareno Trimarchi wrote: > > Hi Vinod > > > > On Thu, Jun 9, 2022 at 8:07 AM Vinod Koul <vkoul@kernel.org> wrote: > > > > > > On 09-06-22, 08:01, Michael Nazzareno Trimarchi wrote: > > > > Hi > > > > > > > > On Thu, Jun 9, 2022 at 7:48 AM Vinod Koul <vkoul@kernel.org> wrote: > > > > > > > > > > On 07-06-22, 11:58, Dario Binacchi wrote: > > > > > > Driver registration fails on SOC imx8mn as its supplier, the clock > > > > > > control module, is not ready. Since platform_driver_probe(), as > > > > > > reported by its description, is incompatible with deferred probing, > > > > > > we have to use platform_driver_register(). > > > > > > > > > > > > Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") > > > > > > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > > > Cc: stable@vger.kernel.org > > > > > > > > > > > > --- > > > > > > > > > > > > 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..b8a3e692330d 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) > > > > > > > > > > why drop __init for these...? > > > > > > > > > > > > > I think that you refer to the fact that it can not be compiled as a > > > > module, am I right? > > > > > > It is still declared as a module_platform_driver... From changelog I can > > > understand that you are changing init level from subsys to module (in > > > fact clocks should be moved up as arch level and dmaengine users as > > > module) ... > > > > The way the driver was using to register was: > > platform_driver_probe(&driver, driver_probe); > > > > The function try to register the driver, one time and if the > > dependences is not satisfied, > > then there will not a next try, so the driver initialized that way can > > not depends to anything > > apart himself, or all the dependencies should be ready at the time the > > driver_probe is called > > There are two ways to solve this, you lowered the init level of this > driver but your consumers are going to have same issue... > Consumers are platform drivers that support -EPROBE_DEFER. Is a problem this approach? > > > > > > > > But why remove __init declaration from these? Whatever purpose that may > > > solve needs to be documented in changelog and perhaps a different patch > > > > > > > I was thinking that driver can be compiled as module as other driver > > but is bool and not tristate > > Ok, but why drop __init() Was a mistake. Things marked as __init are dropped in the init section. As I said this driver can not be a .ko and must be in the kernel image, the __init can stay there. Now I don't remember how init section are used when a part of the kernel is compiled as module, but anyway this driver as only one initialization time Sorry Vinod, but if you are not happy with the answer, I have the feeling that you need to give more large lesson on this topic Michael > > -- > ~Vinod
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 994fc4d2aca4..b8a3e692330d 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); +module_platform_driver(mxs_dma_driver);