Commit a04d620c authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k block local_irq*() updates

Convert m68k block drivers to new local_irq*() framework:
  - Atari ACSI
  - Amiga floppy
  - Atari floppy
  - Macintosh IIfx/Quadra 900/Quadra 950 floppy
parent f95ae0b0
...@@ -493,8 +493,7 @@ static int acsicmd_dma( const char *cmd, char *buffer, int blocks, int rwflag, i ...@@ -493,8 +493,7 @@ static int acsicmd_dma( const char *cmd, char *buffer, int blocks, int rwflag, i
acsi_delay_end(COMMAND_DELAY); acsi_delay_end(COMMAND_DELAY);
DISABLE_IRQ(); DISABLE_IRQ();
save_flags(flags); local_irq_save(flags);
cli();
/* Low on A1 */ /* Low on A1 */
dma_wd.dma_mode_status = 0x88 | rwflag; dma_wd.dma_mode_status = 0x88 | rwflag;
MFPDELAY(); MFPDELAY();
...@@ -511,7 +510,7 @@ static int acsicmd_dma( const char *cmd, char *buffer, int blocks, int rwflag, i ...@@ -511,7 +510,7 @@ static int acsicmd_dma( const char *cmd, char *buffer, int blocks, int rwflag, i
else else
dma_wd.dma_hi = (unsigned char)paddr; dma_wd.dma_hi = (unsigned char)paddr;
MFPDELAY(); MFPDELAY();
restore_flags(flags); local_irq_restore(flags);
/* send the command bytes except the last */ /* send the command bytes except the last */
for( i = 0; i < 5; ++i ) { for( i = 0; i < 5; ++i ) {
......
...@@ -500,12 +500,11 @@ static void slm_test_ready( unsigned long dummy ) ...@@ -500,12 +500,11 @@ static void slm_test_ready( unsigned long dummy )
int did_wait = 0; int did_wait = 0;
#endif #endif
save_flags(flags); local_irq_save(flags);
cli();
addr = get_dma_addr(); addr = get_dma_addr();
if ((d = SLMEndAddr - addr) > 0) { if ((d = SLMEndAddr - addr) > 0) {
restore_flags(flags); local_irq_restore(flags);
/* slice not yet finished, decide whether to start another timer or to /* slice not yet finished, decide whether to start another timer or to
* busy-wait */ * busy-wait */
...@@ -523,7 +522,7 @@ static void slm_test_ready( unsigned long dummy ) ...@@ -523,7 +522,7 @@ static void slm_test_ready( unsigned long dummy )
do_gettimeofday( &start_tm ); do_gettimeofday( &start_tm );
did_wait = 1; did_wait = 1;
#endif #endif
cli(); local_irq_disable();
while( get_dma_addr() < SLMEndAddr ) while( get_dma_addr() < SLMEndAddr )
barrier(); barrier();
} }
...@@ -547,7 +546,7 @@ static void slm_test_ready( unsigned long dummy ) ...@@ -547,7 +546,7 @@ static void slm_test_ready( unsigned long dummy )
DMA_LONG_WRITE( SLM_DMA_AMOUNT, 0x112 ); DMA_LONG_WRITE( SLM_DMA_AMOUNT, 0x112 );
#endif #endif
restore_flags(flags); local_irq_restore(flags);
#ifdef DEBUG #ifdef DEBUG
if (did_wait) { if (did_wait) {
...@@ -584,10 +583,9 @@ static void slm_test_ready( unsigned long dummy ) ...@@ -584,10 +583,9 @@ static void slm_test_ready( unsigned long dummy )
static void set_dma_addr( unsigned long paddr ) static void set_dma_addr( unsigned long paddr )
{ unsigned long flags; { unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli();
dma_wd.dma_lo = (unsigned char)paddr; dma_wd.dma_lo = (unsigned char)paddr;
paddr >>= 8; paddr >>= 8;
MFPDELAY(); MFPDELAY();
...@@ -599,7 +597,7 @@ static void set_dma_addr( unsigned long paddr ) ...@@ -599,7 +597,7 @@ static void set_dma_addr( unsigned long paddr )
else else
dma_wd.dma_hi = (unsigned char)paddr; dma_wd.dma_hi = (unsigned char)paddr;
MFPDELAY(); MFPDELAY();
restore_flags(flags); local_irq_restore(flags);
} }
......
...@@ -228,12 +228,11 @@ static void ms_delay(int ms) ...@@ -228,12 +228,11 @@ static void ms_delay(int ms)
unsigned long flags; unsigned long flags;
int ticks; int ticks;
if (ms > 0) { if (ms > 0) {
save_flags(flags); local_irq_save(flags);
cli();
while (ms_busy == 0) while (ms_busy == 0)
sleep_on(&ms_wait); sleep_on(&ms_wait);
ms_busy = 0; ms_busy = 0;
restore_flags(flags); local_irq_restore(flags);
ticks = MS_TICKS*ms-1; ticks = MS_TICKS*ms-1;
ciaa.tblo=ticks%256; ciaa.tblo=ticks%256;
ciaa.tbhi=ticks/256; ciaa.tbhi=ticks/256;
...@@ -259,13 +258,12 @@ static void get_fdc(int drive) ...@@ -259,13 +258,12 @@ static void get_fdc(int drive)
#ifdef DEBUG #ifdef DEBUG
printk("get_fdc: drive %d fdc_busy %d fdc_nested %d\n",drive,fdc_busy,fdc_nested); printk("get_fdc: drive %d fdc_busy %d fdc_nested %d\n",drive,fdc_busy,fdc_nested);
#endif #endif
save_flags(flags); local_irq_save(flags);
cli();
while (!try_fdc(drive)) while (!try_fdc(drive))
sleep_on(&fdc_wait); sleep_on(&fdc_wait);
fdc_busy = drive; fdc_busy = drive;
fdc_nested++; fdc_nested++;
restore_flags(flags); local_irq_restore(flags);
} }
static inline void rel_fdc(void) static inline void rel_fdc(void)
...@@ -321,8 +319,7 @@ static void fd_deselect (int drive) ...@@ -321,8 +319,7 @@ static void fd_deselect (int drive)
} }
get_fdc(drive); get_fdc(drive);
save_flags (flags); local_irq_save(flags);
cli();
selected = -1; selected = -1;
...@@ -330,7 +327,7 @@ static void fd_deselect (int drive) ...@@ -330,7 +327,7 @@ static void fd_deselect (int drive)
prb |= (SELMASK(0)|SELMASK(1)|SELMASK(2)|SELMASK(3)); prb |= (SELMASK(0)|SELMASK(1)|SELMASK(2)|SELMASK(3));
ciab.prb = prb; ciab.prb = prb;
restore_flags (flags); local_irq_restore (flags);
rel_fdc(); rel_fdc();
} }
...@@ -1305,10 +1302,9 @@ static int non_int_flush_track (unsigned long nr) ...@@ -1305,10 +1302,9 @@ static int non_int_flush_track (unsigned long nr)
rel_fdc(); rel_fdc();
return 0; return 0;
} }
save_flags(flags); local_irq_save(flags);
cli();
if (writepending != 2) { if (writepending != 2) {
restore_flags(flags); local_irq_restore(flags);
(*unit[nr].dtype->write_fkt)(nr); (*unit[nr].dtype->write_fkt)(nr);
if (!raw_write(nr)) { if (!raw_write(nr)) {
printk (KERN_NOTICE "floppy disk write protected " printk (KERN_NOTICE "floppy disk write protected "
...@@ -1320,7 +1316,7 @@ static int non_int_flush_track (unsigned long nr) ...@@ -1320,7 +1316,7 @@ static int non_int_flush_track (unsigned long nr)
sleep_on (&wait_fd_block); sleep_on (&wait_fd_block);
} }
else { else {
restore_flags(flags); local_irq_restore(flags);
ms_delay(2); /* 2 ms post_write delay */ ms_delay(2); /* 2 ms post_write delay */
post_write(nr); post_write(nr);
} }
...@@ -1428,8 +1424,7 @@ static void redo_fd_request(void) ...@@ -1428,8 +1424,7 @@ static void redo_fd_request(void)
* setup a callback to write the track buffer * setup a callback to write the track buffer
* after a short (1 tick) delay. * after a short (1 tick) delay.
*/ */
save_flags (flags); local_irq_save(flags);
cli();
floppy->dirty = 1; floppy->dirty = 1;
/* reset the timer */ /* reset the timer */
...@@ -1437,7 +1432,7 @@ static void redo_fd_request(void) ...@@ -1437,7 +1432,7 @@ static void redo_fd_request(void)
flush_track_timer[drive].expires = jiffies + 1; flush_track_timer[drive].expires = jiffies + 1;
add_timer (flush_track_timer + drive); add_timer (flush_track_timer + drive);
restore_flags (flags); local_irq_restore(flags);
break; break;
} }
} }
...@@ -1606,15 +1601,14 @@ static int floppy_open(struct inode *inode, struct file *filp) ...@@ -1606,15 +1601,14 @@ static int floppy_open(struct inode *inode, struct file *filp)
} }
} }
save_flags(flags); local_irq_save(flags);
cli();
fd_ref[drive]++; fd_ref[drive]++;
fd_device[drive] = system; fd_device[drive] = system;
#ifdef MODULE #ifdef MODULE
if (unit[drive].motor == 0) if (unit[drive].motor == 0)
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
#endif #endif
restore_flags(flags); local_irq_restore(flags);
if (old_dev != system) if (old_dev != system)
invalidate_buffers(mk_kdev(FLOPPY_MAJOR, drive + (system << 2))); invalidate_buffers(mk_kdev(FLOPPY_MAJOR, drive + (system << 2)));
......
...@@ -248,24 +248,24 @@ static struct atari_floppy_struct { ...@@ -248,24 +248,24 @@ static struct atari_floppy_struct {
#define FDC_READ(reg) ({ \ #define FDC_READ(reg) ({ \
/* unsigned long __flags; */ \ /* unsigned long __flags; */ \
unsigned short __val; \ unsigned short __val; \
/* save_flags(__flags); cli(); */ \ /* local_irq_save(__flags); */ \
dma_wd.dma_mode_status = 0x80 | (reg); \ dma_wd.dma_mode_status = 0x80 | (reg); \
udelay(25); \ udelay(25); \
__val = dma_wd.fdc_acces_seccount; \ __val = dma_wd.fdc_acces_seccount; \
MFPDELAY(); \ MFPDELAY(); \
/* restore_flags(__flags); */ \ /* local_irq_restore(__flags); */ \
__val & 0xff; \ __val & 0xff; \
}) })
#define FDC_WRITE(reg,val) \ #define FDC_WRITE(reg,val) \
do { \ do { \
/* unsigned long __flags; */ \ /* unsigned long __flags; */ \
/* save_flags(__flags); cli(); */ \ /* local_irq_save(__flags); */ \
dma_wd.dma_mode_status = 0x80 | (reg); \ dma_wd.dma_mode_status = 0x80 | (reg); \
udelay(25); \ udelay(25); \
dma_wd.fdc_acces_seccount = (val); \ dma_wd.fdc_acces_seccount = (val); \
MFPDELAY(); \ MFPDELAY(); \
/* restore_flags(__flags); */ \ /* local_irq_restore(__flags); */ \
} while(0) } while(0)
...@@ -434,14 +434,14 @@ static void fd_select_side( int side ) ...@@ -434,14 +434,14 @@ static void fd_select_side( int side )
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); /* protect against various other ints mucking around with the PSG */
cli(); /* protect against various other ints mucking around with the PSG */ local_irq_save(flags);
sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */ sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
sound_ym.wd_data = (side == 0) ? sound_ym.rd_data_reg_sel | 0x01 : sound_ym.wd_data = (side == 0) ? sound_ym.rd_data_reg_sel | 0x01 :
sound_ym.rd_data_reg_sel & 0xfe; sound_ym.rd_data_reg_sel & 0xfe;
restore_flags(flags); local_irq_restore(flags);
} }
...@@ -457,13 +457,13 @@ static void fd_select_drive( int drive ) ...@@ -457,13 +457,13 @@ static void fd_select_drive( int drive )
if (drive == SelectedDrive) if (drive == SelectedDrive)
return; return;
save_flags(flags); /* protect against various other ints mucking around with the PSG */
cli(); /* protect against various other ints mucking around with the PSG */ local_irq_save(flags);
sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */ sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
tmp = sound_ym.rd_data_reg_sel; tmp = sound_ym.rd_data_reg_sel;
sound_ym.wd_data = (tmp | DSKDRVNONE) & ~(drive == 0 ? DSKDRV0 : DSKDRV1); sound_ym.wd_data = (tmp | DSKDRVNONE) & ~(drive == 0 ? DSKDRV0 : DSKDRV1);
atari_dont_touch_floppy_select = 1; atari_dont_touch_floppy_select = 1;
restore_flags(flags); local_irq_restore(flags);
/* restore track register to saved value */ /* restore track register to saved value */
FDC_WRITE( FDCREG_TRACK, UD.track ); FDC_WRITE( FDCREG_TRACK, UD.track );
...@@ -484,8 +484,8 @@ static void fd_deselect( void ) ...@@ -484,8 +484,8 @@ static void fd_deselect( void )
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); /* protect against various other ints mucking around with the PSG */
cli(); /* protect against various other ints mucking around with the PSG */ local_irq_save(flags);
atari_dont_touch_floppy_select = 0; atari_dont_touch_floppy_select = 0;
sound_ym.rd_data_reg_sel=14; /* Select PSG Port A */ sound_ym.rd_data_reg_sel=14; /* Select PSG Port A */
sound_ym.wd_data = (sound_ym.rd_data_reg_sel | sound_ym.wd_data = (sound_ym.rd_data_reg_sel |
...@@ -493,7 +493,7 @@ static void fd_deselect( void ) ...@@ -493,7 +493,7 @@ static void fd_deselect( void )
/* On Falcon, the drive B select line is used on the printer port, so /* On Falcon, the drive B select line is used on the printer port, so
* leave it alone... */ * leave it alone... */
SelectedDrive = -1; SelectedDrive = -1;
restore_flags(flags); local_irq_restore(flags);
} }
...@@ -549,8 +549,8 @@ static void check_change( unsigned long dummy ) ...@@ -549,8 +549,8 @@ static void check_change( unsigned long dummy )
if (++drive > 1 || !UD.connected) if (++drive > 1 || !UD.connected)
drive = 0; drive = 0;
save_flags(flags); /* protect against various other ints mucking around with the PSG */
cli(); /* protect against various other ints mucking around with the PSG */ local_irq_save(flags);
if (!stdma_islocked()) { if (!stdma_islocked()) {
sound_ym.rd_data_reg_sel = 14; sound_ym.rd_data_reg_sel = 14;
...@@ -566,7 +566,7 @@ static void check_change( unsigned long dummy ) ...@@ -566,7 +566,7 @@ static void check_change( unsigned long dummy )
set_bit (drive, &changed_floppies); set_bit (drive, &changed_floppies);
} }
} }
restore_flags(flags); local_irq_restore(flags);
start_check_change_timer(); start_check_change_timer();
} }
...@@ -666,13 +666,12 @@ static int do_format(kdev_t device, struct atari_format_descr *desc) ...@@ -666,13 +666,12 @@ static int do_format(kdev_t device, struct atari_format_descr *desc)
DPRINT(("do_format( dr=%d tr=%d he=%d offs=%d )\n", DPRINT(("do_format( dr=%d tr=%d he=%d offs=%d )\n",
drive, desc->track, desc->head, desc->sect_offset )); drive, desc->track, desc->head, desc->sect_offset ));
save_flags(flags); local_irq_save(flags);
cli();
while( fdc_busy ) sleep_on( &fdc_wait ); while( fdc_busy ) sleep_on( &fdc_wait );
fdc_busy = 1; fdc_busy = 1;
stdma_lock(floppy_irq, NULL); stdma_lock(floppy_irq, NULL);
atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */ atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */
restore_flags(flags); local_irq_restore(flags);
type = minor(device) >> 2; type = minor(device) >> 2;
if (type) { if (type) {
...@@ -930,8 +929,7 @@ static void fd_rwsec( void ) ...@@ -930,8 +929,7 @@ static void fd_rwsec( void )
udelay(25); udelay(25);
/* Setup DMA */ /* Setup DMA */
save_flags(flags); local_irq_save(flags);
cli();
dma_wd.dma_lo = (unsigned char)paddr; dma_wd.dma_lo = (unsigned char)paddr;
MFPDELAY(); MFPDELAY();
paddr >>= 8; paddr >>= 8;
...@@ -943,7 +941,7 @@ static void fd_rwsec( void ) ...@@ -943,7 +941,7 @@ static void fd_rwsec( void )
else else
dma_wd.dma_hi = (unsigned char)paddr; dma_wd.dma_hi = (unsigned char)paddr;
MFPDELAY(); MFPDELAY();
restore_flags(flags); local_irq_restore(flags);
/* Clear FIFO and switch DMA to correct mode */ /* Clear FIFO and switch DMA to correct mode */
dma_wd.dma_mode_status = 0x90 | rwflag; dma_wd.dma_mode_status = 0x90 | rwflag;
...@@ -990,8 +988,7 @@ static void fd_readtrack_check( unsigned long dummy ) ...@@ -990,8 +988,7 @@ static void fd_readtrack_check( unsigned long dummy )
{ {
unsigned long flags, addr, addr2; unsigned long flags, addr, addr2;
save_flags(flags); local_irq_save(flags);
cli();
if (!MultReadInProgress) { if (!MultReadInProgress) {
/* This prevents a race condition that could arise if the /* This prevents a race condition that could arise if the
...@@ -1000,7 +997,7 @@ static void fd_readtrack_check( unsigned long dummy ) ...@@ -1000,7 +997,7 @@ static void fd_readtrack_check( unsigned long dummy )
* already cleared 'MultReadInProgress' when flow of control * already cleared 'MultReadInProgress' when flow of control
* gets here. * gets here.
*/ */
restore_flags(flags); local_irq_restore(flags);
return; return;
} }
...@@ -1026,7 +1023,7 @@ static void fd_readtrack_check( unsigned long dummy ) ...@@ -1026,7 +1023,7 @@ static void fd_readtrack_check( unsigned long dummy )
*/ */
SET_IRQ_HANDLER( NULL ); SET_IRQ_HANDLER( NULL );
MultReadInProgress = 0; MultReadInProgress = 0;
restore_flags(flags); local_irq_restore(flags);
DPRINT(("fd_readtrack_check(): done\n")); DPRINT(("fd_readtrack_check(): done\n"));
FDC_WRITE( FDCREG_CMD, FDCCMD_FORCI ); FDC_WRITE( FDCREG_CMD, FDCCMD_FORCI );
udelay(25); udelay(25);
...@@ -1038,7 +1035,7 @@ static void fd_readtrack_check( unsigned long dummy ) ...@@ -1038,7 +1035,7 @@ static void fd_readtrack_check( unsigned long dummy )
} }
else { else {
/* not yet finished, wait another tenth rotation */ /* not yet finished, wait another tenth rotation */
restore_flags(flags); local_irq_restore(flags);
DPRINT(("fd_readtrack_check(): not yet finished\n")); DPRINT(("fd_readtrack_check(): not yet finished\n"));
mod_timer(&readtrack_timer, jiffies + HZ/5/10); mod_timer(&readtrack_timer, jiffies + HZ/5/10);
} }
...@@ -1199,8 +1196,7 @@ static void fd_writetrack( void ) ...@@ -1199,8 +1196,7 @@ static void fd_writetrack( void )
udelay(40); udelay(40);
/* Setup DMA */ /* Setup DMA */
save_flags(flags); local_irq_save(flags);
cli();
dma_wd.dma_lo = (unsigned char)paddr; dma_wd.dma_lo = (unsigned char)paddr;
MFPDELAY(); MFPDELAY();
paddr >>= 8; paddr >>= 8;
...@@ -1212,7 +1208,7 @@ static void fd_writetrack( void ) ...@@ -1212,7 +1208,7 @@ static void fd_writetrack( void )
else else
dma_wd.dma_hi = (unsigned char)paddr; dma_wd.dma_hi = (unsigned char)paddr;
MFPDELAY(); MFPDELAY();
restore_flags(flags); local_irq_restore(flags);
/* Clear FIFO and switch DMA to correct mode */ /* Clear FIFO and switch DMA to correct mode */
dma_wd.dma_mode_status = 0x190; dma_wd.dma_mode_status = 0x190;
...@@ -1325,12 +1321,11 @@ static void finish_fdc_done( int dummy ) ...@@ -1325,12 +1321,11 @@ static void finish_fdc_done( int dummy )
start_check_change_timer(); start_check_change_timer();
start_motor_off_timer(); start_motor_off_timer();
save_flags(flags); local_irq_save(flags);
cli();
stdma_release(); stdma_release();
fdc_busy = 0; fdc_busy = 0;
wake_up( &fdc_wait ); wake_up( &fdc_wait );
restore_flags(flags); local_irq_restore(flags);
DPRINT(("finish_fdc() finished\n")); DPRINT(("finish_fdc() finished\n"));
} }
...@@ -1519,10 +1514,10 @@ void do_fd_request(request_queue_t * q) ...@@ -1519,10 +1514,10 @@ void do_fd_request(request_queue_t * q)
stdma_lock(floppy_irq, NULL); stdma_lock(floppy_irq, NULL);
atari_disable_irq( IRQ_MFP_FDC ); atari_disable_irq( IRQ_MFP_FDC );
save_flags(flags); /* The request function is called with ints local_save_flags(flags); /* The request function is called with ints
sti(); * disabled... so must save the IPL for later */ local_irq_disable(); * disabled... so must save the IPL for later */
redo_fd_request(); redo_fd_request();
restore_flags(flags); local_irq_restore(flags);
atari_enable_irq( IRQ_MFP_FDC ); atari_enable_irq( IRQ_MFP_FDC );
} }
......
...@@ -209,17 +209,16 @@ static void swimiop_init_request(struct swim_iop_req *req) ...@@ -209,17 +209,16 @@ static void swimiop_init_request(struct swim_iop_req *req)
static int swimiop_send_request(struct swim_iop_req *req) static int swimiop_send_request(struct swim_iop_req *req)
{ {
unsigned long cpu_flags; unsigned long flags;
int err; int err;
/* It's doubtful an interrupt routine would try to send */ /* It's doubtful an interrupt routine would try to send */
/* a SWIM request, but I'd rather play it safe here. */ /* a SWIM request, but I'd rather play it safe here. */
save_flags(cpu_flags); local_irq_save(flags);
cli();
if (current_req != NULL) { if (current_req != NULL) {
restore_flags(cpu_flags); local_irq_restore(flags);
return -ENOMEM; return -ENOMEM;
} }
...@@ -227,7 +226,7 @@ static int swimiop_send_request(struct swim_iop_req *req) ...@@ -227,7 +226,7 @@ static int swimiop_send_request(struct swim_iop_req *req)
/* Interrupts should be back on for iop_send_message() */ /* Interrupts should be back on for iop_send_message() */
restore_flags(cpu_flags); local_irq_restore(flags);
err = iop_send_message(SWIM_IOP, SWIM_CHAN, (void *) req, err = iop_send_message(SWIM_IOP, SWIM_CHAN, (void *) req,
sizeof(req->command), (__u8 *) &req->command[0], sizeof(req->command), (__u8 *) &req->command[0],
...@@ -423,14 +422,13 @@ static int grab_drive(struct floppy_state *fs, enum swim_state state, ...@@ -423,14 +422,13 @@ static int grab_drive(struct floppy_state *fs, enum swim_state state,
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli();
if (fs->state != idle) { if (fs->state != idle) {
++fs->wanted; ++fs->wanted;
while (fs->state != available) { while (fs->state != available) {
if (interruptible && signal_pending(current)) { if (interruptible && signal_pending(current)) {
--fs->wanted; --fs->wanted;
restore_flags(flags); local_irq_restore(flags);
return -EINTR; return -EINTR;
} }
interruptible_sleep_on(&fs->wait); interruptible_sleep_on(&fs->wait);
...@@ -438,7 +436,7 @@ static int grab_drive(struct floppy_state *fs, enum swim_state state, ...@@ -438,7 +436,7 @@ static int grab_drive(struct floppy_state *fs, enum swim_state state,
--fs->wanted; --fs->wanted;
} }
fs->state = state; fs->state = state;
restore_flags(flags); local_irq_restore(flags);
return 0; return 0;
} }
...@@ -446,11 +444,10 @@ static void release_drive(struct floppy_state *fs) ...@@ -446,11 +444,10 @@ static void release_drive(struct floppy_state *fs)
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli();
fs->state = idle; fs->state = idle;
start_request(fs); start_request(fs);
restore_flags(flags); local_irq_restore(flags);
} }
static void set_timeout(struct floppy_state *fs, int nticks, static void set_timeout(struct floppy_state *fs, int nticks,
...@@ -458,7 +455,7 @@ static void set_timeout(struct floppy_state *fs, int nticks, ...@@ -458,7 +455,7 @@ static void set_timeout(struct floppy_state *fs, int nticks,
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); cli(); local_irq_save(flags);
if (fs->timeout_pending) if (fs->timeout_pending)
del_timer(&fs->timeout); del_timer(&fs->timeout);
init_timer(&fs->timeout); init_timer(&fs->timeout);
...@@ -467,7 +464,7 @@ static void set_timeout(struct floppy_state *fs, int nticks, ...@@ -467,7 +464,7 @@ static void set_timeout(struct floppy_state *fs, int nticks,
fs->timeout.data = (unsigned long) fs; fs->timeout.data = (unsigned long) fs;
add_timer(&fs->timeout); add_timer(&fs->timeout);
fs->timeout_pending = 1; fs->timeout_pending = 1;
restore_flags(flags); local_irq_restore(flags);
} }
static void do_fd_request(request_queue_t * q) static void do_fd_request(request_queue_t * q)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment