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

Commit d2645d62 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Move gmu_fault from snapshot structure



Add gmu_fault member to kgsl device structure and remove it
from snapshot, a6xx gmu and rgmu structures. This helps in
removing snapshot function from the gmu core ops in the next
patch.

Change-Id: I5f2aba879ebf0330ef2c73d1d2fa4a2032bb6c9b
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 97a10b91
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -1670,8 +1670,6 @@ static void a6xx_gmu_suspend(struct adreno_device *adreno_dev)
		regulator_set_mode(gmu->cx_gdsc, REGULATOR_MODE_NORMAL);

	dev_err(&gmu->pdev->dev, "Suspended GMU\n");

	gmu->fault = false;
}

static int a6xx_gmu_dcvs_set(struct adreno_device *adreno_dev,
@@ -1936,7 +1934,7 @@ void a6xx_gmu_snapshot(struct kgsl_device *device)
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);

	/* Abstain from sending another nmi or over-writing snapshot */
	if (gmu->fault)
	if (device->gmu_fault)
		return;

	/* make sure we're reading the latest cm3_fault */
@@ -1961,7 +1959,7 @@ void a6xx_gmu_snapshot(struct kgsl_device *device)
	gmu_core_regwrite(device, A6XX_GMU_GMU2HOST_INTR_MASK,
		HFI_IRQ_MASK);

	gmu->fault = true;
	device->gmu_fault = true;

}

@@ -2108,12 +2106,12 @@ static int a6xx_gmu_first_boot(struct adreno_device *adreno_dev)

	icc_set_bw(pwr->icc_path, 0, 0);

	gmu->fault = false;
	device->gmu_fault = false;

	return 0;

err:
	if (gmu->fault) {
	if (device->gmu_fault) {
		a6xx_gmu_suspend(adreno_dev);
		return ret;
	}
@@ -2181,12 +2179,12 @@ static int a6xx_gmu_boot(struct adreno_device *adreno_dev)
	if (ret)
		goto err;

	gmu->fault = false;
	device->gmu_fault = false;

	return 0;

err:
	if (gmu->fault) {
	if (device->gmu_fault) {
		a6xx_gmu_suspend(adreno_dev);
		return ret;
	}
@@ -2669,9 +2667,10 @@ static int halt_gbif(struct adreno_device *adreno_dev)
static int a6xx_gmu_power_off(struct adreno_device *adreno_dev)
{
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	int ret = 0;

	if (gmu->fault)
	if (device->gmu_fault)
		goto error;

	/* Wait for the lowest idle level we requested */
+0 −2
Original line number Diff line number Diff line
@@ -201,8 +201,6 @@ struct a6xx_gmu_device {
	void *itcm_shadow;
	/** @flags: Internal gmu flags */
	unsigned long flags;
	/** @fault: To track if we hit a gmu fault */
	bool fault;
};

/* Helper function to get to a6xx gmu device from adreno device */
+4 −6
Original line number Diff line number Diff line
@@ -515,7 +515,7 @@ static void a6xx_rgmu_snapshot(struct kgsl_device *device)
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct a6xx_rgmu_device *rgmu = to_a6xx_rgmu(adreno_dev);

	if (rgmu->fault)
	if (device->gmu_fault)
		return;

	/* Mask so there's no interrupt caused by NMI */
@@ -538,7 +538,7 @@ static void a6xx_rgmu_snapshot(struct kgsl_device *device)

	rgmu->fault_count++;

	rgmu->fault = true;
	device->gmu_fault = true;
}

static void a6xx_rgmu_suspend(struct adreno_device *adreno_dev)
@@ -687,13 +687,12 @@ static void halt_gbif_arb(struct adreno_device *adreno_dev)
/* Caller shall ensure GPU is ready for SLUMBER */
static void a6xx_rgmu_power_off(struct adreno_device *adreno_dev)
{
	struct a6xx_rgmu_device *rgmu = to_a6xx_rgmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	int ret;

	kgsl_pwrctrl_axi(device, KGSL_PWRFLAGS_OFF);

	if (rgmu->fault)
	if (device->gmu_fault)
		return a6xx_rgmu_suspend(adreno_dev);

	/* Wait for the lowest idle level we requested */
@@ -795,7 +794,6 @@ static int a6xx_gpu_boot(struct adreno_device *adreno_dev)

static int a6xx_rgmu_boot(struct adreno_device *adreno_dev)
{
	struct a6xx_rgmu_device *rgmu = to_a6xx_rgmu(adreno_dev);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	int ret;

@@ -824,7 +822,7 @@ static int a6xx_rgmu_boot(struct adreno_device *adreno_dev)
	if (ret)
		goto err;

	rgmu->fault = false;
	device->gmu_fault = false;

	return 0;

+0 −2
Original line number Diff line number Diff line
@@ -56,8 +56,6 @@ struct a6xx_rgmu_device {
	struct clk *rgmu_clk;
	unsigned int idle_level;
	unsigned int fault_count;
	/** @fault: to track whether we encountered a rgmu fault */
	bool fault;
	/** @flags: rgmu internal flags */
	unsigned long flags;
};
+2 −2
Original line number Diff line number Diff line
@@ -320,6 +320,8 @@ struct kgsl_device {
	rwlock_t event_groups_lock;
	/** @speed_bin: Speed bin for the GPU device if applicable */
	u32 speed_bin;
	/** @gmu_fault: Set when a gmu or rgmu fault is encountered */
	bool gmu_fault;
};

#define KGSL_MMU_DEVICE(_mmu) \
@@ -485,7 +487,6 @@ struct kgsl_device_private {
 * @process: the process that caused the hang, if known.
 * @sysfs_read: Count of current reads via sysfs
 * @first_read: True until the snapshot read is started
 * @gmu_fault: Snapshot collected when GMU fault happened
 * @recovered: True if GPU was recovered after previous snapshot
 */
struct kgsl_snapshot {
@@ -509,7 +510,6 @@ struct kgsl_snapshot {
	struct kgsl_process_private *process;
	unsigned int sysfs_read;
	bool first_read;
	bool gmu_fault;
	bool recovered;
	struct kgsl_device *device;
};
Loading