lkml.org 
[lkml]   [2002]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRE: Problem on a kernel driver(SuSE, SMP)
On Wed, 4 Sep 2002, Libershteyn, Vladimir wrote:

> >
> > You are not too specific, which makes it hard to understand what may
> > be going wrong so I'll assume that you probably did a bad thing.
>
> I think I gave all the specific information
>
> >
> > (1) You cannot sleep in an interrupt, which means you can't use
> > down_*() and friends inside an ISR.
>
> I DO NOT sleep in ISR, the up*() routine is inside the ISR, dut not down*()
> This is a standard use of the mechanism
>
> >
> > (2) Wait queues should work fine from the 'user-side' of a driver,
> > but again, you cannot ever sleep in an interrupt service routine.
> > Look in ../linux/drivers/* for examples of code that works.
> >
>
> Again there is NO sleep in ISR, and I know that queues should work fine,
> but they don't, that why I have a problem, but problem only on
> SMP machine.
>
> > (3) You can't use any wait-queue or sleep on a semaphore while
> > holding a spin-lock or while the interrupts are disabled. You can
> > manage your own lock against re-entry in your procedure, but you
> > can't allow two tasks to try the same semaphore at (nearly) the
> > same time or you can dead-lock.
>
> I DO NOT hold any spinlocks, while use down_interruptible
>
> >
> >
> > (4) The fact that 'down' hangs means that there is nothing
> > that the CPU can do. This is direct evidence that you have the
> > interrupts disabled when down executes.
>
> To be more specific, here is a code:
> ----------------------------------------------------
> function when thread go to sleep, if data not ready
> ---------------------------------------------------

Snipped code.

How do you know that
up(&a->sem[enumerator]);
in the ISR and...
down_interruptible(&a->sem[enumerator]);
In axl_get_response...
... have the same value of 'enumerator', therefore the same
semaphore?

One comes from a modulus and another from indirection off from 'board
address'?

I think there is a bug there.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
The US military has given us many words, FUBAR, SNAFU, now ENRON.
Yes, top management were graduates of West Point and Annapolis.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.161 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site