All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Doug Brunner <dbrunner@ebus.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Interpreting I-pipe trace
Date: Tue, 11 Sep 2012 21:21:57 +0200	[thread overview]
Message-ID: <504F8F55.9080006@xenomai.org> (raw)
In-Reply-To: <504EC598.7050005@ebus.com>

On 09/11/2012 07:01 AM, Doug Brunner wrote:

> While running my latency testing earlier I saw some rather high 
> worst-case latencies (~70us) compared to average case (~14us), so I ran 
> again with I-pipe tracing enabled. However, I'm not sure what to make of 
> the results.
> 
> My worst case involves an IRQ (common_interrupt appears in the trace 
> with user value 0xFFFFFFC4) and the wiki page talks about being able to 
> translate the user value 0xFFFFFFF4 into IRQ 11 but doesn't elaborate on 
> how this correspondence works. I'm not horribly concerned since it's a 
> delay of 53 us on a rather slow processor (Geode LX800) but it would be 
> nice to know what interrupt is taking so long.


You may also want to apply the following patch for SMI on Geode LX, and 
enable CONFIG_XENO_HW_SMI_WORKAROUND. You can remove the '#if 0', if you
do not use PCI.

diff --git a/ksrc/arch/x86/smi.c b/ksrc/arch/x86/smi.c
index d80b14b..6d641be 100644
--- a/ksrc/arch/x86/smi.c
+++ b/ksrc/arch/x86/smi.c
@@ -31,6 +31,7 @@
 #include <linux/reboot.h>
 #include <asm-generic/xenomai/pci_ids.h>
 #include <asm/xenomai/hal.h>
+#include <asm/geode.h>
 
 static struct pci_device_id rthal_smi_pci_tbl[] = {
 	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0)},
@@ -192,6 +193,35 @@ void rthal_smi_init(void)
 	struct pci_dev *dev = NULL;
 	struct pci_device_id *id;
 
+#ifdef CONFIG_XENO_HW_SMI_WORKAROUND
+	if (is_geode_lx()) {
+		unsigned long long val;
+#define SMM_CTRL_MSR 0x00001301
+
+/* Do not clear 0x10, that is SMI_IO */
+#define SMM_CTRL_MSR_CLR 0x0000000000000020ULL
+#define GLIU0_MSR_SMI 0x10002002
+#define GLIU1_MSR_SMI 0x40002002
+#define GLIU0_ASMI 0x10000083
+#define GLIU1_ASMI 0x40000083
+#define CS5536_MSR_SMI 0x4c002002
+#define CS5536_PCI_MSR_SMI 0x50002002
+
+		printk("Geode LX found, trying SMI workaround\n");
+		rdmsrl(SMM_CTRL_MSR, val);
+		wrmsrl(SMM_CTRL_MSR, val & ~SMM_CTRL_MSR_CLR);
+		wrmsrl(GLIU0_MSR_SMI, 0x0000001800000018ULL);
+		wrmsrl(GLIU1_MSR_SMI, 0x0000001800000018ULL);
+		wrmsrl(GLIU0_ASMI, 0x000000000000ffffULL);
+		wrmsrl(GLIU1_ASMI, 0x000000000000ffffULL);
+		wrmsrl(CS5536_MSR_SMI, 0x00000000001f001fULL);
+#if 0
+	       /* PCI SMI are needed to get PCI running. */
+		wrmsrl(CS5536_PCI_MSR_SMI, 0x00000000003f003fULL);
+#endif
+	}
+#endif
+
 	/*
 	 * Do not use pci_register_driver, pci_enable_device, ...
 	 * Just register the used ports.


-- 
                                                                Gilles.


  parent reply	other threads:[~2012-09-11 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11  5:01 [Xenomai] Interpreting I-pipe trace Doug Brunner
2012-09-11  7:44 ` Gilles Chanteperdrix
2012-09-11  7:48 ` Philippe Gerum
2012-09-11 19:21 ` Gilles Chanteperdrix [this message]
2012-09-11 21:19   ` Gilles Chanteperdrix
2012-09-12  6:53     ` Gilles Chanteperdrix
     [not found]     ` <505667A8.9040409@ebus.com>
2012-09-17  7:01       ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=504F8F55.9080006@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=dbrunner@ebus.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.