: ide-floppy & devfs

: ide-floppy & devfs

Post by Martin Wilc » Sun, 29 Jul 2001 04:40:07



Hi,

The following patch causes ide-floppy to register a disc
even if no cartridge is in the drive, so that devfs creates
nodes for the drive for later use. Without this patch,
if devfs is used, no device node is ever created, and
ide-floppy must be rmmoded and reloaded if a floppy is inserted
into a drive that was empty at boot time.

The reason is that grok_partitions() returns immediately if the
device passed has a size parameter of 0, which was the case
in ide-floppy with no cartrifge in the drive.

The patch is against 2.4.7.

It is somewhat a hack, perhaps somebody else finds a more elegant
way to do it. But it makes sense that an empty drive
does not return a capacity of 0, but the capacity of a standard media
cartridge.

Martin

--

FSC EP PS DS1, Paderborn      Tel. +49 5251 8 15113

--- 2.4.7a/drivers/ide/ide-probe.c      Sun Mar 18 18:25:02 2001

                                                printk("cdrom or floppy?, assuming ");
                                        if (drive->media != ide_cdrom) {
                                                printk ("FLOPPY");
+                                               drive->removable = 1;
                                                break;
                                        }
                                }
--- 2.4.7a/drivers/ide/ide-floppy.c     Wed Jul 25 20:20:44 2001

                                        printk (KERN_NOTICE "%s: warning: non 512 bytes block size not fully supported\n", drive->name);
                                rc = 0;
                        }
-               }
+               } else if (!i && descriptor->dc == CAPACITY_NO_CARTRIDGE
+                          && drive->removable && !(length % 512)) {
+                       /*
+                          Set these two so that idefloppy_capacity returns a positive value,
+                          needed for devfs registration.
+                        */
+                       floppy->blocks = blocks;
+                       floppy->bs_factor = length / 512;
+               };
 #if IDEFLOPPY_DEBUG_INFO
                if (!i) printk (KERN_INFO "Descriptor 0 Code: %d\n", descriptor->dc);
                printk (KERN_INFO "Descriptor %d: %dkB, %d blocks, %d sector size\n", i, blocks * length / 1024, blocks, length);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

: ide-floppy & devfs

Post by Richard Gooc » Sun, 29 Jul 2001 21:30:08


Quote:Kevin P. Fleming writes:
> Also note that I have already forwarded a patch to Richard to make
> the devfs nodes that get created when grok_partitions runs get
> removed when the media is removed and new media is validated
> (i.e. the partition nodes will stay in sync with the cartridge in
> the drive).

Are you saying that the two patch conflict? If not, can someone please
verify that both together are safe? Or is your patch a superset?

Either way, I can't really test these patches since I don't have
removable media devices, so I'd prefer if someone else nurses this
into Linus' tree (i.e. test it, call for testing and feed it to Linus
until it goes in).

                                Regards,

                                        Richard....


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

: ide-floppy & devfs

Post by Kevin P. Flemin » Mon, 30 Jul 2001 01:30:13


<snip>

Quote:> Are you saying that the two patch conflict? If not, can someone please
> verify that both together are safe? Or is your patch a superset?

Actually, the patches are complementary. However, my patch I won't be
continuing to work on, as the entire way that partitions are
read/validated/passed to devfs/etc will be changed in 2.5, and I've already
forwarded this patch over to the maintainer of that code (whose name escapes
my memory at the moment). So I'd say don't worry about it from the devfs
end, you'll see the changes once 2.5 opens and these changes get merged in
to that tree.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

: ide-floppy & devfs

Post by Kevin P. Flemin » Thu, 09 Aug 2001 03:30:13


Also, Andre's new IDE driver subsystem will allow me to continue what I had
originally started working on, which was implementing Media Status
Notification in the ide-floppy driver, so that the drive can "intelligently"
allow/disallow media removal, and when media is removed, the /dev entries
will be kept up to date as well. This looks like all 2.5 stuff as well,
though, as I don't expect to see Andre's new IDE stuff for 2.4 any time
soon.
----- Original Message -----






Sent: Tuesday, August 07, 2001 1:25 PM
Subject: Re: [PATCH]: ide-floppy & devfs

> OK.  I am the maintainer of the code, and I will try to make sense out
> of all the patches that got submitted while I was away on holiday...

> BTW, I also am looking forward to 2.5 starting when we can get this
> devfs stuff really working.  I have a version of ide-floppy "working
> with devfs" on my system but it still has too many funnies.

> Watch this space.

> Paul


> > <snip>

> >>Are you saying that the two patch conflict? If not, can someone please
> >>verify that both together are safe? Or is your patch a superset?

> > Actually, the patches are complementary. However, my patch I won't be
> > continuing to work on, as the entire way that partitions are
> > read/validated/passed to devfs/etc will be changed in 2.5, and I've
already
> > forwarded this patch over to the maintainer of that code (whose name
escapes
> > my memory at the moment). So I'd say don't worry about it from the devfs
> > end, you'll see the changes once 2.5 opens and these changes get merged
in
> > to that tree.

> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in

> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/

> --

> Paul

> Email:

> Web:
> http://paulbristow.net
> ICQ:
> 11965223

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. ide-floppy & devfs - /dev entry not created if drive is empty

Hallo Paul Bristow,

I have tested ide-floppy on my Linux 2.4.19 with ATAPI ZIP 100. I am
using devfs.

I found following problem:

If module ide-floppy is loaded and no disc is present in the drive,
/dev/ide/host0/bus1/target1/lun0/disc entry is not created. Later
inserted media cannot be checked in any way, because no /dev entry
exists.

Older kernels have also this behavior.

Fix: Create .../disc entry in all cases, even if no disc is present.

--
Stanislav Brabec
http://www.penguin.cz/~utx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Linux and Western Digital 13G hard disk

3. ide-floppy & devfs - /dev entry not created if drive is empty (repost)

4. how to assign out=`cmd` w/out waiting for "cmd" to finish??

5. devfs and ide-floppy.c

6. Topic summary from solarisx86@yahoogroups.com

7. devfs and IDE ATAPI floppy

8. Dual-boot - accessing Linux file-system from DOS partition?

9. devfs (3/7) - cleanup devfs use in ide

10. IDE floppy drives and devfs - no device nodes if no disk loaded at boot

11. floppy.c vs. ide-floppy.c

12. devfs and temrinal creation problems (devfs & pts)

13. PATCH: support for IDE devices in ide-scsi with devfs