From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B833C4338F for ; Wed, 28 Jul 2021 08:26:20 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2C5FA60240 for ; Wed, 28 Jul 2021 08:26:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C5FA60240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UnShZHfCP7AKUsp1bWGHptAAm9S5S2lewJz9Wj4x8e8=; b=3NolOg17xv1hxp V6bhz2+wXU3EJdiM3zJ6DAO/x9NT+ck4dkfIt8bz64564r93yDE31YBTR3kTrcVvxJFzdQkhL53I2 QxxiLG+81BeJJj/d9XrfoX+9eccBJq3diUFubEqksB0xI5OZBvzUlVhDaYYd2EWRjXrZjHgnks3c+ kLaKyIGK0rCEDzon43DP+iyf4CJPBRGvNgwYv2NI1mvjgv4mL3hdnI1m1b14O4gQsunJJeM/f0+sH kPbb/huE8+94qmu56w+wriCIBPRojkqfgAhxpQFdj7FQoTCEVAocDTVvllMmir4ohxPhSQgllTvbt s7R7F67ieNvF2WT4lzSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8er7-00HXV4-Lf; Wed, 28 Jul 2021 08:23:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8er4-00HXUO-4e for linux-arm-kernel@lists.infradead.org; Wed, 28 Jul 2021 08:23:55 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id C665A6052B; Wed, 28 Jul 2021 08:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627460633; bh=JoL5rq4g2TYiFcHdBW5n8r5L+GbGCJK1HloPFAw/yUk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NOAhwpI1yPbejtEhoQx7rMG5w0ynfAtNeucI9UbyeChRmeQVvakqDG1A44DWowXGJ wZ+sZtaUi3E2gdgtPeBn49xdLz3LRpqnpeB4z/RDeT+JysJgLKv4nheODa+m+1MiV2 kEGwDolaplwBmgxM8VETT2V0mF9REOyEi8ykMxNk4egw+kI++oJD67gmzPoLuOIH2N MTP5TiPJvsM6sXxThfwlOIc5MxRIGBLDEGWuxpVUR48WLnk1kfwqFADsML0ao33JDq PXeW6Rny1ggVRPV4QEQdiORxCKoP9D6q/5DzrqwUgqFrWfkaNQ2BVm2FGPHmSJb9RT jEVdaFNFOtpHg== Date: Wed, 28 Jul 2021 13:53:48 +0530 From: Vinod Koul To: =?iso-8859-1?Q?Cl=E9ment_L=E9ger?= Cc: Ludovic Desroches , Tudor Ambarus , Alexandre Belloni , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dmaengine: at_xdmac: use module_platform_driver Message-ID: References: <20210625090042.17085-1-clement.leger@bootlin.com> <20210728093831.27430737@fixe.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210728093831.27430737@fixe.home> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210728_012354_262171_73349A1D X-CRM114-Status: GOOD ( 30.85 ) 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: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 28-07-21, 09:38, Cl=E9ment L=E9ger wrote: > Le Wed, 28 Jul 2021 12:26:50 +0530, > Vinod Koul a =E9crit : > = > > On 25-06-21, 11:00, Cl=E9ment L=E9ger wrote: > > > The driver was previously probed with platform_driver_probe. This > > > does not allow the driver to be probed again later if probe function > > > returns -EPROBE_DEFER. This patch replace the use of > > > platform_driver_probe with module_platform_driver which allows that. > > > = > > > Signed-off-by: Cl=E9ment L=E9ger > > > --- > > > drivers/dma/at_xdmac.c | 6 +----- > > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > = > > > diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c > > > index 64a52bf4d737..109a4c0895f4 100644 > > > --- a/drivers/dma/at_xdmac.c > > > +++ b/drivers/dma/at_xdmac.c > > > @@ -2238,11 +2238,7 @@ static struct platform_driver > > > at_xdmac_driver =3D { } > > > }; > > > = > > > -static int __init at_xdmac_init(void) > > > -{ > > > - return platform_driver_probe(&at_xdmac_driver, > > > at_xdmac_probe); -} > > > -subsys_initcall(at_xdmac_init); > > > +module_platform_driver(at_xdmac_driver); = > > = > > You are also changing the init call here, there is a reason why > > dmaengine drivers are subsys_initcall.. have you tested this? > > = > = > I understood that the subsys initcall was there to probe the DMA driver > earlier than other drivers (at least I guess this was the reason). I That is correct > also tested it and can confirm you this works as expected on my > platform (sama5d2_xplained and sama5d27_som1). > = > In my configuration, the clocks are provided using SCMI and the SCMI > driver probes them later than other drivers. = Heh, clocks should get probed even earlier > With the current subsys_initcall, platform_driver_probe calls > __platform_driver_probe which will eventually calls platform_probe. > This one will fails because SCMI clocks are not available at this time. > And as said in the kernel doc, __platform_driver_probe is incompatible > with deferred probing. This leads to failure of all drivers that needs > DMA channels provbided by at_xdmac. > = > With module_platform_driver, the at_xdmac driver is correctly probed > again later and all drivers that depends on DMA channels provided by > this one are also correctly probed. The deferred probing mechanism seems > to do its job correctly (at least in my case). OK would then recommend making it like module_platform_driver ie remove platform_driver_probe, so the defer probe would work, but keep the init at subsys level. That should work for you while keeping this sane for folks that dont need this -- = ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel