Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]Kernel and modular confusion.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 614

PostPosted: Mon Oct 21, 2024 11:39 am    Post subject: [solved]Kernel and modular confusion. Reply with quote

So I'm using the https://github.com/google/gasket-driver.
I clone the repo, move the src directory to /usr/src/linux[whatever]/drivers/staging/gasket-driver, tweak staging Makefile and Kconfig to include the subdir, switch the two drivers to "m" in menuconfig, and aside from the other considerations for these devices it works.
The issue I'm facing is when the two drivers are set to "y" they don't work, the device remains "without driver" according to lspci.

Am I missing some kind of "yes, you are allowed to include staging drivers as builtins" switch somewhere, or is there some deeper issue?


Last edited by Ralphred on Mon Oct 21, 2024 9:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4989
Location: Bavaria

PostPosted: Mon Oct 21, 2024 1:00 pm    Post subject: Re: Kernel and modular confusion. Reply with quote

Ralphred wrote:
Am I missing some kind of "yes, you are allowed to include staging drivers as builtins" switch somewhere, or is there some deeper issue?

Do you have some message(s) in your "dmesg"?

I would say that the error is in the Kconfig file. Here it is claimed that the module is tristate (so it can be built as a module or static).

You have to know the following: everything that is built as a module is only initialized by the kernel after the root partition has been mounted. Everything that is statically built into the kernel is initialized before. If a module requires another module before it is initialized, then this dependency must be defined in Kconfig. At the moment only this is defined:
Code:
depends on PCI && (X86_64 || ARM64)

If this dependency is not defined, then one module should be able to wait until the other module has been initialized. Neither seems to be the case here.

Presumably it requires another module which is configured as a module in your system. You could try to build everything else statically in your kernel and then check whether you can now also include apex statically. but again: then the definition of this dependency in Kconfig is missing here.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 614

PostPosted: Mon Oct 21, 2024 3:20 pm    Post subject: Re: Kernel and modular confusion. Reply with quote

pietinger wrote:
Do you have some message(s) in your "dmesg"?
Nothing untoward.
pietinger wrote:
Here it is claimed that the module is tristate (so it can be built as a module or static).
Hence the conclusion I was doing something wrong...
pietinger wrote:
Presumably it requires another module which is configured as a module in your system. You could try to build everything else statically in your kernel and then check whether you can now also include apex statically. but again: then the definition of this dependency in Kconfig is missing here.
The whole kernel is static, gasket and apex are literally the only two modules. But you have sparked an idea about apex depending on gasket, and that not being "registered" when they are both static. I'm tempted to try a static gasket with modular apex - if that works I'm thinking I can split the two and define the "dependency" in a separate staging/apex directory's Kconfig?.

This is a bit outside my "kernel tinkering comfort zone" - I'm not sure I'm thinking about it in the right way.

Edit: Meh, it's really odd, with GASKET=y and APEX=m both are still built as modules.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4989
Location: Bavaria

PostPosted: Mon Oct 21, 2024 6:36 pm    Post subject: Reply with quote

Aaaahh ... yes, you dont use the TODO ->
Code:
- obj-m   += gasket.o
- obj-m   += apex.o
+ obj-$(CONFIG_STAGING_GASKET_FRAMEWORK)   += gasket.o
+ obj-$(CONFIG_STAGING_APEX_DRIVER)   += apex.o

because normal makefile ist:
Code:
obj-m += gasket.o
obj-m += apex.o

:lol:
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Ralphred
l33t
l33t


Joined: 31 Dec 2013
Posts: 614

PostPosted: Mon Oct 21, 2024 9:10 pm    Post subject: Reply with quote

pietinger wrote:
Code:
- obj-m   += gasket.o
- obj-m   += apex.o
+ obj-$(CONFIG_STAGING_GASKET_FRAMEWORK)   += gasket.o
+ obj-$(CONFIG_STAGING_APEX_DRIVER)   += apex.o
Working and working; you Sir are a Gentleman and a Scholar, thanks.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4989
Location: Bavaria

PostPosted: Mon Oct 21, 2024 9:22 pm    Post subject: Reply with quote

Ralphred wrote:
Working and working; you Sir are a Gentleman and a Scholar, thanks.

I have not forgotten who translated my German article (iptables) into English ... and yes, you are also a great Gentleman. :D
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum