On Tue, 5 Sep 2023, Tony Lindgren wrote: > * Matthew Howell <matthew.howell@xxxxxxxxxxxx> [230905 16:43]: > > On Tue, 5 Sep 2023, Tony Lindgren wrote: > > > Maybe check if rmmod 8250_exar now somehow causes the following insmod > > > 8250_exar attempts to fail? > > > > Could you clarify what you mean? It is at that stage that I normally see > > the error in dmesg unless I have reverted the port id patch. In other > > words, if I just load it as-is I get the error in question. > > > > Do you mean to try loading the installed kernel module with insmod? > > If that is what you mean, I just tried loading the included binary with > > insmod but did not get the error and it loaded correctly. I loaded it > > with: > > > > sudo insmod /usr/lib/modules/6.5.0-1-MANJARO/kernel/drivers/tty/serial/8250/8250_exar.ko.zst > > I meant maybe reloading 8250_exar fails. So the test I would do is build > build a plain v6.5 kernel, boot it, modprobe 8250_exar, rmmod 8250_exar, > and then again modprobe 8250_exar. Sorry for the late reply, had some Manjaro/Arch specific issues installing the plain v6.5 kernel and so I switched over to Ubuntu 23.04. The results are as follows: 1. I confirmed I get the same behavior on Ubuntu as I do on Manjaro as far as compiling and loading 8250_exar from v6.5 using insmod. In this case, the running kernel was v6.2. 2. I installed the v6.5 kernel package and confirmed the issue does NOT occur 'out of the box'. In other words, the 8250_exar module 'bundled' / installed with the Ubuntu v6.5 kernel package does not have issues loading the ports. 3. I then attempted to insmod the 8250_exar module I built from the v6.5 source. This still results in the same dmesg error. 4. I then built the entire v6.5 kernel from source and installed it on Ubuntu 23.04. I used the .config file from the Ubuntu v6.5 kernel. This behaves the same as the v6.5 kernel package. In other words, the 8250_exar module bundled / installed with the kernel has no issues, even when I compile it myself. 5. Finally, I tested to see if insmod vs modprobe was significant by unloading and reloading the installed / bundled 8250_exar with both modprobe and rmmod/insmod. There were no differences between the two methods. For insmod, I tried this against both the 8250_exar module in /lib/modules and the 8250_Exar module in the original source directory. In conclusion, it seems like the 8250_exar module works as expected when running against exactly the kernel it was built against, but fails when running against any other kernel, even if that kernel is practically identical. I also would have expected some symbol or symver error if the kernels actually differed in some meaningful way. So it seems like this might not be an issue for typical 'users' of the kernel, but may impact people who need to build and load 8250_exar manually for whatever reason, unless I am just building the module incorrectly somehow. Any chance you could try building the module with your setup and then send it over? I changed the EXTRAVERSION and LOCALVERSION of my build such that the final version string is 6.5.0-090823-TESTING and I think your module would need to match for me to load it. > So maybe the first modprobe 8250_exar works after boot, but the second > modprobe 8250_exar won't? > > > Do you see anything concerning or possibly incorrect with the way I am > > building the 8250_exar module? > > No I don't see how that would make a difference. > > Regards, > > Tony > >