From patchwork Tue Aug 1 10:37:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 9874185 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 32F7160365 for ; Tue, 1 Aug 2017 10:42:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F78B2853E for ; Tue, 1 Aug 2017 10:42:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3412A2868B; Tue, 1 Aug 2017 10:42:51 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDC702853E for ; Tue, 1 Aug 2017 10:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8INfpFYzvRoQHEGZJfXpKWEx3NH4bMZfiyC8oVslFz8=; b=mcE93QX4pR02xQys+nXld/3nAl 5S0v+4NnEB9wDgA9U6jHCqA+OXJ+Za2iLryRd+MZv9YXHp4A5aPatDndyZjg9YXlO/OX5j6IBB1sI bL3TB7i+YXxBVHxocIs8XNKh+rnzT3Y5kIGnMfGeS2g/Xx9fk0zqomToYtfPMVyLUmQrci++pV7ye VY7DAmL2Ji5XpvW2hBKQsJ6/IrSH5Ib+0RsipJQKLcuxrWBK+TAkvuHAK/oF9ThjTBZSTZS3kYqAv kEKMZCtYYGqbkyDKI2AtRnG1C7YCkGIB8Y1ctXj9Wo4FWPd4aeZ/qqq+hvjcf63jHAdYxue/jX9dG 4ylGlyzQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dcUdT-0007zU-El; Tue, 01 Aug 2017 10:42:47 +0000 Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dcUbk-00064U-12 for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2017 10:42:09 +0000 Received: by mail-qt0-x235.google.com with SMTP id 16so6438453qtz.4 for ; Tue, 01 Aug 2017 03:40:44 -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=DFzCMa9I1eA7MVZlO2H7mqTcb/ZGuM+YRskqt4GNDsF4ElHeCOyYA9bCLZ8jAJQiOU Wq4Cy1HGpPv+lhZJtQcqrH0b/1QZSHs1eWnOCqVinX+1jmIUfeam83lZMBFStQu5TQ+G AmWeZLKCD7k2A9iNQ548mNLFePgX0xMaSdMcc= 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=p+UkzOjH1yWJSuKGI1eycEEPlT8WJJ1LVJaeXvNBHHS/NdASsBvPcrm48uxBvvvBLR ioAKKIbOMV7urVnXdtZTeUrzvelUQdWbf4dm4d5fDVEKTThNN66zp74ttl/u/oCQFPh3 TBwqRkTv6lhLBUVwjTllXD0v95ZxDNfSi/vh5rF17sYEMaFn1YikDiHUEgoNTVRB4xfY 5z4xSGJLGjGeR+kK5dugKXKCBOkvvab1rsSoqqigFNCAaO4WGyeuca4LBIyWd6le9AyC WmsX6KouX4+acmkuM6SywfyJyaNz4i5j+wueIqq1SYbztbwmm6WjwBGZpZ6mduRnxaGM dLgg== X-Gm-Message-State: AIVw110pAroucj0GJeylGlKzIKZql1DlvxcyTDS/y23Wn00B3tnLbX3E jGF8ViSdjR2IgbzH X-Received: by 10.200.8.152 with SMTP id v24mr1566073qth.68.1501584043781; Tue, 01 Aug 2017 03:40:43 -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 e32sm21784162qtb.63.2017.08.01.03.40.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Aug 2017 03:40:43 -0700 (PDT) From: Anup Patel To: Rob Herring , Mark Rutland , Vinod Koul , Dan Williams Subject: [PATCH v2 14/16] dmaengine: bcm-sba-raid: Remove redundant SBA_REQUEST_STATE_RECEIVED Date: Tue, 1 Aug 2017 16:07:58 +0530 Message-Id: <1501583880-32072-15-git-send-email-anup.patel@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501583880-32072-1-git-send-email-anup.patel@broadcom.com> References: <1501583880-32072-1-git-send-email-anup.patel@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170801_034100_633890_3699B5F7 X-CRM114-Status: GOOD ( 13.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Florian Fainelli , Anup Patel , Scott Branden , Ray Jui , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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);