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: 9914723 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 77F8060381 for ; Tue, 22 Aug 2017 09:59:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 879A32883F for ; Tue, 22 Aug 2017 09:59:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C70128854; Tue, 22 Aug 2017 09:59:49 +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=ham 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 212DA2883F for ; Tue, 22 Aug 2017 09:59:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932722AbdHVJ7S (ORCPT ); Tue, 22 Aug 2017 05:59:18 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:35034 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932370AbdHVJ7O (ORCPT ); Tue, 22 Aug 2017 05:59:14 -0400 Received: by mail-wr0-f175.google.com with SMTP id k46so45902754wre.2 for ; Tue, 22 Aug 2017 02:59:13 -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=oRf6zTHyFVEtcz7boTJAOr1HmbpV+x4Hw4y9WhKcGjHWrk+dQhb7QOAHIwsinsqEVZ dKemgKueYrw5jR0OLXHdreyCY2eKAtj1oYw38Qnu7ysFxlPHKjZjQlAjo7EZqjaZWK6J T7ePe8Wh9Cy12cNvz6YQPQWo+GFrbuaz3smSlVP8cU3fx02hA9Yf2jVbe25abPrnig4U n+SP7/SzG2z/dgriNBkxF6/v6tuorfd7TexsQSBUMIs5FcCyg8fpRvY62htQqaiBJDzM Q5ZMlBq0VGiiNXNYeIfxL4q7wM+7tKNjt1DM5tom6ttMkQT4c0RkM96PJqlfsXzeD1hu eAkw== X-Gm-Message-State: AHYfb5j2xBXmdaWo+Uu9bvhmXAQbHKe99HjPJOJx3v0Of1o5d2bybEa3 GP8ui+1XcEInpO4z 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 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 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> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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 */