Commit a72b8859 authored by Robert Richter's avatar Robert Richter Committed by Robert Richter

edac, highbank: Fix interrupt setup of mem and l2 controller

Register and enable interrupts after the edac registration. Otherwise
incomming ecc error interrupts lead to crashes during device setup.

Fixing this in drivers for mc and l2.
Signed-off-by: default avatarRobert Richter <robert.richter@linaro.org>
Acked-by: default avatarRob Herring <rob.herring@calxeda.com>
Cc: stable <stable@vger.kernel.org>     # 3.6+
Signed-off-by: default avatarRobert Richter <rric@kernel.org>
parent 959f5854
...@@ -90,28 +90,30 @@ static int highbank_l2_err_probe(struct platform_device *pdev) ...@@ -90,28 +90,30 @@ static int highbank_l2_err_probe(struct platform_device *pdev)
goto err; goto err;
} }
dci->mod_name = dev_name(&pdev->dev);
dci->dev_name = dev_name(&pdev->dev);
if (edac_device_add_device(dci))
goto err;
drvdata->db_irq = platform_get_irq(pdev, 0); drvdata->db_irq = platform_get_irq(pdev, 0);
res = devm_request_irq(&pdev->dev, drvdata->db_irq, res = devm_request_irq(&pdev->dev, drvdata->db_irq,
highbank_l2_err_handler, highbank_l2_err_handler,
0, dev_name(&pdev->dev), dci); 0, dev_name(&pdev->dev), dci);
if (res < 0) if (res < 0)
goto err; goto err2;
drvdata->sb_irq = platform_get_irq(pdev, 1); drvdata->sb_irq = platform_get_irq(pdev, 1);
res = devm_request_irq(&pdev->dev, drvdata->sb_irq, res = devm_request_irq(&pdev->dev, drvdata->sb_irq,
highbank_l2_err_handler, highbank_l2_err_handler,
0, dev_name(&pdev->dev), dci); 0, dev_name(&pdev->dev), dci);
if (res < 0) if (res < 0)
goto err; goto err2;
dci->mod_name = dev_name(&pdev->dev);
dci->dev_name = dev_name(&pdev->dev);
if (edac_device_add_device(dci))
goto err;
devres_close_group(&pdev->dev, NULL); devres_close_group(&pdev->dev, NULL);
return 0; return 0;
err2:
edac_device_del_device(&pdev->dev);
err: err:
devres_release_group(&pdev->dev, NULL); devres_release_group(&pdev->dev, NULL);
edac_device_free_ctl_info(dci); edac_device_free_ctl_info(dci);
......
...@@ -189,14 +189,6 @@ static int highbank_mc_probe(struct platform_device *pdev) ...@@ -189,14 +189,6 @@ static int highbank_mc_probe(struct platform_device *pdev)
goto err; goto err;
} }
irq = platform_get_irq(pdev, 0);
res = devm_request_irq(&pdev->dev, irq, highbank_mc_err_handler,
0, dev_name(&pdev->dev), mci);
if (res < 0) {
dev_err(&pdev->dev, "Unable to request irq %d\n", irq);
goto err;
}
mci->mtype_cap = MEM_FLAG_DDR3; mci->mtype_cap = MEM_FLAG_DDR3;
mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED;
mci->edac_cap = EDAC_FLAG_SECDED; mci->edac_cap = EDAC_FLAG_SECDED;
...@@ -217,10 +209,20 @@ static int highbank_mc_probe(struct platform_device *pdev) ...@@ -217,10 +209,20 @@ static int highbank_mc_probe(struct platform_device *pdev)
if (res < 0) if (res < 0)
goto err; goto err;
irq = platform_get_irq(pdev, 0);
res = devm_request_irq(&pdev->dev, irq, highbank_mc_err_handler,
0, dev_name(&pdev->dev), mci);
if (res < 0) {
dev_err(&pdev->dev, "Unable to request irq %d\n", irq);
goto err2;
}
highbank_mc_create_debugfs_nodes(mci); highbank_mc_create_debugfs_nodes(mci);
devres_close_group(&pdev->dev, NULL); devres_close_group(&pdev->dev, NULL);
return 0; return 0;
err2:
edac_mc_del_mc(&pdev->dev);
err: err:
devres_release_group(&pdev->dev, NULL); devres_release_group(&pdev->dev, NULL);
edac_mc_free(mci); edac_mc_free(mci);
......
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