[PATCH v5 09/11] clk: qcom: gdsc: Use PM clocks to control gdsc clocks

Rajendra Nayak rnayak at codeaurora.org
Mon May 11 20:02:12 PDT 2015


[]
>>
>> +static int gdsc_attach(struct generic_pm_domain *domain, struct device *dev)
>> +{
>> +	int ret;
>> +	struct gdsc *sc = domain_to_gdsc(domain);
>> +	char **con_id;
>> +
>> +	if (!sc->con_ids[0])
>> +		return 0;
>
> Did you test this on your side? It panic kernel badly cause the flexible
> array is not initialised.
>
> Could you revisit the above check. Or you could add below initialisation
> for every gdsc structure in gcc-xxx.c files.

Hey, that does seem like a problem. Not sure how I did not end up
seeing it. I'll fix it up, thanks.

>
> static struct gdsc venus_gdsc = {
> 	.gdscr = 0x4c018,
> 	.pd = {
> 		.name = "venus",
> 	},
> 	.con_ids = { NULL },
> };
>
>
>> +
>> +	ret = pm_clk_create(dev);
>> +	if (ret) {
>> +		dev_err(dev, "pm_clk_create failed %d\n", ret);
>> +		return ret;
>> +	}
>> +
>> +	for (con_id = sc->con_ids; *con_id; con_id++) {
>> +		ret = pm_clk_add(dev, *con_id);
>> +		if (ret) {
>> +			dev_err(dev, "pm_clk_add failed %d\n", ret);
>> +			goto fail;
>> +		}
>> +	}
>> +	return 0;
>> +fail:
>> +	pm_clk_destroy(dev);
>> +	return ret;
>> +};
>> +
>
> <snip>
>
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation



More information about the linux-arm-kernel mailing list