Re: [PATCH v2 5/6] soc: qcom: rpmh powerdomain driver

From: Rajendra Nayak
Date: Fri Jun 01 2018 - 04:49:01 EST


Hi David,

On 05/26/2018 06:38 AM, David Collins wrote:
>
>> + [1] = &sdm845_mx,
>> + [2] = &sdm845_mx_ao,
>> + [3] = &sdm845_cx,
>> + [4] = &sdm845_cx_ao,
>> + [5] = &sdm845_lmx,
>> + [6] = &sdm845_lcx,
>> + [7] = &sdm845_gfx,
>> + [8] = &sdm845_mss,
>> +};
>> +
>> +static const struct rpmhpd_desc sdm845_desc = {
>> + .rpmhpds = sdm845_rpmhpds,
>> + .num_pds = ARRAY_SIZE(sdm845_rpmhpds),
>> +};
>> +
>> +static const struct of_device_id rpmhpd_match_table[] = {
>> + { .compatible = "qcom,sdm845-rpmhpd", .data = &sdm845_desc },
>> + { }
>> +};
>> +MODULE_DEVICE_TABLE(of, rpmhpd_match_table);
>> +
>> +static int rpmhpd_send_corner(struct rpmhpd *pd, int state, unsigned int corner)
>> +{
>> + struct tcs_cmd cmd = {
>> + .addr = pd->addr,
>> + .data = corner,
>> + };
>> +
>> + return rpmh_write(pd->dev, state, &cmd, 1);
> This can be optimized by calling rpmh_write_async() whenever the corner
> being sent is smaller than the last value sent. That way, no time is
> wasted waiting for an ACK when decreasing voltage. Would you mind adding
> the necessary check and previous request caching for this?

is it safe to assume all sleep votes can be sent as async always? and only
active votes could be sync/async depending on the last value sent?

regards,
Rajendra

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