From: Manojkiran Eda <manojkiran.eda@gmail.com>
To: patrick.rudolph@9elements.com, chiawei_wang@aspeedtech.com,
ryan_chen@aspeedtech.com, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org
Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
conor+dt@kernel.org, joel@jms.id.au, andrew@codeconstruct.com.au,
miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
manojkiran.eda@gmail.com, jk@codeconstruct.com.au,
openbmc@lists.ozlabs.org
Subject: [PATCH v2 2/4] mtd: Replace module_init with subsys_initcall
Date: Tue, 19 Mar 2024 15:04:03 +0530 [thread overview]
Message-ID: <20240319093405.39833-3-manojkiran.eda@gmail.com> (raw)
In-Reply-To: <20240319093405.39833-1-manojkiran.eda@gmail.com>
While engaged in development on the espi kernel device driver[1],
I noticed that the espi flash driver, utilizing the mtd subsystem,
appears to initialize before the mtdcore subsystem registers the
mtd_class. As a result, although the mtd device for espi is created,
it does not populate within the /sys/class/mtd hierarchy.
Given that mtd serves as a subsystem upon which numerous other drivers
rely for infrastructure, it appears logical to adjust the module_init()
call to an alternative priority initcall, subsys_initcall(), thereby
ensuring that the mtd core subsystem is probed prior to the drivers
utilizing its infrastructure.
Although this adjustment alters the initialization ordering, there
exists a slight risk of uncovering implicit initialization ordering
issues. However, I believe it is preferable to prioritize it reasonably
rather than having module_init() in order to maintain the exact old
ordering.
Link : [1] https://lore.kernel.org/openbmc/20240213-espi_driver-v1-1-92741c812843@gmail.com
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
---
drivers/mtd/mtdcore.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index e451b28840d5..cc51c9fb2c1e 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -2560,7 +2560,7 @@ static void __exit cleanup_mtd(void)
idr_destroy(&mtd_idr);
}
-module_init(init_mtd);
+subsys_initcall(init_mtd);
module_exit(cleanup_mtd);
MODULE_LICENSE("GPL");
--
2.40.1
next prev parent reply other threads:[~2024-03-19 9:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-19 9:34 [PATCH v2 0/4] Add eSPI device driver (flash channel) Manojkiran Eda
2024-03-19 9:34 ` [PATCH v2 1/4] " Manojkiran Eda
2024-03-19 9:49 ` Krzysztof Kozlowski
2024-03-19 9:34 ` Manojkiran Eda [this message]
2024-03-19 9:51 ` [PATCH v2 2/4] mtd: Replace module_init with subsys_initcall Krzysztof Kozlowski
2024-03-19 9:53 ` Miquel Raynal
2024-03-19 9:34 ` [PATCH v2 3/4] ARM: dts: aspeed: Add eSPI node Manojkiran Eda
2024-03-19 9:50 ` Krzysztof Kozlowski
2024-03-19 9:34 ` [PATCH v2 4/4] dt-bindings: aspeed: Add eSPI controller Manojkiran Eda
2024-03-19 9:56 ` Krzysztof Kozlowski
[not found] ` <a9faa9b4-9bf6-49b6-b7eb-f642e2d261c3@gmail.com>
2024-03-20 14:44 ` Krzysztof Kozlowski
2024-03-28 11:33 ` Manojkiran Eda
2024-03-30 18:36 ` Krzysztof Kozlowski
2024-03-20 15:40 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240319093405.39833-3-manojkiran.eda@gmail.com \
--to=manojkiran.eda@gmail.com \
--cc=andrew@codeconstruct.com.au \
--cc=chiawei_wang@aspeedtech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jk@codeconstruct.com.au \
--cc=joel@jms.id.au \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=openbmc@lists.ozlabs.org \
--cc=patrick.rudolph@9elements.com \
--cc=richard@nod.at \
--cc=robh+dt@kernel.org \
--cc=ryan_chen@aspeedtech.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®