* [PATCH] fix 2.5.39 floppy driver
@ 2002-09-28 19:14 Mikael Pettersson
2002-09-28 20:22 ` John Levon
0 siblings, 1 reply; 3+ messages in thread
From: Mikael Pettersson @ 2002-09-28 19:14 UTC (permalink / raw)
To: linux-kernel; +Cc: viro
The 2.5.39 floppy driver is still broken. Jens' fix to ll_rw_block
was included in 2.5.39, so the kernel doesn't reboot at the first
I/O operation as it did in 2.5.38, but several problems remain:
1. Accessing /dev/fd0H1440 oopses fs/block_dev.c:do_open().
Fixed by applying Al Viro's O100-get_gendisk-C38 patch.
2. The capacity of floppies is halved.
Fixed by applying Al Viro's O101-floppy_sizes-C38 patch.
3. /dev/fd0 size autodetection doesn't work properly. The very
first read or write only transmits 2K (or 4K with Al's patches)
of data. I/O works after a reopen of /dev/fd0.
Explanation: the floppy interrupt handler updates floppy_sizes[],
but doesn't set_capacity() on the corresponding gendisk, causing
the detected size for /dev/fd0 to not be applied until the next
time /dev/fd0 is opened.
Quick fix: add the missing set_capacity() calls.
With Al's two patches and this one floppies work reliably for me.
/Mikael
--- linux-2.5.39/drivers/block/floppy.c.~1~ Sat Sep 28 12:42:00 2002
+++ linux-2.5.39/drivers/block/floppy.c Sat Sep 28 18:49:27 2002
@@ -778,6 +778,7 @@
"disk change\n");
current_type[drive] = NULL;
floppy_sizes[TOMINOR(drive)] = MAX_DISK_SIZE << 1;
+ set_capacity(&disks[drive], floppy_sizes[TOMINOR(drive)]);
}
/*USETF(FD_DISK_NEWCHANGE);*/
@@ -2426,6 +2427,7 @@
}
current_type[current_drive] = _floppy;
floppy_sizes[TOMINOR(current_drive) ]= _floppy->size+1;
+ set_capacity(&disks[current_drive], floppy_sizes[TOMINOR(current_drive)]);
break;
}
@@ -2435,6 +2437,7 @@
_floppy->name,current_drive);
current_type[current_drive] = _floppy;
floppy_sizes[TOMINOR(current_drive)] = _floppy->size+1;
+ set_capacity(&disks[current_drive], floppy_sizes[TOMINOR(current_drive)]);
probing = 0;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix 2.5.39 floppy driver
2002-09-28 19:14 [PATCH] fix 2.5.39 floppy driver Mikael Pettersson
@ 2002-09-28 20:22 ` John Levon
2002-09-28 21:12 ` Thomas Molina
0 siblings, 1 reply; 3+ messages in thread
From: John Levon @ 2002-09-28 20:22 UTC (permalink / raw)
To: linux-kernel
On Sat, Sep 28, 2002 at 09:14:04PM +0200, Mikael Pettersson wrote:
> Fixed by applying Al Viro's O100-get_gendisk-C38 patch.
> Fixed by applying Al Viro's O101-floppy_sizes-C38 patch.
> Quick fix: add the missing set_capacity() calls.
Works great for me. Thanks.
regards
john
--
"When your name is Winner, that's it. You don't need a nickname."
- Loser Lane
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix 2.5.39 floppy driver
2002-09-28 20:22 ` John Levon
@ 2002-09-28 21:12 ` Thomas Molina
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Molina @ 2002-09-28 21:12 UTC (permalink / raw)
To: linux-kernel
On Sat, 28 Sep 2002, John Levon wrote:
> On Sat, Sep 28, 2002 at 09:14:04PM +0200, Mikael Pettersson wrote:
>
> > Fixed by applying Al Viro's O100-get_gendisk-C38 patch.
> > Fixed by applying Al Viro's O101-floppy_sizes-C38 patch.
> > Quick fix: add the missing set_capacity() calls.
>
> Works great for me. Thanks.
tested. I'll mark this item fixed on my list when it makes it to bk.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-09-28 21:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-28 19:14 [PATCH] fix 2.5.39 floppy driver Mikael Pettersson
2002-09-28 20:22 ` John Levon
2002-09-28 21:12 ` Thomas Molina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).