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

Commit 194b0bdb authored by Jagadeesh Ponduru's avatar Jagadeesh Ponduru
Browse files

msm: ipa3: code changes to fix kernel panic error



This Issue is seen by Enabling CONFIG_DEBUG_ATOMIC_SLEEP=y and boot the 
device.To avoid going into kernel panic state,changed the function
calls order of spin_lock() and idr_preload() after calling 
kmem_cache_zalloc().Originally, these two functions were called 
before calling kmem_cache_zalloc().

Change-Id: I2738548abd4148828e7d9436415c5c4d769680b9
Signed-off-by: default avatarJagadeesh Ponduru <jponduru@codeaurora.org>
parent 56b50e97
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -7120,16 +7120,13 @@ int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *header)
{
	int i, unused_cnt, unused_max, unused_start_id;
	struct ipa_ioc_flt_rt_counter_alloc *counter;

	idr_preload(GFP_KERNEL);
	spin_lock(&ipa3_ctx->flt_rt_counters.hdl_lock);

	counter = kmem_cache_zalloc(ipa3_ctx->fnr_stats_cache, GFP_KERNEL);
	if (!counter) {
		IPAERR_RL("failed to alloc fnr stats counter object\n");
		spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock);
		return -ENOMEM;
	}
	idr_preload(GFP_KERNEL);
	spin_lock(&ipa3_ctx->flt_rt_counters.hdl_lock);
	memcpy(counter, header, sizeof(struct ipa_ioc_flt_rt_counter_alloc));
	/* allocate hw counters */
	counter->hw_counter.start_id = 0;