All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quinn Harris <quinn@nmt.edu>
To: linux-newbie@vger.kernel.org
Subject: Re: Preventing signal interrupt in Kernel module code
Date: 13 Sep 2002 09:56:50 -0600	[thread overview]
Message-ID: <1031932610.6322.24.camel@quinn.rcn.nmt.edu> (raw)
In-Reply-To: <7C078C66B7752B438B88E11E5E20E72E0EF512@GENERAL.farsite.co.uk>

Would placing the process waiting for the hardware in an
TASK_UNINTERRUPTIBLE state do what you want?  As far as I understand
it,  the TASK_UNINTERRUPTIBLE state is used to prevent anything from
waking up a process when it is waiting for something it can't be
interrupted by a signal from.  If you call wait_event(wq, condition);
(actually a define in sched.h) the process will be placed in a
TASK_UNINTERRUPTIBLE state until the wait queue is woken up and the
condition is met.  wait_event_interruptible(wq, condition) would allow a
process to be interrupted by a signal.  You might be doing essentially
what wait_event does without using it.  I have seen a bit of kernel code
(I think usually older code) that doesn't used wait_event when it could
to place the current process on a wait queue.


On Fri, 2002-09-13 at 07:54, Kevin Curtis wrote:
> Hi,
> 	I have written a Kernel module and I'm having a small problem with
> signals that I hope someone can steer me through.  The signal in question
> are SIGCHILD, but that is not really relevant.  I must be able to handle any
> signal that the process has enabled.
> 
> 	My module has several wait queues, most of which I can cope with
> being interrupted by a signal (returning EINTR to the process).  However,
> there are some hardware operations that I need to wait for completion of, as
> it would be impossible to restart them or pick up where we left off.  I
> still want to use a wait queue so other things can run.  Is there some
> system call I can make to mask signals until the operation has completed.
> Would I still call signal_pending() to see if one had occurred while they
> were blocked?
> 
> I'm sure the answer is really simple but I haven't stumbled across it yet.
> 
> TIA
> 
> Kevin
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs
> 


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs

  reply	other threads:[~2002-09-13 15:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-13 13:54 Preventing signal interrupt in Kernel module code Kevin Curtis
2002-09-13 13:54 ` Kevin Curtis
2002-09-13 15:56 ` Quinn Harris [this message]
2002-09-13 18:33 ` Bill Pleasants
2002-09-13 15:39   ` Ken Boyer
2002-09-13 15:53   ` Ray Olszewski
2002-09-13 16:00     ` Ken Boyer
2002-09-13 21:33     ` starts error Bill Pleasants
2002-09-13 19:48       ` Ray Olszewski
2002-09-14  9:20       ` pa3gcu
2002-09-13 20:06   ` Preventing signal interrupt in Kernel module code Bryan Whitehead
  -- strict thread matches above, loose matches on Subject: below --
2002-09-13 15:49 Kevin Curtis
2002-09-13 17:22 ` Quinn Harris
2002-09-13 16:02 Kevin Curtis
     [not found] <7C078C66B7752B438B88E11E5E20E72E0EF515@GENERAL.farsite.co. uk>
2002-09-13 16:40 ` Ray Olszewski

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=1031932610.6322.24.camel@quinn.rcn.nmt.edu \
    --to=quinn@nmt.edu \
    --cc=linux-newbie@vger.kernel.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.