All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Gregory Dymarek <gregd72002@gmail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] RaspberryPi kernel 3.8 issue
Date: Sun, 02 Mar 2014 19:16:33 +0100	[thread overview]
Message-ID: <53137581.5060600@xenomai.org> (raw)
In-Reply-To: <CAEbDrgmB4vZ0TPrD2-_-vR8bDwYXLKL2fMdNzFZWGsoiK9ZBDQ@mail.gmail.com>

On 03/02/2014 06:26 PM, Gregory Dymarek wrote:
> So I started from scratch, have not used any xenomai/ipipe patches. But
> used the same .config.
> As a result all worked fine. The USB device is getting initialized
> correctly.
> 
> So the current situation is that xenomai does work on 3.2 but does not on
> 3.8 because of some USB driver issues.
> I diff'ed the code for dwc_otg_hcd_handle_intr and this has changed.
> What is intriguing:
> https://github.com/raspberrypi/linux/blob/rpi-3.8.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c#L530
> 
> // We should be OK doing this because the common interrupts should already
> have been serviced
> 
> So I removed all the DEBUG code from this function, but this did not help
> either. Not sure if my test is valid in here.

If the driver relies on FIQ to work (which is a bad idea with Xenomai, 
as it will cause an increase in latencies), the following construction:


local_irq_save(flags);
local_fiq_disable();

/* do something */

local_irq_restore(flags);

Will mask the FIQ with CONFIG_IPIPE whereas local_irq_restore unmasks 
both the IRQ and FIQ without CONFIG_IPIPE. 

So, as a last try before giving up, could you try the following patch?

diff --git a/drivers/usb/host/dwc_common_port/dwc_common_linux.c b/drivers/usb/host/dwc_common_port/dwc_common_linux.c
index 0812d3a..6d01261 100644
--- a/drivers/usb/host/dwc_common_port/dwc_common_linux.c
+++ b/drivers/usb/host/dwc_common_port/dwc_common_linux.c
@@ -585,6 +585,7 @@ void DWC_MODIFY_REG32(uint32_t volatile *reg, uint32_t clear_mask, uint32_t set_
 	local_irq_save(flags);
 	local_fiq_disable();
 	writel((readl(reg) & ~clear_mask) | set_mask, reg);
+	local_fiq_enable();
 	local_irq_restore(flags);
 }
 
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
index b5a007d..10eead2 100644
--- a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
+++ b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
@@ -1354,6 +1354,7 @@ static inline uint32_t dwc_otg_read_common_intr(dwc_otg_core_if_t * core_if, gin
 		gintmsk.d32 |= gintmsk_common.d32;
 		gintsts_saved.d32 &= ~gintmsk_common.d32;
 		reenable_gintmsk->d32 = gintmsk.d32;
+		local_fiq_enable();
 		local_irq_restore(flags);
 	}
 
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
index 7d521d9..86d9cbe 100644
--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
@@ -97,6 +97,7 @@ void notrace _fiq_print(FIQDBG_T dbg_lvl, char *fmt, ...)
 		memcpy(buffer + wptr, text, 16);
 		wptr = (wptr + 16) % sizeof(buffer);
 	}
+	local_fiq_enable();
 	local_irq_restore(flags);
 }
 #endif


-- 
                                                                Gilles.


  parent reply	other threads:[~2014-03-02 18:16 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-23 21:27 [Xenomai] RaspberryPi kernel 3.8 issue Gregory Dymarek
2014-02-23 21:37 ` Gilles Chanteperdrix
2014-02-23 22:18   ` Gregory Dymarek
2014-02-23 22:36     ` Gilles Chanteperdrix
2014-02-23 22:37 ` Adam Vaughan
2014-02-23 23:08   ` Adam Vaughan
2014-02-23 23:30     ` Gregory Dymarek
2014-02-23 23:32       ` Gregory Dymarek
2014-02-23 23:42       ` Gilles Chanteperdrix
2014-02-24 21:19         ` Gregory Dymarek
2014-02-24 22:00           ` Gilles Chanteperdrix
2014-02-25 20:04             ` Gregory Dymarek
2014-02-25 20:20               ` Gilles Chanteperdrix
2014-02-25 20:23                 ` Gregory Dymarek
     [not found]                 ` <CAEbDrgkJCnbWu_J4svoXOU1x2rz=n95A5+3Ee=R_9CpMgx-JmA@mail.gmail.com>
2014-02-25 20:25                   ` Gilles Chanteperdrix
2014-02-25 20:43                     ` Gregory Dymarek
2014-02-25 20:50                       ` Gilles Chanteperdrix
2014-02-25 21:09                         ` Gregory Dymarek
2014-02-25 21:24                           ` Gilles Chanteperdrix
2014-02-25 21:28                             ` Gilles Chanteperdrix
2014-02-25 21:31                           ` Gilles Chanteperdrix
2014-02-25 22:30                             ` Adam Vaughan
2014-02-25 23:20                               ` Gregory Dymarek
2014-02-25 23:42                                 ` Adam Vaughan
2014-02-25 23:45                                   ` Adam Vaughan
2014-02-26  0:12                                     ` Gregory Dymarek
2014-02-26  0:22                                       ` Adam Vaughan
2014-02-26  0:33                                       ` Gilles Chanteperdrix
2014-02-26 10:00                                         ` Gregory Dymarek
2014-02-26 18:48                                           ` Adam Vaughan
2014-02-26 21:46                                           ` Gilles Chanteperdrix
2014-02-26 10:26                                       ` Paul
2014-02-25 23:51                                 ` Gilles Chanteperdrix
     [not found]                                   ` <CAEbDrgkWZqSxjCUfjR3YCp=YOzh1r-=YC6Wyr-Jvk9d7JYEcmQ@mail.gmail.com>
     [not found]                                     ` <530E6159.4050204@xenomai.org>
2014-02-26 22:37                                       ` Gregory Dymarek
2014-02-27 10:48                                         ` Gilles Chanteperdrix
2014-02-27 18:43                                           ` Gregory Dymarek
2014-02-27 20:14                                             ` Gilles Chanteperdrix
2014-02-27 20:33                                               ` Gregory Dymarek
2014-02-27 20:48                                                 ` Gilles Chanteperdrix
2014-02-27 20:58                                                   ` Gilles Chanteperdrix
2014-02-27 21:15                                                 ` Gilles Chanteperdrix
2014-02-27 22:54                                                   ` Gregory Dymarek
2014-02-28  1:12                                                   ` Paul
2014-02-28 11:42                                                     ` Gilles Chanteperdrix
2014-02-28 11:41                                                 ` Gilles Chanteperdrix
2014-03-01 12:27                                                   ` Gregory Dymarek
2014-03-02 15:11                                                     ` Gilles Chanteperdrix
2014-03-02 17:26                                                       ` Gregory Dymarek
2014-03-02 18:05                                                         ` Gilles Chanteperdrix
2014-03-02 18:16                                                         ` Gilles Chanteperdrix [this message]
     [not found]                                                           ` <CAEbDrg=2nX1kKOGt6i7b-w5AsLXkEyoJCGUMw1dkMXvka4MeKw@mail.gmail.com>
2014-03-02 18:55                                                             ` Gregory Dymarek
2014-03-02 18:57                                                             ` Gilles Chanteperdrix
2014-03-02 19:04                                                               ` Gilles Chanteperdrix
2014-03-02 19:08                                                                 ` Gregory Dymarek
2014-03-02 21:03                                                                   ` Gregory Dymarek
2014-02-24  0:22       ` Paul
2014-02-24  0:47         ` Adam Vaughan
2014-02-24  0:53           ` Adam Vaughan
2014-02-24  1:20             ` Adam Vaughan
2014-02-26 19:59 Gregory Dymarek
2014-02-26 20:29 ` Gregory Dymarek

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=53137581.5060600@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=gregd72002@gmail.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.