Messages in this thread | | | Date | Sun, 15 Nov 1998 17:14:15 +0100 | From | Alain Knaff <> | Subject | Re: Does 2.1.127 still needs floppy resource fix? |
| |
In linux, you wrote: > >--EVF5PPMfhYS0aIcm >Content-Type: text/plain; charset=us-ascii > >The attached patch was submitted by Andrzej Krzysztofowicz ><ankry@green.mif.pg.gda.pl> to fix resource problems when >floppy initialization fails. I assume it's still needed... >-- >Chip Salzenberg - a.k.a. - <chip@perlsupport.com> > "There -- we made them swerve slightly!" //MST3K > >--EVF5PPMfhYS0aIcm >Content-Type: text/plain; charset=us-ascii >Content-Disposition: attachment; filename=patch > > >Index: drivers/block/floppy.c >*************** __initfunc(int floppy_init(void)) >*** 4182,4185 **** >--- 4182,4188 ---- > FDCS->rawcmd = 2; > if (user_reset_fdc(-1,FD_RESET_ALWAYS,0)){ >+ /* free ioports reserved by floppy_grab_irq_and_dma() */ >+ release_region(FDCS->address, 6); >+ release_region(FDCS->address+7, 1); > FDCS->address = -1; > FDCS->version = FDC_NONE; >*************** __initfunc(int floppy_init(void)) >*** 4189,4192 **** >--- 4192,4198 ---- > FDCS->version = get_fdc_version(); > if (FDCS->version == FDC_NONE){ >+ /* free ioports reserved by floppy_grab_irq_and_dma() */ >+ release_region(FDCS->address, 6); >+ release_region(FDCS->address+7, 1); > FDCS->address = -1; > continue;
Indeed, the above two items are still needed in 2.1.x. Without them, the region of the second floppy disk controller would not get freed if there was any problem initializ'ing it.
>*************** __initfunc(int floppy_init(void)) >*** 4210,4213 **** >--- 4216,4225 ---- > { > DPRINT("no floppy controllers found\n"); >+ floppy_tq.routine = (void *)(void *) empty; >+ mark_bh(IMMEDIATE_BH); >+ schedule();
This should not be needed with the 2.1.x kernels. First, there is now a routine wich does the setting of floppy_tq.routine and mark_bh in one step. Second: if any bottom half routine is still pending, it is _already_ marked, so no need to do a mark_bh of empty here. In conclusion, a call to schedule() alone should be enough to "drain" any bottom handlers that might still be hanging around.
>+ if (usage_count) >+ floppy_release_irq_and_dma();
Why is this needed? At this point in time, usage_count is always zero, as the floppy_release_irq_and_dma already happened a few lines earlyer. Well, fortunately, it tests usage_count at least ;-).
>+ blk_dev[MAJOR_NR].request_fn = NULL;
Why is this needed? If it is needed, wouldn't we need it before _every_ unregister_blkdev? If so, shouldn't we do it in the unregister_blkdev function itself (in fs/devices.c) rather than in each driver?
> unregister_blkdev(MAJOR_NR,"fd"); > } > >--EVF5PPMfhYS0aIcm-- > >- >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >the body of a message to majordomo@vger.rutgers.edu >Please read the FAQ at http://www.tux.org/lkml/
Regards,
Alain
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |