From patchwork Mon Apr 2 18:24:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10320175 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 D2DC460375 for ; Mon, 2 Apr 2018 18:25:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C334328A67 for ; Mon, 2 Apr 2018 18:25:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5AEC28A74; Mon, 2 Apr 2018 18:25:03 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 57F1528A67 for ; Mon, 2 Apr 2018 18:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754319AbeDBSZB (ORCPT ); Mon, 2 Apr 2018 14:25:01 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54128 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753322AbeDBSYl (ORCPT ); Mon, 2 Apr 2018 14:24:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id p9so27330955wmc.3 for ; Mon, 02 Apr 2018 11:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=qUIWucCRifZc0Jr7Psrn0Ac0yXQYvnq7TMr7ucPEtZw=; b=XK2DdhjK2r5EDyk+KwncXq6urxbgmy2aYM+Ahe3IyCtzYDMJKTI3H+5PMNgUwpP5C+ TXV53Rjj+xVaGaiuRh6k8iX7xNq4tzM8H55D+8EdT6md0esEuaSG1TYRc24WBt2LycGw ilws6SV9V8IgiOEfigxqG1+/X9SybXnVSBuKTQzIpcv+i8yFJOFg4YSDsw05igQNzdW6 JLtiCC/FtoOo1sp+sqsd5b2DoEwCQZ3uT3+J1cgIyftVhPoSAOHRuHfk5NDJ8uO+dfKJ c5G1wtKkwzoml5TZkheDLnuruaXLteN/JdZIgfdZzBbWxZw5wYQJbOjbj0b32jckAuXO h+DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=qUIWucCRifZc0Jr7Psrn0Ac0yXQYvnq7TMr7ucPEtZw=; b=KcrJoRslceOtN2Gjv43Jg1q5XfOED2DHgaglpNyWyX0b68MDMyGdEJo0I9b/GmDeBd a6SVpSFT81IUPHzTKMdqI/E/oCGtOj/WO+c5qdr5BRMB4KnNZsqshJyvAJ1S91w6GuYp /44xfos1rNVE4rVYH0a8wtAEYXfaSb6lgP7vGovSqLEyjCDVTWvCdFj5GHeDJpDYimbO Gf7U2LXkpeQResA7irfFPeYqmTxbEySQUxRYFv0DbmI8u6iQeCQeBqpFAB0/e8EGEd3F A1U3SFtlHO4O2jeNzXNqlu0WiygCNOnR3A14PdsSfdTCgm1JOv1tr311MgMWEM6AyElr doDw== X-Gm-Message-State: ALQs6tALpabydzI3zMNmlUbx0CXTG5THH2ZU1tiyG46lD+AeqzevkGhr rBrONi4aJau6Bp3VZb4HWyviVw== X-Google-Smtp-Source: AIpwx4/yU6rtSjawFnMi1dODL1fmXDegObPAcQIVV7KJvIVJQSgariglhqcKl8jaDBx9CyR+9NkAyA== X-Received: by 10.28.112.11 with SMTP id l11mr1476102wmc.31.1522693480501; Mon, 02 Apr 2018 11:24:40 -0700 (PDT) Received: from dvbdev.wuest.de (ip-84-118-193-200.unity-media.net. [84.118.193.200]) by smtp.gmail.com with ESMTPSA id x9sm2368273wrb.18.2018.04.02.11.24.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 11:24:40 -0700 (PDT) From: Daniel Scheller 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 Message-Id: <20180402182427.20918-12-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180402182427.20918-1-d.scheller.oss@gmail.com> References: <20180402182427.20918-1-d.scheller.oss@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Scheller 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 --- 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)