Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef54b1bb authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (34 commits)
  ACPI, i915: Register ACPI video even when not modesetting
  Revert "ACPICA: delete check for AML access to port 0x81-83"
  I/O port protection: update for windows compatibility.
  sony-laptop: always try to unblock rfkill on load
  sony-laptop: fix bogus error message display on resume
  ACPI: EC: Fix ACPI EC resume non-query interrupt message
  sony-laptop: SNC input event 38 fix
  sony-laptop: SNC 127 Initialization Fix
  sony-laptop: Duplicate SNC 127 Event Fix
  ACPI: prevent processor.max_cstate=0 boot crash
  ACPI/hpet: prevent boot hang when hpet=force used on ICH-4M
  ACPI: delete obsolete "bus master activity" proc field
  ACPI: idle: mark_tsc_unstable() at init-time, not run-time
  ACPI: add /sys/firmware/acpi/interrupts/sci_not counter
  ACPI video: fix an error when the brightness levels on AC and on Battery are same
  acpi-cpufreq: Do not let get_measured perf depend on internal variable
  acpi-cpufreq: style-only: add parens to math expression
  acpi-cpufreq: Cleanup: Use printk_once
  x86, acpi_cpufreq: Fix the NULL pointer dereference in get_measured_perf
  thinkpad-acpi: bump up version to 0.23
  ...
parents 9fe9293d 1162cf6b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -69,9 +69,13 @@ Description:
		gpe1F:	     0	invalid
		gpe_all:    1192
		sci:	1194
		sci_not:     0	

		sci - The total number of times the ACPI SCI
		has claimed an interrupt.
		sci - The number of times the ACPI SCI
		has been called and claimed an interrupt.

		sci_not - The number of times the ACPI SCI
		has been called and NOT claimed an interrupt.

		gpe_all - count of SCI caused by GPEs.

+2 −2
Original line number Diff line number Diff line
		     ThinkPad ACPI Extras Driver

                            Version 0.22
                        November 23rd,  2008
                            Version 0.23
                          April 10th, 2009

               Borislav Deianov <borislav@users.sf.net>
             Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+16 −14
Original line number Diff line number Diff line
@@ -65,14 +65,18 @@ enum {
struct acpi_cpufreq_data {
	struct acpi_processor_performance *acpi_data;
	struct cpufreq_frequency_table *freq_table;
	unsigned int max_freq;
	unsigned int resume;
	unsigned int cpu_feature;
	u64 saved_aperf, saved_mperf;
};

static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data);

struct acpi_msr_data {
	u64 saved_aperf, saved_mperf;
};

static DEFINE_PER_CPU(struct acpi_msr_data, msr_data);

DEFINE_TRACE(power_mark);

/* acpi_perf_data is a pointer to percpu data. */
@@ -287,11 +291,11 @@ static unsigned int get_measured_perf(struct cpufreq_policy *policy,
		return 0;

	cur.aperf.whole = readin.aperf.whole -
				per_cpu(drv_data, cpu)->saved_aperf;
				per_cpu(msr_data, cpu).saved_aperf;
	cur.mperf.whole = readin.mperf.whole -
				per_cpu(drv_data, cpu)->saved_mperf;
	per_cpu(drv_data, cpu)->saved_aperf = readin.aperf.whole;
	per_cpu(drv_data, cpu)->saved_mperf = readin.mperf.whole;
				per_cpu(msr_data, cpu).saved_mperf;
	per_cpu(msr_data, cpu).saved_aperf = readin.aperf.whole;
	per_cpu(msr_data, cpu).saved_mperf = readin.mperf.whole;

#ifdef __i386__
	/*
@@ -335,7 +339,7 @@ static unsigned int get_measured_perf(struct cpufreq_policy *policy,

#endif

	retval = per_cpu(drv_data, policy->cpu)->max_freq * perf_percent / 100;
	retval = (policy->cpuinfo.max_freq * perf_percent) / 100;

	return retval;
}
@@ -688,16 +692,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
	/* Check for high latency (>20uS) from buggy BIOSes, like on T42 */
	if (perf->control_register.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE &&
	    policy->cpuinfo.transition_latency > 20 * 1000) {
		static int print_once;
		policy->cpuinfo.transition_latency = 20 * 1000;
		if (!print_once) {
			print_once = 1;
			printk(KERN_INFO "Capping off P-state tranision latency"
				" at 20 uS\n");
		}
			printk_once(KERN_INFO "Capping off P-state tranision"
				    " latency at 20 uS\n");
	}

	data->max_freq = perf->states[0].core_frequency * 1000;
	/* table init */
	for (i = 0; i < perf->state_count; i++) {
		if (i > 0 && perf->states[i].core_frequency >=
@@ -716,6 +715,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
	if (result)
		goto err_freqfree;

	if (perf->states[0].core_frequency * 1000 != policy->cpuinfo.max_freq)
		printk(KERN_WARNING FW_WARN "P-state 0 is not max freq\n");

	switch (perf->control_register.space_id) {
	case ACPI_ADR_SPACE_SYSTEM_IO:
		/* Current speed is unknown and not detectable by IO port */
+26 −17
Original line number Diff line number Diff line
@@ -211,6 +211,12 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)

ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)

static unsigned int gts, bfs;
module_param(gts, uint, 0644);
module_param(bfs, uint, 0644);
MODULE_PARM_DESC(gts, "Enable evaluation of _GTS on suspend.");
MODULE_PARM_DESC(bfs, "Enable evaluation of _BFS on resume".);

/*******************************************************************************
 *
 * FUNCTION:    acpi_enter_sleep_state
@@ -278,6 +284,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
		return_ACPI_STATUS(status);
	}

	if (gts) {
		/* Execute the _GTS method */

		arg_list.count = 1;
@@ -289,6 +296,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
		if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
			return_ACPI_STATUS(status);
		}
	}

	/* Get current value of PM1A control */

@@ -513,6 +521,7 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
		}
	}

	if (bfs) {
		/* Execute the _BFS method */

		arg_list.count = 1;
@@ -524,7 +533,7 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state)
		if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
			ACPI_EXCEPTION((AE_INFO, status, "During Method _BFS"));
		}

	}
	return_ACPI_STATUS(status);
}

+72 −14
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ static const struct acpi_port_info acpi_protected_ports[] = {
	{"PIT2", 0x0048, 0x004B, ACPI_OSI_WIN_XP},
	{"RTC", 0x0070, 0x0071, ACPI_OSI_WIN_XP},
	{"CMOS", 0x0074, 0x0076, ACPI_OSI_WIN_XP},
	{"DMA1", 0x0081, 0x0083, ACPI_OSI_WIN_XP},
	{"DMA1L", 0x0087, 0x0087, ACPI_OSI_WIN_XP},
	{"DMA2", 0x0089, 0x008B, ACPI_OSI_WIN_XP},
	{"DMA2L", 0x008F, 0x008F, ACPI_OSI_WIN_XP},
@@ -151,7 +152,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
		ACPI_ERROR((AE_INFO,
			    "Illegal I/O port address/length above 64K: 0x%p/%X",
			    ACPI_CAST_PTR(void, address), byte_width));
		return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS);
		return_ACPI_STATUS(AE_LIMIT);
	}

	/* Exit if requested address is not within the protected port table */
@@ -178,11 +179,12 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
			/* Port illegality may depend on the _OSI calls made by the BIOS */

			if (acpi_gbl_osi_data >= port_info->osi_dependency) {
				ACPI_ERROR((AE_INFO,
				ACPI_DEBUG_PRINT((ACPI_DB_IO,
						  "Denied AML access to port 0x%p/%X (%s 0x%.4X-0x%.4X)",
						  ACPI_CAST_PTR(void, address),
						  byte_width, port_info->name,
					    port_info->start, port_info->end));
						  port_info->start,
						  port_info->end));

				return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS);
			}
@@ -206,7 +208,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
 *              Value               Where value is placed
 *              Width               Number of bits
 *
 * RETURN:      Value read from port
 * RETURN:      Status and value read from port
 *
 * DESCRIPTION: Read data from an I/O port or register. This is a front-end
 *              to acpi_os_read_port that performs validation on both the port
@@ -217,16 +219,45 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
{
	acpi_status status;
	u32 one_byte;
	u32 i;

	/* Validate the entire request and perform the I/O */

	status = acpi_hw_validate_io_request(address, width);
	if (ACPI_FAILURE(status)) {
	if (ACPI_SUCCESS(status)) {
		status = acpi_os_read_port(address, value, width);
		return status;
	}

	status = acpi_os_read_port(address, value, width);
	if (status != AE_AML_ILLEGAL_ADDRESS) {
		return status;
	}

	/*
	 * There has been a protection violation within the request. Fall
	 * back to byte granularity port I/O and ignore the failing bytes.
	 * This provides Windows compatibility.
	 */
	for (i = 0, *value = 0; i < width; i += 8) {

		/* Validate and read one byte */

		if (acpi_hw_validate_io_request(address, 8) == AE_OK) {
			status = acpi_os_read_port(address, &one_byte, 8);
			if (ACPI_FAILURE(status)) {
				return status;
			}

			*value |= (one_byte << i);
		}

		address++;
	}

	return AE_OK;
}

/******************************************************************************
 *
 * FUNCTION:    acpi_hw_write_port
@@ -235,7 +266,7 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
 *              Value               Value to write
 *              Width               Number of bits
 *
 * RETURN:      None
 * RETURN:      Status
 *
 * DESCRIPTION: Write data to an I/O port or register. This is a front-end
 *              to acpi_os_write_port that performs validation on both the port
@@ -246,12 +277,39 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width)
{
	acpi_status status;
	u32 i;

	/* Validate the entire request and perform the I/O */

	status = acpi_hw_validate_io_request(address, width);
	if (ACPI_FAILURE(status)) {
	if (ACPI_SUCCESS(status)) {
		status = acpi_os_write_port(address, value, width);
		return status;
	}

	status = acpi_os_write_port(address, value, width);
	if (status != AE_AML_ILLEGAL_ADDRESS) {
		return status;
	}

	/*
	 * There has been a protection violation within the request. Fall
	 * back to byte granularity port I/O and ignore the failing bytes.
	 * This provides Windows compatibility.
	 */
	for (i = 0; i < width; i += 8) {

		/* Validate and write one byte */

		if (acpi_hw_validate_io_request(address, 8) == AE_OK) {
			status =
			    acpi_os_write_port(address, (value >> i) & 0xFF, 8);
			if (ACPI_FAILURE(status)) {
				return status;
			}
		}

		address++;
	}

	return AE_OK;
}
Loading