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

Commit 1b6b3732 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Make kgsl_pwrctrl_axi return a value



On gmu targets, we may fail the boot bandwidth hfi, so
return the error all the way up.

Change-Id: I059fb18090ae6cb33af3c0b53f2a8fd5875b7e52
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent d7784ea6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -747,7 +747,7 @@ int a6xx_hfi_start(struct adreno_device *adreno_dev)
		goto err;

	/* Request default BW vote */
	kgsl_pwrctrl_axi(device, KGSL_PWRFLAGS_ON);
	result = kgsl_pwrctrl_axi(device, KGSL_PWRFLAGS_ON);

err:
	if (result)
+3 −1
Original line number Diff line number Diff line
@@ -815,7 +815,9 @@ static int a6xx_rgmu_boot(struct adreno_device *adreno_dev)
	if (ret)
		goto err;

	kgsl_pwrctrl_axi(device, KGSL_PWRFLAGS_ON);
	ret = kgsl_pwrctrl_axi(device, KGSL_PWRFLAGS_ON);
	if (ret)
		goto err;

	rgmu->fault = false;

+3 −3
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ static u32 _ab_buslevel_update(struct kgsl_pwrctrl *pwr,
}


void kgsl_bus_update(struct kgsl_device *device, bool on)
int kgsl_bus_update(struct kgsl_device *device, bool on)
{
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	/* FIXME: this might be wrong? */
@@ -41,7 +41,7 @@ void kgsl_bus_update(struct kgsl_device *device, bool on)

	/* the bus should be ON to update the active frequency */
	if (on && !(test_bit(KGSL_PWRFLAGS_AXI_ON, &pwr->power_flags)))
		return;
		return 0;
	/*
	 * If the bus should remain on calculate our request and submit it,
	 * otherwise request bus level 0, off.
@@ -60,7 +60,7 @@ void kgsl_bus_update(struct kgsl_device *device, bool on)
	/* buslevel is the IB vote, update the AB */
	ab = _ab_buslevel_update(pwr, pwr->ddr_table[buslevel]);

	device->ftbl->gpu_bus_set(device, buslevel, ab);
	return device->ftbl->gpu_bus_set(device, buslevel, ab);
}

static void validate_pwrlevels(struct kgsl_device *device, u32 *ibs,
+2 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 */

#ifndef _KGSL_BUS_H
@@ -11,7 +11,7 @@ struct platform_device;

int kgsl_bus_init(struct kgsl_device *device, struct platform_device *pdev);
void kgsl_bus_close(struct kgsl_device *device);
void kgsl_bus_update(struct kgsl_device *device, bool on);
int kgsl_bus_update(struct kgsl_device *device, bool on);

u32 *kgsl_bus_get_table(struct platform_device *pdev,
		const char *name, int *count);
+6 −4
Original line number Diff line number Diff line
@@ -1248,26 +1248,28 @@ static void kgsl_pwrctrl_clk(struct kgsl_device *device, int state,
	}
}

void kgsl_pwrctrl_axi(struct kgsl_device *device, int state)
int kgsl_pwrctrl_axi(struct kgsl_device *device, int state)
{
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;

	if (test_bit(KGSL_PWRFLAGS_AXI_ON, &pwr->ctrl_flags))
		return;
		return 0;

	if (state == KGSL_PWRFLAGS_OFF) {
		if (test_and_clear_bit(KGSL_PWRFLAGS_AXI_ON,
			&pwr->power_flags)) {
			trace_kgsl_bus(device, state);
			kgsl_bus_update(device, false);
			return kgsl_bus_update(device, false);
		}
	} else if (state == KGSL_PWRFLAGS_ON) {
		if (!test_and_set_bit(KGSL_PWRFLAGS_AXI_ON,
			&pwr->power_flags)) {
			trace_kgsl_bus(device, state);
			kgsl_bus_update(device, true);
			return kgsl_bus_update(device, true);
		}
	}

	return 0;
}

static int enable_regulator(struct device *dev, struct regulator *regulator,
Loading