Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-power/bbswitch/files: bbswitch-0.5-kernel-3.8.patch
Date: Tue, 26 Feb 2013 20:10:51
Message-Id: 20130226201045.9991F20081@flycatcher.gentoo.org
1 pacho 13/02/26 20:10:45
2
3 Added: bbswitch-0.5-kernel-3.8.patch
4 Log:
5 Add kernel-3.8 compatibity patch from upstream (#458508 by Philipp Leonhardt), drop old.
6
7 (Portage version: 2.1.11.52/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
8
9 Revision Changes Path
10 1.1 sys-power/bbswitch/files/bbswitch-0.5-kernel-3.8.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/bbswitch/files/bbswitch-0.5-kernel-3.8.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/bbswitch/files/bbswitch-0.5-kernel-3.8.patch?rev=1.1&content-type=text/plain
14
15 Index: bbswitch-0.5-kernel-3.8.patch
16 ===================================================================
17 From 5593d9519364dc7f6f28c3dd8358afb907f39c0f Mon Sep 17 00:00:00 2001
18 From: Peter Wu <lekensteyn@×××××.com>
19 Date: Wed, 30 Jan 2013 18:57:56 +0100
20 Subject: [PATCH] Linux 3.8 compatibility hack
21
22 Since the following commit, the device would not turn off because the power
23 state is unknown. Until a fix is released in Linux (or until I know what
24 better to do), I just assume the power state D0.
25
26 commit ddc150f7a33ae0c9cb16eaac3641abc00f56316f
27 Author: Lv Zheng <lv.zheng@×××××.com>
28 Date: Fri Nov 16 02:46:28 2012 +0100
29
30 ACPI / PM: Add check preventing transitioning to non-D0 state from D3.
31
32 No power transitioning from D3 state up to a non-D0 state is allowed
33 so make acpi_device_set_power() fail and complain if such a transition
34 is attempted.
35
36 Signed-off-by: Lv Zheng <lv.zheng@×××××.com>
37 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@×××××.com>
38 ---
39 bbswitch.c | 14 ++++++++++++++
40 1 file changed, 14 insertions(+)
41
42 diff --git a/bbswitch.c b/bbswitch.c
43 index d839fa7..2646f29 100644
44 --- a/bbswitch.c
45 +++ b/bbswitch.c
46 @@ -238,6 +238,20 @@ static void bbswitch_off(void) {
47 pci_save_state(dis_dev);
48 pci_clear_master(dis_dev);
49 pci_disable_device(dis_dev);
50 + do {
51 + struct acpi_device *ad = NULL;
52 + int r;
53 +
54 + r = acpi_bus_get_device(dis_handle, &ad);
55 + if (r || !ad) {
56 + pr_warn("Cannot get ACPI device for PCI device\n");
57 + break;
58 + }
59 + if (ad->power.state == ACPI_STATE_UNKNOWN) {
60 + pr_debug("ACPI power state is unknown, forcing D0\n");
61 + ad->power.state = ACPI_STATE_D0;
62 + }
63 + } while (0);
64 pci_set_power_state(dis_dev, PCI_D3cold);
65
66 if (bbswitch_acpi_off())
67 --
68 1.7.10