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

Commit 6e5488c4 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Don't accidentally unvote for buses when vote_bus is called



The client occasionally calls vote_bus with load of 0, which actually is
translated to an unvote_bus.  Since this isn't likely what the client
intended, vote for the lowest bus vector.

As a side effect of the above bug, ocmem_free occasionally failed as the
driver accidentally unvoted for ocmem noc bus, which reset the ocmem core.

CRs-Fixed: 649903
Change-Id: I8504d5f660b881d757245db3b33521443bc3073e
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 718daa02
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -804,7 +804,13 @@ static int venus_hfi_vote_buses(void *dev, struct vidc_bus_vote_data *data,
			continue;
		}

		bus_vector = venus_hfi_get_bus_vector(device, bus, load);
		/* Annoying little hack here: if the bus vector is 0, it
		 * actually means "unvote".  However if the client is calling
		 * vote_bus, it's probably not very nice to unvote the buses.
		 * So pick up the lowest bandwidth table and use that instead.
		 * If client wants to unvote, it'll call venus_hfi_unvote\
		 * _buses */
		bus_vector = venus_hfi_get_bus_vector(device, bus, load) ?: 1;
		rc = msm_bus_scale_client_update_request(bus->priv, bus_vector);
		if (rc) {
			dprintk(VIDC_ERR, "Failed voting for bus %s @ %d: %d\n",