On 28/11/2022 14:42, quic_mmitkov@xxxxxxxxxxx wrote:
Hey Milen.
This bit here is racy.
+
+ csid->phy.need_vc_update = true;
enable_irq(csid->irq);
ret = csid->ops->reset(csid);
if (ret < 0) {
disable_irq(csid->irq);
camss_disable_clocks(csid->nclocks, csid->clock);
regulator_bulk_disable(csid->num_supplies,
csid->supplies);
pm_runtime_put_sync(dev);
return ret;
}
csid->ops->hw_version(csid);
csid->phy.need_vc_update = true;
You're updating need_vc_update - after enabling the IRQ.
Its a hypothetical bug but still not thread safe even if it has no
unintended side-effects we should initalise all of our data-structures
prior to enabling a potential path of parallel execution.
---
bod