Re: [PATCH v5 1/4] media: camss: sm8250: Virtual channels for CSID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux