From patchwork Sat Nov 15 10:52:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Utkin X-Patchwork-Id: 5311521 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8B3259F440 for ; Sat, 15 Nov 2014 10:53:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B94C520149 for ; Sat, 15 Nov 2014 10:53:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E640420145 for ; Sat, 15 Nov 2014 10:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754081AbaKOKxf (ORCPT ); Sat, 15 Nov 2014 05:53:35 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:39707 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222AbaKOKxe (ORCPT ); Sat, 15 Nov 2014 05:53:34 -0500 Received: by mail-wi0-f177.google.com with SMTP id l15so4934513wiw.10 for ; Sat, 15 Nov 2014 02:53:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=veGEMZ1kjHW/etAWkOsy0/TnrCdOF0EISdfrBdU3WJU=; b=Vs5qYMh9SQukdXIl+7gNlQyhphHhTpnc3yI4I5ZNQfiIlMpqAh5T29KVAc+uwnI3wi p8l3/nZD8HJuH061tYBmbBGH6bRZ5FkjNQ3cu9jC4Le2lhsaO1EZL/AMf/XwSWvtg8IJ 3/mnkPGxE/3T0ynmCw/FDR+dsygTiK2wLCIi0tvrJlr4+5uL/aSDNut3QWnh1xEYyKlR DtwfbqvC0N0u3+jWrFMHdSI/Upl4CnPHuYXO1sE+JXw0cChuzGX2Cq5Q8u/j2ma2h2f8 a6gfMu7U1st14FZ//jTGYxw61OP/1YI/CyYiiuBH4vliC/oDzfFegKrO3D+xfJKFeWVV w0WQ== X-Gm-Message-State: ALoCoQmEFG00XAq6GqJpH8d4tV8v87TiTG81IaqnILNvrUhbw8ZuLc/C0vnhQSPlPTX+MoCKxD9K X-Received: by 10.194.92.82 with SMTP id ck18mr21714705wjb.103.1416048812568; Sat, 15 Nov 2014 02:53:32 -0800 (PST) Received: from localhost.localdomain ([73.165.39.130]) by mx.google.com with ESMTPSA id fv5sm740636wjc.37.2014.11.15.02.53.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Nov 2014 02:53:31 -0800 (PST) From: Andrey Utkin To: khalasa@piap.pl, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, m.chehab@samsung.com, hverkuil@xs4all.nl Subject: [PATCH] solo6x10: fix a race in IRQ handler Date: Sat, 15 Nov 2014 14:52:26 +0400 Message-Id: <1416048746-12717-1-git-send-email-andrey.utkin@corp.bluecherry.net> X-Mailer: git-send-email 2.0.4 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Krzysztof Ha?asa The IRQs have to be acknowledged before they are serviced, otherwise some events may be skipped. Also, acknowledging IRQs just before returning from the handler doesn't leave enough time for the device to deassert the INTx line, and for bridges to propagate this change. This resulted in twice the IRQ rate on ARMv6 dual core CPU. Signed-off-by: Krzysztof Ha?asa Acked-by: Andrey Utkin Tested-by: Andrey Utkin the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/media/pci/solo6x10/solo6x10-core.c +++ b/drivers/media/pci/solo6x10/solo6x10-core.c @@ -105,11 +105,8 @@ static irqreturn_t solo_isr(int irq, void *data) if (!status) return IRQ_NONE; - if (status & ~solo_dev->irq_mask) { - solo_reg_write(solo_dev, SOLO_IRQ_STAT, - status & ~solo_dev->irq_mask); - status &= solo_dev->irq_mask; - } + /* Acknowledge all interrupts immediately */ + solo_reg_write(solo_dev, SOLO_IRQ_STAT, status); if (status & SOLO_IRQ_PCI_ERR) solo_p2m_error_isr(solo_dev); @@ -132,9 +129,6 @@ static irqreturn_t solo_isr(int irq, void *data) if (status & SOLO_IRQ_G723) solo_g723_isr(solo_dev); - /* Clear all interrupts handled */ - solo_reg_write(solo_dev, SOLO_IRQ_STAT, status); - return IRQ_HANDLED; } -- To unsubscribe from this list: send the line "unsubscribe linux-media" in