Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1485161ybt; Mon, 15 Jun 2020 01:12:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlrRHJRplnJakkmQk178ek70ccYBJ/pyMH/jSdIeprrZ0QODz1iNvLa3nm9Nm1GsH4jeYB X-Received: by 2002:a05:6402:1761:: with SMTP id da1mr8764148edb.68.1592208777079; Mon, 15 Jun 2020 01:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592208777; cv=none; d=google.com; s=arc-20160816; b=XqZONRvzNJCoLWjpe6aG42eEnVxtjoKznn2cS8bMknkSgyspqVoa+J+KV3uwDFKoiQ ksFSoKdLE9ZSkUKSkGANH8+a7g/t3KUKyltD/XgcYtV6jX4zEpATatcqQ9I20odsW0o8 T9kx2qbbuh75J8tMBHfzak9VJRPc1gEJATfRejGUczV2gXgiLdVwCfWpGsMTxKp0JP2H bftOaStabMO6quAPQ7NVE8cKmC/8ly2pwApyE1URz6HxLrmgWKrFqL9QmrcQ1ma6Khxp 2z9mtL10OUs5DJQlhdFYQJ/TM6H6vKOUaNUKbNVV+J0nG2osc/EMhPf/G3Pw3cH16MBo ztRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=7vmrUPKACM0qC0VW3QCX8iJCPvuAulso5TrbPlRxFZo=; b=L0k4RM559n27UBcsFaSi6zvH59XKcpTgkJDxjJpC4B+MkwrxSMrEJjNmSK1IR9w0EQ hasn1h/ZNuRPRIAdA7MpvpTvt3hfTfJWj1o0hwxh0OtTEgEfwMtPh/cs/pYhFYSYNNrw 1zBx0e+fUzXpTF+QcJP8vlvnt7U/5ID+P1tdzztW37Myoo3tUmrwfS9TuhgqktgZJ0oN TmFXreQVM5Pqce5iInqzGQefrYd77R3sUBDqBp+7igfc/Vbr2fB0btNC2YOSEHvLknZF 8U5h/z8h39sBmKS4VQxLs7po+3w0stiOZ80IdXr6Pp42e976u3VunXwraCE1KAc7kjH0 DHEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v7dwvejm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w7si8580637eji.484.2020.06.15.01.12.33; Mon, 15 Jun 2020 01:12:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v7dwvejm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728921AbgFOIIO (ORCPT + 99 others); Mon, 15 Jun 2020 04:08:14 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); -- 2.7.4