From patchwork Mon Apr 9 16:47:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10331765 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 1ACAB6037F for ; Mon, 9 Apr 2018 16:48:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D72C2015F for ; Mon, 9 Apr 2018 16:48:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0264F28801; Mon, 9 Apr 2018 16:48:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, 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 A7A922015F for ; Mon, 9 Apr 2018 16:48:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753411AbeDIQsJ (ORCPT ); Mon, 9 Apr 2018 12:48:09 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:45743 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753387AbeDIQsG (ORCPT ); Mon, 9 Apr 2018 12:48:06 -0400 Received: by mail-wr0-f196.google.com with SMTP id u11so10255915wri.12 for ; Mon, 09 Apr 2018 09:48:05 -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=TdkE5R55QH3/p098Ea1QVz99kxQWS0wxZS2DgHBHtCVtqfVRcesHQ4NfXK9pMan0RG 6p0tCY7B5ntHxWjl0uLIh3obR270+hAozu75cp7JiCs336r/Ak8a1FhS5ZAME2xFp7oy wdSPyhur8xqWP8DHgbOtHcQaTxnMPUmXpm4ULiLHtEU47FeeetvOo3AxNKqDjWZppC9Z Ndz1L6RJcKgQQglT/HyE96o2t9/F7ZycWFwTy9OgXVmf5Fpu+YmwojBf12EHIZ5BfIYM NMbf+XJvr5dEZYrc/+L5nTQHnN4LPsPT8zyHCdSga+qNwd3yeHLHoDVsVJXY2AFb/EQe +Vdw== 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=tFgH3L8uJTA9vTNhnWUE+CDqC4PmuixyXhM4ilb0z69uOw1SXlspLcyqjzeaYmS1DP FGXtQrkpXjgVBV6I7qHNjj0JUDUtwmm/WKNlWHVa6e+hcosnIUod7uYd9iP2DauRz8e9 DqeUH7+sXO9FBP/Yd/G3kGGB/AvC6BXSaD63OVeuNLtqzMwuxOiFRBSbvOtp4WKC9XYQ BGTFAUiPwiTIs0VLukZfTXPTsLZPdSY/xyGXXbrx16M2vgqq3CeWmuKirZaBAO6YRsrT Q3Z/NwKd+9GjyEh9oHTXxV+ANeRT43LZoYhvsLEStJQftEp9qFJOvnrQCz/Yg4TTH2Ld 5kbg== X-Gm-Message-State: AElRT7HvWRO/+ffs0Cl7I4YXmSRQEKfYeHfyZeZxarGaczXayeKl0hJ2 FCwvodm5wGFf3RL3I3OZoWy9tA== X-Google-Smtp-Source: AIpwx49+3zKH3/G6y02laJ7DMhO7pYGzyqcFHO3vcpnsWqeaaSoSrJTPQ50/9QfmBsuFtGa+LpSSWQ== X-Received: by 10.223.185.76 with SMTP id b12mr28063288wrg.205.1523292484598; Mon, 09 Apr 2018 09:48:04 -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 11sm1380416wmd.1.2018.04.09.09.48.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 09:48:04 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Subject: [PATCH v2 10/19] [media] ddbridge: use spin_lock_irqsave() in output_work() Date: Mon, 9 Apr 2018 18:47:43 +0200 Message-Id: <20180409164752.641-11-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180409164752.641-1-d.scheller.oss@gmail.com> References: <20180409164752.641-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)