From patchwork Thu Jul 28 06:18:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 12931016 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 56CE4C04A68 for ; Thu, 28 Jul 2022 06:20:12 +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=khk2lW3et0jHPSwABYTq0vrHxlBQmHJ9VD6GnUW86iw=; b=4ORx2UezCDEf1m eIZSK9lCFYiyBZx56FOl/GukzrM8Fsq1wHnOsnJ+6UHK2fiYO2i73rCltyBjFvjQk7HIWSnlJA8EV 9gkb6OnnVJcD4idWtHGp63OXkaRxgYFxhfqwscnEbYbvfQ6mamW+pNh76q+Aa9rTN7TcKu2aiiTEr OAq1hJofqh1TrukT9XRvzJXXtqE9kmnmXQH2qPKALDJxjcXoRhbf8ooC5uvhaiwv/7mHElOSSvQtQ NoUt+XzaH0b3I8uKAcuId+VsSjDD+fybARTzsUy9AUMtGdS6Hn+Y9EbcNsX5hcef+Fv8nAm/msdP9 kQNqTYuf5hyuR8ywkjTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGwrW-004xN8-IJ; Thu, 28 Jul 2022 06:19:10 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGwrU-004xKq-9C for linux-arm-kernel@lists.infradead.org; Thu, 28 Jul 2022 06:19:09 +0000 Received: by mail-ej1-x62e.google.com with SMTP id ez10so1364883ejc.13 for ; Wed, 27 Jul 2022 23:19:05 -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=C3neU1AtxmqWdDSuYqkB7lF7A3shUmwSCsbgD00NRVo=; b=JbjP0JxIPi4T11YXcnH4HfzVt3B9IfnonC2lFIPLzS/wmOUb7lhpdzdYvT4RKIgN1s +fllYg1aF6mDvF+BzTc6y2eUkbdIIT+mir7T0+tHeml2NqWAzQ7NwFEWVxbKafGJdQYr QfcK0ns+1kHqIN7wPBPR+/tZaFEMkZuqLNs6A= 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=C3neU1AtxmqWdDSuYqkB7lF7A3shUmwSCsbgD00NRVo=; b=nFUTgufa1+lXniKKbtRb8YVR8h7RWVX9IJnRGXGEaz/iApHf29pxlWZ10l48pmnGYN XLWNggm9UFYo7zSNNEBcgsTfpCHNc+NF0uZG2XrViaI2MOOo2h7aMpN9LMKGMDOOXPv4 Y6HzJrer1+gmLyWZ8TObdknIp6GNz8lm9u3ovqjg4ESI3DsctweYZetjGR9FfTS3tfje sh0AMyiTcVR4bhgtzEmF5YaDMH8+D8T12kN22SBTas1m5nCQc9OpnWta2NxhukC+95tb /CpzVB3kzA0py+oV+NoCB9t+AbPIzufSsoiwb4zG+S8ObbBV3nTtzQ9DaD/gxio6zeMF jfhw== X-Gm-Message-State: AJIora8NxB4yPllhoqbpLys2aKQkrHdc4vk3JxaI44KfIsAEAWjNnUaw UxuJDPcCKC9yFzbn2TCIrsPOEA== X-Google-Smtp-Source: AGRyM1vRSnP3N6GPEflp6ikLzS+9t4V10CZ7mlxxZuvGRyYifP+MCFcmCR166eNhGSGUlfm9VPhAfw== X-Received: by 2002:a17:907:6818:b0:72b:5bac:c3a3 with SMTP id qz24-20020a170907681800b0072b5bacc3a3mr19390245ejc.139.1658989144713; Wed, 27 Jul 2022 23:19:04 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-31-31-9.retail.telecomitalia.it. [79.31.31.9]) by smtp.gmail.com with ESMTPSA id d6-20020aa7ce06000000b0043ba24a26casm105469edv.23.2022.07.27.23.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 23:19:04 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Michael Trimarchi , linux-amarula@amarulasolutions.com, Dario Binacchi , 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: [RESEND PATCH v5 1/2] dmaengine: mxs: use platform_driver_register Date: Thu, 28 Jul 2022 08:18:51 +0200 Message-Id: <20220728061852.209938-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-20220727_231908_367474_A44DB5BA X-CRM114-Status: GOOD ( 16.53 ) 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. - 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 | 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 Thu Jul 28 06:18:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 12931017 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 A2DE3C04A68 for ; Thu, 28 Jul 2022 06:20:22 +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=g2tBG+NyQriECc /6T1E6XRkZA2hKnqcQJZJB1er6707A7Z9Y00g9g6Vs4zlbIda6p7Jxyz35UFzD/PDfvv5vAuaagIc LJ2e5aTUk3JfhxMl7m4Xwf2T6myoGcwnZiH6S9grkzOf3/YHii3Noj0JROmeZnMO7OwjG0DjVp6Ch 01a2KhrWDTgPWcHi45sLfD04k3kGIcE//ny/reo2yK0OJ0SIPxTpUQDYODHnBcRYzyaa9Wqy/6A05 WDXs4pbx1yyT990StmeR3bjtctT5xHFvaHNwgdJ5Lm2m9mgL4z0oAtmr4PtmXUUJOg5VpnxD/d6fA lvC2ZewBnx6FOIkOUQ/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGwrh-004xRq-6U; Thu, 28 Jul 2022 06:19:21 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGwrW-004xLZ-0n for linux-arm-kernel@lists.infradead.org; Thu, 28 Jul 2022 06:19:11 +0000 Received: by mail-ed1-x529.google.com with SMTP id a89so911409edf.5 for ; Wed, 27 Jul 2022 23:19:07 -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=JxzV2oSfWwKritZ+fmuoWkOXRPsUIVzZhiFsuXbVagrOjYrHlMyQE3ykTSYSnDmW3u JUFSQpcMZYC+K91RrMsY4H6KlQ7vzRxdPTZjQ5f/toaKumjVjVAYVZXltUN9f2/Y2tni Fb4jE49zfjC8zyoV5FTPrQnoWkLwKoCPsILno= 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=KTXK+kmT8PFsOrWUvlZUEm+AT3LclDco8/1dVWc6Fo7nOgSG3A6MYzgZGaU+KHxS1z xmvQlbtZmh8MNyDYgcDq5tfd/a106JTnvrhhArtC99GyiBbg9SEVfp3wNHZgeACrvsLQ A1cRuBehKcnFMjBiTdZOUiwLPUNe1R9xVeM/aLCYM1f3GXEHeMUjfu+PIiTE66qxkNpc yKtxBd4+d6KDDfRoWlFpxiZiz7alIsna8d1FeXAJz95ZgkCpiE3ioyXBhzMP19nVc0Ru C2xRkGsAphyVaAR5tDXPtizFQGjprwquiZpRWdgHXRhDXUHAvp64/rruIsfRSGn7XUZA g/jg== X-Gm-Message-State: AJIora9ZZ7ARG/nbMzwP+KNcaBNDlyUhTXIY0meCYpt2xLMNHCRnl4TL tz5EHf72fmAReslECjymFrXX8Q== X-Google-Smtp-Source: AGRyM1tz1tC6LEg2WNIzbzcbIY1B6VTZVLyNkR0LykMksjUXB9PQLJr/W73edAmaLaoCMJ3ovFMSSg== X-Received: by 2002:a05:6402:484:b0:43b:6e02:71af with SMTP id k4-20020a056402048400b0043b6e0271afmr26664127edv.176.1658989146470; Wed, 27 Jul 2022 23:19:06 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-31-31-9.retail.telecomitalia.it. [79.31.31.9]) by smtp.gmail.com with ESMTPSA id d6-20020aa7ce06000000b0043ba24a26casm105469edv.23.2022.07.27.23.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 23:19:05 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Michael Trimarchi , linux-amarula@amarulasolutions.com, Dario Binacchi , 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: [RESEND PATCH v5 2/2] dmaengine: mxs: fix section mismatch Date: Thu, 28 Jul 2022 08:18:52 +0200 Message-Id: <20220728061852.209938-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220728061852.209938-1-dario.binacchi@amarulasolutions.com> References: <20220728061852.209938-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-20220727_231910_084004_3662605C X-CRM114-Status: GOOD ( 14.96 ) 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,