860 set_dor(fdc, ~0, 8);
861#if N_FDC > 1
862 set_dor(1 - fdc, ~8, 0);
863#endif
864 if (FDCS->rawcmd == 2)
865 reset_fdc_info(1);
866 if (fd_inb(FD_STATUS) != STATUS_READY)
867 FDCS->reset = 1;
868}
869
870
871static int _lock_fdc(int drive, int interruptible, int line)
872{
873 if (!usage_count) {
874 printk(KERN_ERR
875 "Trying to lock fdc while usage count=0 at line %d\n",
876 line);
877 return -1;
878 }
879
880 if (test_and_set_bit(0, &fdc_busy)) {
881 DECLARE_WAITQUEUE(wait, current);
882 add_wait_queue(&fdc_wait, &wait);
883
884 for (;;) {
885 set_current_state(TASK_INTERRUPTIBLE);
886
887 if (!test_and_set_bit(0, &fdc_busy))
888 break;
889
890 schedule();
891
892 if (!NO_SIGNAL) {
893 remove_wait_queue(&fdc_wait, &wait);
894 return -EINTR;
895 }
896 }
897
898 set_current_state(TASK_RUNNING);
899 remove_wait_queue(&fdc_wait, &wait);
900 flush_scheduled_work();