Re: [RESEND PATCH v4 5/7] remoteproc: qcom: Modify reset sequence for hexagon to support v56 1.5.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 12/13/2016 11:39 PM, Bjorn Andersson wrote:
On Mon 12 Dec 04:45 PST 2016, Dwivedi, Avaneesh Kumar (avani) wrote:
On 12/9/2016 10:05 AM, Bjorn Andersson wrote:
On Thu 24 Nov 02:00 PST 2016, Avaneesh Kumar Dwivedi wrote:
[..]
+
+		/* Turn on L1, L2, ETB and JU memories 1 at a time */
+		val = readl_relaxed(qproc->reg_base + QDSP6SS_MEM_PWR_CTL);
+		for (i = 19; i >= 0; i--) {
+			val |= BIT(i);
+			writel_relaxed(val, qproc->reg_base +
+						QDSP6SS_MEM_PWR_CTL);
+			/*
+			 * Wait for 1us for both memory peripheral and
+			 * data array to turn on.
+			 */
+			 mb();
mb() ensures that your writes are ordered, it does not ensure that the
write is done before the sleep. What is the actual requirement here?
As in comment, order of turning need to be serialized so this memory
barrier.
Do u think its not required?
The problem is that mb() don't actually wait for the write to finish, it
simply makes sure that any subsequent writes will come after this one.
mb() is for below comment

/* Turn on L1, L2, ETB and JU memories 1 at a time */

While delay corresponding to

 /*
+ * Wait for 1us for both memory peripheral and
+ * data array to turn on.
+ */


If we want to make sure the write actually hits the hardware before the
delay we should read the register back after the write - as that would
stall execution until the write is available.

Either way, using the non-_relaxed version of writel() will be
equivalent to what you have now.
Do you mean if writel is used , udelay() should be removed? i understand writel will not return before register write operation is actually done. udelay() is to give enough time so that after writel , there is some time available to turn on mem peripheral and data array.

+			udelay(1);
+		}
Regards,
Bjorn

--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux