All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Scheller <d.scheller.oss@gmail.com>
To: linux-media@vger.kernel.org, mchehab@kernel.org,
	mchehab@s-opensource.com
Subject: [PATCH 11/20] [media] ddbridge: use spin_lock_irqsave() in output_work()
Date: Mon,  2 Apr 2018 20:24:18 +0200	[thread overview]
Message-ID: <20180402182427.20918-12-d.scheller.oss@gmail.com> (raw)
In-Reply-To: <20180402182427.20918-1-d.scheller.oss@gmail.com>

From: Daniel Scheller <d.scheller@gmx.net>

Make sure to save IRQ states before taking the dma lock, as already done
in it's input_work() counterpart.

Picked up from the upstream dddvb-0.9.33 release.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
---
 drivers/media/pci/ddbridge/ddbridge-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index 9d91221dacc4..c22537eceee5 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -2132,18 +2132,18 @@ static void output_work(struct work_struct *work)
 	struct ddb_dma *dma = container_of(work, struct ddb_dma, work);
 	struct ddb_output *output = (struct ddb_output *)dma->io;
 	struct ddb *dev = output->port->dev;
+	unsigned long flags;
 
-	spin_lock(&dma->lock);
-	if (!dma->running) {
-		spin_unlock(&dma->lock);
-		return;
-	}
+	spin_lock_irqsave(&dma->lock, flags);
+	if (!dma->running)
+		goto unlock_exit;
 	dma->stat = ddbreadl(dev, DMA_BUFFER_CURRENT(dma));
 	dma->ctrl = ddbreadl(dev, DMA_BUFFER_CONTROL(dma));
 	if (output->redi)
 		output_ack_input(output, output->redi);
 	wake_up(&dma->wq);
-	spin_unlock(&dma->lock);
+unlock_exit:
+	spin_unlock_irqrestore(&dma->lock, flags);
 }
 
 static void output_handler(void *data)
-- 
2.16.1

  parent reply	other threads:[~2018-04-02 18:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 18:24 [PATCH 00/20] dddvb/ddbridge-0.9.33 Daniel Scheller
2018-04-02 18:24 ` [PATCH 01/20] [media] dvb-frontends/stv0910: add init values for TSINSDELM/L Daniel Scheller
2018-04-02 18:24 ` [PATCH 02/20] [media] dvb-frontends/stv0910: increase parallel TS output speed Daniel Scheller
2018-04-02 18:24 ` [PATCH 03/20] [media] dvb-frontends/stv0910: fix CNR reporting in read_snr() Daniel Scheller
2018-04-02 18:24 ` [PATCH 04/20] [media] ddbridge: move modparams to ddbridge-core.c Daniel Scheller
2018-04-02 18:24 ` [PATCH 05/20] [media] ddbridge: move ddb_wq and the wq+class initialisation to -core Daniel Scheller
2018-04-02 18:24 ` [PATCH 06/20] [media] ddbridge: move MSI IRQ cleanup to a helper function Daniel Scheller
2018-04-02 18:24 ` [PATCH 07/20] [media] ddbridge: request/free_irq using pci_irq_vector, enable MSI-X Daniel Scheller
2018-04-02 18:24 ` [PATCH 08/20] [media] ddbridge: add helper for IRQ handler setup Daniel Scheller
2018-04-02 18:24 ` [PATCH 09/20] [media] ddbridge: add macros to handle IRQs in nibble and byte blocks Daniel Scheller
2018-04-02 18:24 ` [PATCH 10/20] [media] ddbridge: improve separated MSI IRQ handling Daniel Scheller
2018-04-02 18:24 ` Daniel Scheller [this message]
2018-04-02 18:24 ` [PATCH 12/20] [media] ddbridge: fix output buffer check Daniel Scheller
2018-04-02 18:24 ` [PATCH 13/20] [media] ddbridge: set devid entry for link 0 Daniel Scheller
2018-04-02 18:24 ` [PATCH 14/20] [media] ddbridge: make DMA buffer count and size modparam-configurable Daniel Scheller
2018-04-02 18:24 ` [PATCH 15/20] [media] ddbridge: support dummy tuners with 125MByte/s dummy data stream Daniel Scheller
2018-04-02 18:24 ` [PATCH 16/20] [media] ddbridge: initial support for MCI-based MaxSX8 cards Daniel Scheller
2018-04-02 18:24 ` [PATCH 17/20] [media] ddbridge/max: implement MCI/MaxSX8 attach function Daniel Scheller
2018-04-02 18:24 ` [PATCH 18/20] [media] ddbridge: add hardware defs and PCI IDs for MCI cards Daniel Scheller
2018-04-02 18:24 ` [PATCH 19/20] [media] ddbridge: recognize and attach the MaxSX8 cards Daniel Scheller
2018-04-02 18:24 ` [PATCH 20/20] [media] ddbridge: set driver version to 0.9.33-integrated Daniel Scheller
2018-04-05 20:45 ` [PATCH 00/20] dddvb/ddbridge-0.9.33 Daniel Scheller

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=20180402182427.20918-12-d.scheller.oss@gmail.com \
    --to=d.scheller.oss@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mchehab@s-opensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.