linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]: ide-floppy & devfs
       [not found] <200107271541.f6RFfFe12463@mobilix.ras.ucalgary.ca>
@ 2001-07-27 19:34 ` Martin Wilck
  2001-07-27 23:40   ` Kevin P. Fleming
  2001-07-28 12:15   ` Richard Gooch
  0 siblings, 2 replies; 6+ messages in thread
From: Martin Wilck @ 2001-07-27 19:34 UTC (permalink / raw)
  To: Richard Gooch; +Cc: Martin Wilck, devfs mailing list, Linux Kernel mailing list


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

-- 
Martin Wilck     <Martin.Wilck@fujitsu-siemens.com>
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
+++ 2.4.7/drivers/ide/ide-probe.c	Fri Jul 27 23:01:49 2001
@@ -122,6 +122,7 @@
 						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
+++ 2.4.7/drivers/ide/ide-floppy.c	Fri Jul 27 23:00:38 2001
@@ -1279,7 +1279,15 @@
 					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);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH]: ide-floppy & devfs
  2001-07-27 19:34 ` [PATCH]: ide-floppy & devfs Martin Wilck
@ 2001-07-27 23:40   ` Kevin P. Fleming
  2001-07-28 12:15   ` Richard Gooch
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin P. Fleming @ 2001-07-27 23:40 UTC (permalink / raw)
  To: Martin Wilck, Richard Gooch
  Cc: Martin Wilck, devfs mailing list, Linux Kernel mailing list

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).

----- Original Message -----
From: "Martin Wilck" <Martin.Wilck@fujitsu-siemens.com>
To: "Richard Gooch" <rgooch@ras.ucalgary.ca>
Cc: "Martin Wilck" <Martin.Wilck@fujitsu-siemens.com>; "devfs mailing list"
<devfs@oss.sgi.com>; "Linux Kernel mailing list"
<linux-kernel@vger.kernel.org>
Sent: Friday, July 27, 2001 12:34 PM
Subject: [PATCH]: ide-floppy & devfs


>
> 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
>
> --
> Martin Wilck     <Martin.Wilck@fujitsu-siemens.com>
> 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
> +++ 2.4.7/drivers/ide/ide-probe.c Fri Jul 27 23:01:49 2001
> @@ -122,6 +122,7 @@
>   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
> +++ 2.4.7/drivers/ide/ide-floppy.c Fri Jul 27 23:00:38 2001
> @@ -1279,7 +1279,15 @@
>   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);
>
>
>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH]: ide-floppy & devfs
  2001-07-27 19:34 ` [PATCH]: ide-floppy & devfs Martin Wilck
  2001-07-27 23:40   ` Kevin P. Fleming
@ 2001-07-28 12:15   ` Richard Gooch
  2001-07-28 16:23     ` Kevin P. Fleming
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Gooch @ 2001-07-28 12:15 UTC (permalink / raw)
  To: Kevin P. Fleming
  Cc: Martin Wilck, devfs mailing list, Linux Kernel mailing list

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....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH]: ide-floppy & devfs
  2001-07-28 12:15   ` Richard Gooch
@ 2001-07-28 16:23     ` Kevin P. Fleming
  2001-08-07 20:25       ` Paul Bristow
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin P. Fleming @ 2001-07-28 16:23 UTC (permalink / raw)
  To: Richard Gooch; +Cc: Martin Wilck, devfs mailing list, Linux Kernel mailing list

<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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH]: ide-floppy & devfs
  2001-08-07 20:25       ` Paul Bristow
@ 2001-08-07 18:28         ` Kevin P. Fleming
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin P. Fleming @ 2001-08-07 18:28 UTC (permalink / raw)
  To: Paul Bristow
  Cc: Richard Gooch, Martin Wilck, devfs mailing list,
	Linux Kernel mailing list

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 -----
From: "Paul Bristow" <paul@paulbristow.net>
To: "Kevin P. Fleming" <kevin@labsysgrp.com>
Cc: "Richard Gooch" <rgooch@ras.ucalgary.ca>; "Martin Wilck"
<Martin.Wilck@fujitsu-siemens.com>; "devfs mailing list"
<devfs@oss.sgi.com>; "Linux Kernel mailing list"
<linux-kernel@vger.kernel.org>
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
>
> Kevin P. Fleming wrote:
> > <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
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> >
>
>
> --
>
> Paul
>
> Email:
> paul@paulbristow.net
> Web:
> http://paulbristow.net
> ICQ:
> 11965223
>
>
>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH]: ide-floppy & devfs
  2001-07-28 16:23     ` Kevin P. Fleming
@ 2001-08-07 20:25       ` Paul Bristow
  2001-08-07 18:28         ` Kevin P. Fleming
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Bristow @ 2001-08-07 20:25 UTC (permalink / raw)
  To: Kevin P. Fleming
  Cc: Richard Gooch, Martin Wilck, devfs mailing list,
	Linux Kernel mailing list

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

Kevin P. Fleming wrote:
> <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
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


-- 

Paul

Email: 
paul@paulbristow.net
Web: 
http://paulbristow.net
ICQ: 
11965223


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-08-07 18:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200107271541.f6RFfFe12463@mobilix.ras.ucalgary.ca>
2001-07-27 19:34 ` [PATCH]: ide-floppy & devfs Martin Wilck
2001-07-27 23:40   ` Kevin P. Fleming
2001-07-28 12:15   ` Richard Gooch
2001-07-28 16:23     ` Kevin P. Fleming
2001-08-07 20:25       ` Paul Bristow
2001-08-07 18:28         ` Kevin P. Fleming

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).