aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@broadcom.com>2017-08-22 05:57:03 -0400
committerVinod Koul <vinod.koul@intel.com>2017-08-28 07:14:24 -0400
commitb99c238669a7abdfc54d14494687c13856280a50 (patch)
treeea07ffaa3d3e62aa2af3d3a23bd1083273fe086a
parentd6ffd2395a9225f89ab7e07b4ee5216018aa7787 (diff)
dmaengine: bcm-sba-raid: Remove redundant SBA_REQUEST_STATE_RECEIVED
The SBA_REQUEST_STATE_RECEIVED state is now redundant because received sba_request are immediately freed or moved to completed list in sba_process_received_request(). This patch removes redundant SBA_REQUEST_STATE_RECEIVED state. Signed-off-by: Anup Patel <anup.patel@broadcom.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/bcm-sba-raid.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c
index abed03967e94..8d2487de1086 100644
--- a/drivers/dma/bcm-sba-raid.c
+++ b/drivers/dma/bcm-sba-raid.c
@@ -98,9 +98,8 @@ enum sba_request_flags {
98 SBA_REQUEST_STATE_ALLOCED = 0x002, 98 SBA_REQUEST_STATE_ALLOCED = 0x002,
99 SBA_REQUEST_STATE_PENDING = 0x004, 99 SBA_REQUEST_STATE_PENDING = 0x004,
100 SBA_REQUEST_STATE_ACTIVE = 0x008, 100 SBA_REQUEST_STATE_ACTIVE = 0x008,
101 SBA_REQUEST_STATE_RECEIVED = 0x010, 101 SBA_REQUEST_STATE_COMPLETED = 0x010,
102 SBA_REQUEST_STATE_COMPLETED = 0x020, 102 SBA_REQUEST_STATE_ABORTED = 0x020,
103 SBA_REQUEST_STATE_ABORTED = 0x040,
104 SBA_REQUEST_STATE_MASK = 0x0ff, 103 SBA_REQUEST_STATE_MASK = 0x0ff,
105 SBA_REQUEST_FENCE = 0x100, 104 SBA_REQUEST_FENCE = 0x100,
106}; 105};
@@ -160,7 +159,6 @@ struct sba_device {
160 struct list_head reqs_alloc_list; 159 struct list_head reqs_alloc_list;
161 struct list_head reqs_pending_list; 160 struct list_head reqs_pending_list;
162 struct list_head reqs_active_list; 161 struct list_head reqs_active_list;
163 struct list_head reqs_received_list;
164 struct list_head reqs_completed_list; 162 struct list_head reqs_completed_list;
165 struct list_head reqs_aborted_list; 163 struct list_head reqs_aborted_list;
166 struct list_head reqs_free_list; 164 struct list_head reqs_free_list;
@@ -307,18 +305,6 @@ static void _sba_complete_request(struct sba_device *sba,
307 sba->reqs_fence = false; 305 sba->reqs_fence = false;
308} 306}
309 307
310/* Note: Must be called with sba->reqs_lock held */
311static void _sba_received_request(struct sba_device *sba,
312 struct sba_request *req)
313{
314 lockdep_assert_held(&sba->reqs_lock);
315 req->flags &= ~SBA_REQUEST_STATE_MASK;
316 req->flags |= SBA_REQUEST_STATE_RECEIVED;
317 list_move_tail(&req->node, &sba->reqs_received_list);
318 if (list_empty(&sba->reqs_active_list))
319 sba->reqs_fence = false;
320}
321
322static void sba_free_chained_requests(struct sba_request *req) 308static void sba_free_chained_requests(struct sba_request *req)
323{ 309{
324 unsigned long flags; 310 unsigned long flags;
@@ -360,10 +346,6 @@ static void sba_cleanup_nonpending_requests(struct sba_device *sba)
360 list_for_each_entry_safe(req, req1, &sba->reqs_alloc_list, node) 346 list_for_each_entry_safe(req, req1, &sba->reqs_alloc_list, node)
361 _sba_free_request(sba, req); 347 _sba_free_request(sba, req);
362 348
363 /* Freeup all received request */
364 list_for_each_entry_safe(req, req1, &sba->reqs_received_list, node)
365 _sba_free_request(sba, req);
366
367 /* Freeup all completed request */ 349 /* Freeup all completed request */
368 list_for_each_entry_safe(req, req1, &sba->reqs_completed_list, node) 350 list_for_each_entry_safe(req, req1, &sba->reqs_completed_list, node)
369 _sba_free_request(sba, req); 351 _sba_free_request(sba, req);
@@ -482,9 +464,6 @@ static void sba_process_received_request(struct sba_device *sba,
482 _sba_free_request(sba, nreq); 464 _sba_free_request(sba, nreq);
483 INIT_LIST_HEAD(&first->next); 465 INIT_LIST_HEAD(&first->next);
484 466
485 /* Mark request as received */
486 _sba_received_request(sba, first);
487
488 /* The client is allowed to attach dependent operations 467 /* The client is allowed to attach dependent operations
489 * until 'ack' is set 468 * until 'ack' is set
490 */ 469 */
@@ -1498,7 +1477,6 @@ static int sba_prealloc_channel_resources(struct sba_device *sba)
1498 INIT_LIST_HEAD(&sba->reqs_alloc_list); 1477 INIT_LIST_HEAD(&sba->reqs_alloc_list);
1499 INIT_LIST_HEAD(&sba->reqs_pending_list); 1478 INIT_LIST_HEAD(&sba->reqs_pending_list);
1500 INIT_LIST_HEAD(&sba->reqs_active_list); 1479 INIT_LIST_HEAD(&sba->reqs_active_list);
1501 INIT_LIST_HEAD(&sba->reqs_received_list);
1502 INIT_LIST_HEAD(&sba->reqs_completed_list); 1480 INIT_LIST_HEAD(&sba->reqs_completed_list);
1503 INIT_LIST_HEAD(&sba->reqs_aborted_list); 1481 INIT_LIST_HEAD(&sba->reqs_aborted_list);
1504 INIT_LIST_HEAD(&sba->reqs_free_list); 1482 INIT_LIST_HEAD(&sba->reqs_free_list);