[PATCH] Platform bus support
Pierre Ossman
drzeus-list at drzeus.cx
Wed Aug 24 08:48:20 PDT 2005
David Zeuthen wrote:
>On Tue, 2005-08-23 at 23:06 +0200, Pierre Ossman wrote:
>
>
>>Huh? Platform has been in the kernel for ages. At least since 2.6.9,
>>probably since 2.6.0.
>>
>>
>
>Yes.. but fixing the x86 floppy driver to give this
>
> [davidz at daxter ~]$ ls -l /sys/bus/platform/devices/floppy.0/
> total 0
> lrwxrwxrwx 1 root root 0 Aug 24 10:14 block -> ../../../block/fd0
> lrwxrwxrwx 1 root root 0 Aug 24 06:13 bus -> ../../../bus/platform
> drwxr-xr-x 2 root root 0 Aug 24 10:14 power
> [davidz at daxter ~]$
>
>
>is a rather recent addition - an addition that allows us to treat the
>x86 floppy drive like any other block device. So.. we just need to make
>sure that the patch works with this too..
>
>
>
Ah. So the situation would be that with this patch you would get a
floppy block node _without_ a parent on old systems and a node _with_ a
parent on new systems, right?
>>I've found a machine to fiddle with. I has a floppy controller, but no
>>floppy drive. But when I removed 'parent == NULL' from your hack I at
>>least got:
>>
>>16124: 22:57:42.943: probe-pc-floppy.c:73: Checking if /dev/fd0 is
>>actually present
>>16124: 22:57:42.945: probe-pc-floppy.c:88: floppy drive name is 'H1440'
>>16124: 22:57:43.633: probe-pc-floppy.c:96: floppy drive /dev/fd0 seems
>>not to exist
>>
>>It would seem some hacking is till needed since the platform information
>>cannot provide any decent information about the actual device. Perhaps
>>we could scan all block devices with the ioctl:s in probe-pc-floppy and
>>use that?
>>
>>
>>I have to run off now, but if you have some ideas on how to proceed I
>>can continue this tomorrow.
>>
>>
>
>I have a machine with a real floppy drive.. Send me a patch and I'll
>test it!
>
>
>
>
Well, I wouldn't know how to make said patch. It still needs some hack
to determine that it's a floppy. I see three solutions:
* Continue checking device node name. Easiest to do, just remove (parent
== NULL) from the current if-clause.
* Check the name of the device (i.e. "floppy-[0-9]+"). This is how the
platform bus identifies things on Linux.
* Try the floppy ioctl:s on every block device found. Consider those
with a valid response to be floppies. This is the least hackish, but I
don't know enough about the ioctls to determine how well it would work.
So which of the three would be preferred?
Rgds
Pierre
More information about the hal
mailing list