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

Commit 211a4610 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa3: workaround for HW limitation suspend IRQ not generated"

parents 5ef36a5b 8492131e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -2288,6 +2288,23 @@ int ipa_remove_interrupt_handler(enum ipa_irq_type interrupt)
}
EXPORT_SYMBOL(ipa_remove_interrupt_handler);

/**
* ipa_restore_suspend_handler() - restores the original suspend IRQ handler
* as it was registered in the IPA init sequence.
* Return codes:
* 0: success
* -EPERM: failed to remove current handler or failed to add original handler
* */
int ipa_restore_suspend_handler(void)
{
	int ret;

	IPA_API_DISPATCH_RETURN(ipa_restore_suspend_handler);

	return ret;
}
EXPORT_SYMBOL(ipa_restore_suspend_handler);

/**
 * ipa_bam_reg_dump() - Dump selected BAM registers for IPA and DMA-BAM
 *
+2 −0
Original line number Diff line number Diff line
@@ -282,6 +282,8 @@ struct ipa_api_controller {

	int (*ipa_remove_interrupt_handler)(enum ipa_irq_type interrupt);

	int (*ipa_restore_suspend_handler)(void);

	void (*ipa_bam_reg_dump)(void);

	int (*ipa_get_ep_mapping)(enum ipa_client_type client);
+27 −0
Original line number Diff line number Diff line
@@ -3042,6 +3042,33 @@ void ipa_suspend_handler(enum ipa_irq_type interrupt,
	}
}

/**
* ipa2_restore_suspend_handler() - restores the original suspend IRQ handler
* as it was registered in the IPA init sequence.
* Return codes:
* 0: success
* -EPERM: failed to remove current handler or failed to add original handler
* */
int ipa2_restore_suspend_handler(void)
{
	int result = 0;

	result  = ipa2_remove_interrupt_handler(IPA_TX_SUSPEND_IRQ);
	if (result) {
		IPAERR("remove handler for suspend interrupt failed\n");
		return -EPERM;
	}

	result = ipa2_add_interrupt_handler(IPA_TX_SUSPEND_IRQ,
			ipa_suspend_handler, true, NULL);
	if (result) {
		IPAERR("register handler for suspend interrupt failed\n");
		result = -EPERM;
	}

	return result;
}

static int apps_cons_release_resource(void)
{
	return 0;
+1 −0
Original line number Diff line number Diff line
@@ -1975,4 +1975,5 @@ void ipa_suspend_apps_pipes(bool suspend);
void ipa_update_repl_threshold(enum ipa_client_type ipa_client);
void ipa_flow_control(enum ipa_client_type ipa_client, bool enable,
			uint32_t qmap_id);
int ipa2_restore_suspend_handler(void);
#endif /* _IPA_I_H_ */
+1 −0
Original line number Diff line number Diff line
@@ -278,6 +278,7 @@ int ipa2_remove_interrupt_handler(enum ipa_irq_type interrupt)
		return -EFAULT;
	}

	kfree(ipa_interrupt_to_cb[irq_num].private_data);
	ipa_interrupt_to_cb[irq_num].deferred_flag = false;
	ipa_interrupt_to_cb[irq_num].handler = NULL;
	ipa_interrupt_to_cb[irq_num].private_data = NULL;
Loading