From patchwork Mon Jun 15 08:07:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11604173 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEC07912 for ; Mon, 15 Jun 2020 08:08:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 964F8206E2 for ; Mon, 15 Jun 2020 08:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592208494; bh=iJjCtGA60IxEMe6LqJFvQCe1OucL9pzPXJCoK6sfAig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iL0dHVG5pYhorVuT8q2Uczb7SeM8NFzXkxXeU0P0CEc92B45KNp/n/2hYRVbMJPXy OPR9S58MtidEsLeUrJFpw8Wnho+fJklFxiPlXJe0WtmzHt3uQshZqZlooUapcfkttI ln+Ei2I+2KkI70kpmSN6g8sujkL4iNrQytLo7zds= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbgFOIIN (ORCPT ); Mon, 15 Jun 2020 04:08:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:32770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728875AbgFOIIH (ORCPT ); Mon, 15 Jun 2020 04:08:07 -0400 Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E0F2520757; Mon, 15 Jun 2020 08:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592208487; bh=iJjCtGA60IxEMe6LqJFvQCe1OucL9pzPXJCoK6sfAig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v7dwvejmsHWlpMyATQrG+75DTVF8FiwOvhgsTE7tJQWKORGU7ymV3YxpI0TXd3HaI eS4YSCU5aHUSjyuEs3ANjls/o8cqQcuILm8bp/1DC74kSNgzqhlLRMb7+600nLnz7g HbCCS5bOwKcSEwP9U8l+vonOPtPCMKSmYxaaLmAQ= From: Krzysztof Kozlowski To: Mark Brown , Thomas Gleixner , Vladimir Oltean , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marc Kleine-Budde , Wolfram Sang , kernel@pengutronix.de, Krzysztof Kozlowski Subject: [PATCH v2 3/3] genirq: Do not test disabled IRQs with DEBUG_SHIRQ Date: Mon, 15 Jun 2020 10:07:19 +0200 Message-Id: <1592208439-17594-3-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592208439-17594-1-git-send-email-krzk@kernel.org> References: <1592208439-17594-1-git-send-email-krzk@kernel.org> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Testing events during freeing of disabled shared interrupts (CONFIG_DEBUG_SHIRQ) leads to false positives. The driver disabled interrupts on purpose to be sure that they will not fire during device removal. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. New patch. --- kernel/irq/manage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 761911168438..f19f0dedc30d 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1775,12 +1775,14 @@ static struct irqaction *__free_irq(struct irq_desc *desc, void *dev_id) /* * It's a shared IRQ -- the driver ought to be prepared for an IRQ * event to happen even now it's being freed, so let's make sure that - * is so by doing an extra call to the handler .... + * is so by doing an extra call to the handler. + * Although the driver could disable the interrupts just before freeing + * just to avoid such trouble - don't test it then. * * ( We do this after actually deregistering it, to make sure that a * 'real' IRQ doesn't run in parallel with our fake. ) */ - if (action->flags & IRQF_SHARED) { + if (action->flags & IRQF_SHARED && !desc->depth) { local_irq_save(flags); action->handler(irq, dev_id); local_irq_restore(flags);