Re: [PATCH] soc: qcom: llcc: Add llcc device availability check

From: Krzysztof Kozlowski
Date: Tue Mar 12 2024 - 12:47:33 EST


On 12/03/2024 17:25, Mukesh Ojha wrote:
>>> static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER;
>>> +static DEFINE_MUTEX(dev_avail);
>>> +
>>> +static bool is_llcc_device_available(void)
>>> +{
>>> + static struct llcc_drv_data *ptr;
>>> +
>>> + mutex_lock(&dev_avail);
>>> + if (!ptr) {
>>> + struct device_node *node;
>>> +
>>> + node = of_find_node_by_name(NULL, "system-cache-controller");
>>
>> Why do you look names by name? This create undocumented ABI. >
>> NAK (also for any future uses of such of_find_node_by_name()).
>
> I agree, what if we add a common compatible string like qcom,llcc to all
> llcc supported SoCs.

I did not dig into the your problem (also commit msg does not really
help me in that), but usually relationship between device nodes is
expressed with phandles.

This also has benefits of easier (future) integration with device links
and probe ordering.

Best regards,
Krzysztof