linux-mips
[Top] [All Lists]

[PATCH 08/10] MIPS: Netlogic: use preset loops per jiffy

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 08/10] MIPS: Netlogic: use preset loops per jiffy
From: "Jayachandran C" <jchandra@broadcom.com>
Date: Mon, 14 Jan 2013 21:42:00 +0530
Cc: "Jayachandran C" <jchandra@broadcom.com>
In-reply-to: <1358179922-26663-1-git-send-email-jchandra@broadcom.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1358179922-26663-1-git-send-email-jchandra@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
Doing calibrate delay on a hardware thread will be inaccurate since
it depends on the load on other threads in the core. It will also
slow down the boot process when done for 128 hardware threads. Switch
to a pre-computed loops per jiffy based on the core frequency. The
value is computed based on the core frequency and roughly matches the
value calculated by calibrate_delay().

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
 arch/mips/netlogic/common/time.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/netlogic/common/time.c b/arch/mips/netlogic/common/time.c
index 20f89bc..5c56555 100644
--- a/arch/mips/netlogic/common/time.c
+++ b/arch/mips/netlogic/common/time.c
@@ -98,6 +98,10 @@ void __init plat_time_init(void)
 {
        nlm_init_pic_timer();
        mips_hpt_frequency = nlm_get_cpu_frequency();
+       if (current_cpu_type() == CPU_XLR)
+               preset_lpj = mips_hpt_frequency / (3 * HZ);
+       else
+               preset_lpj = mips_hpt_frequency / (2 * HZ);
        pr_info("MIPS counter frequency [%ld]\n",
                        (unsigned long)mips_hpt_frequency);
 }
-- 
1.7.9.5



<Prev in Thread] Current Thread [Next in Thread>