rem: return B_DO_NOT_RESCHEDULE;
add: return B_UNHANDLED_INTERRUPT;
context: ide_irq_handler(ide_bus_info *bus, uint8 status){		ide_device_info *device;	TRACE(("\n"));	FAST_LOG0(bus->log, ev_ide_irq_handle);	// we need to lock bus to have a solid bus state	// (side effect: we lock out the timeout handler and get	//  delayed if the IRQ happens at the same time as a command is	//  issued; in the latter case, we have no official way to determine	//  whether the command was issued before or afterwards; if it was	//  afterwards, the device must not be busy; if it was before,	//  the device is either busy because of the sent command, or it's	//  not busy as the command has already been finished, i.e. there	//  was a second IRQ which we've overlooked as we didn't acknowledge	//  the first IRQ)	IDE_LOCK(bus);	device = bus->active_device;	if (device == NULL) {		IDE_UNLOCK(bus);		TRACE(("IRQ though there is no active device\n"));		return B_DO_NOT_RESCHEDULE;	}	if ((status & ide_status_bsy) != 0) {		// the IRQ seems to be fired before the last command was sent,		// i.e. it's not the one that signals finishing of command		IDE_UNLOCK(bus);		TRACE(("IRQ though device is busy\n"));		return B_DO_NOT_RESCHEDULE;	}	TRACE(("state: %d\n", bus->state));	switch (bus->state) {		case ide_state_async_waiting:			TRACE(("async waiting\n"));			bus->state = ide_state_accessing;			IDE_UNLOCK(bus);			scsi->schedule_dpc(bus->scsi_cookie, bus->irq_dpc, ide_dpc, bus);			return B_INVOKE_SCHEDULER; 		case ide_state_idle:			TRACE(("idle\n"));			// this must be a service request;			// if no request is pending, the IRQ was fired wrongly			if (bus->num_running_reqs == 0) {				IDE_UNLOCK(bus);				return B_HANDLED_INTERRUPT;			}			bus->state = ide_state_accessing;			IDE_UNLOCK(bus);			scsi->schedule_dpc(bus->scsi_cookie, bus->irq_dpc, ide_dpc, bus);			return B_INVOKE_SCHEDULER;		case ide_state_sync_waiting:			TRACE(("sync waiting\n"));			bus->state = ide_state_accessing;			bus->sync_wait_timeout = false;			IDE_UNLOCK(bus);			release_sem_etc(bus->sync_wait_sem, 1, B_DO_NOT_RESCHEDULE);			return B_INVOKE_SCHEDULER;		case ide_state_accessing:			TRACE(("spurious IRQ - there is a command being executed\n"));			IDE_UNLOCK(bus);			return B_DO_NOT_RESCHEDULE;		default:			dprintf("BUG: unknown state (%d)\n", bus->state);			IDE_UNLOCK(bus);			return B_DO_NOT_RESCHEDULE;	}}