Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0dfbcd1 authored by Hanumath Prasad's avatar Hanumath Prasad Committed by Amir Vajid
Browse files

PM / devfreq: bimc-bwmon: set a floor_mbps for irq threshold



Interrupt storm happens when bwmon is enabled for GPU. This is mainly
due to constant low traffic observed with GPU while doing memory
read/write. So as the data rates read from counters are low and so the
threshold set for triggering the interrupt also set as low, which in
turn causes huge number of interrupts. Avoid this by setting a minimum
floor for the irq threshold.

Change-Id: I190fad5108bc24afcb67bec5809485380ee3662e
Signed-off-by: default avatarHanumath Prasad <hpprasad@codeaurora.org>
parent 7123adfc
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -32,6 +32,13 @@
#define MON_MASK(m)		((m)->base + 0x298)
#define MON_MATCH(m)		((m)->base + 0x29C)

/*
 * Don't set the threshold lower than this value. This helps avoid
 * threshold IRQs when the traffic is close to zero and even small
 * changes can exceed the threshold percentage.
 */
#define FLOOR_MBPS	100UL

struct bwmon_spec {
	bool wrap_on_thres;
	bool overflow;
@@ -195,7 +202,7 @@ static unsigned long meas_bw_and_set_irq(struct bw_hwmon *hw,
	 * multiple times before the IRQ is processed.
	 */
	if (likely(!m->spec->wrap_on_thres))
		limit = mbps_to_bytes(mbps, sample_ms, tol);
		limit = mbps_to_bytes(max(mbps, FLOOR_MBPS), sample_ms, tol);
	else
		limit = mbps_to_bytes(max(mbps, 400UL), sample_ms, tol);