Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 511110 - <=app-laptop/laptop-mode-tools-1.64 is incompatible with kernel >=3.13
Summary: <=app-laptop/laptop-mode-tools-1.64 is incompatible with kernel >=3.13
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alon Bar-Lev (RETIRED)
URL: https://github.com/rickysarraf/laptop...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-05-23 14:00 UTC by Stefan Huber
Modified: 2014-06-11 22:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix path for enable / disable ethernet device (0001-Fix-path-for-enable-disable-ethernet-device.patch,2.73 KB, patch)
2014-05-23 14:26 UTC, Stefan Huber
Details | Diff
wireless-iwl-power: sysfs attr enbable -> enabled (0003-wireless-iwl-power-sysfs-attr-enbable-enabled.patch,1.04 KB, patch)
2014-05-23 14:26 UTC, Stefan Huber
Details | Diff
wireless-ipw-power: sysfs attr enable -> enabled (0004-wireless-ipw-power-sysfs-attr-enable-enabled.patch,1.15 KB, patch)
2014-05-23 14:27 UTC, Stefan Huber
Details | Diff
pci-support-both-enable-enabled.patch (0001-pci-support-both-enable-enabled.patch,4.00 KB, patch)
2014-05-24 09:36 UTC, Alon Bar-Lev (RETIRED)
Details | Diff
Fix kernel >=3.13 compatibility for wireless modules (laptop-mode-tools-1.64-wireless-sysfsattr.patch,1.88 KB, patch)
2014-05-28 08:54 UTC, Stefan Huber
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Huber 2014-05-23 14:00:14 UTC
The current laptop-mode-tools have a module wireless-iwl-power to set powersave modes for wifi cards. To enumerate wifi devices, a sysfs attr "enable" of PCI devices is queried. This attribute was renamed to "enabled" with kernel versions >=3.13. Hence, this module stopped working with kernel version 3.13 or higher.

In the current development repository is a fix for this, however, the current ebuilds should check for the kernel version:

https://github.com/rickysarraf/laptop-mode-tools/commit/564b8811b09c2673beb91dd201e5c4b3d110e1e6

Reproducible: Always
Comment 1 Stefan Huber 2014-05-23 14:26:24 UTC
Created attachment 377500 [details, diff]
Fix path for enable / disable ethernet device
Comment 2 Stefan Huber 2014-05-23 14:26:46 UTC
Created attachment 377502 [details, diff]
wireless-iwl-power: sysfs attr enbable -> enabled
Comment 3 Stefan Huber 2014-05-23 14:27:05 UTC
Created attachment 377504 [details, diff]
wireless-ipw-power: sysfs attr enable -> enabled
Comment 4 Stefan Huber 2014-05-23 14:27:34 UTC
The same problem exists for wireless-ipw-power (pull-request pending) and ethernet (commit 7f5e8d1515667d96cbfd2016110499b060770561). I have attached the patches in case fixes for kernel versions >=3.13 are added to Gentoo portage. Also note that the next version of laptop-mode-tools will be incompatible for kernel version <3.13.
Comment 5 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-05-23 14:29:09 UTC
If this is catched by module-rebuild, then doing it in the ebuild is fine; if not, this patch needs to be adjusted to check which of both files is present; otherwise, it will result in incompatibility when you switch between kernels...
Comment 6 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-05-23 14:32:36 UTC
(In reply to Stefan Huber from comment #4)
> Also note that the next version of laptop-mode-tools will be
> incompatible for kernel version <3.13.

That could block further stabilization, given we're not stabilizing 3.14 soon.
Comment 7 Alon Bar-Lev (RETIRED) gentoo-dev 2014-05-23 14:33:06 UTC
I believe a patch that check for both enable and enabled is the correct solution.
Comment 8 Stefan Huber 2014-05-23 15:05:03 UTC
The patches add(In reply to Alon Bar-Lev from comment #7)
> I believe a patch that check for both enable and enabled is the correct
> solution.

The patches added here are simply 'git format-patch' outputs from the upstream repository. I guess it would be best to agree on a strategy before the next version of laptop-mode-tools is released, and the maintainer (rrs@researchut.com) should be involved. In particular, he is the author of the patch for ethernet module.
Comment 9 Alon Bar-Lev (RETIRED) gentoo-dev 2014-05-24 09:36:48 UTC
Created attachment 377556 [details, diff]
pci-support-both-enable-enabled.patch

Hi,

Can you please checkout this patch on top of upstream?
Comment 10 Stefan Huber 2014-05-24 09:42:36 UTC
(In reply to Alon Bar-Lev from comment #9)
> Can you please checkout this patch on top of upstream?

I similar patch is proposed in the git repository. Maybe it makes sense to bring such a change in the main repository and extract the corresponding patch for Gentoo portage?
Comment 11 Alon Bar-Lev (RETIRED) gentoo-dev 2014-05-24 09:44:48 UTC
(In reply to Stefan Huber from comment #10)
> (In reply to Alon Bar-Lev from comment #9)
> > Can you please checkout this patch on top of upstream?
> 
> I similar patch is proposed in the git repository. Maybe it makes sense to
> bring such a change in the main repository and extract the corresponding
> patch for Gentoo portage?

This is correct, however usually it is easier to merge once we test it out and provide something that is working. Either way this should go into upstream.
Comment 12 Stefan Huber 2014-05-24 09:50:14 UTC
(In reply to Alon Bar-Lev from comment #11)

The pull request I posted there about an hour ago also reduces code complexity a bit. What do you think?

https://github.com/rickysarraf/laptop-mode-tools/pull/26
Comment 13 Alon Bar-Lev (RETIRED) gentoo-dev 2014-05-24 09:55:30 UTC
(In reply to Stefan Huber from comment #12)
> (In reply to Alon Bar-Lev from comment #11)
> 
> The pull request I posted there about an hour ago also reduces code
> complexity a bit. What do you think?
> 
> https://github.com/rickysarraf/laptop-mode-tools/pull/26

I think that you do not follow current styles of project, and I think that it is more complex than the patch I posted.

when submitting patch do not add style modifications, do not violate project conventions, do not use bashism if not bash.
Comment 14 Stefan Huber 2014-05-24 09:59:36 UTC
(In reply to Alon Bar-Lev from comment #13)
 
> I think that you do not follow current styles of project,

If you mean the tab vs. space then it seems to be different even within many files.

> and I think that it is more complex than the patch I posted.

That depends on the point of view. The decision which file to choose is only made at one place in my proposal. This I would consider less complex in some sense. Your patch is smaller on the other hand.
Comment 15 Stefan Huber 2014-05-27 16:03:06 UTC
Little update: Writing to "enabled" turned out to be a bad idea. The corresponding code was replaced by a different approach. This makes the patches proposed in this bug report obsolete. See here for details:

   https://github.com/rickysarraf/laptop-mode-tools/pull/30

It seems that a new release of laptop-mode-tools will be prepared in the near future.
Comment 16 Alon Bar-Lev (RETIRED) gentoo-dev 2014-05-27 16:42:29 UTC
Thanks!

I backported it into laptop-mode-tools-1.64-r1

I hope all is good now.
Comment 17 Stefan Huber 2014-05-28 08:54:15 UTC
Created attachment 377752 [details, diff]
Fix kernel >=3.13 compatibility for wireless modules

(In reply to Alon Bar-Lev from comment #16)
> I backported it into laptop-mode-tools-1.64-r1
> 
> I hope all is good now.

Thank you for the backport. Unfortunately, the original problem reported by this bug report is still unfixed: the wireless modules still use the old "enable" sysfs file. The attached patch is a backport of half of the commit in the mainline git repo that fixes this.
Comment 18 Alon Bar-Lev (RETIRED) gentoo-dev 2014-06-11 22:29:31 UTC
Fixed in laptop-mode-tools-1.64-r2, thanks!