From: Jerome Poncin <JPoncin@hilscher.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Hilscher driver for cifX boards
Date: Tue, 26 Feb 2013 15:25:10 +0100 [thread overview]
Message-ID: <512CC5C6.8050204@hilscher.com> (raw)
In-Reply-To: <512C9E78.1060208@siemens.com>
Hello Jan,
Thank you for your answer. I checked /proc/interrupts and lspci -v, and I saw that the IRQ is shared.
"If yes, resolve that conflict."
=> What must I do ? I'm not sure to have understood ?
/*****************************************************************************/
/*!
* \brief cifx_handler
*
* \param [in] irq Resource task pointer
*
* \return RTDM_IRQ_NONE or RTDM_IRQ_HANDLED
*
* \note cifx interrupt handler
*/
/*****************************************************************************/
static /*inline*/ int cifx_handler(rtdm_irq_t *irq)
{
struct rtdm_device *info = (struct rtdm_device
*)rtdm_irq_get_arg(irq, void);
io_info_t *device_data = (io_info_t *)
info->device_data;
if ((device_data->priv != NULL) || (device_data->irq_registered ==
FALSE) || (device_data->irq_enable == FALSE))
{
/* This is a PLX device and cannot produce an IRQ */
return RTDM_IRQ_NONE;
}
else
{
void __iomem *int_enable_reg =
device_data->mem[DPM_INDEX].internal_addr + DPM_HOST_INT_EN0;
void __iomem *int_status_reg =
device_data->mem[DPM_INDEX].internal_addr + DPM_HOST_INT_STAT0;
/* Is one of our interrupts enabled and active ? */
if (!(ioread32(int_enable_reg) & ioread32(int_status_reg) &
DPM_HOST_INT_MASK))
return RTDM_IRQ_NONE;
/* Disable interrupt */
iowrite32(ioread32(int_enable_reg) & ~DPM_HOST_INT_GLOBAL_EN,
int_enable_reg);
return RTDM_IRQ_HANDLED;
}
}
If IRQ is not mine, I return RTDM_IRQ_NONE, it's not correct ?
Thank you very much for your help,
Hilscher France
12, rue du 35ème Régiment d'Aviation
Miniparc du Chêne
69500 BRON
France
Tél. : +33 (0) 4 72 37 98 40
Fax : +33 (0) 4 78 26 83 27
http://www.hilscher.fr
HILSCHER FRANCE Jérôme Poncin
jponcin@hilscher.com
Ingénieur Développement Logiciel
Tél. : +33 (0) 4 72 37 98 44
Le 26/02/2013 12:37, Jan Kiszka a écrit :
> On 2013-02-26 10:29, Jerome Poncin wrote:
>> Hello,
>>
>> I have a problem with driver for Hilscher cifx with IRQ.
>>
>> All driver run good (I verified in polling mode) but in case I activate
>> IRQ the system freeze.
>>
>> I checked parameters of "rtdm_irq_request" function without success (all
>> seems good) ! I tried to see on internet to get some information about
>> the use of "rtdm_irq_request", or compare my code with other driver but
>> it's not easy...
>> I give you in attached file my code because I have no idea about my
>> problem, and it's really difficult to have some information or trace
>> after system freeze...
>> Do you have an idea about my problem ?
>> static inline int cifx_handler(rtdm_irq_t *irq)
> ^^^^^^
> But I suspect the compiler is smart enough to ignore this.
>
> Is the line you are registering for shared with other devices? Check
> /proc/interrupts and lspci -v. If yes, resolve that conflict.
>
> If not, add printk to your IRQ handler, redirect the kernel messages to
> a serial console and try to find out how far and how ofter you get into
> the handler.
>
> Well, and then there is the option of source-level debugging. kgdb for
> I-pipe patches aren't merged yet, but more convenient is KVM-based
> debugging anyway. See [1] for the concept. Just requires VT-d or AMD
> IOMMU on your target.
>
> Jan
>
> PS: Still no kernel coding style. Specifically the long lines makes it
> hard to read.
>
> [1]
> http://chemnitzer.linux-tage.de/2012/vortraege/folien/1061-VirtualDebugging.pdf
>
next prev parent reply other threads:[~2013-02-26 14:25 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-26 9:29 [Xenomai] Hilscher driver for cifX boards Jerome Poncin
2013-02-26 11:37 ` Jan Kiszka
2013-02-26 14:25 ` Jerome Poncin [this message]
2013-02-26 14:28 ` Jan Kiszka
2013-02-28 8:15 ` Jerome Poncin
2013-02-28 11:31 ` Jan Kiszka
2013-02-28 12:08 ` Jerome Poncin
2013-03-01 13:56 ` Jerome Poncin
2013-03-01 17:02 ` Jan Kiszka
2013-03-01 20:06 ` Gilles Chanteperdrix
2013-03-04 9:13 ` Jerome Poncin
2013-03-04 21:08 ` Gilles Chanteperdrix
2013-03-05 10:45 ` Jerome Poncin
2013-03-05 11:26 ` Jan Kiszka
2013-03-05 12:21 ` Gilles Chanteperdrix
2013-03-05 12:30 ` Gilles Chanteperdrix
2013-03-05 15:42 ` Jerome Poncin
2013-03-05 19:41 ` Gilles Chanteperdrix
2013-03-06 8:10 ` Jerome Poncin
2013-03-06 8:19 ` Gilles Chanteperdrix
2013-03-06 8:55 ` Jerome Poncin
2013-03-06 10:33 ` Jerome Poncin
2013-03-06 12:04 ` Gilles Chanteperdrix
2013-03-06 13:58 ` Jerome Poncin
2013-03-06 15:28 ` Jan Kiszka
2013-03-06 21:05 ` Gilles Chanteperdrix
2013-03-07 15:33 ` Jerome Poncin
2013-03-08 10:17 ` Jerome Poncin
2013-03-08 12:22 ` Gilles Chanteperdrix
2013-03-12 9:10 ` Jerome Poncin
2013-03-12 12:21 ` Gilles Chanteperdrix
2013-03-12 15:27 ` Jerome Poncin
2013-03-12 19:38 ` Gilles Chanteperdrix
2013-03-13 11:08 ` Jerome Poncin
2013-03-15 9:09 ` Jerome Poncin
2013-03-15 11:07 ` Jan Kiszka
2013-03-15 13:04 ` Jerome Poncin
2013-03-15 13:24 ` Jan Kiszka
2013-03-18 10:02 ` Jerome Poncin
2013-03-19 13:42 ` Jerome Poncin
2013-03-06 20:42 ` Gilles Chanteperdrix
-- strict thread matches above, loose matches on Subject: below --
2013-02-12 11:37 Stéphane LOS
2013-02-12 11:51 ` Jan Kiszka
2013-02-13 14:09 ` Stéphane LOS
2013-02-14 13:36 ` Stéphane LOS
2013-02-14 15:01 ` Stéphane LOS
2013-02-15 14:54 ` Jan Kiszka
2013-02-18 11:43 ` Stéphane LOS
2013-02-07 14:53 Stéphane LOS
2013-02-07 16:11 ` Gilles Chanteperdrix
2013-02-08 9:07 ` Stéphane LOS
2013-02-08 9:18 ` Gilles Chanteperdrix
2013-02-08 11:28 ` Jan Kiszka
2013-02-08 11:35 ` Gilles Chanteperdrix
2013-02-08 11:46 ` Jan Kiszka
[not found] ` <5114FD7B.20902@hilscher.com>
2013-02-08 13:40 ` Jan Kiszka
2013-02-08 14:33 ` Stéphane LOS
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=512CC5C6.8050204@hilscher.com \
--to=jponcin@hilscher.com \
--cc=jan.kiszka@siemens.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.