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: 9874209 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 2F3196038F for ; Tue, 1 Aug 2017 10:50:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4356D27FAE for ; Tue, 1 Aug 2017 10:50:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37F202867D; Tue, 1 Aug 2017 10:50:46 +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=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 C8ED627FAE for ; Tue, 1 Aug 2017 10:50:45 +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=8g24igDHF1YtpTEivthX982C47JQWDpVkgKwVlaNK4w=; b=VZrlFEGEcuuoUf4n4uvJqqmBK8 6Vnpj2fr9lQL7cYmg4gTsvoCNUAjoW13joOdZfc3I6g1WUnWDeiHyCzniDQ9L44aEAnnAiU4XrQJy iyW062tHoRcqH+/3BdPQt/9NGZffVihFuWlf4uZOK8CYIQ9VuGnoyy08Tk48nQriHnu7i6fTmxXcH xOyGkeZyITCkTLBNxPpXu/m+zNtb+Yjy2/quPE6lDIQXtTSPX+UPlRAQQmLcgPwLVxc/JsRZr7V+r kZm+263vHDaNV1y40LWlnbxruoSqYZjAh7NsduqHP0AdFmnMabZNm01xCmcTc0+OsIxZpixZcXuim 87/gwtYw==; 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 1dcUl7-0003QS-HD; Tue, 01 Aug 2017 10:50:41 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dcUl5-0003Mq-EW for linux-arm-kernel@bombadil.infradead.org; Tue, 01 Aug 2017 10:50:39 +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=sA3CwLPGkoqkKUaGYcWX1q4iG3Z+7p3a4wIJwZIzBqg=; b=LVAJ8ppfQc18UaxVSvohw/frd QjObW8h8RWm6ExIrhK/jQdYQa7Ud4nBp9ypdwQKRbRz0ye5ZB0Aq6JcYAB5JGSk954do5bwupgITw UMYccRkz06Is1TN06uP/3FkGdpeYFcDCtYwHq9+87sKmN3m+macmmvYjcnKFyb1BXmh2GOb9b3RSv uYANKlGsgMdu9/JHXC+kpM01BxKCuZbPLHDp0NYboKRnGr+/4bClUbJt3eFEkKvAnQaPFrZeuEiVt CIpLpf/OYp//rdaFKJBw2KYWqt4JhXKpLBPZ8bx1zlW4Wc5n1v4d7SB/bmfS7iNuyrshHZ+UermsV ATV/SPkfg==; Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dcUc0-0002hQ-Pl for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2017 10:41:19 +0000 Received: by mail-qk0-x22a.google.com with SMTP id d136so6473903qkg.3 for ; Tue, 01 Aug 2017 03:40:56 -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=KbHgeFEwUc5Jxlz4emvqVq0KOZm+69svMCn+NsPAScwmPHt4cbfhjTS0P6hBM0Tjp2 fa3ayR9Vf3nWx5841kluhLvnrqywvIRUJPhJqiNkbDTFw3a1Qi6NQ+Dy1c+C60ZebV/n FVXrC72zjTxpV0D5MvvZ7SbvI7UuI+KA9nYiHt9zXCQcTu5vWgJGYlyIrBzQGblIpPeE YuQcqjjSPNP5gTnMbGbf7eH8yyjfFfI4xbTPLDlFiuff74JukXUPPkOEY5poBGebATiD KeidtL9wlyBFgiuZrDmIlw75pAfZIu152UJ1U0j/FlOEX11/g0yu/ICyHeoW5a3NZ/EI nI7Q== X-Gm-Message-State: AIVw111hFYT8xKSywWe/P29UqPVK6lFRSajTO1mGqvZwqzwGdtyPikkE 5OGOdBYmES812f7f 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170801_114117_512664_01627059 X-CRM114-Status: GOOD ( 13.11 ) 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 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 */