BoukeHaarsma23/zenergy

doesn't build on 6.9 kernel

MRSS02 opened this issue · 0 comments

Zenergy lo longer works on linux 6.9 mainline build, while it was working at 6.8.

So I tried to investigate why and decided to compile the module manually, as I was previously installing it from AUR.
But when trying to build this module in linux 6.9, it gives the following error:

/home/mparagames/zenergy/zenergy.c:229:27: error: ‘struct cpuinfo_x86’ has no member named ‘x86_max_cores’
  229 |         sockets = cpus / c->x86_max_cores;
      |

As it can be seen in this image:

image

However, apparently linux 6.9 changed the way information about the amount of physical cores, threads (logical cores), and dies per socket is obtained, according to this changelog on the documentation:

image

So I tried changing line 229 of the code to

sockets = cpus / topology_num_cores_per_package();`

Replacing c->x86_max_cores to topology_num_cores_per_package() with topology_num_cores_per_package().

This will make it compile on linux 6.9, but i assume it would then fail on linux 6.8 and below (I haven't tested it, however).

image

Please keep in mind, however, that I am no kernel or kernel module developer, I am just a cs student and I only know very basic c and code some projects as a hobby (usually in high level languages). Therefore, please be aware that I am prone to mistakes, as I don't really know what exactly would be the side effects of this change.
So i just kindly ask that you look deeper at what caused the change in linux 6.9 that made zenergy stop working, and I am giving this as a possible hint of what could be going on from what I observed.

Thank you in advance.