aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common/pl330.c
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2011-12-21 05:19:00 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-03 10:16:25 -0500
commitf98b9a26fe08f7f9d7fb26ee3d9f167f79b2f6b6 (patch)
tree086ebd4a3724e6ff6b3bd9dd0cadf4efbcb0bd50 /arch/arm/common/pl330.c
parent1ec332a3756a22405d2fbd5352e3afab556cb205 (diff)
ARM: 7242/1: PL330: Detach the request from the pl330_thread when it finishes successful
When a request has finished successfully and we are about to call its callback, remove its pointer from the corresponding pl330_thread . This prevents the core driver from calling its callback again if pl330_release_channel() is called without first flushing the device. When pl330_update() returns, the driver is allowed to free the pointer to pl330_req so the core driver shouldn't be able to access it again. Reference: <CAJe_ZhftO+481BfL0ErEcM_brfmSuTXkTEniLRYxxM2T7OM2QA@mail.gmail.com> Signed-off-by: Javi Merino <javi.merino@arm.com> Acked-by: Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common/pl330.c')
-rw-r--r--arch/arm/common/pl330.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c
index 8d8df744f7a5..d8e44a43047c 100644
--- a/arch/arm/common/pl330.c
+++ b/arch/arm/common/pl330.c
@@ -1467,13 +1467,19 @@ int pl330_update(const struct pl330_info *pi)
1467 1467
1468 /* Now that we are in no hurry, do the callbacks */ 1468 /* Now that we are in no hurry, do the callbacks */
1469 while (!list_empty(&pl330->req_done)) { 1469 while (!list_empty(&pl330->req_done)) {
1470 struct pl330_req *r;
1471
1470 rqdone = container_of(pl330->req_done.next, 1472 rqdone = container_of(pl330->req_done.next,
1471 struct _pl330_req, rqd); 1473 struct _pl330_req, rqd);
1472 1474
1473 list_del_init(&rqdone->rqd); 1475 list_del_init(&rqdone->rqd);
1474 1476
1477 /* Detach the req */
1478 r = rqdone->r;
1479 rqdone->r = NULL;
1480
1475 spin_unlock_irqrestore(&pl330->lock, flags); 1481 spin_unlock_irqrestore(&pl330->lock, flags);
1476 _callback(rqdone->r, PL330_ERR_NONE); 1482 _callback(r, PL330_ERR_NONE);
1477 spin_lock_irqsave(&pl330->lock, flags); 1483 spin_lock_irqsave(&pl330->lock, flags);
1478 } 1484 }
1479 1485