From patchwork Tue Aug 22 09:57:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 9914759 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 B479F60381 for ; Tue, 22 Aug 2017 10:03:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2E732883F for ; Tue, 22 Aug 2017 10:03:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B759528854; Tue, 22 Aug 2017 10:03:31 +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=ham 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 3707F2883F for ; Tue, 22 Aug 2017 10:03:31 +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=Gw6dOTJ7QwyfWW0jKjg2P/D9ELauw4y8N176lGX1E7c=; b=IoeVuydC8oqK72VfGVqdED37Hv Ea1BP+XyV5B3qRp44d7qmdgUjppNwUuznO6THBf1NFeqZr72cmh9oywLd5gvUYTU68ff3h7O7ZCvC sf9FkbwXwT6Wn/8bpy+MBpZlMEoYH8QeEU4UKB/s6+lQEum3UKs1j3v6KYfPMpZPysffx3umM/imM +9tx0ECzItcfY6N7xWepXPuf4KPLsPvMDJXlCUGxteGSefkN3/wksLct/Fqku7U9S1xM1xElHB7MY HZ1o3a7PfTb5N54m3vy+pKmestytEWvX1x4DmATwaDxANKzEZo35bsvGST5fvohF9lZSAcQS7TtUq 7f6YDuJQ==; 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 1dk61u-0003T1-Ed; Tue, 22 Aug 2017 10:03:26 +0000 Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dk5yA-0007Oi-Kv for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2017 10:00:16 +0000 Received: by mail-wr0-x231.google.com with SMTP id p8so56569054wrf.5 for ; Tue, 22 Aug 2017 02:59:14 -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=nqYF9n/x/eC77NdIE6w/jeWSPZc3GGgDI9dMiHfbHfQ=; b=hHd3tB96TRREUv+bRJL3yrY4pXYN24xzocaUW0xwC0agekTKSdyKlZRUtedR5++0hX 17/SRF9df9cGaC5RDhGlCsM34SKRyqM4bC1xqYpaUGxwwf6+TmygYMbn5F3nG0XAlXWI QpoLQiuZcZG28hPQwMeLjq7OsObhl+WRfb0cA= 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=nqYF9n/x/eC77NdIE6w/jeWSPZc3GGgDI9dMiHfbHfQ=; b=Kn2RrjaVnfeloDFqwLziiCy+0qAkxM2z3VWf6+nwJDrAco1q78pTuCtFUXYjcUzuxu p2OZb11euSW+v/hOQ4Px2/ecmpZVYaPzkl/gF2towM1g9yFOdd21+TjHhdeomYttLbEM 0MNpg5jePmo7IayDG+YiOe/TT1cO9SYdFQuChbKOJfVYL6O4p6lcvU/yiedPaFjrlwvb jQ88INV6QkG1Ddfs4WVUjvyZh7p11WLUsF2znp2cJRI5dcROgmfLU1zkmS6n4uu/Yl3K ykG8NYA58nwkE78mlaC4J+eyKTgk15nCmtQ3DGfDr7OVKpQD5Krk1VBEWlV0pV02xGbw REVw== X-Gm-Message-State: AHYfb5i37OU14r5tnPnVpHzd8iB/88XrmKKf+k9iaXYng+gQeBYZo02i M46p2ovAHQMlcO0J X-Received: by 10.28.157.73 with SMTP id g70mr17535wme.73.1503395952769; Tue, 22 Aug 2017 02:59:12 -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.59.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Aug 2017 02:59:12 -0700 (PDT) From: Anup Patel To: Vinod Koul , Dan Williams Subject: [PATCH v3 16/17] dmaengine: bcm-sba-raid: Explicitly ACK mailbox message after sending Date: Tue, 22 Aug 2017 15:27:05 +0530 Message-Id: <1503395827-19428-17-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_025935_419873_6885E214 X-CRM114-Status: GOOD ( 12.13 ) 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 We should explicitly ACK mailbox message because after sending message we can know the send status via error attribute of brcm_message. This will also help SBA-RAID to use "txdone_ack" method whenever mailbox controller supports it. Signed-off-by: Anup Patel Reviewed-by: Ray Jui --- drivers/dma/bcm-sba-raid.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c index 12310aa..0c41136 100644 --- a/drivers/dma/bcm-sba-raid.c +++ b/drivers/dma/bcm-sba-raid.c @@ -396,13 +396,17 @@ static int sba_send_mbox_request(struct sba_device *sba, dev_err(sba->dev, "send message failed with error %d", ret); return ret; } + + /* Check error returned by mailbox controller */ ret = req->msg.error; if (ret < 0) { dev_err(sba->dev, "message error %d", ret); - return ret; } - return 0; + /* Signal txdone for mailbox channel */ + mbox_client_txdone(sba->mchans[mchans_idx], ret); + + return ret; } /* Note: Must be called with sba->reqs_lock held */ @@ -1724,7 +1728,7 @@ static int sba_probe(struct platform_device *pdev) sba->client.dev = &pdev->dev; sba->client.rx_callback = sba_receive_message; sba->client.tx_block = false; - sba->client.knows_txdone = false; + sba->client.knows_txdone = true; sba->client.tx_tout = 0; /* Allocate mailbox channel array */