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

Commit e737f3b6 authored by Alok Chauhan's avatar Alok Chauhan
Browse files

msm: msm_bus: send correct value to bw division function



While calculating bw for existing client request
sometimes it can go to negative if client unregisters
or send request with lesser ab/ib values. Bus driver
will divide bandwidth if interleaving enabled.

Added a macro wrapper to handle negative bw values
since the division utility function can't handle
negative values

CRs-Fixed: 521940
Change-Id: Ic3a216b8efb535593fe02ad3228d71808d2e0f98
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent e6edf782
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@
	(((slv >= MSM_BUS_SLAVE_FIRST) && (slv <= MSM_BUS_SLAVE_LAST)) ? 1 : 0)

#define INTERLEAVED_BW(fab_pdata, bw, ports) \
	((fab_pdata->il_flag) ? msm_bus_div64((ports), (bw)) : (bw))
	((fab_pdata->il_flag) ? ((bw < 0) \
	? -msm_bus_div64((ports), (-bw)) : msm_bus_div64((ports), (bw))) : (bw))
#define INTERLEAVED_VAL(fab_pdata, n) \
	((fab_pdata->il_flag) ? (n) : 1)