diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-05-31 02:53:03 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-31 02:53:03 -0400 |
commit | 5c2de44417523385010b529599a2b30f290831a3 (patch) | |
tree | adb1ff03eee4b2c9955ab11664548a529f6d2bc8 /drivers/dma | |
parent | 9436b4abec28a22edd961ae375535d940625f1f2 (diff) |
dmaengine: shdma: Fix up fallout from runtime PM changes.
The runtime PM changes introduce sh_dmae_rst() wrapping via the
runtime_resume helper, depending on dev_get_drvdata() to fetch the
platform data needed for the DMAOR initialization default at a time
where drvdata hasn't yet been established by the probe path, resulting
in general probe misery:
Unable to handle kernel NULL pointer dereference at virtual address 000000c4
pc = 8025adee
*pde = 00000000
Oops: 0000 [#1]
Modules linked in:
Pid : 1, Comm: swapper
CPU : 0 Not tainted (3.0.0-rc1-00012-g9436b4a-dirty #1456)
PC is at sh_dmae_rst+0x28/0x86
PR is at sh_dmae_rst+0x22/0x86
PC : 8025adee SP : 9e803d10 SR : 400080f1 TEA : 000000c4
R0 : 000000c4 R1 : 0000fff8 R2 : 00000000 R3 : 00000040
R4 : 000000f0 R5 : 00000000 R6 : 00000000 R7 : 804f184c
R8 : 00000000 R9 : 804dd0e8 R10 : 80283204 R11 : ffffffda
R12 : 000000a0 R13 : 804dd18c R14 : 9e803d10
MACH: 00000000 MACL: 00008f20 GBR : 00000000 PR : 8025ade8
Call trace:
[<8025ae70>] sh_dmae_runtime_resume+0x24/0x34
[<80283238>] pm_generic_runtime_resume+0x34/0x3c
[<80283370>] rpm_callback+0x4a/0x7e
[<80283efc>] rpm_resume+0x240/0x384
[<80283f54>] rpm_resume+0x298/0x384
[<8028428c>] __pm_runtime_resume+0x44/0x7c
[<8038a358>] __ioremap_caller+0x0/0xec
[<80284296>] __pm_runtime_resume+0x4e/0x7c
[<8038a358>] __ioremap_caller+0x0/0xec
[<80666254>] sh_dmae_probe+0x180/0x6a0
[<802803ae>] platform_drv_probe+0x26/0x2e
Fix up the ordering accordingly.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/shdma.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 636e40925b16..727e76ff13e1 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
@@ -1144,6 +1144,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev) | |||
1144 | /* platform data */ | 1144 | /* platform data */ |
1145 | shdev->pdata = pdata; | 1145 | shdev->pdata = pdata; |
1146 | 1146 | ||
1147 | platform_set_drvdata(pdev, shdev); | ||
1148 | |||
1147 | pm_runtime_enable(&pdev->dev); | 1149 | pm_runtime_enable(&pdev->dev); |
1148 | pm_runtime_get_sync(&pdev->dev); | 1150 | pm_runtime_get_sync(&pdev->dev); |
1149 | 1151 | ||
@@ -1256,7 +1258,6 @@ static int __init sh_dmae_probe(struct platform_device *pdev) | |||
1256 | 1258 | ||
1257 | pm_runtime_put(&pdev->dev); | 1259 | pm_runtime_put(&pdev->dev); |
1258 | 1260 | ||
1259 | platform_set_drvdata(pdev, shdev); | ||
1260 | dma_async_device_register(&shdev->common); | 1261 | dma_async_device_register(&shdev->common); |
1261 | 1262 | ||
1262 | return err; | 1263 | return err; |
@@ -1278,6 +1279,8 @@ rst_err: | |||
1278 | 1279 | ||
1279 | if (dmars) | 1280 | if (dmars) |
1280 | iounmap(shdev->dmars); | 1281 | iounmap(shdev->dmars); |
1282 | |||
1283 | platform_set_drvdata(pdev, NULL); | ||
1281 | emapdmars: | 1284 | emapdmars: |
1282 | iounmap(shdev->chan_reg); | 1285 | iounmap(shdev->chan_reg); |
1283 | synchronize_rcu(); | 1286 | synchronize_rcu(); |
@@ -1316,6 +1319,8 @@ static int __exit sh_dmae_remove(struct platform_device *pdev) | |||
1316 | iounmap(shdev->dmars); | 1319 | iounmap(shdev->dmars); |
1317 | iounmap(shdev->chan_reg); | 1320 | iounmap(shdev->chan_reg); |
1318 | 1321 | ||
1322 | platform_set_drvdata(pdev, NULL); | ||
1323 | |||
1319 | synchronize_rcu(); | 1324 | synchronize_rcu(); |
1320 | kfree(shdev); | 1325 | kfree(shdev); |
1321 | 1326 | ||