EISA: Initialize device before its resources
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
commit 26abfeed4341872364386c6a52b9acef8c81a81a
Author: Bjorn Helgaas <[email protected]>
Date: Mon Apr 15 14:34:02 2013 -0600
EISA: Initialize device before its resources
The regression was introduced as of v3.10-rc1.
Reverting this commit has resolved the bug. I wanted to get your feedback, since you are the patch author. Should we consider reverting this commit in mainline and the stable trees?
Thanks,
Joe
Quoted 4 lines · Joseph Salisbury
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
Sorry about that, and thanks for the report. Did you mean to include URL for the bug?
Quoted 16 lines
commit
26abfeed4341872364386c6a52b9acef8c81a81a
Author: Bjorn Helgaas <[email protected]>
Date: Mon Apr 15 14:34:02 2013 -0600EISA: Initialize device before its resources
The regression was introduced as of v3.10-rc1.
Reverting this commit has resolved the bug. I wanted to get your feedback, since you are the patch author. Should we consider reverting this commit in mainline and the stable trees?
Thanks,
Joe
Quoted 8 lines · Bjorn Helgaas
Quoted 4 lines · Joseph Salisbury
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
Sorry about that, and thanks for the report. Did you mean to include URL for the bug?
Yes, sorry about that:
http://pad.lv/1251816
Quoted 17 lines
Quoted 17 lines
commit
26abfeed4341872364386c6a52b9acef8c81a81a
Author: Bjorn Helgaas <[email protected]>
Date: Mon Apr 15 14:34:02 2013 -0600EISA: Initialize device before its resources
The regression was introduced as of v3.10-rc1.
Reverting this commit has resolved the bug. I wanted to get your feedback, since you are the patch author. Should we consider reverting this commit in mainline and the stable trees?
Thanks,
Joe
Quoted 11 lines · Joseph Salisbury
Quoted 8 lines · Bjorn Helgaas
Quoted 4 lines · Joseph Salisbury
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
Sorry about that, and thanks for the report. Did you mean to include URL for the bug?
Yes, sorry about that:
http://pad.lv/1251816
Hi Joseph,
Can you attach the 3.8.0-32-generic config (the one matching the successful boot at https://launchpadlibrarian.net/156685076/BootDmesg.txt) to the bug?
The only way I can match up the output:
EISA: Probing bus 0 at eisa.0
Cannot allocate resource for EISA slot 1
Cannot allocate resource for EISA slot 2
Cannot allocate resource for EISA slot 4
Cannot allocate resource for EISA slot 5
EISA: Detected 0 cards.
with the code is if we have root->force_probe set, and the only way I see for that to happen is if we're in the virtual_eisa_root_init() path and CONFIG_EISA_VLB_PRIMING=y:
#if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_EISA_VLB_PRIMING) #define EISA_FORCE_PROBE_DEFAULT 1 #else #define EISA_FORCE_PROBE_DEFAULT 0 #endif static int force_probe = EISA_FORCE_PROBE_DEFAULT;
virtual_eisa_root_init
eisa_bus_root.force_probe = force_probe
eisa_root_register(&eisa_bus_root)
eisa_probe(root)
printk("EISA: Probing bus %d at %s")
if (eisa_request_resources)
printk("EISA: Cannot allocate resource for mainboard") # we don't see this
if (eisa_init_device)
eisa_release_resources
kfree
if (!root->force_probe)
return -ENODEV
goto force_probe
printk("EISA: Mainboard %s detected") # we don't see this
force_probe:
for (i = 1; ...; i++)
if (eisa_request_resources(i))
printk("Cannot allocate resource for EISA slot %d", i)
printk("EISA: Detected %d cards")
Bjorn
Quoted 8 lines · Bjorn Helgaas
Quoted 7 lines · Joseph Salisbury
Quoted 6 lines · Bjorn Helgaas
Quoted 4 lines · Joseph Salisbury
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Sorry about that, and thanks for the report. Did you mean to include URL for the bug?
Yes, sorry about that:
http://pad.lv/1251816Hi Joseph,
Can you attach the 3.8.0-32-generic config (the one matching the successful boot at https://launchpadlibrarian.net/156685076/BootDmesg.txt) to the bug?
I attached the config file to the bug:
https://launchpadlibrarian.net/162754666/config.common.ubuntu
I also attached a tar file with the complete config directory for that kernel version.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/+attachment/3951156/+files/raring-config.tar
Quoted 44 lines
The only way I can match up the output:
EISA: Probing bus 0 at eisa.0
Cannot allocate resource for EISA slot 1
Cannot allocate resource for EISA slot 2
Cannot allocate resource for EISA slot 4
Cannot allocate resource for EISA slot 5
EISA: Detected 0 cards.with the code is if we have
root->force_probeset, and the only way I see for that to happen is if we're in thevirtual_eisa_root_init()path andCONFIG_EISA_VLB_PRIMING=y:#if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_EISA_VLB_PRIMING) #define EISA_FORCE_PROBE_DEFAULT 1 #else #define EISA_FORCE_PROBE_DEFAULT 0 #endif static int force_probe = EISA_FORCE_PROBE_DEFAULT;
virtual_eisa_root_init
eisa_bus_root.force_probe =force_probe
eisa_root_register(&eisa_bus_root)
eisa_probe(root)
printk("EISA: Probing bus %d at %s")
if (eisa_request_resources)
printk("EISA: Cannot allocate resource for mainboard")# we don't see this
if (eisa_init_device)
eisa_release_resources
kfree
if (!root->force_probe)
return-ENODEV
gotoforce_probe
printk("EISA: Mainboard %s detected")# we don't see this
force_probe:
for (i = 1; ...; i++)
if (eisa_request_resources(i))
printk("Cannot allocate resource for EISA slot %d", i)
printk("EISA: Detected %d cards")Bjorn
Quoted 18 lines · Joseph Salisbury
Quoted 8 lines · Bjorn Helgaas
Quoted 7 lines · Joseph Salisbury
Quoted 6 lines · Bjorn Helgaas
Quoted 4 lines · Joseph Salisbury
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Sorry about that, and thanks for the report. Did you mean to include URL for the bug?
Yes, sorry about that:
http://pad.lv/1251816Hi Joseph,
Can you attach the 3.8.0-32-generic config (the one matching the successful boot at https://launchpadlibrarian.net/156685076/BootDmesg.txt) to the bug?
Quoted 6 lines
I attached the config file to the bug:
https://launchpadlibrarian.net/162754666/config.common.ubuntuI also attached a tar file with the complete config directory for that kernel version.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/+attachment/3951156/+files/raring-config.tar
Thanks again. I attached the following reverts to launchpad. I screwed up when doing those EISA changes. I'd like to squeeze these into my v3.14 merge request (probably early next week), so please test and let me know if this fixes the problem. I'm really sorry for the inconvenience.
Bjorn
Revert "EISA: Log device resources in dmesg"
From: Bjorn Helgaas <[email protected]>
This reverts commit a2080d0c561c546d73cb8b296d4b7ca414e6860b.
--- drivers/eisa/eisa-bus.c | 1 - 1 file changed, 1 deletion(-)
drivers/eisa/eisa-bus.c +0 -1
@@ -288,7 +288,6 @@ static int __init eisa_request_resources(struct eisa_root_device *root, edev->res[i].flags =IORESOURCE_IO |IORESOURCE_BUSY ; } -dev_printk (KERN_DEBUG , &edev->dev,"%pR\n" , &edev->res[i]);if (request_resource (root->res, &edev->res[i])) goto failed; }
Revert "EISA: Initialize device before its resources"
From: Bjorn Helgaas <[email protected]>
This reverts commit 26abfeed4341872364386c6a52b9acef8c81a81a.
In the eisa_probe() force_probe path, if we were unable to request slot resources (e.g., [io 0x800-0x8ff]), we skipped the slot with "Cannot allocate resource for EISA slot %d" before reading the EISA signature in eisa_init_device().
Commit 26abfeed4341 moved eisa_init_device() earlier, so we tried to read the EISA signature before requesting the slot resources, and this caused hangs during boot.
--- drivers/eisa/eisa-bus.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
drivers/eisa/eisa-bus.c +15 -11
@@ -277,11 +277,13 @@ static int __init eisa_request_resources(struct eisa_root_device *root, }if (slot) { + edev->res[i].name =NULL ; edev->res[i].start =SLOT_ADDRESS (root, slot) + (i *0x400 ); edev->res[i].end = edev->res[i].start +0xff ; edev->res[i].flags =IORESOURCE_IO ; }else { + edev->res[i].name =NULL ; edev->res[i].start =SLOT_ADDRESS (root, slot) +EISA_VENDOR_ID_OFFSET ; edev->res[i].end = edev->res[i].start +3 ;
@@ -327,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root)return -ENOMEM ; } -if (eisa_init_device (root, edev,0 )) { +if (eisa_request_resources (root, edev,0 )) { +dev_warn (root->dev, +"EISA: Cannot allocate resource for mainboard\n" );kfree (edev);if (!root->force_probe) -return -ENODEV ; +return -EBUSY ; goto force_probe; } -if (eisa_request_resources (root, edev,0 )) { -dev_warn (root->dev, -"EISA: Cannot allocate resource for mainboard\n" ); +if (eisa_init_device (root, edev,0 )) { +eisa_release_resources (edev);kfree (edev);if (!root->force_probe) -return -EBUSY ; +return -ENODEV ; goto force_probe; }
@@ -362,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root)continue ; } -if (eisa_init_device (root, edev, i)) { -kfree (edev); -continue ; - } -if (eisa_request_resources (root, edev, i)) { dev_warn(root->dev, "Cannot allocate resource for EISA slot %d\n",
@@ -375,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root)continue ; } +if (eisa_init_device (root, edev, i)) { +eisa_release_resources (edev); +kfree (edev); +continue ; + } +if (edev->state == (EISA_CONFIG_ENABLED |EISA_CONFIG_FORCED )) enabled_str =" (forced enabled)" ;else if (edev->state ==EISA_CONFIG_FORCED )
Quoted 136 lines · Bjorn Helgaas
Quoted 15 lines · Joseph Salisbury
Quoted 14 lines · Bjorn Helgaas
Quoted 11 lines · Joseph Salisbury
Quoted 8 lines · Bjorn Helgaas
Quoted 4 lines · Joseph Salisbury
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
Sorry about that, and thanks for the report. Did you mean to include URL for the bug?
Yes, sorry about that:
http://pad.lv/1251816Hi Joseph,
Quoted 8 lines
Quoted 2 lines
Can you attach the 3.8.0-32-generic config (the one matching the successful boot at https://launchpadlibrarian.net/156685076/BootDmesg.txt) to the bug?
I attached the config file to the bug:
https://launchpadlibrarian.net/162754666/config.common.ubuntuI also attached a tar file with the complete config directory for that kernel version.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/+attachment/3951156/+files/raring-config.tarThanks again. I attached the following reverts to launchpad. I screwed up when doing those EISA changes. I'd like to squeeze these into my v3.14 merge request (probably early next week), so please test and let me know if this fixes the problem. I'm really sorry for the inconvenience.
Bjorn
Revert "EISA: Log device resources in dmesg"
From: Bjorn Helgaas <[email protected]>
This reverts commit
a2080d0c561c546d73cb8b296d4b7ca414e6860b.Signed-off-by Bjorn Helgaas <[email protected]>--- drivers/eisa/eisa-bus.c | 1 - 1 file changed, 1 deletion(-)drivers/eisa/eisa-bus.c +0
-1@@ -288,7 +288,6 @@ static int __init eisa_request_resources(struct eisa_root_device *root, edev->res[i].flags =IORESOURCE_IO |IORESOURCE_BUSY ; } -dev_printk (KERN_DEBUG , &edev->dev,"%pR\n" , &edev->res[i]);if (request_resource (root->res, &edev->res[i])) goto failed; }Revert "EISA: Initialize device before its resources"
From: Bjorn Helgaas <[email protected]>
This reverts commit
26abfeed4341872364386c6a52b9acef8c81a81a.In the
eisa_probe()force_probepath, if we were unable to request slot resources (e.g., [io 0x800-0x8ff]), we skipped the slot with "Cannot allocate resource for EISA slot %d" before reading the EISA signature ineisa_init_device().Commit
26abfeed4341movedeisa_init_device()earlier, so we tried to read the EISA signature before requesting the slot resources, and this caused hangs during boot.Signed-off-by Bjorn Helgaas <[email protected]>--- drivers/eisa/eisa-bus.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)drivers/eisa/eisa-bus.c +9
-11@@ -277,11 +277,13 @@ static int __init eisa_request_resources(struct eisa_root_device *root, }if (slot) { + edev->res[i].name =NULL ; edev->res[i].start =SLOT_ADDRESS (root, slot) + (i *0x400 ); edev->res[i].end = edev->res[i].start +0xff ; edev->res[i].flags =IORESOURCE_IO ; }else { + edev->res[i].name =NULL ; edev->res[i].start =SLOT_ADDRESS (root, slot) +EISA_VENDOR_ID_OFFSET ; edev->res[i].end = edev->res[i].start +3 ;@@ -327,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root)return -ENOMEM ; } -if (eisa_init_device (root, edev,0 )) { +if (eisa_request_resources (root, edev,0 )) { +dev_warn (root->dev, +"EISA: Cannot allocate resource for mainboard\n" );kfree (edev);if (!root->force_probe) -return -ENODEV ; +return -EBUSY ; goto force_probe; } -if (eisa_request_resources (root, edev,0 )) { -dev_warn (root->dev, -"EISA: Cannot allocate resource for mainboard\n" ); +if (eisa_init_device (root, edev,0 )) { +eisa_release_resources (edev);kfree (edev);if (!root->force_probe) -return -EBUSY ; +return -ENODEV ; goto force_probe; }@@ -362,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root)continue ; } -if (eisa_init_device (root, edev, i)) { -kfree (edev); -continue ; - } -if (eisa_request_resources (root, edev, i)) { dev_warn(root->dev, "Cannot allocate resource for EISA slot %d\n",@@ -375,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root)continue ; }
drivers/eisa/eisa-bus.c static int __init eisa_probe(struct eisa_root_device *root) · line 384
Quoted 10 lines
drivers/eisa/eisa-bus.c +6
-0+if (eisa_init_device (root, edev, i)) { +eisa_release_resources (edev); +kfree (edev); +continue ; + } +if (edev->state == (EISA_CONFIG_ENABLED |EISA_CONFIG_FORCED )) enabled_str =" (forced enabled)" ;else if (edev->state ==EISA_CONFIG_FORCED )
Thanks again for looking at this, Bjorn!
Yes, reverting commit 26abfeed4 does in fact resolve the bug. I already built a test kernel, noted in comment #34:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/comments/34
The original bug reporter tested the kernel to confirm it fixes the bug:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/comments/36
Would it be also possible for you to request the revert in the stable trees, in addition to 3.14?
Thanks,
Joe
Quoted 149 lines · Joseph Salisbury
Quoted 136 lines · Bjorn Helgaas
Quoted 15 lines · Joseph Salisbury
Quoted 14 lines · Bjorn Helgaas
Quoted 11 lines · Joseph Salisbury
Quoted 8 lines · Bjorn Helgaas
Quoted 4 lines · Joseph Salisbury
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
Sorry about that, and thanks for the report. Did you mean to include URL for the bug?
Yes, sorry about that:
http://pad.lv/1251816Hi Joseph,
Quoted 8 lines
Quoted 2 lines
Can you attach the 3.8.0-32-generic config (the one matching the successful boot at https://launchpadlibrarian.net/156685076/BootDmesg.txt) to the bug?
I attached the config file to the bug:
https://launchpadlibrarian.net/162754666/config.common.ubuntuI also attached a tar file with the complete config directory for that kernel version.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/+attachment/3951156/+files/raring-config.tarThanks again. I attached the following reverts to launchpad. I screwed up when doing those EISA changes. I'd like to squeeze these into my v3.14 merge request (probably early next week), so please test and let me know if this fixes the problem. I'm really sorry for the inconvenience.
Bjorn
Revert "EISA: Log device resources in dmesg"
From: Bjorn Helgaas <[email protected]>
This reverts commit
a2080d0c561c546d73cb8b296d4b7ca414e6860b.Signed-off-by Bjorn Helgaas <[email protected]>--- drivers/eisa/eisa-bus.c | 1 - 1 file changed, 1 deletion(-)drivers/eisa/eisa-bus.c +0
-1@@ -288,7 +288,6 @@ static int __init eisa_request_resources(struct eisa_root_device *root, edev->res[i].flags =IORESOURCE_IO |IORESOURCE_BUSY ; } -dev_printk (KERN_DEBUG , &edev->dev,"%pR\n" , &edev->res[i]);if (request_resource (root->res, &edev->res[i])) goto failed; }Revert "EISA: Initialize device before its resources"
From: Bjorn Helgaas <[email protected]>
This reverts commit
26abfeed4341872364386c6a52b9acef8c81a81a.In the
eisa_probe()force_probepath, if we were unable to request slot resources (e.g., [io 0x800-0x8ff]), we skipped the slot with "Cannot allocate resource for EISA slot %d" before reading the EISA signature ineisa_init_device().Commit
26abfeed4341movedeisa_init_device()earlier, so we tried to read the EISA signature before requesting the slot resources, and this caused hangs during boot.Signed-off-by Bjorn Helgaas <[email protected]>--- drivers/eisa/eisa-bus.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)drivers/eisa/eisa-bus.c +9
-11@@ -277,11 +277,13 @@ static int __init eisa_request_resources(struct eisa_root_device *root, }if (slot) { + edev->res[i].name =NULL ; edev->res[i].start =SLOT_ADDRESS (root, slot) + (i *0x400 ); edev->res[i].end = edev->res[i].start +0xff ; edev->res[i].flags =IORESOURCE_IO ; }else { + edev->res[i].name =NULL ; edev->res[i].start =SLOT_ADDRESS (root, slot) +EISA_VENDOR_ID_OFFSET ; edev->res[i].end = edev->res[i].start +3 ;@@ -327,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root)return -ENOMEM ; } -if (eisa_init_device (root, edev,0 )) { +if (eisa_request_resources (root, edev,0 )) { +dev_warn (root->dev, +"EISA: Cannot allocate resource for mainboard\n" );kfree (edev);if (!root->force_probe) -return -ENODEV ; +return -EBUSY ; goto force_probe; } -if (eisa_request_resources (root, edev,0 )) { -dev_warn (root->dev, -"EISA: Cannot allocate resource for mainboard\n" ); +if (eisa_init_device (root, edev,0 )) { +eisa_release_resources (edev);kfree (edev);if (!root->force_probe) -return -EBUSY ; +return -ENODEV ; goto force_probe; }@@ -362,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root)continue ; } -if (eisa_init_device (root, edev, i)) { -kfree (edev); -continue ; - } -if (eisa_request_resources (root, edev, i)) { dev_warn(root->dev, "Cannot allocate resource for EISA slot %d\n",@@ -375,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root)continue ; }drivers/eisa/eisa-bus.c static int __init eisa_probe(struct eisa_root_device *root) · line 384
Quoted 10 lines
drivers/eisa/eisa-bus.c +6
-0+if (eisa_init_device (root, edev, i)) { +eisa_release_resources (edev); +kfree (edev); +continue ; + } +if (edev->state == (EISA_CONFIG_ENABLED |EISA_CONFIG_FORCED )) enabled_str =" (forced enabled)" ;else if (edev->state ==EISA_CONFIG_FORCED )Thanks again for looking at this, Bjorn!
Quoted 6 lines
Yes, reverting commit
26abfeed4does in fact resolve the bug. I already built a test kernel, noted in comment #34:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/comments/34The original bug reporter tested the kernel to confirm it fixes the bug:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/comments/36
OK. I don't know exactly what patch you applied to revert this. I assume that you reverted both a2080d0c561 and 26abfeed43.
Quoted 2 lines
Would it be also possible for you to request the revert in the stable trees, in addition to 3.14?
Oh, of course, thanks for the reminder. I added a stable tag and re-pushed.
Bjorn
Quoted 151 lines · Bjorn Helgaas
Quoted 149 lines · Joseph Salisbury
Quoted 136 lines · Bjorn Helgaas
Quoted 15 lines · Joseph Salisbury
Quoted 14 lines · Bjorn Helgaas
Quoted 11 lines · Joseph Salisbury
Quoted 8 lines · Bjorn Helgaas
Quoted 4 lines · Joseph Salisbury
Hi Bjorn,
A kernel bug was opened against Ubuntu [0]. After a kernel bisect, it was found the following commit introduced this bug:
Sorry about that, and thanks for the report. Did you mean to include URL for the bug?
Yes, sorry about that:
http://pad.lv/1251816Hi Joseph,
Quoted 8 lines
Quoted 2 lines
Can you attach the 3.8.0-32-generic config (the one matching the successful boot at https://launchpadlibrarian.net/156685076/BootDmesg.txt) to the bug?
I attached the config file to the bug:
https://launchpadlibrarian.net/162754666/config.common.ubuntuI also attached a tar file with the complete config directory for that kernel version.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/+attachment/3951156/+files/raring-config.tarThanks again. I attached the following reverts to launchpad. I screwed up when doing those EISA changes. I'd like to squeeze these into my v3.14 merge request (probably early next week), so please test and let me know if this fixes the problem. I'm really sorry for the inconvenience.
Bjorn
Revert "EISA: Log device resources in dmesg"
From: Bjorn Helgaas <[email protected]>
This reverts commit
a2080d0c561c546d73cb8b296d4b7ca414e6860b.Signed-off-by Bjorn Helgaas <[email protected]>--- drivers/eisa/eisa-bus.c | 1 - 1 file changed, 1 deletion(-)drivers/eisa/eisa-bus.c +0
-1@@ -288,7 +288,6 @@ static int __init eisa_request_resources(struct eisa_root_device *root, edev->res[i].flags =IORESOURCE_IO |IORESOURCE_BUSY ; } -dev_printk (KERN_DEBUG , &edev->dev,"%pR\n" , &edev->res[i]);if (request_resource (root->res, &edev->res[i])) goto failed; }Revert "EISA: Initialize device before its resources"
From: Bjorn Helgaas <[email protected]>
This reverts commit
26abfeed4341872364386c6a52b9acef8c81a81a.In the
eisa_probe()force_probepath, if we were unable to request slot resources (e.g., [io 0x800-0x8ff]), we skipped the slot with "Cannot allocate resource for EISA slot %d" before reading the EISA signature ineisa_init_device().Commit
26abfeed4341movedeisa_init_device()earlier, so we tried to read the EISA signature before requesting the slot resources, and this caused hangs during boot.Signed-off-by Bjorn Helgaas <[email protected]>--- drivers/eisa/eisa-bus.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)drivers/eisa/eisa-bus.c +9
-11@@ -277,11 +277,13 @@ static int __init eisa_request_resources(struct eisa_root_device *root, }if (slot) { + edev->res[i].name =NULL ; edev->res[i].start =SLOT_ADDRESS (root, slot) + (i *0x400 ); edev->res[i].end = edev->res[i].start +0xff ; edev->res[i].flags =IORESOURCE_IO ; }else { + edev->res[i].name =NULL ; edev->res[i].start =SLOT_ADDRESS (root, slot) +EISA_VENDOR_ID_OFFSET ; edev->res[i].end = edev->res[i].start +3 ;@@ -327,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root)return -ENOMEM ; } -if (eisa_init_device (root, edev,0 )) { +if (eisa_request_resources (root, edev,0 )) { +dev_warn (root->dev, +"EISA: Cannot allocate resource for mainboard\n" );kfree (edev);if (!root->force_probe) -return -ENODEV ; +return -EBUSY ; goto force_probe; } -if (eisa_request_resources (root, edev,0 )) { -dev_warn (root->dev, -"EISA: Cannot allocate resource for mainboard\n" ); +if (eisa_init_device (root, edev,0 )) { +eisa_release_resources (edev);kfree (edev);if (!root->force_probe) -return -EBUSY ; +return -ENODEV ; goto force_probe; }@@ -362,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root)continue ; } -if (eisa_init_device (root, edev, i)) { -kfree (edev); -continue ; - } -if (eisa_request_resources (root, edev, i)) { dev_warn(root->dev, "Cannot allocate resource for EISA slot %d\n",@@ -375,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root)continue ; }drivers/eisa/eisa-bus.c static int __init eisa_probe(struct eisa_root_device *root) · line 384
Quoted 10 lines
drivers/eisa/eisa-bus.c +6
-0+if (eisa_init_device (root, edev, i)) { +eisa_release_resources (edev); +kfree (edev); +continue ; + } +if (edev->state == (EISA_CONFIG_ENABLED |EISA_CONFIG_FORCED )) enabled_str =" (forced enabled)" ;else if (edev->state ==EISA_CONFIG_FORCED )Thanks again for looking at this, Bjorn!
Quoted 8 lines
Quoted 6 lines
Yes, reverting commit
26abfeed4does in fact resolve the bug. I already built a test kernel, noted in comment #34:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/comments/34The original bug reporter tested the kernel to confirm it fixes the bug:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/comments/36OK. I don't know exactly what patch you applied to revert this. I assume that you reverted both
a2080d0c561and26abfeed43.
Right, my original test kernel only had commit 26abfeed43 reverted. I built one more kernel with both a2080d0c561 and 26abfeed43 reverted, and that does resolve the bug:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816/comments/44
Thanks again for the help, Bjorn!
Quoted 6 lines
Quoted 3 lines
Would it be also possible for you to request the revert in the stable trees, in addition to 3.14?
Oh, of course, thanks for the reminder. I added a stable tag and re-pushed.
Bjorn