Messages in this thread Patch in this message | | | From | Bjorn Helgaas <> | Subject | Re: 2.6.8-rc4-mm1 doesn't boot | Date | Fri, 13 Aug 2004 15:15:56 -0600 |
| |
On Thursday 12 August 2004 4:43 pm, Len Brown wrote: > I expect that the the bug is that floppy.c, like other motherboard > devices, should take advantage of ACPI for device resource > enumeration.
Adrian, can you try the following patch? This is very sketchy start at using ACPI to enumerate floppies. This patch only checks for a floppy controller (PNP0700) in the ACPI namespace. If ACPI has been disabled, or we actually find a controller, we probe blindly for the floppy controller as we did in the past. If ACPI is enabled and we DON'T find a controller, we just exit with -ENODEV.
A more ambitious patch would actually look at the _CRS of the controller and use the IRQ and DMA information from there instead of the current hard-coded defaults. But that's a lot more invasive and likely to break things. And since floppies are nearly extinct, I'm not sure there's enough benefit to justify that.
===== drivers/block/floppy.c 1.103 vs edited ===== --- 1.103/drivers/block/floppy.c 2004-08-02 02:00:45 -06:00 +++ edited/drivers/block/floppy.c 2004-08-13 15:09:13 -06:00 @@ -180,6 +180,9 @@ #include <linux/devfs_fs_kernel.h> #include <linux/device.h> #include <linux/buffer_head.h> /* for invalidate_buffers() */ +#include <linux/acpi.h> + +#include <acpi/acpi_bus.h> /* * PS/2 floppies have much slower step rates than regular floppies. @@ -4222,10 +4225,41 @@ return get_disk(disks[drive]); } +#ifdef CONFIG_ACPI_BUS +static int acpi_floppies_found = 0; + +static int acpi_floppy_add(struct acpi_device *device) +{ + printk("%s: found a controller at ACPI %s\n", DEVICE_NAME, + device->pnp.bus_id); + acpi_floppies_found++; + return 0; +} + +static struct acpi_driver acpi_floppy_driver = { + .name = "floppy", + .ids = "PNP0700", + .ops = { + .add = acpi_floppy_add, + }, +}; + +static int acpi_floppy_init(void) +{ + return acpi_bus_register_driver(&acpi_floppy_driver); +} +#endif + int __init floppy_init(void) { int i, unit, drive; int err, dr; + +#ifdef CONFIG_ACPI_BUS + err = acpi_floppy_init(); + if (err >= 0 && acpi_floppies_found == 0) + return -ENODEV; +#endif raw_cmd = NULL; - 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/
| |