Commit cb60736b authored by Arnaud Patard's avatar Arnaud Patard Committed by Jeff Garzik

Fix libata resource conflict for legacy mode

When the libata is trying to handle legacy ide ports (0x1f0 for instance), it
doesn't take care if the resource has childs or not.
The result is that this situation :
0100-01fe : pnp 00:09
  0170-0177 : libata
  01f0-01f7 : libata

is seen as conflict, which is wrong.
The proposed fix is to detect childs and in this case, look at which child is
conflicting.
Signed-off-by: default avatarArnaud Patard <apatard@mandriva.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 95064a75
...@@ -1016,11 +1016,14 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, ...@@ -1016,11 +1016,14 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
res.start = 0x1f0; res.start = 0x1f0;
res.end = 0x1f0 + 8 - 1; res.end = 0x1f0 + 8 - 1;
conflict = ____request_resource(&ioport_resource, &res); conflict = ____request_resource(&ioport_resource, &res);
while (conflict->child)
conflict = ____request_resource(conflict, &res);
if (!strcmp(conflict->name, "libata")) if (!strcmp(conflict->name, "libata"))
legacy_mode |= (1 << 0); legacy_mode |= (1 << 0);
else { else {
disable_dev_on_err = 0; disable_dev_on_err = 0;
printk(KERN_WARNING "ata: 0x1f0 IDE port busy\n"); printk(KERN_WARNING "ata: 0x1f0 IDE port busy\n" \
"ata: conflict with %s\n", conflict->name);
} }
} else } else
legacy_mode |= (1 << 0); legacy_mode |= (1 << 0);
...@@ -1030,11 +1033,14 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, ...@@ -1030,11 +1033,14 @@ int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
res.start = 0x170; res.start = 0x170;
res.end = 0x170 + 8 - 1; res.end = 0x170 + 8 - 1;
conflict = ____request_resource(&ioport_resource, &res); conflict = ____request_resource(&ioport_resource, &res);
while (conflict->child)
conflict = ____request_resource(conflict, &res);
if (!strcmp(conflict->name, "libata")) if (!strcmp(conflict->name, "libata"))
legacy_mode |= (1 << 1); legacy_mode |= (1 << 1);
else { else {
disable_dev_on_err = 0; disable_dev_on_err = 0;
printk(KERN_WARNING "ata: 0x170 IDE port busy\n"); printk(KERN_WARNING "ata: 0x170 IDE port busy\n" \
"ata: conflict with %s\n", conflict->name);
} }
} else } else
legacy_mode |= (1 << 1); legacy_mode |= (1 << 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment