Skip to content

Commit 5fe4990

Browse files
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: ACPI: Idle C-states disabled by max_cstate should not disable the TSC ACPI: idle: fix init-time TSC check regression ACPI processor: reset the throttling state once it's invalid ACPI processor: introduce module parameter processor.ignore_tpc ACPI, i915: build fix ACPI: suspend: restore BM_RLD on resume ACPI: resume: re-enable SCI-enable workaround thermal: fix off-by-1 error in trip point trigger condition eeepc-laptop: unregister_rfkill_notifier on failure asus-laptop: fix input keycode eeepc-laptop: support for super hybrid engine (SHE) eeepc-laptop: Work around rfkill firmware bug eeepc-laptop: report brightness control events via the input layer eeepc-laptop: fix wlan rfkill state change during init ACPI: suspend: don't let device _PS3 failure prevent suspend ACPI: power: update error message ACPI: video: DMI workaround another broken Acer BIOS enabling display brightness ACPICA: use acpi.* modparam namespace ACPI video: dmi check for broken _BQC on Acer Aspire 5720
2 parents 1406de8 + 4e3507f commit 5fe4990

11 files changed

Lines changed: 174 additions & 42 deletions

File tree

‎drivers/acpi/acpica/Makefile‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,43 @@
55
ccflags-y := -Os
66
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
77

8-
obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
8+
# use acpi.o to put all files here into acpi.o modparam namespace
9+
obj-y += acpi.o
10+
11+
acpi-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
912
dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \
1013
dsinit.o
1114

12-
obj-y += evevent.o evregion.o evsci.o evxfevnt.o \
15+
acpi-y += evevent.o evregion.o evsci.o evxfevnt.o \
1316
evmisc.o evrgnini.o evxface.o evxfregn.o \
1417
evgpe.o evgpeblk.o
1518

16-
obj-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
19+
acpi-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
1720
exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\
1821
excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \
1922
exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o
2023

21-
obj-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o
24+
acpi-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o
2225

23-
obj-$(ACPI_FUTURE_USAGE) += hwtimer.o
26+
acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
2427

25-
obj-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \
28+
acpi-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \
2629
nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \
2730
nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \
2831
nsparse.o nspredef.o
2932

30-
obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
33+
acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
3134

32-
obj-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \
35+
acpi-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \
3336
psopcode.o psscope.o psutils.o psxface.o
3437

35-
obj-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
38+
acpi-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
3639
rscalc.o rsirq.o rsmemory.o rsutils.o
3740

38-
obj-$(ACPI_FUTURE_USAGE) += rsdump.o
41+
acpi-$(ACPI_FUTURE_USAGE) += rsdump.o
3942

40-
obj-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o
43+
acpi-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o
4144

42-
obj-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
45+
acpi-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
4346
utcopy.o utdelete.o utglobal.o utmath.o utobject.o \
4447
utstate.o utmutex.o utobject.o utresrc.o utlock.o

‎drivers/acpi/acpica/aclocal.h‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,12 @@ struct acpi_bit_register_info {
787787

788788
/* For control registers, both ignored and reserved bits must be preserved */
789789

790-
#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0201 /* Bits 9, 0(SCI_EN) */
790+
/*
791+
* The ACPI spec says to ignore PM1_CTL.SCI_EN (bit 0)
792+
* but we need to be able to write ACPI_BITREG_SCI_ENABLE directly
793+
* as a BIOS workaround on some machines.
794+
*/
795+
#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bits 9 */
791796
#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
792797
#define ACPI_PM1_CONTROL_PRESERVED_BITS \
793798
(ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)

‎drivers/acpi/bus.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
312312
end:
313313
if (result)
314314
printk(KERN_WARNING PREFIX
315-
"Transitioning device [%s] to D%d\n",
315+
"Device [%s] failed to transition to D%d\n",
316316
device->pnp.bus_id, state);
317317
else {
318318
device->power.state = state;

‎drivers/acpi/processor_idle.c‎

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,21 +202,44 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr,
202202
* Suspend / resume control
203203
*/
204204
static int acpi_idle_suspend;
205+
static u32 saved_bm_rld;
206+
207+
static void acpi_idle_bm_rld_save(void)
208+
{
209+
acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld);
210+
}
211+
static void acpi_idle_bm_rld_restore(void)
212+
{
213+
u32 resumed_bm_rld;
214+
215+
acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld);
216+
217+
if (resumed_bm_rld != saved_bm_rld)
218+
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
219+
}
205220

206221
int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
207222
{
223+
if (acpi_idle_suspend == 1)
224+
return 0;
225+
226+
acpi_idle_bm_rld_save();
208227
acpi_idle_suspend = 1;
209228
return 0;
210229
}
211230

212231
int acpi_processor_resume(struct acpi_device * device)
213232
{
233+
if (acpi_idle_suspend == 0)
234+
return 0;
235+
236+
acpi_idle_bm_rld_restore();
214237
acpi_idle_suspend = 0;
215238
return 0;
216239
}
217240

218241
#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
219-
static int tsc_halts_in_c(int state)
242+
static void tsc_check_state(int state)
220243
{
221244
switch (boot_cpu_data.x86_vendor) {
222245
case X86_VENDOR_AMD:
@@ -226,13 +249,17 @@ static int tsc_halts_in_c(int state)
226249
* C/P/S0/S1 states when this bit is set.
227250
*/
228251
if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
229-
return 0;
252+
return;
230253

231254
/*FALL THROUGH*/
232255
default:
233-
return state > ACPI_STATE_C1;
256+
/* TSC could halt in idle, so notify users */
257+
if (state > ACPI_STATE_C1)
258+
mark_tsc_unstable("TSC halts in idle");
234259
}
235260
}
261+
#else
262+
static void tsc_check_state(int state) { return; }
236263
#endif
237264

238265
static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
@@ -578,14 +605,9 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
578605

579606
pr->power.timer_broadcast_on_state = INT_MAX;
580607

581-
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
608+
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
582609
struct acpi_processor_cx *cx = &pr->power.states[i];
583610

584-
#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
585-
/* TSC could halt in idle, so notify users */
586-
if (tsc_halts_in_c(cx->type))
587-
mark_tsc_unstable("TSC halts in idle");;
588-
#endif
589611
switch (cx->type) {
590612
case ACPI_STATE_C1:
591613
cx->valid = 1;
@@ -603,6 +625,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
603625
acpi_timer_check_state(i, pr, cx);
604626
break;
605627
}
628+
if (cx->valid)
629+
tsc_check_state(cx->type);
606630

607631
if (cx->valid)
608632
working++;

‎drivers/acpi/processor_throttling.c‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@
4545
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
4646
ACPI_MODULE_NAME("processor_throttling");
4747

48+
/* ignore_tpc:
49+
* 0 -> acpi processor driver doesn't ignore _TPC values
50+
* 1 -> acpi processor driver ignores _TPC values
51+
*/
52+
static int ignore_tpc;
53+
module_param(ignore_tpc, int, 0644);
54+
MODULE_PARM_DESC(ignore_tpc, "Disable broken BIOS _TPC throttling support");
55+
4856
struct throttling_tstate {
4957
unsigned int cpu; /* cpu nr */
5058
int target_state; /* target T-state */
@@ -283,13 +291,19 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
283291

284292
if (!pr)
285293
return -EINVAL;
294+
295+
if (ignore_tpc)
296+
goto end;
297+
286298
status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc);
287299
if (ACPI_FAILURE(status)) {
288300
if (status != AE_NOT_FOUND) {
289301
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC"));
290302
}
291303
return -ENODEV;
292304
}
305+
306+
end:
293307
pr->throttling_platform_limit = (int)tpc;
294308
return 0;
295309
}
@@ -302,6 +316,9 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
302316
struct acpi_processor_limit *limit;
303317
int target_state;
304318

319+
if (ignore_tpc)
320+
return 0;
321+
305322
result = acpi_processor_get_platform_limit(pr);
306323
if (result) {
307324
/* Throttling Limit is unsupported */
@@ -821,6 +838,14 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
821838
ret = acpi_read_throttling_status(pr, &value);
822839
if (ret >= 0) {
823840
state = acpi_get_throttling_state(pr, value);
841+
if (state == -1) {
842+
ACPI_WARNING((AE_INFO,
843+
"Invalid throttling state, reset\n"));
844+
state = 0;
845+
ret = acpi_processor_set_throttling(pr, state);
846+
if (ret)
847+
return ret;
848+
}
824849
pr->throttling.state = state;
825850
}
826851

‎drivers/acpi/video.c‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,41 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
538538
return -EINVAL;
539539
}
540540

541+
/*
542+
* For some buggy _BQC methods, we need to add a constant value to
543+
* the _BQC return value to get the actual current brightness level
544+
*/
545+
546+
static int bqc_offset_aml_bug_workaround;
547+
static int __init video_set_bqc_offset(const struct dmi_system_id *d)
548+
{
549+
bqc_offset_aml_bug_workaround = 9;
550+
return 0;
551+
}
552+
553+
static struct dmi_system_id video_dmi_table[] __initdata = {
554+
/*
555+
* Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
556+
*/
557+
{
558+
.callback = video_set_bqc_offset,
559+
.ident = "Acer Aspire 5720",
560+
.matches = {
561+
DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
562+
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
563+
},
564+
},
565+
{
566+
.callback = video_set_bqc_offset,
567+
.ident = "Acer Aspire 5710Z",
568+
.matches = {
569+
DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
570+
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"),
571+
},
572+
},
573+
{}
574+
};
575+
541576
static int
542577
acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
543578
unsigned long long *level)
@@ -557,6 +592,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
557592
*level = device->brightness->levels[*level + 2];
558593

559594
}
595+
*level += bqc_offset_aml_bug_workaround;
560596
device->brightness->curr = *level;
561597
return 0;
562598
} else {
@@ -2290,6 +2326,8 @@ EXPORT_SYMBOL(acpi_video_register);
22902326

22912327
static int __init acpi_video_init(void)
22922328
{
2329+
dmi_check_system(video_dmi_table);
2330+
22932331
if (intel_opregion_present())
22942332
return 0;
22952333

‎drivers/gpu/drm/Kconfig‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ config DRM_I915
8484
config DRM_I915_KMS
8585
bool "Enable modesetting on intel by default"
8686
depends on DRM_I915
87+
# i915 KMS depends on ACPI_VIDEO when ACPI is enabled
88+
# but for select to work, need to select ACPI_VIDEO's dependencies, ick
89+
select VIDEO_OUTPUT_CONTROL if ACPI
90+
select BACKLIGHT_CLASS_DEVICE if ACPI
91+
select INPUT if ACPI
92+
select ACPI_VIDEO if ACPI
8793
help
8894
Choose this option if you want kernel modesetting enabled by default,
8995
and you have a new enough userspace to support this. Running old

‎drivers/platform/x86/asus-laptop.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,16 @@ static struct key_entry asus_keymap[] = {
269269
{KE_KEY, 0x34, KEY_SWITCHVIDEOMODE},
270270
{KE_KEY, 0x40, KEY_PREVIOUSSONG},
271271
{KE_KEY, 0x41, KEY_NEXTSONG},
272-
{KE_KEY, 0x43, KEY_STOP},
272+
{KE_KEY, 0x43, KEY_STOPCD},
273273
{KE_KEY, 0x45, KEY_PLAYPAUSE},
274274
{KE_KEY, 0x50, KEY_EMAIL},
275275
{KE_KEY, 0x51, KEY_WWW},
276-
{KE_KEY, 0x5C, BTN_EXTRA}, /* Performance */
276+
{KE_KEY, 0x5C, KEY_SCREENLOCK}, /* Screenlock */
277277
{KE_KEY, 0x5D, KEY_WLAN},
278278
{KE_KEY, 0x61, KEY_SWITCHVIDEOMODE},
279279
{KE_KEY, 0x6B, BTN_TOUCH}, /* Lock Mouse */
280280
{KE_KEY, 0x82, KEY_CAMERA},
281-
{KE_KEY, 0x8A, KEY_TV},
281+
{KE_KEY, 0x8A, KEY_PROG1},
282282
{KE_KEY, 0x95, KEY_MEDIA},
283283
{KE_KEY, 0x99, KEY_PHONE},
284284
{KE_END, 0},

0 commit comments

Comments
 (0)