Patch for drivers/block/floppy.c

Claus-Justus Heine (claus@momo.math.rwth-aachen.de)
02 Apr 1997 11:13:35 +0200


--pgp-sign-Multipart_Wed_Apr__2_11:13:29_1997-1
Content-Type: multipart/mixed;
boundary="Multipart_Wed_Apr__2_11:13:29_1997-1"
Content-Transfer-Encoding: 7bit

--Multipart_Wed_Apr__2_11:13:29_1997-1
Content-Type: text/plain; charset=US-ASCII

Hi!

Below I've included a small patch to the floppy driver that makes it
check for IO regions before doing any hardware probing. There could be
conflicts between the floppy driver and the ftape driver when
accidentally trying to access a floppy disk while the ftape driver was
using the tape drive (or vice versa). My latest development version of
the ftape driver also uses the check_region() calls before accessing
hardware registers s.t. those conflicts should be solved.

What I've done: call check_region() before actually accessing the
hardware. If the region is unused, call request_region() to signal
other drivers (i.e. ftape) that the io region is currently in use.

The current version of the floppy driver does part of its hardware
probing before checking if other drivers (i.e. ftape) make currently
use of it.

The patched floppy driver also releases the regions after releasing the
irq and dma channel. The current implementation doesn't do this but
leave the io region `allocated' until it is unloaded (i.e. never when
compiled into the kernel). This behavior make the proper use of
check/request/release_region() impossible with the floppy driver.

Hopefully the patch doesn't hose up the floppy driver. It works for
me, though. That patch is against 2.1.30. It should also apply to
2.0.29, but I only tested it with 2.1.30.

Cheers

Claus

--Multipart_Wed_Apr__2_11:13:29_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="floppy.c.dif"
Content-Transfer-Encoding: x-uue

begin 644 floppy.c.dif
M+2TM(&9L;W!P>2YC+6]R:6<)5V5D($%P<B`@,B`Q,#HS.3HU-"`Q.3DW"BLK
M*R!F;&]P<'DN8PE4=64@07!R("`Q(#$X.C(R.C,R(#$Y.3<*0$`@+30P,#$L
M,3`@*S0P,#$L,3(@0$`*(`D)"6-O;G1I;G5E.PH@"0E]"B`**R-I9B`P"B`)
M"7)E<75E<W1?<F5G:6]N*$9$0U,M/F%D9')E<W,L(#8L(")F;&]P<'DB*3L*
M(`D)<F5Q=65S=%]R96=I;VXH1D1#4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D1#4RT^861D<F5S<R`A/2`M,2E[
M"BL)"0ER97-E=%]F9&-?:6YF;R@Q*3L**PD)"69D7V]U=&(H1D1#4RT^9&]R
M+"!&1%]$3U(I.PHK"0E]"BL)?0HK"69D8R`](#`["BL)<V5T7V1O<B@P+"!^
M,"P@."D[("`O*B!A=F]I9"!I;6UE9&EA=&4@:6YT97)R=7!T("HO"BL*(`EF
M;W(@*&9D8R`](#`[(&9D8R`\($Y?1D1#.R!F9&,K*RD*(`D):68@*$9$0U,M
M/F%D9')E<W,@(3T@+3$I"B`)"0EF9%]O=71B*$9$0U,M/F1O<BP@1D1?1$]2
M*3L*0$`@+30P-S(L-B`K-#`Y-BPW($!`"B`*('-T871I8R!V;VED(&9L;W!P
M>5]R96QE87-E7VER<5]A;F1?9&UA*'9O:60I"B!["BL):6YT(&]L9%]F9&,[
M"B`C:69D968@1DQ/4%!97U-!3DE465]#2$5#2PH@(VEF;F1E9B!?7W-P87)C
M7U\*(`EI;G0@9')I=F4["D!`("TT,3(Q+#8@*S0Q-#8L,3,@0$`*(`EI9B`H
M9FQO<'!Y7W1Q+G-Y;F,I"B`)"7!R:6YT:R@B=&%S:R!Q=65U92!S=&EL;"!A
M8W1I=F5<;B(I.PH@(V5N9&EF"BL);VQD7V9D8R`](&9D8SL**PEF;W(@*&9D
M8R`](#`[(&9D8R`\($Y?1D1#.R!F9&,K*RD**PD):68@*$9$0U,M/F%D9')E
M<W,@(3T@+3$I('L**PD)"7)E;&5A<V5?<F5G:6]N*$9$0U,M/F%D9')E<W,L
M(#8I.PHK"0D)<F5L96%S95]R96=I;VXH1D1#4RT^861D<F5S<RLW+"`Q*3L*
M*PD)?0HK"69D8R`](&]L9%]F9&,["B`)34]$7T1%0U]54T5?0T]53E0["B!]
#"B`*
`
end

--Multipart_Wed_Apr__2_11:13:29_1997-1
Content-Type: text/plain; charset=US-ASCII

Claus-Justus Heine
claus@momo.math.rwth-aachen.de
http://samuel.math.rwth-aachen.de/~LBFM/claus

PGP Public Key:
http://samuel.math.rwth-aachen.de/~LBFM/claus/claus-public-key.asc

Ftape - the Linux Floppy Tape Project
WWW : http://samuel.math.rwth-aachen.de/~LBFM/claus/ftape
Mailing-list: linux-tape@vger.rutgers.edu
Newsgroup : linux.dev.tape




--Multipart_Wed_Apr__2_11:13:29_1997-1--

--pgp-sign-Multipart_Wed_Apr__2_11:13:29_1997-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----
Version: 2.6.3i
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBM0IjPto/s1zPE7AdAQE6JwP/b+k3EIj719Wwjof0AOzNG66Wdl8e+YJS
kK9DZ6t2iLCXCNHa2OCu8t4DdxwWV/KjmYpjfQgyybz8F+lYFWIuwcB0YPRjpPrx
qV8e78eAcsw+shw8ptVErWs9YltvWLwomTf1lnFZS3Z/xzX97ARVW0PnNlHpZglA
di1ws4hBly8=
=aCSv
-----END PGP MESSAGE-----

--pgp-sign-Multipart_Wed_Apr__2_11:13:29_1997-1--