mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
Merge branches 'misc', 'eeepc-laptop' and 'bugzilla-14445' into release
This commit is contained in:
commit
12308a2f27
10 changed files with 257 additions and 235 deletions
|
|
@ -103,9 +103,9 @@
|
|||
|
||||
#define ACPI_MAX_REFERENCE_COUNT 0x1000
|
||||
|
||||
/* Size of cached memory mapping for system memory operation region */
|
||||
/* Default page size for use in mapping memory for operation regions */
|
||||
|
||||
#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096
|
||||
#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
|
||||
|
||||
/* owner_id tracking. 8 entries allows for 255 owner_ids */
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,8 @@ acpi_ex_system_memory_space_handler(u32 function,
|
|||
void *logical_addr_ptr = NULL;
|
||||
struct acpi_mem_space_context *mem_info = region_context;
|
||||
u32 length;
|
||||
acpi_size window_size;
|
||||
acpi_size map_length;
|
||||
acpi_size page_boundary_map_length;
|
||||
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
|
||||
u32 remainder;
|
||||
#endif
|
||||
|
|
@ -144,25 +145,39 @@ acpi_ex_system_memory_space_handler(u32 function,
|
|||
}
|
||||
|
||||
/*
|
||||
* Don't attempt to map memory beyond the end of the region, and
|
||||
* constrain the maximum mapping size to something reasonable.
|
||||
* Attempt to map from the requested address to the end of the region.
|
||||
* However, we will never map more than one page, nor will we cross
|
||||
* a page boundary.
|
||||
*/
|
||||
window_size = (acpi_size)
|
||||
map_length = (acpi_size)
|
||||
((mem_info->address + mem_info->length) - address);
|
||||
|
||||
if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) {
|
||||
window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE;
|
||||
/*
|
||||
* If mapping the entire remaining portion of the region will cross
|
||||
* a page boundary, just map up to the page boundary, do not cross.
|
||||
* On some systems, crossing a page boundary while mapping regions
|
||||
* can cause warnings if the pages have different attributes
|
||||
* due to resource management
|
||||
*/
|
||||
page_boundary_map_length =
|
||||
ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;
|
||||
|
||||
if (!page_boundary_map_length) {
|
||||
page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
|
||||
}
|
||||
|
||||
if (map_length > page_boundary_map_length) {
|
||||
map_length = page_boundary_map_length;
|
||||
}
|
||||
|
||||
/* Create a new mapping starting at the address given */
|
||||
|
||||
mem_info->mapped_logical_address =
|
||||
acpi_os_map_memory((acpi_physical_address) address, window_size);
|
||||
mem_info->mapped_logical_address = acpi_os_map_memory((acpi_physical_address) address, map_length);
|
||||
if (!mem_info->mapped_logical_address) {
|
||||
ACPI_ERROR((AE_INFO,
|
||||
"Could not map memory at %8.8X%8.8X, size %X",
|
||||
ACPI_FORMAT_NATIVE_UINT(address),
|
||||
(u32) window_size));
|
||||
(u32) map_length));
|
||||
mem_info->mapped_length = 0;
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
|
@ -170,7 +185,7 @@ acpi_ex_system_memory_space_handler(u32 function,
|
|||
/* Save the physical address and mapping size */
|
||||
|
||||
mem_info->mapped_physical_address = address;
|
||||
mem_info->mapped_length = window_size;
|
||||
mem_info->mapped_length = map_length;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -294,7 +294,11 @@ static int set_acpi_trip(struct acpi_power_meter_resource *resource)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
return data;
|
||||
/* _PTP returns 0 on success, nonzero otherwise */
|
||||
if (data)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t set_trip(struct device *dev, struct device_attribute *devattr,
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ acpi_system_write_wakeup_device(struct file *file,
|
|||
struct list_head *node, *next;
|
||||
char strbuf[5];
|
||||
char str[5] = "";
|
||||
int len = count;
|
||||
unsigned int len = count;
|
||||
struct acpi_device *found_dev = NULL;
|
||||
|
||||
if (len > 4)
|
||||
|
|
|
|||
|
|
@ -770,7 +770,7 @@ static struct notifier_block acpi_cpu_notifier =
|
|||
.notifier_call = acpi_cpu_soft_notify,
|
||||
};
|
||||
|
||||
static int acpi_processor_add(struct acpi_device *device)
|
||||
static int __cpuinit acpi_processor_add(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_processor *pr = NULL;
|
||||
int result = 0;
|
||||
|
|
|
|||
|
|
@ -1133,15 +1133,15 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
|
|||
int result = 0;
|
||||
struct acpi_processor_throttling *pthrottling;
|
||||
|
||||
if (!pr)
|
||||
return -EINVAL;
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
"pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
|
||||
pr->throttling.address,
|
||||
pr->throttling.duty_offset,
|
||||
pr->throttling.duty_width));
|
||||
|
||||
if (!pr)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* Evaluate _PTC, _TSS and _TPC
|
||||
* They must all be present or none of them can be used.
|
||||
|
|
|
|||
|
|
@ -1223,7 +1223,7 @@ acpi_video_device_write_state(struct file *file,
|
|||
u32 state = 0;
|
||||
|
||||
|
||||
if (!dev || count + 1 > sizeof str)
|
||||
if (!dev || count >= sizeof(str))
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(str, buffer, count))
|
||||
|
|
@ -1280,7 +1280,7 @@ acpi_video_device_write_brightness(struct file *file,
|
|||
int i;
|
||||
|
||||
|
||||
if (!dev || !dev->brightness || count + 1 > sizeof str)
|
||||
if (!dev || !dev->brightness || count >= sizeof(str))
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(str, buffer, count))
|
||||
|
|
@ -1562,7 +1562,7 @@ acpi_video_bus_write_POST(struct file *file,
|
|||
unsigned long long opt, options;
|
||||
|
||||
|
||||
if (!video || count + 1 > sizeof str)
|
||||
if (!video || count >= sizeof(str))
|
||||
return -EINVAL;
|
||||
|
||||
status = acpi_video_bus_POST_options(video, &options);
|
||||
|
|
@ -1602,7 +1602,7 @@ acpi_video_bus_write_DOS(struct file *file,
|
|||
unsigned long opt;
|
||||
|
||||
|
||||
if (!video || count + 1 > sizeof str)
|
||||
if (!video || count >= sizeof(str))
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(str, buffer, count))
|
||||
|
|
|
|||
Loading…
Reference in a new issue