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: 9914771 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 55EA2603F9 for ; Tue, 22 Aug 2017 10:16:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59331287DC for ; Tue, 22 Aug 2017 10:16:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DE9E2885C; Tue, 22 Aug 2017 10:16:21 +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=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW 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 D3F11287DC for ; Tue, 22 Aug 2017 10:16:20 +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=ASGAHUWAXu7Gw1z+Y8dizHOfgR 3jnUbM28pz4P0pp6QOJv/FPbVLOLVsqK+UU6vfNZi3yczsCrPNv61K6E9dzqkf3I2w+8nHm8Nh8PD 0rkn3quCZE81P0y7o2rXJ2DIFVFlRfhH72OSjVm+TBgLg3IPTMOqDyF4LAhGJ8Aola7eRZELOirb0 xIEZ/uYcRoPrygf3BqS+5oA9ZlctBOhsMfkhQqmYCHLm6KQ77sW/xJ7npGsrf4g4mu0L2aJC80azg MJ7XDPd2aRnUTEZgMmBwk1XfYc6L6rWkk25i5LHgsMbp/3wZkEajEwO3hZ6MMX83vWN1W4DhkfpZk cwSf8aHg==; 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 1dk6EK-00055f-2M; Tue, 22 Aug 2017 10:16:16 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dk6DI-0003Sd-1z for linux-arm-kernel@bombadil.infradead.org; Tue, 22 Aug 2017 10:15:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HA4BbKDH+Za0rIDw5CZKs3Z5dLp97L+MYdaDpJCNmRo=; b=dicwglm3vnB/lgAY8+6byxPg1 gOSUJ1VBBsF+SQ0eM6OwrzUiRl3KX6N17SXVtaFlyhvfPd6arcsEM5k4okQOARuFBIayYWkzu7lT9 TT+9KoCu4+q+sai6DJfxrw0VA57biELLx9oo0Lf0h77x3IoQyhljqwm6X1KdCNwpZx4tsYmcvp/aW wxCUxFmZ7fBqQRxgwvZn/lJQIFecfBZbc/f9EwBxi//f4y5tY3kcz5ZAZvl2WOa08gjOiIA7TpwYe Jawaa3Jc5rRbl/A/LvnjmYkIYaYloJWOuStRTXz57W6o0jlQV2Hub5IxoPIk2EB0dmpgUaTVq4L6W H2w8oQ+JA==; Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dk5xw-0001s7-95 for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2017 09:59:21 +0000 Received: by mail-wr0-x22c.google.com with SMTP id z91so118788724wrc.4 for ; Tue, 22 Aug 2017 02:59:00 -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=kambSVIFr/0veoUXkuw51M6+hdGGP+kjzaJcOAJYP0bwzlqPQxnKrYW7WdgdhPpedv x4Kpq0FOOzLE43SUF8ELMn3pUVGnPDWXLz6q0Qmua9SncLyL4mQiyvVoI9KZxFHaeHTe CI7CMVafc09c6HmsAIVuVWLclVzdz1CI9/WT4f+4QDJMx/Qc76+L23vIUsQ8+RLlXLK3 hn3QEzXf9bIggwjGZqJ7yVfcBgy5GxDGIQxigVw2ZI5uKHHvjv8pAXNdmZu9WnPc5qgk SvVV81E7SeoEFZrwZjjwyoLamw7Nr/jvu/S5VFslTHLPRC2ZEuerEmV635Koo79ypQwo KANw== X-Gm-Message-State: AHYfb5hcVWSPyHe/jhPJcf5t7ouqpc7JWyvInP8rRnsUxMNpau/HkiUs K5of78thdrq5JrWn 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170822_105920_380822_3ACFEEB7 X-CRM114-Status: GOOD ( 13.39 ) 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: 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);