From patchwork Tue May 30 10:11:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 100746 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2085031vqr; Tue, 30 May 2023 03:46:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6F22GKXa5UyH99EkTinkklqHl7JCf82LLpIE4BSbuEI7TbyUzMf0r2QoM5fLk9eKGjBPLo X-Received: by 2002:a05:6a00:1a51:b0:64f:4812:8c7e with SMTP id h17-20020a056a001a5100b0064f48128c7emr1842397pfv.19.1685443598851; Tue, 30 May 2023 03:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685443598; cv=none; d=google.com; s=arc-20160816; b=S04Ycmbj1+SV5w9xC9armi2hOxGBrFF6er3sto8r33bWps4fmn+atGoGTFd1vh5XpY FrxSnb/kKHHSVTW4klkhWL/8bKb5K2VaJQS98Hz+sgRhHLx0QMnC1kOqtxTOHoXZzmMJ i4yEid6F8AiX50+YiOvXuoHPBmNzXDvukFKMCE15X9DVycSeo6yFnO4oowPorpF10pR8 IY6zmdaTiJ+EiE0cvTMWFG4lsuw6mnKKQ6NKUZB4+I2UCJwHn9QRF0BQaiH+4is8o+nh CbGsmd6HSqQK+/Lk8KhM6gAmUOYm9uYLocmrrPTlOR4dSPu9lnm7KOxCZpDEhvbPYPIk KhOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=Kgox1DACm+wImb37rOPJ3ZxaCjPRS4PC+RXndEqMgYI=; b=rMEHZChTaM4dsUM7hJO9cbBJfrWghZN0Ik+CiFhc3psYKXgxG1kTjofftWp8OcF4lR sv8RmGoH9aGL8hAA/dSszqIcQ7mnuZBW8/NnHKtAQ9CoHiq0I/Zl5OY8Tb+GzYhyZDuA dPHYs+UzMUJxJW8CUDjWdqvbjTWa6zzKIhRg81Jk/RPzpm82Ifd+SpcbWpxD+tVa9eFT pSBRhc1La10NFr6MuaH9ssy0jkq/xXYDYkUsxpezgis8ITO6GIrph2Y5G0yeavlmRjdE u5R+N7BZtCwwQyrU5Vj8WS1GCovweuVrp9NzZmAsV93pghctboXUbNAJMJYZBNoRttGc FwiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0yABhfWb; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j196-20020a636ecd000000b0051b6ee8bdd0si9880730pgc.687.2023.05.30.03.46.26; Tue, 30 May 2023 03:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0yABhfWb; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbjE3KMI (ORCPT + 99 others); Tue, 30 May 2023 06:12:08 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767315706793661513?= X-GMAIL-MSGID: =?utf-8?q?1767315706793661513?= The following commit has been merged into the irq/irqchip-fixes branch of irqchip: Commit-ID: 91539341a3b6e9c868024a4292455dae36e6f58c Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/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 devices 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-common.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;