From mboxrd@z Thu Jan 1 00:00:00 1970 From: milton@krutt.org (Milton Krutt) Date: Mon, 23 Mar 2015 05:18:45 -0700 Subject: Delaying an interrupt handler Message-ID: <20150323121844.GA4484@debian> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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.