if (adap->phys_addr == CEC_PHYS_ADDR_INVALID)
return -EINTR;
+ /* Also bail out if the PA changed while configuring. */
+ if (adap->must_reconfigure)
+ return -EINTR;
+
if (err)
return err;
if (las->log_addr_type[0] == CEC_LOG_ADDR_TYPE_UNREGISTERED)
goto configured;
+reconfigure:
for (i = 0; i < las->num_log_addrs; i++) {
unsigned int type = las->log_addr_type[i];
const u8 *la_list;
last_la = la_list[0];
err = cec_config_log_addr(adap, i, last_la);
+
+ if (adap->must_reconfigure) {
+ adap->must_reconfigure = false;
+ las->log_addr_mask = 0;
+ goto reconfigure;
+ }
+
if (err > 0) /* Reused last LA */
continue;
las->log_addr[i] = CEC_LOG_ADDR_INVALID;
adap->is_configured = true;
adap->is_configuring = false;
+ adap->must_reconfigure = false;
cec_post_state_event(adap);
/*
las->log_addr[i] = CEC_LOG_ADDR_INVALID;
cec_adap_unconfigure(adap);
adap->is_configuring = false;
+ adap->must_reconfigure = false;
adap->kthread_config = NULL;
complete(&adap->config_completion);
mutex_unlock(&adap->lock);
adap->phys_addr = phys_addr;
cec_post_state_event(adap);
- if (adap->log_addrs.num_log_addrs)
+ if (!adap->log_addrs.num_log_addrs)
+ return;
+ if (adap->is_configuring)
+ adap->must_reconfigure = true;
+ else
cec_claim_log_addrs(adap, block);
}
* in order to transmit or receive CEC messages. This is usually a HW
* limitation.
* @is_configuring: the CEC adapter is configuring (i.e. claiming LAs)
+ * @must_reconfigure: while configuring, the PA changed, so reclaim LAs
* @is_configured: the CEC adapter is configured (i.e. has claimed LAs)
* @cec_pin_is_high: if true then the CEC pin is high. Only used with the
* CEC pin framework.
u16 phys_addr;
bool needs_hpd;
bool is_configuring;
+ bool must_reconfigure;
bool is_configured;
bool cec_pin_is_high;
bool adap_controls_phys_addr;