Revert "media: cec: core: avoid recursive cec_claim_log_addrs"

This reverts commit 302077d270 which is
commit 47c82aac10a6954d68f29f10d9758d016e8e5af1 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: I8c6b68d3db780285be19b84004758f46be37048b
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-08-12 13:28:20 +00:00
parent dcb51feb27
commit d201efdaa4
3 changed files with 2 additions and 7 deletions

View File

@@ -1557,12 +1557,9 @@ unconfigure:
*/ */
static void cec_claim_log_addrs(struct cec_adapter *adap, bool block) static void cec_claim_log_addrs(struct cec_adapter *adap, bool block)
{ {
if (WARN_ON(adap->is_claiming_log_addrs || if (WARN_ON(adap->is_configuring || adap->is_configured))
adap->is_configuring || adap->is_configured))
return; return;
adap->is_claiming_log_addrs = true;
init_completion(&adap->config_completion); init_completion(&adap->config_completion);
/* Ready to kick off the thread */ /* Ready to kick off the thread */
@@ -1577,7 +1574,6 @@ static void cec_claim_log_addrs(struct cec_adapter *adap, bool block)
wait_for_completion(&adap->config_completion); wait_for_completion(&adap->config_completion);
mutex_lock(&adap->lock); mutex_lock(&adap->lock);
} }
adap->is_claiming_log_addrs = false;
} }
/* /*

View File

@@ -178,7 +178,7 @@ static long cec_adap_s_log_addrs(struct cec_adapter *adap, struct cec_fh *fh,
CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU | CEC_LOG_ADDRS_FL_ALLOW_RC_PASSTHRU |
CEC_LOG_ADDRS_FL_CDC_ONLY; CEC_LOG_ADDRS_FL_CDC_ONLY;
mutex_lock(&adap->lock); mutex_lock(&adap->lock);
if (!adap->is_claiming_log_addrs && !adap->is_configuring && if (!adap->is_configuring &&
(!log_addrs.num_log_addrs || !adap->is_configured) && (!log_addrs.num_log_addrs || !adap->is_configured) &&
!cec_is_busy(adap, fh)) { !cec_is_busy(adap, fh)) {
err = __cec_s_log_addrs(adap, &log_addrs, block); err = __cec_s_log_addrs(adap, &log_addrs, block);

View File

@@ -244,7 +244,6 @@ struct cec_adapter {
u16 phys_addr; u16 phys_addr;
bool needs_hpd; bool needs_hpd;
bool is_enabled; bool is_enabled;
bool is_claiming_log_addrs;
bool is_configuring; bool is_configuring;
bool must_reconfigure; bool must_reconfigure;
bool is_configured; bool is_configured;