From patchwork Tue Aug 1 10:38:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 9874153 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 DE71360365 for ; Tue, 1 Aug 2017 10:41:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E94AF2853E for ; Tue, 1 Aug 2017 10:41:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC6EC2869C; Tue, 1 Aug 2017 10:41:39 +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 2D77F286AB for ; Tue, 1 Aug 2017 10:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752102AbdHAKlP (ORCPT ); Tue, 1 Aug 2017 06:41:15 -0400 Received: from mail-qk0-f174.google.com ([209.85.220.174]:34918 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752219AbdHAKk4 (ORCPT ); Tue, 1 Aug 2017 06:40:56 -0400 Received: by mail-qk0-f174.google.com with SMTP id d145so6536359qkc.2 for ; Tue, 01 Aug 2017 03:40:55 -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=sA3CwLPGkoqkKUaGYcWX1q4iG3Z+7p3a4wIJwZIzBqg=; b=BPOd4yk6CMvY95qHNnDPguQb5KEau6bLMartPBKVuRhZuSdT7DR3jQJ8rGMgvI30IX LI/5zy8ggfoLNnpVVroRnHrl4+RO1qv1n0ddrwmYLOzKz8ckzqlXtL60EYRfN81G5d8z xrHY/Gh4tdSR7nCVDj4pMUjxL1ZmFpeQnP7jM= 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=sA3CwLPGkoqkKUaGYcWX1q4iG3Z+7p3a4wIJwZIzBqg=; b=qe8Bs2lMkkk69JIu2n1NGWVYeP6NW3qx5tdkYd7dABLYIo/FqbaQGyxQ7fNw2DtV6P oyOVgINgJ2lAvKe7gxF8u0yQKCmQzM/G+1iAX6vd6fE+MPak7ySME5m+6u6f8U9jtuMq lq45mEiEn1XWI+ls8uQcPkQmniw1oJyifRp7/4aWRc5khl0mu90lJNT+cIbqZTyfNeMw 8MTZBtgvdOxAZDwioGrNhE8zi9vv7BKMk3f4qrh3ZtyJPBHoviPlKOy//ngx73cmvm8X KGiN5B9GxYMZEXof06YYtAL6VnaYwviuPA7mygJpoUYgbafibE+9mMIH808EnY2cza9z wBgQ== X-Gm-Message-State: AIVw110IQV9CWt93grdo/mueb5k5w7a3R8hglcY0V4cToMQvCikfeEDp JRpADvOkRMMas0lY X-Received: by 10.55.21.193 with SMTP id 62mr27846071qkv.42.1501584055100; Tue, 01 Aug 2017 03:40:55 -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.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Aug 2017 03:40:54 -0700 (PDT) From: Anup Patel To: Rob Herring , Mark Rutland , Vinod Koul , Dan Williams Cc: Florian Fainelli , Scott Branden , Ray Jui , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, dmaengine@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Anup Patel Subject: [PATCH v2 16/16] dmaengine: bcm-sba-raid: Explicitly ACK mailbox message after sending Date: Tue, 1 Aug 2017 16:08:00 +0530 Message-Id: <1501583880-32072-17-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> 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 f9d110c..730e1a0 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 */