public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anup Patel <anup.patel@broadcom.com>
To: Vinod Koul <vinod.koul@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Cc: Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	Anup Patel <anup.patel@broadcom.com>
Subject: [PATCH 1/4] dmaengine: bcm-sba-raid: serialize dma_cookie_complete() using reqs_lock
Date: Tue,  3 Oct 2017 10:52:57 +0530	[thread overview]
Message-ID: <1507008180-27171-2-git-send-email-anup.patel@broadcom.com> (raw)
In-Reply-To: <1507008180-27171-1-git-send-email-anup.patel@broadcom.com>

As-per documentation in driver/dma/dmaengine.h, the
dma_cookie_complete() API should be called with lock
held.

This patch ensures that Broadcom SBA RAID driver calls
the dma_cookie_complete() API with reqs_lock held.

Signed-off-by: Anup Patel <anup.patel@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
---
 drivers/dma/bcm-sba-raid.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c
index 6c2c447..15c5585 100644
--- a/drivers/dma/bcm-sba-raid.c
+++ b/drivers/dma/bcm-sba-raid.c
@@ -442,7 +442,9 @@ static void sba_process_received_request(struct sba_device *sba,
 
 		WARN_ON(tx->cookie < 0);
 		if (tx->cookie > 0) {
+			spin_lock_irqsave(&sba->reqs_lock, flags);
 			dma_cookie_complete(tx);
+			spin_unlock_irqrestore(&sba->reqs_lock, flags);
 			dmaengine_desc_get_callback_invoke(tx, NULL);
 			dma_descriptor_unmap(tx);
 			tx->callback = NULL;
-- 
2.7.4

  reply	other threads:[~2017-10-03  5:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03  5:22 [PATCH 0/4] Few more SBA RAID driver improvements Anup Patel
2017-10-03  5:22 ` Anup Patel [this message]
2017-10-03  5:22 ` [PATCH 2/4] dmaengine: bcm-sba-raid: Use only single mailbox channel Anup Patel
2017-10-03  5:22 ` [PATCH 3/4] dmaengine: bcm-sba-raid: Use common GPL comment header Anup Patel
2017-10-03  5:23 ` [PATCH 4/4] dmaengine: Build bcm-sba-raid driver as loadable module for iProc SoCs Anup Patel
2017-10-23  6:06 ` [PATCH 0/4] Few more SBA RAID driver improvements Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507008180-27171-2-git-send-email-anup.patel@broadcom.com \
    --to=anup.patel@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox