Hi Konrad,
On 5/18/22 19:47, Konrad Dybcio wrote:
On 18/05/2022 12:35, Vladimir Zapolskiy wrote:
Access to I/O of SM8250 camera clock controller IP depends on enabled
GCC_CAMERA_AHB_CLK clock supplied by global clock controller, the
latter
one is inited on subsys level, so, to satisfy the dependency, it would
make sense to deprive the init level of camcc-sm8250 driver.
Hi,
I believe this is due to the fact that this clock is falsely advertised
by the header and Linux does not know anything about it, because it is
handled by a magic write [1] (as I once said in a similar case, this was
going bite eventually..) instead and the index corresponding to the
define symbol is not initialized, hence it points to NULL. Adding the
your observation is correct in my opinion, however it does not change the
identified root cause of the problem, and my rationale remains the same,
the camera clock controller should be initialized after the GCC, thus
this change, and currently the critical fix, remains valid.
clock properly in GCC would let the OF clock stuff handle it gracefully.
If/when the clock is properly added in the GCC, then it will open an
option to clk_prepare_enable() it in the CAMCC driver, so at least it's
a point to keep it described in a dts as it's done right from the
beginning,
especially because the platform dtsi describes the hardware properly.
To add a real CCF clock would be my preference, but, as I've said above,
even if it happens, it does not belittle the presented change.
If that is the case, your patch disabling the clock controller block
(which I'm against unless there's abosolute need, as having the hw block
initialized properly should be possible regardless of the board, as it's
a generic SoC components) should not be necessary.
Here I do oppose, I believe board dts files should explicitly describe
enabled IPs in accordance to actual board peripherals. For instance it's
unclear why CAMCC or e.g. CAMSS should be enabled by default on a board
without camera sensors at all. I understand that there is an option to
explicitly disable some particular device tree nodes in board files, but
it is against common practicalities.
Also above I do neglect the fact that the GCC clock is always enabled,
irrelatively of its actual usage by probably disabled CAMCC.