forked from mirrors/linux
		
	ACPI: processor: idle: Allow probing on platforms with one ACPI C-state
It is possible for ACPI _CST to return only one ACPI C-state, for example, when deep cstate disabled in the BIOS. And it is better for the acpi_idle driver to probe succesfully in this case as well for consistency. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
		
							parent
							
								
									6a8b55ed40
								
							
						
					
					
						commit
						496121c021
					
				
					 1 changed files with 2 additions and 7 deletions
				
			
		| 
						 | 
					@ -308,11 +308,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						if (!pr->power.count)
 | 
				
			||||||
	 * It is expected that there will be at least 2 states, C1 and
 | 
					 | 
				
			||||||
	 * something else (C2 or C3), so fail if that is not the case.
 | 
					 | 
				
			||||||
	 */
 | 
					 | 
				
			||||||
	if (pr->power.count < 2)
 | 
					 | 
				
			||||||
		return -EFAULT;
 | 
							return -EFAULT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pr->flags.has_cst = 1;
 | 
						pr->flags.has_cst = 1;
 | 
				
			||||||
| 
						 | 
					@ -468,8 +464,7 @@ static int acpi_processor_get_cstate_info(struct acpi_processor *pr)
 | 
				
			||||||
	for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
 | 
						for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
 | 
				
			||||||
		if (pr->power.states[i].valid) {
 | 
							if (pr->power.states[i].valid) {
 | 
				
			||||||
			pr->power.count = i;
 | 
								pr->power.count = i;
 | 
				
			||||||
			if (pr->power.states[i].type >= ACPI_STATE_C2)
 | 
								pr->flags.power = 1;
 | 
				
			||||||
				pr->flags.power = 1;
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue