Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1700849

[PATCH v2 16/16] dmaengine: bcm-sba-raid: Explicitly ACK mailbox message after sending

From Anup Patel <anup.patel@broadcom.com>
Newsgroups linux.kernel
Subject [PATCH v2 16/16] dmaengine: bcm-sba-raid: Explicitly ACK mailbox message after sending
Date 2017-08-01 12:50 +0200
Message-ID <u9CUq-2Qq-21@gated-at.bofh.it> (permalink)
References <u9CKK-2Ig-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <anup.patel@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
---
 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 */
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/16] Broadcom SBA-RAID driver improvements Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:40 +0200
  [PATCH v2 03/16] dmaengine: bcm-sba-raid: Common flags for sba_request state and fence Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:40 +0200
  [PATCH v2 08/16] dmaengine: bcm-sba-raid: Increase number of free sba_request Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:40 +0200
  [PATCH v2 05/16] dmaengine: bcm-sba-raid: Remove redundant resp_dma from sba_request Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:40 +0200
  [PATCH v2 12/16] dmaengine: bcm-sba-raid: Pre-ack async tx descriptor Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:50 +0200
  [PATCH v2 10/16] dmaengine: bcm-sba-raid: Alloc resources before registering DMA device Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:50 +0200
  [PATCH v2 14/16] dmaengine: bcm-sba-raid: Remove redundant SBA_REQUEST_STATE_RECEIVED Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:50 +0200
  [PATCH v2 16/16] dmaengine: bcm-sba-raid: Explicitly ACK mailbox message after sending Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:50 +0200
  [PATCH v2 13/16] dmaengine: bcm-sba-raid: Re-factor sba_process_deferred_requests() Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:50 +0200
  [PATCH v2 15/16] dmaengine: bcm-sba-raid: Add debugfs support Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:50 +0200
  [PATCH v2 11/16] dmaengine: bcm-sba-raid: Peek mbox when we have no free requests Anup Patel <anup.patel@broadcom.com> - 2017-08-01 12:50 +0200

csiph-web