ACPI / EC: Cleanup transaction wakeup code
This patch moves transaction wakeup code into advance_transaction(). No functional changes. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Родитель
ec6f34e5b5
Коммит
0c78808f51
|
@ -200,7 +200,7 @@ static int ec_transaction_completed(struct acpi_ec *ec)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool advance_transaction(struct acpi_ec *ec)
|
static void advance_transaction(struct acpi_ec *ec)
|
||||||
{
|
{
|
||||||
struct transaction *t;
|
struct transaction *t;
|
||||||
u8 status;
|
u8 status;
|
||||||
|
@ -235,7 +235,7 @@ static bool advance_transaction(struct acpi_ec *ec)
|
||||||
t->flags |= ACPI_EC_COMMAND_COMPLETE;
|
t->flags |= ACPI_EC_COMMAND_COMPLETE;
|
||||||
wakeup = true;
|
wakeup = true;
|
||||||
}
|
}
|
||||||
return wakeup;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
if (EC_FLAGS_QUERY_HANDSHAKE &&
|
if (EC_FLAGS_QUERY_HANDSHAKE &&
|
||||||
!(status & ACPI_EC_FLAG_SCI) &&
|
!(status & ACPI_EC_FLAG_SCI) &&
|
||||||
|
@ -251,7 +251,7 @@ static bool advance_transaction(struct acpi_ec *ec)
|
||||||
t->flags |= ACPI_EC_COMMAND_POLL;
|
t->flags |= ACPI_EC_COMMAND_POLL;
|
||||||
} else
|
} else
|
||||||
goto err;
|
goto err;
|
||||||
return wakeup;
|
goto out;
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
/*
|
/*
|
||||||
|
@ -262,14 +262,16 @@ err:
|
||||||
if (in_interrupt() && t)
|
if (in_interrupt() && t)
|
||||||
++t->irq_count;
|
++t->irq_count;
|
||||||
}
|
}
|
||||||
return wakeup;
|
out:
|
||||||
|
if (wakeup && in_interrupt())
|
||||||
|
wake_up(&ec->wait);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void start_transaction(struct acpi_ec *ec)
|
static void start_transaction(struct acpi_ec *ec)
|
||||||
{
|
{
|
||||||
ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0;
|
ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0;
|
||||||
ec->curr->flags = 0;
|
ec->curr->flags = 0;
|
||||||
(void)advance_transaction(ec);
|
advance_transaction(ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data);
|
static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data);
|
||||||
|
@ -304,7 +306,7 @@ static int ec_poll(struct acpi_ec *ec)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
spin_lock_irqsave(&ec->lock, flags);
|
spin_lock_irqsave(&ec->lock, flags);
|
||||||
(void)advance_transaction(ec);
|
advance_transaction(ec);
|
||||||
spin_unlock_irqrestore(&ec->lock, flags);
|
spin_unlock_irqrestore(&ec->lock, flags);
|
||||||
} while (time_before(jiffies, delay));
|
} while (time_before(jiffies, delay));
|
||||||
pr_debug("controller reset, restart transaction\n");
|
pr_debug("controller reset, restart transaction\n");
|
||||||
|
@ -688,8 +690,7 @@ static u32 acpi_ec_gpe_handler(acpi_handle gpe_device,
|
||||||
struct acpi_ec *ec = data;
|
struct acpi_ec *ec = data;
|
||||||
|
|
||||||
spin_lock_irqsave(&ec->lock, flags);
|
spin_lock_irqsave(&ec->lock, flags);
|
||||||
if (advance_transaction(ec))
|
advance_transaction(ec);
|
||||||
wake_up(&ec->wait);
|
|
||||||
spin_unlock_irqrestore(&ec->lock, flags);
|
spin_unlock_irqrestore(&ec->lock, flags);
|
||||||
ec_check_sci(ec, acpi_ec_read_status(ec));
|
ec_check_sci(ec, acpi_ec_read_status(ec));
|
||||||
return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
|
return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче