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

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

Merge "msm: mhi_dev: update NHWER after M0 from host"

parents 5186e6e8 e6a0d89d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2364,6 +2364,10 @@ static int mhi_dev_cache_host_cfg(struct mhi_dev *mhi)
		return rc;
	}

	mhi_log(MHI_MSG_VERBOSE,
		"Number of Event rings : %d, HW Event rings : %d\n",
			mhi->cfg.event_rings, mhi->cfg.hw_event_rings);

	mhi->cmd_ctx_shadow.size = sizeof(struct mhi_dev_cmd_ctx);
	mhi->ev_ctx_shadow.size = sizeof(struct mhi_dev_ev_ctx) *
					mhi->cfg.event_rings;
+11 −3
Original line number Diff line number Diff line
@@ -709,13 +709,21 @@ EXPORT_SYMBOL(mhi_dev_mmio_init);

int mhi_dev_update_ner(struct mhi_dev *dev)
{
	int rc = 0, mhi_cfg = 0;

	if (WARN_ON(!dev))
		return -EINVAL;

	mhi_dev_mmio_masked_read(dev, MHICFG, MHICFG_NER_MASK,
				  MHICFG_NER_SHIFT, &dev->cfg.event_rings);
	rc = mhi_dev_mmio_read(dev, MHICFG, &mhi_cfg);
	if (rc)
		return rc;

	pr_debug("MHICFG: 0x%x", mhi_cfg);

	pr_debug("NER in HW :%d\n", dev->cfg.event_rings);
	dev->cfg.event_rings =
		(mhi_cfg & MHICFG_NER_MASK) >> MHICFG_NER_SHIFT;
	dev->cfg.hw_event_rings =
		(mhi_cfg & MHICFG_NHWER_MASK) >> MHICFG_NHWER_SHIFT;

	return 0;
}