Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  • Loading branch information
krzk committed May 24, 2022
1 parent 368404c commit 55cd7b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/soc/qcom/icc-bwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ static void bwmon_set_threshold(struct icc_bwmon *bwmon, unsigned int reg,
unsigned int thres;

thres = mult_frac(mbps, bwmon->sample_ms, MSEC_PER_SEC);
pr_err("AAA setting threshold: %u kbps, %u mbps, %u\n", kbps, mbps, thres);
writel_relaxed(thres, bwmon->base + reg);
}

Expand Down Expand Up @@ -203,6 +204,9 @@ static irqreturn_t bwmon_intr(int irq, void *dev_id)
max = readl(bwmon->base + BWMON_ZONE_MAX(zone)) * SZ_1K;
bwmon->target_kbps = mult_frac(max, MSEC_PER_SEC, bwmon->sample_ms);

pr_err("AAA Zone %d 0x%x | %u -> %u kBps\n", zone, status,
bwmon->current_kbps / 1024, bwmon->target_kbps / 1024);

return IRQ_WAKE_THREAD;
}

Expand Down Expand Up @@ -238,13 +242,16 @@ static irqreturn_t bwmon_intr_thread(int irq, void *dev_id)
irq_enable = BIT(BWMON_IRQ_ENABLE_ZONE1_SHIFT) |
BIT(BWMON_IRQ_ENABLE_ZONE3_SHIFT);

pr_err("AAA up %u down %u %s\n", up_kbps, down_kbps,
(bwmon->target_kbps == bwmon->current_kbps) ? "(same)" : "");
bwmon_set_threshold(bwmon, BWMON_THRESHOLD_HIGH, up_kbps);
bwmon_set_threshold(bwmon, BWMON_THRESHOLD_MED, down_kbps);
bwmon_clear(bwmon);
bwmon_enable(bwmon, irq_enable);

if (bwmon->target_kbps == bwmon->current_kbps)
if (bwmon->target_kbps == bwmon->current_kbps) {
goto out;
}

dev_pm_opp_set_opp(bwmon->dev, target_opp);
bwmon->current_kbps = bwmon->target_kbps;
Expand Down

0 comments on commit 55cd7b9

Please sign in to comment.