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

Commit 3e55b4f4 authored by Ghanim Fodi's avatar Ghanim Fodi Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: Notify RPMH on IPA PC from centralized place



Notify need to be done when IPA uC is loaded,
so wait until uC loaded IRQ is received.

Change-Id: I7d62a70c99ed41f924a4ebb15ebb6351b7de5c51
Signed-off-by: default avatarGhanim Fodi <gfodi@codeaurora.org>
parent 5af8d318
Loading
Loading
Loading
Loading
+16 −17
Original line number Diff line number Diff line
@@ -8092,20 +8092,22 @@ void ipa_pc_qmp_enable(void)
	char buf[MAX_LEN] = "{class: bcm, res: ipa_pc, val: 1}";
	struct qmp_pkt pkt;
	int ret = 0;
	struct ipa3_pc_mbox_data *mbox_data = &ipa3_ctx->pc_mbox;

	IPADBG("Enter\n");

	/* prepare the mailbox struct */
	ipa3_ctx->mbox_client.dev = &ipa3_ctx->master_pdev->dev;
	ipa3_ctx->mbox_client.tx_block = true;
	ipa3_ctx->mbox_client.tx_tout = MBOX_TOUT_MS;
	ipa3_ctx->mbox_client.knows_txdone = false;

	ipa3_ctx->mbox = mbox_request_channel(&ipa3_ctx->mbox_client, 0);
	if (IS_ERR(ipa3_ctx->mbox)) {
		ret = PTR_ERR(ipa3_ctx->mbox);
	mbox_data->mbox_client.dev = &ipa3_ctx->master_pdev->dev;
	mbox_data->mbox_client.tx_block = true;
	mbox_data->mbox_client.tx_tout = MBOX_TOUT_MS;
	mbox_data->mbox_client.knows_txdone = false;

	mbox_data->mbox = mbox_request_channel(&mbox_data->mbox_client, 0);
	if (IS_ERR(mbox_data->mbox)) {
		ret = PTR_ERR(mbox_data->mbox);
		if (ret != -EPROBE_DEFER)
			IPAERR("mailbox channel request failed, ret=%d\n", ret);

		ipa3_ctx->mbox = NULL;
		return;
	}

@@ -8114,16 +8116,13 @@ void ipa_pc_qmp_enable(void)
	pkt.data = buf;

	/* send the QMP packet to AOP */
	ret = mbox_send_message(ipa3_ctx->mbox, &pkt);
	if (ret < 0) {
	ret = mbox_send_message(mbox_data->mbox, &pkt);
	if (ret < 0)
		IPAERR("qmp message send failed, ret=%d\n", ret);
		goto cleanup;
	}

cleanup:
	if (ipa3_ctx->mbox) {
		mbox_free_channel(ipa3_ctx->mbox);
		ipa3_ctx->mbox = NULL;
	if (mbox_data->mbox) {
		mbox_free_channel(mbox_data->mbox);
		mbox_data->mbox = NULL;
	}
}

+6 −2
Original line number Diff line number Diff line
@@ -1585,6 +1585,11 @@ struct ipa3_char_device_context {
	struct cdev cdev;
};

struct ipa3_pc_mbox_data {
	struct mbox_client mbox_client;
	struct mbox_chan *mbox;
};

/**
 * struct ipa3_context - IPA context
 * @cdev: cdev context
@@ -1828,8 +1833,7 @@ struct ipa3_context {
	u32 sd_state;
	void __iomem *reg_collection_base;
	struct ipa3_wdi2_ctx wdi2_ctx;
	struct mbox_client mbox_client;
	struct mbox_chan *mbox;
	struct ipa3_pc_mbox_data pc_mbox;
	atomic_t ipa_clk_vote;
	int gsi_chk_intset_value;
	int uc_mailbox17_chk;
+1 −4
Original line number Diff line number Diff line
@@ -503,10 +503,7 @@ static void ipa3_uc_response_hdlr(enum ipa_irq_type interrupt,
		 * To enable ipa power collapse we need to enable rpmh and uc
		 * handshake So that uc can do register retention. To enable
		 * this handshake we need to send the below message to rpmh.
		 * For APQ only target, we do it here once uC loading is
		 * completed.
		 */
		if (ipa3_ctx->platform_type == IPA_PLAT_TYPE_APQ)
		ipa_pc_qmp_enable();

		for (i = 0; i < IPA_HW_NUM_FEATURES; i++) {
+0 −7
Original line number Diff line number Diff line
@@ -3921,13 +3921,6 @@ void ipa3_q6_handshake_complete(bool ssr_bootup)
		 * SSR recovery
		 */
		rmnet_ipa_get_network_stats_and_update();
	} else {
		/*
		 * To enable ipa power collapse we need to enable rpmh and uc
		 * handshake So that uc can do register retention. To enable
		 * this handshake we need to send the below message to rpmh
		 */
		ipa_pc_qmp_enable();
	}

	imp_handle_modem_ready();