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

Commit 8835c0c2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "slim-msm-ngd: Depend on PIL driver notification instead of qmi"

parents ef490783 d4ed06de
Loading
Loading
Loading
Loading
+22 −9
Original line number Diff line number Diff line
@@ -167,17 +167,10 @@ static int ngd_slim_qmi_new_server(struct qmi_handle *hdl,
		container_of(qmi, struct msm_slim_ctrl, qmi);

	SLIM_INFO(dev, "Slimbus QMI new server event received\n");
	/* Hold wake lock until notify slaves thread is done */
	pm_stay_awake(dev->dev);
	qmi->svc_info.sq_family = AF_QIPCRTR;
	qmi->svc_info.sq_node = service->node;
	qmi->svc_info.sq_port = service->port;
	if (dev->lpass_mem_usage) {
		dev->lpass_mem->start = dev->lpass_phy_base;
		dev->lpass.base = dev->lpass_virt_base;
	}
	atomic_set(&dev->ssr_in_progress, 0);
	schedule_work(&dev->dsp.dom_up);
	complete(&dev->qmi_up);

	return 0;
}
@@ -187,7 +180,10 @@ static void ngd_slim_qmi_del_server(struct qmi_handle *hdl,
{
	struct msm_slim_qmi *qmi =
		container_of(hdl, struct msm_slim_qmi, svc_event_hdl);
	struct msm_slim_ctrl *dev =
		container_of(qmi, struct msm_slim_ctrl, qmi);

	reinit_completion(&dev->qmi_up);
	qmi->svc_info.sq_node = 0;
	qmi->svc_info.sq_port = 0;
}
@@ -275,6 +271,18 @@ static int dsp_domr_notify_cb(struct notifier_block *n, unsigned long code,
		ngd_dom_down(dev);
		mutex_unlock(&dev->tx_lock);
		break;
	case SUBSYS_AFTER_POWERUP:
	case SERVREG_NOTIF_SERVICE_STATE_UP_V01:
		SLIM_INFO(dev, "SLIM DSP SSR notify cb:%lu\n", code);
		/* Hold wake lock until notify slaves thread is done */
		pm_stay_awake(dev->dev);
		if (dev->lpass_mem_usage) {
			dev->lpass_mem->start = dev->lpass_phy_base;
			dev->lpass.base = dev->lpass_virt_base;
		}
		atomic_set(&dev->ssr_in_progress, 0);
		schedule_work(&dev->dsp.dom_up);
		break;
	case LOCATOR_UP:
		reg = _cmd;
		if (!reg || reg->total_domains != 1) {
@@ -1627,6 +1635,7 @@ static int ngd_notify_slaves(void *data)
		pm_relax(dev->dev);
		return ret;
	}
	ngd_dom_init(dev);

	while (!kthread_should_stop()) {
		wait_for_completion_interruptible(&dev->qmi.slave_notify);
@@ -1642,7 +1651,6 @@ static int ngd_notify_slaves(void *data)
			 * controller is up
			 */
			slim_ctrl_add_boarddevs(&dev->ctrl);
			ngd_dom_init(dev);
		} else {
			slim_framer_booted(ctrl);
		}
@@ -1689,6 +1697,10 @@ static void ngd_dom_up(struct work_struct *work)
		container_of(work, struct msm_slim_ss, dom_up);
	struct msm_slim_ctrl *dev =
		container_of(dsp, struct msm_slim_ctrl, dsp);

	/* Make sure qmi service is up before continuing */
	wait_for_completion_interruptible(&dev->qmi_up);

	mutex_lock(&dev->ssr_lock);
	ngd_slim_enable(dev, true);
	mutex_unlock(&dev->ssr_lock);
@@ -1960,6 +1972,7 @@ static int ngd_slim_probe(struct platform_device *pdev)

	init_completion(&dev->reconf);
	init_completion(&dev->ctrl_up);
	init_completion(&dev->qmi_up);
	mutex_init(&dev->tx_lock);
	mutex_init(&dev->ssr_lock);
	spin_lock_init(&dev->tx_buf_lock);
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */

#ifndef _SLIM_MSM_H
@@ -324,6 +324,7 @@ struct msm_slim_ctrl {
	u32			current_rx_buf[10];
	int			current_count;
	atomic_t		ssr_in_progress;
	struct completion	qmi_up;
};

struct msm_sat_chan {