kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Delaying an interrupt handler
@ 2015-03-23 12:18 Milton Krutt
  2015-03-23 12:46 ` Daniel Baluta
  0 siblings, 1 reply; 3+ messages in thread
From: Milton Krutt @ 2015-03-23 12:18 UTC (permalink / raw)
  To: kernelnewbies

Hi.
It is known that no semaphore synchronization should be
used inside an interrupt handler.

Anyway, I am looking at a freeBSD device driver (written by
a profesionist) and there are semaphores inside an interrupt
handler's subroutine.

Since I should port to linux that driver, I ask you how can I
reach such synchronization under linux; I tried to use semaphores
inside my handler but I got complains, and I don't want to break
the law, so no semaphores for me.

The scenario is the following:

firmware downloader {

while(fw_blocks--){

/* the call below will cause an interrupt */
load_block();

/* sleep unitl the int handler ackn's the previous
operation, and prevent ANY int. handler operations
until the process goes actually to sleep through the
following call */

sleep();      }
	  }


int handler {

if(the process is NOT asleep)
	wait();

wake up the process.
			}


NOTE: I am on a 2.6.10 in order to be closely tutored by LDD3.

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

end of thread, other threads:[~2015-03-23 13:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 12:18 Delaying an interrupt handler Milton Krutt
2015-03-23 12:46 ` Daniel Baluta
2015-03-23 13:46   ` Milton Krutt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).