ACPICA: Use spinlock for acpi_{en|dis}able_gpe
Disabling gpe might interfere with gpe detection/handling, thus producing "interrupt not handled" errors. Ironically, disabling of GPE from interrupt context is already under spinlock, so only userspace needs to start using it. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:

committed by
Len Brown

vanhempi
a2f93aeadf
commit
0b7084ac67
@@ -282,7 +282,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
|
||||
/* disable GPE during transaction if storm is detected */
|
||||
if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
|
||||
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
|
||||
acpi_disable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
|
||||
acpi_disable_gpe(NULL, ec->gpe);
|
||||
}
|
||||
/* start transaction */
|
||||
spin_lock_irqsave(&ec->curr_lock, tmp);
|
||||
@@ -305,7 +305,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
|
||||
/* check if we received SCI during transaction */
|
||||
ec_check_sci(ec, acpi_ec_read_status(ec));
|
||||
/* it is safe to enable GPE outside of transaction */
|
||||
acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
|
||||
acpi_enable_gpe(NULL, ec->gpe);
|
||||
} else if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags) &&
|
||||
t->irq_count > ACPI_EC_STORM_THRESHOLD) {
|
||||
pr_info(PREFIX "GPE storm detected, "
|
||||
@@ -897,7 +897,7 @@ static int ec_install_handlers(struct acpi_ec *ec)
|
||||
if (ACPI_FAILURE(status))
|
||||
return -ENODEV;
|
||||
acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME);
|
||||
acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
|
||||
acpi_enable_gpe(NULL, ec->gpe);
|
||||
status = acpi_install_address_space_handler(ec->handle,
|
||||
ACPI_ADR_SPACE_EC,
|
||||
&acpi_ec_space_handler,
|
||||
@@ -1036,7 +1036,7 @@ static int acpi_ec_suspend(struct acpi_device *device, pm_message_t state)
|
||||
/* Stop using GPE */
|
||||
set_bit(EC_FLAGS_NO_GPE, &ec->flags);
|
||||
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
|
||||
acpi_disable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
|
||||
acpi_disable_gpe(NULL, ec->gpe);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1045,7 +1045,7 @@ static int acpi_ec_resume(struct acpi_device *device)
|
||||
struct acpi_ec *ec = acpi_driver_data(device);
|
||||
/* Enable use of GPE back */
|
||||
clear_bit(EC_FLAGS_NO_GPE, &ec->flags);
|
||||
acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR);
|
||||
acpi_enable_gpe(NULL, ec->gpe);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Viittaa uudesa ongelmassa
Block a user