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

Commit 78a0913b authored by Jeff Hugo's avatar Jeff Hugo
Browse files

msm: smem: Ensure the remote spinlock can be fully initialized



The remote spinlock framework may use a software based implementation which
stores the actual lock in shared memory.  This requires the SMEM driver
to be able to find SMEM items that are allocated by the bootloader.  The
SMEM driver requires information from Device Tree before being able to find
SMEM items.

Move the call to init the remote spinlock so that the dependencies for a
software based remote spinlock are met.

Change-Id: Iad1da35f4ebe42d3b72a3da38e430b706691f08f
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 0dcf4ed8
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -1190,6 +1190,18 @@ static int msm_smem_probe(struct platform_device *pdev)
	if (!smem_initialized_check())
		return -ENODEV;

	/*
	 * The software implementation requires smem_find(), which needs
	 * smem_ram_base to be intitialized.  The remote spinlock item is
	 * guarenteed to be allocated by the bootloader, so this is the
	 * safest and earliest place to init the spinlock.
	 */
	ret = init_smem_remote_spinlock();
	if (ret) {
		LOG_ERR("%s: remote spinlock init failed %d\n", __func__, ret);
		return ret;
	}

	key = "irq-reg-base";
	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, key);
	if (!r) {
@@ -1353,12 +1365,6 @@ int __init msm_smem_init(void)
		msm_smem_debug_mask = 0;
	}

	rc = init_smem_remote_spinlock();
	if (rc) {
		LOG_ERR("%s: remote spinlock init failed %d\n", __func__, rc);
		return rc;
	}

	rc = platform_driver_register(&msm_smem_driver);
	if (rc) {
		LOG_ERR("%s: msm_smem_driver register failed %d\n",