All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Michael Smith <2michael.smith@gmail.com>
Cc: "Xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Oops message on rtdm_read()
Date: Tue, 29 Sep 2015 15:35:38 +0200	[thread overview]
Message-ID: <20150929133538.GC13638@hermes.click-hack.org> (raw)
In-Reply-To: <CANWkrRMksLWR10fuM=M1Oc25GYzDHTzFqEq5cDJmGBpjdyxwyg@mail.gmail.com>

On Tue, Sep 29, 2015 at 03:10:38PM +0200, Michael Smith wrote:
> Hi. I'm unclear what I am doing wrong. But I get a oops message when I am
> trying to do a read() (RTDM) from user space into my device driver.
> 
> The read function in the driver has been setup as follows:
> 
>     .ops = {
>             .open           = open_dev,
>             .close          = close_dev,
>             .ioctl_rt       = device_ioctl,
>             .ioctl_nrt      = device_ioctl,
>             .read_nrt       = read_dev,
>             .read_rt        = read_dev,
>             .write_nrt      = write_dev,
>             .write_rt       = write_dev,
> 
> As can be seen I call the same read routine in real-time and non
> real-time, because they both boil down to the same type of callback
> function nl.
> 
> ssize_t rtdm_read_handler(struct rtdm_fd * fd,void __user * buf,size_t size )
> 
> When the read() call is done from user space (non real-time) I get a
> oops as follows:
> 
> [62847.263710] I-pipe: Detected illicit call from head domain 'Xenomai'
> [62847.263710]         into a regular Linux service
> [62847.263716] CPU: 2 PID: 4466 Comm: flash.out Tainted: G
> OE 3.16.0-xenomai-3.0.6 #2
> [62847.263718] Hardware name: To Be Filled By O.E.M. To Be Filled By
> O.E.M./Z87 Extreme4, BIOS P2.30 07/03/2013
> [62847.263719]  0000000000051730 ffff880092d6fd50 ffffffff817530ca
> 000000000000dde0
> [62847.263723]  ffff880092d6fd80 ffffffff8110b59d 0000000000000001
> 0000000000000004
> [62847.263727]  0000000000020000 0000000000002000 ffff880092d6fd98
> ffffffff8110c922
> [62847.263731] Call Trace:
> [62847.263738]  [<ffffffff817530ca>] dump_stack+0x45/0x56
> [62847.263742]  [<ffffffff8110b59d>] ipipe_root_only+0x18d/0x1b0
> [62847.263745]  [<ffffffff8110c922>] ipipe_restore_root+0x12/0x50
> [62847.263747]  [<ffffffff8175a17a>] _raw_spin_unlock_irqrestore+0x2a/0x30
> [62847.263751]  [<ffffffff816344e3>] pci_conf1_read+0xd3/0x130
> [62847.263754]  [<ffffffff81637763>] raw_pci_read+0x23/0x40
> [62847.263757]  [<ffffffff816377ac>] pci_read+0x2c/0x30
> [62847.263761]  [<ffffffff813e3dd6>]
> pci_bus_read_config_dword+0x66/0xa0

pci_bus_read_config_dword uses a plain Linux spinlock, thus can not
be called from primary mode.

So, read_dev may be a valid handler for read_nrt, but not for
read_rt.

-- 
					    Gilles.
https://click-hack.org


  reply	other threads:[~2015-09-29 13:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 13:10 [Xenomai] Oops message on rtdm_read() Michael Smith
2015-09-29 13:35 ` Gilles Chanteperdrix [this message]
2015-09-29 13:40 ` Philippe Gerum

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=20150929133538.GC13638@hermes.click-hack.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=2michael.smith@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.