All of lore.kernel.org
 help / color / mirror / Atom feed
* (no subject)
@ 2003-07-16  1:55 Eliot Blennerhassett
  2003-07-16 11:40 ` Takashi Iwai
  2003-07-16 14:56 ` 24 bit pcm_meter ? Case van Rij
  0 siblings, 2 replies; 3+ messages in thread
From: Eliot Blennerhassett @ 2003-07-16  1:55 UTC (permalink / raw)
  To: alsa-devel

The problem I am seeking help on is not an ALSA problem per-se, but as I am
working on an ALSA driver I thought I'd start here...
any suggestions for a more appropriate forum will be gratefully accepted.


Background info:
I have a lowlevel driver that works fine when I used semaphores to prevent
conention for my hardware.  Access was soley via ioctl into my driver.

I have to change the semaphore to a spinlock now that I also call basically the
same entry point from a timer routine in my ALSA driver.

When I record from the card the data is read from the card into a userspace
buffer

    ptr,size = <Buffer pointer,size received from user application>

    fs = get_fs();
    set_fs(get_ds());
    /* Ensure that the data buffer is resident in memory.  */
    if (!access_ok (wrflag ? VERIFY_WRITE : VERIFY_READ, ptr, bytes))
    {
        set_fs(fs);
        return -EFAULT;
     }

    /* Inside here is the spinlock, and a copy to the ptr mentioned above */
    HPI_MessageF (gphHpiSubsys, &hm, &hr, file );
    
    set_fs(fs);
    
Problem:
The single change from semaphore to spinlock results in a kernel panic when I
try to record from my card:
	Unable to handle kernel paging request at virtual address ...

    
Question:
Notwithstanding bad style etc, am I doing something that is fundamentally wrong
in using a userspace buffer when I am inside a spinlock i.e. in interrupt
context?  (In the same way as I must not use a semaphore in interrupt context)

Could it be that when I try to write to the buffer it causes a page fault, which
cannot be handled in interrupt context?
But I thought that access_ok call should take care of making sure the buffer is
in memory...


TIA for any insights you may have.

Eliot Blennerhassett
AudioScience Inc.
--
Junk footer beyond this point. Read at your own risk.


-------------------------------------------------------------
Sign up for ICQmail at http://www.icq.com/icqmail/signup.html


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-16 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-16  1:55 (no subject) Eliot Blennerhassett
2003-07-16 11:40 ` Takashi Iwai
2003-07-16 14:56 ` 24 bit pcm_meter ? Case van Rij

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.