Skip to contentSkip to conversation

mmc/wifi/bluetooth: store owner from modules with sdio_register_driver()

PATCH In review Krzysztof Kozlowski 3 participants 10 messages Apr 3, 2024 – Apr 4, 2024

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v2 cover mmc/wifi/bluetooth: store owner from modules with sdio_register_driver()

Changes in v2:
1. Add "wifi: ath10k: sdio: simplify module initialization" patch, from
my other patchset to avoid conflicts.
2. Add Acks/Rb tags.
3. Drop applied SDIO patch, which was the dependency for the rest
cleanups.
4. Update subjects according to feedback.
- Link to v1: https://lore.kernel.org/r/[email protected]

Merging
=======
With Acks from Kalle, please take entire set via mmc/sdio.

Description
===========
Modules registering driver with sdio_register_driver() might forget to set .owner field.

Solve the problem by moving this task away from the drivers to the core code, just like we did for platform_driver in commit 9447057eaff8 ("platform_device: use a macro instead of platform_driver_register").

Best regards,
Krzysztof

---
Krzysztof Kozlowski (7):
Bluetooth: btmrvl_sdio: drop driver owner initialization
Bluetooth: btmtksdio: drop driver owner initialization
wifi: ath10k: sdio: simplify module initialization
wifi: ath10k: sdio: drop driver owner initialization
wifi: brcm80211: drop driver owner initialization
wifi: mwifiex: drop driver owner initialization
wifi: wfx: drop driver owner initialization

 drivers/bluetooth/btmrvl_sdio.c                     |  1 -
 drivers/bluetooth/btmtksdio.c                       |  1 -
 drivers/net/wireless/ath/ath10k/sdio.c              | 21 +--------------------
 .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c   |  1 -
 drivers/net/wireless/marvell/mwifiex/sdio.c         |  1 -
 drivers/net/wireless/silabs/wfx/bus_sdio.c          |  1 -
 6 files changed, 1 insertion(+), 25 deletions(-)

---
base-commit: 7d860d3177a745017d38b37bc2bff2f090631148
change-id: 20240329-module-owner-sdio-abd5de3f1d74

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>
#1 lore raw

PATCH v2 1/7 Bluetooth: btmrvl_sdio: drop driver owner initialization

Core in sdio_register_driver() already sets the .owner, so driver does not need to.

---

Depends on the patch in mmc tree.

---
 drivers/bluetooth/btmrvl_sdio.c | 1 -
 1 file changed, 1 deletion(-)
drivers/bluetooth/btmrvl_sdio.c +0 -1
index d76c799553aa..85b7f2bb4259 100644
@@ -1736,7 +1736,6 @@ static struct sdio_driver bt_mrvl_sdio = {
 	.probe		= btmrvl_sdio_probe,
 	.remove		= btmrvl_sdio_remove,
 	.drv = {
-		.owner = THIS_MODULE,
 		.coredump = btmrvl_sdio_coredump,
 		.pm = &btmrvl_sdio_pm_ops,
 	}
Signature · 1 line
2.34.1
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=841110

---Test result---

Test Summary:

CheckPatch                    PASS      3.07 seconds
GitLint                       PASS      1.40 seconds
SubjectPrefix                 FAIL      0.69 seconds
BuildKernel                   PASS      29.73 seconds
CheckAllWarning               PASS      32.46 seconds
CheckSparse                   PASS      38.12 seconds
CheckSmatch                   FAIL      34.81 seconds
BuildKernel32                 PASS      29.06 seconds
TestRunnerSetup               PASS      518.13 seconds
TestRunner_l2cap-tester       PASS      21.01 seconds
TestRunner_iso-tester         PASS      29.85 seconds
TestRunner_bnep-tester        PASS      4.62 seconds
TestRunner_mgmt-tester        PASS      110.07 seconds
TestRunner_rfcomm-tester      PASS      7.10 seconds
TestRunner_sco-tester         PASS      14.66 seconds
TestRunner_ioctl-tester       PASS      7.49 seconds
TestRunner_mesh-tester        PASS      5.64 seconds
TestRunner_smp-tester         PASS      6.63 seconds
TestRunner_userchan-tester    PASS      4.80 seconds
IncrementalBuild              PASS      57.83 seconds

Details
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix Output:
"Bluetooth: " prefix is not specified in the subject "Bluetooth: " prefix is not specified in the subject "Bluetooth: " prefix is not specified in the subject "Bluetooth: " prefix is not specified in the subject "Bluetooth: " prefix is not specified in the subject
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:

Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/hci_core.o] Error 139 make[4]: *** Deleting file 'net/bluetooth/hci_core.o'
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bcm203x.o] Error 139 make[4]: *** Deleting file 'drivers/bluetooth/bcm203x.o'
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:485: drivers] Error 2
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2

---
Regards,
Linux Bluetooth

#3 lore raw

PATCH v2 2/7 Bluetooth: btmtksdio: drop driver owner initialization

In reply to Krzysztof Kozlowski

Core in sdio_register_driver() already sets the .owner, so driver does not need to.

---

Depends on the patch in mmc tree.

---
 drivers/bluetooth/btmtksdio.c | 1 -
 1 file changed, 1 deletion(-)
drivers/bluetooth/btmtksdio.c +0 -1
index ff4868c83cd8..8ded9ef8089a 100644
@@ -1519,7 +1519,6 @@ static struct sdio_driver btmtksdio_driver = {
 	.remove		= btmtksdio_remove,
 	.id_table	= btmtksdio_table,
 	.drv = {
-		.owner = THIS_MODULE,
 		.pm = BTMTKSDIO_PM_OPS,
 	}
 };
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 3/7 wifi: ath10k: sdio: simplify module initialization

In reply to Krzysztof Kozlowski

This driver's initialization functions do not perform any custom code, except printing messages. Printing messages on modules loading/unloading is discouraged because it pollutes the dmesg regardless whether user actually has this device. Core kernel code already gives tools to investigate whether module was loaded or not.

Drop the printing messages which allows to replace open-coded module_sdio_driver().

---

Changes in v2 moved from other patchset to avoid conflicts.

---
 drivers/net/wireless/ath/ath10k/sdio.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
drivers/net/wireless/ath/ath10k/sdio.c +1 -19
index 0ab5433f6cf6..1acb9fba9a8e 100644
@@ -2671,25 +2671,7 @@ static struct sdio_driver ath10k_sdio_driver = {
 		.pm = ATH10K_SDIO_PM_OPS,
 	},
 };
-
-static int __init ath10k_sdio_init(void)
-{
-	int ret;
-
-	ret = sdio_register_driver(&ath10k_sdio_driver);
-	if (ret)
-		pr_err("sdio driver registration failed: %d\n", ret);
-
-	return ret;
-}
-
-static void __exit ath10k_sdio_exit(void)
-{
-	sdio_unregister_driver(&ath10k_sdio_driver);
-}
-
-module_init(ath10k_sdio_init);
-module_exit(ath10k_sdio_exit);
+module_sdio_driver(ath10k_sdio_driver);
 
 MODULE_AUTHOR("Qualcomm Atheros");
 MODULE_DESCRIPTION("Driver support for Qualcomm Atheros 802.11ac WLAN SDIO devices");
Signature · 1 line
2.34.1
#5 lore raw

PATCH v2 4/7 wifi: ath10k: sdio: drop driver owner initialization

In reply to Krzysztof Kozlowski

Core in sdio_register_driver() already sets the .owner, so driver does not need to.

---

Depends on the patch in mmc tree.

---
 drivers/net/wireless/ath/ath10k/sdio.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/ath/ath10k/sdio.c +0 -1
index 1acb9fba9a8e..cddd9e3010ee 100644
@@ -2667,7 +2667,6 @@ static struct sdio_driver ath10k_sdio_driver = {
 	.probe = ath10k_sdio_probe,
 	.remove = ath10k_sdio_remove,
 	.drv = {
-		.owner = THIS_MODULE,
 		.pm = ATH10K_SDIO_PM_OPS,
 	},
 };
Signature · 1 line
2.34.1
#6 lore raw

PATCH v2 5/7 wifi: brcm80211: drop driver owner initialization

In reply to Krzysztof Kozlowski

Core in sdio_register_driver() already sets the .owner, so driver does not need to.

---

Depends on the patch in mmc tree.

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +0 -1
index 00679a990e3d..13391c2d82aa 100644
@@ -1238,7 +1238,6 @@ static struct sdio_driver brcmf_sdmmc_driver = {
 	.name = KBUILD_MODNAME,
 	.id_table = brcmf_sdmmc_ids,
 	.drv = {
-		.owner = THIS_MODULE,
 		.pm = pm_sleep_ptr(&brcmf_sdio_pm_ops),
 		.coredump = brcmf_dev_coredump,
 	},
Signature · 1 line
2.34.1
#7 lore raw

PATCH v2 6/7 wifi: mwifiex: drop driver owner initialization

In reply to Krzysztof Kozlowski

Core in sdio_register_driver() already sets the .owner, so driver does not need to.

---

Depends on the patch in mmc tree.

---
 drivers/net/wireless/marvell/mwifiex/sdio.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/marvell/mwifiex/sdio.c +0 -1
index f41048b5cd3c..bda9b2b8a1f3 100644
@@ -979,7 +979,6 @@ static struct sdio_driver mwifiex_sdio = {
 	.probe = mwifiex_sdio_probe,
 	.remove = mwifiex_sdio_remove,
 	.drv = {
-		.owner = THIS_MODULE,
 		.coredump = mwifiex_sdio_coredump,
 		.pm = &mwifiex_sdio_pm_ops,
 	}
Signature · 1 line
2.34.1
#8 lore raw

PATCH v2 7/7 wifi: wfx: drop driver owner initialization

In reply to Krzysztof Kozlowski

Core in sdio_register_driver() already sets the .owner, so driver does not need to.

---

Depends on the patch in mmc tree.

---
 drivers/net/wireless/silabs/wfx/bus_sdio.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/wireless/silabs/wfx/bus_sdio.c +0 -1
index 909d5f346a01..f290eecde773 100644
@@ -267,7 +267,6 @@ struct sdio_driver wfx_sdio_driver = {
 	.probe = wfx_sdio_probe,
 	.remove = wfx_sdio_remove,
 	.drv = {
-		.owner = THIS_MODULE,
 		.of_match_table = wfx_sdio_of_match,
 	}
 };
Signature · 1 line
2.34.1
#9 lore raw
In reply to Krzysztof Kozlowski
Quoted 10 lines · Krzysztof Kozlowski

Changes in v2:
1. Add "wifi: ath10k: sdio: simplify module initialization" patch, from
my other patchset to avoid conflicts.
2. Add Acks/Rb tags.
3. Drop applied SDIO patch, which was the dependency for the rest
cleanups.
4. Update subjects according to feedback.
- Link to v1: https://lore.kernel.org/r/[email protected]

Quoted 3 lines

Merging
=======
With Acks from Kalle, please take entire set via mmc/sdio.

The series applied for next, thanks!

[...]

Kind regards
Uffe