From nobody Sun Feb 8 05:37:30 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83168C77B73 for ; Tue, 30 May 2023 10:12:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231425AbjE3KMK (ORCPT ); Tue, 30 May 2023 06:12:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbjE3KLq (ORCPT ); Tue, 30 May 2023 06:11:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB58FF3 for ; Tue, 30 May 2023 03:11:42 -0700 (PDT) Date: Tue, 30 May 2023 10:11:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685441500; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kgox1DACm+wImb37rOPJ3ZxaCjPRS4PC+RXndEqMgYI=; b=0yABhfWbjUr5GEpV4YxmFDoNSsXdV+/sj0sAUW+sEyxaxywok/pllZGcNbAUYX2NColHwa AS/yS/DEAzQR8iz8SMMFRe4mddbqp5Qr3/+PIigctY/9/6YmFRng+BOXyJMHDDeVLn9c9j /pu8N8ZAkjuOfBL3U2ftHtEGZVzwe5XC732bF7gk89mE83Ppwt22wmXapIcVlkhvKFuVYo cdy2pUzldCGPKoPVbe4a+IeZVT0Vwpwo2MhhulbTVZpbdy5L/LSrl5xXK/tAOViNPFmCDQ XhkGmeIAZVdnylsoqylkjHZ5KQTPSk3Sh7CenrioGm33glY/jDpl0qHuBw4D7A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685441500; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kgox1DACm+wImb37rOPJ3ZxaCjPRS4PC+RXndEqMgYI=; b=di5ajOfwLx+9lu6pIZ8FeqhR9ovUes6m/1dXIdl13QM8QojyV3Y16mrdbHRZmbC2pJBFsd Q+jcx1DjV+lttkDw== From: "irqchip-bot for Marc Zyngier" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-fixes] irqchip/gic: Correctly validate OF quirk descriptors Cc: Douglas Anderson , Geert Uytterhoeven , Marc Zyngier , tglx@linutronix.de MIME-Version: 1.0 Message-ID: <168544149933.404.717399647227994720.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-fixes branch of i= rqchip: Commit-ID: 91539341a3b6e9c868024a4292455dae36e6f58c Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-plat= forms/91539341a3b6e9c868024a4292455dae36e6f58c Author: Marc Zyngier AuthorDate: Tue, 30 May 2023 11:01:22 +01:00 Committer: Marc Zyngier CommitterDate: Tue, 30 May 2023 11:01:22 +01:00 irqchip/gic: Correctly validate OF quirk descriptors When checking for OF quirks, make sure either 'compatible' or 'property' is set, and give up otherwise. This avoids non-OF quirks being randomly applied as they don't have any of the OF data that need checking. Cc: Douglas Anderson Reported-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Fixes: 44bd78dd2b88 ("irqchip/gic-v3: Disable pseudo NMIs on Mediatek devic= es w/ firmware issues") Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-com= mon.c index de47b51..afd6a18 100644 --- a/drivers/irqchip/irq-gic-common.c +++ b/drivers/irqchip/irq-gic-common.c @@ -16,6 +16,8 @@ void gic_enable_of_quirks(const struct device_node *np, const struct gic_quirk *quirks, void *data) { for (; quirks->desc; quirks++) { + if (!quirks->compatible && !quirks->property) + continue; if (quirks->compatible && !of_device_is_compatible(np, quirks->compatible)) continue;