NVMe: NVM capacity and unallocated capacity are zero?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: NVMe: NVM capacity and unallocated capacity are zero?

Post by nullplan »

Octocontrabass wrote:Have your scheduler provide a generic "sleep until my IRQ has arrived" function for driver threads to call, and a "wake my driver" function for ISRs to call. Hiding all of the ugly architecture-specific bits will make it feel much less like a hack. The only trick is that the IRQ may arrive before the driver tries to sleep.
Note that this is essentially a semaphore. Take a semaphore, initialize it to zero. Driver waits on the semaphore, ISR posts to it. If the IRQ occurs before the wait, the semaphore will be non-zero, and therefore the wait will not block. Therefore it is no longer necessary to ensure the right order with CLI and STI.
Carpe diem!
Post Reply