• Lv Zheng's avatar
    ACPI / EC: Cleanup QR_EC related code · 550b3aac
    Lv Zheng authored
    The QR_EC related code pieces have redundants, this patch merges them into
    acpi_ec_query() which invokes acpi_ec_transaction() where EC mutex and the
    global lock are already held. After doing so, query handler traversal still
    need to be locked by EC mutex after invoking acpi_ec_transaction().
    
    Note that EC event handling is sequential. We fetch one event from firmware
    event queue and process it until 0x00 or error returned. So we don't need
    to hold mutex for whole acpi_ec_clear() process to determine whether we
    should continue to drain. And for the same reason, we don't need to hold
    mutex for the whole procedure from the QR_EC transaction to the query
    handler traversal.
    Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    550b3aac
ec.c 31.6 KB