From patchwork Tue Aug 22 09:57:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 9914725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0135C60381 for ; Tue, 22 Aug 2017 10:00:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E7F72883F for ; Tue, 22 Aug 2017 10:00:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0126C28854; Tue, 22 Aug 2017 09:59:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 877E12883F for ; Tue, 22 Aug 2017 09:59:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932693AbdHVJ7C (ORCPT ); Tue, 22 Aug 2017 05:59:02 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:37927 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932306AbdHVJ7A (ORCPT ); Tue, 22 Aug 2017 05:59:00 -0400 Received: by mail-wr0-f182.google.com with SMTP id p8so56564038wrf.5 for ; Tue, 22 Aug 2017 02:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HA4BbKDH+Za0rIDw5CZKs3Z5dLp97L+MYdaDpJCNmRo=; b=T01Aqeo/D5/D6Jeq513PY5URWMjIWZivPGcKYOFsHCosHQkgd3Ytg7SYzWSTmj6p73 DRhj0IKsMQR7nwwhZ06K7hLWj6o8JKfzA3ofnyWxzecYqgsrPibzdjT6MNC7othQoaG4 Ro3mREVBk6H7vd3PFJZYWAhU2/2Auh4T8mADE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HA4BbKDH+Za0rIDw5CZKs3Z5dLp97L+MYdaDpJCNmRo=; b=mxVHk8xXqTed3/Y98kiexsdy0apqgvudq6TlpIZCTHZsHk9HezuA3DLwYj6tPK0HWg ITteO/zh1Fz+lkeVcGbsi62g2MI4IWtyMJU+7kMTCFXcQVb+23Pwm/Ws9p/B2HWmH4AR M9bIr3+JgZn7bUUn0mcoNLK8FOqqbapwpFuCI1qWpsrzBQ5nmyNxMhE7I9oeEn2juaTw tyEsS+GORKUG6FSuSx3//vCvDuhwezwkMVd11msucCwhWK0eIpSfb0Z/Pu+LgkAwJnM/ E4F4PrwqoEpkkPD8ggcLqMq1fEFNWhFgVdKsZm8g1lrWaS9wmZ4qtI9fx+SFVNo3ttiz pHRg== X-Gm-Message-State: AHYfb5hYxeOmcWhLWLyTI9yC7KcsH4anEFoqhCEKV2Exy0o+3GWQpkCd 5LuTNpLu5VIIvfFm X-Received: by 10.223.137.9 with SMTP id s9mr82767wrs.242.1503395938785; Tue, 22 Aug 2017 02:58:58 -0700 (PDT) Received: from anup-HP-Compaq-8100-Elite-CMT-PC.dhcp.avagotech.net ([192.19.237.250]) by smtp.gmail.com with ESMTPSA id e137sm12257913wma.29.2017.08.22.02.58.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Aug 2017 02:58:58 -0700 (PDT) From: Anup Patel To: Vinod Koul , Dan Williams Cc: Florian Fainelli , Scott Branden , Ray Jui , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Anup Patel Subject: [PATCH v3 14/17] dmaengine: bcm-sba-raid: Remove redundant SBA_REQUEST_STATE_RECEIVED Date: Tue, 22 Aug 2017 15:27:03 +0530 Message-Id: <1503395827-19428-15-git-send-email-anup.patel@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503395827-19428-1-git-send-email-anup.patel@broadcom.com> References: <1503395827-19428-1-git-send-email-anup.patel@broadcom.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/dma/bcm-sba-raid.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c index cb6b2e2..f0a0e80 100644 --- a/drivers/dma/bcm-sba-raid.c +++ b/drivers/dma/bcm-sba-raid.c @@ -98,9 +98,8 @@ enum sba_request_flags { SBA_REQUEST_STATE_ALLOCED = 0x002, SBA_REQUEST_STATE_PENDING = 0x004, SBA_REQUEST_STATE_ACTIVE = 0x008, - SBA_REQUEST_STATE_RECEIVED = 0x010, - SBA_REQUEST_STATE_COMPLETED = 0x020, - SBA_REQUEST_STATE_ABORTED = 0x040, + SBA_REQUEST_STATE_COMPLETED = 0x010, + SBA_REQUEST_STATE_ABORTED = 0x020, SBA_REQUEST_STATE_MASK = 0x0ff, SBA_REQUEST_FENCE = 0x100, }; @@ -160,7 +159,6 @@ struct sba_device { struct list_head reqs_alloc_list; struct list_head reqs_pending_list; struct list_head reqs_active_list; - struct list_head reqs_received_list; struct list_head reqs_completed_list; struct list_head reqs_aborted_list; struct list_head reqs_free_list; @@ -307,18 +305,6 @@ static void _sba_complete_request(struct sba_device *sba, sba->reqs_fence = false; } -/* Note: Must be called with sba->reqs_lock held */ -static void _sba_received_request(struct sba_device *sba, - struct sba_request *req) -{ - lockdep_assert_held(&sba->reqs_lock); - req->flags &= ~SBA_REQUEST_STATE_MASK; - req->flags |= SBA_REQUEST_STATE_RECEIVED; - list_move_tail(&req->node, &sba->reqs_received_list); - if (list_empty(&sba->reqs_active_list)) - sba->reqs_fence = false; -} - static void sba_free_chained_requests(struct sba_request *req) { unsigned long flags; @@ -360,10 +346,6 @@ static void sba_cleanup_nonpending_requests(struct sba_device *sba) list_for_each_entry_safe(req, req1, &sba->reqs_alloc_list, node) _sba_free_request(sba, req); - /* Freeup all received request */ - list_for_each_entry_safe(req, req1, &sba->reqs_received_list, node) - _sba_free_request(sba, req); - /* Freeup all completed request */ list_for_each_entry_safe(req, req1, &sba->reqs_completed_list, node) _sba_free_request(sba, req); @@ -482,9 +464,6 @@ static void sba_process_received_request(struct sba_device *sba, _sba_free_request(sba, nreq); INIT_LIST_HEAD(&first->next); - /* Mark request as received */ - _sba_received_request(sba, first); - /* The client is allowed to attach dependent operations * until 'ack' is set */ @@ -1498,7 +1477,6 @@ static int sba_prealloc_channel_resources(struct sba_device *sba) INIT_LIST_HEAD(&sba->reqs_alloc_list); INIT_LIST_HEAD(&sba->reqs_pending_list); INIT_LIST_HEAD(&sba->reqs_active_list); - INIT_LIST_HEAD(&sba->reqs_received_list); INIT_LIST_HEAD(&sba->reqs_completed_list); INIT_LIST_HEAD(&sba->reqs_aborted_list); INIT_LIST_HEAD(&sba->reqs_free_list);