Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2371343pxb; Thu, 3 Feb 2022 05:20:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWh3dVzETyoMFSng+TU/rX2yJB7wgExVXrk/cvuI3hD3P5RTCDiN0SgVNugaagZ+i465xd X-Received: by 2002:a17:90a:af97:: with SMTP id w23mr13702718pjq.237.1643894408048; Thu, 03 Feb 2022 05:20:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643894408; cv=none; d=google.com; s=arc-20160816; b=S3ELULpDmsoA2d/+H69UWG6lbvG677FGcm1Ih60dVt2f+Awik/VaJL3PfeNZ+21s9C l4K3g3rszY0fCUT6xNBZQjH7M1bA33YF3+zqnWUz/jx2tTmDECPmgHJLhYQ5YoQkPzZ7 vIxhPwlSL53yxKMNoTz+ZnZFtLYca46D7VYHqrFmF2C3TfR4oM48myIfk92YRx7zI/2V MxyogyNZ3/l5c9SzY0Bkbh14DZbYWdA19A5ATcqT9Do+YlDQJZBokBySOYvjvdYpF3W/ ticxgpg9Q1ynMRIjynFeyRvhOcVjd50lE/oJa3j+mfbFHG+b7zmnV2u/Zb0xGCQhIqb3 tXqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=cQ0+0sV5IAQZWSW0lCv0NVJgdlQrGx2Zy2c2h+Yeo/0=; b=Z3+l+chRG7A7XavQ0tkk+uLQW6JylKtpsBhF1TU6VyNyK7qP1sgjOENEPS2GOFPXR7 SiUJlC2MT4ZAehIThlw36ULyXtz/VKmZW/E74USEOOIySTcWMewzbb8qcMKiwTHt8x4q qeVqC5899umoraDahgZvuahxAKvoCESK8xKhcevjexfUyG6tQqdD0nxvXNambx5hzmZv 8AD7qC+XE8pkffVuDL7wa8o/WF4YTMi+gZF3/LH4QKslmBbKFtz27m8UrhGIcAY6AIoi of61mu3Ocams3AJMJsRI1t5lh/yb+PgtCQFQRlsX1cYxZ2miBd80y/pHW9WozAU+o/3k P/dw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13si24092891pfc.194.2022.02.03.05.19.55; Thu, 03 Feb 2022 05:20:08 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344221AbiBBMu7 (ORCPT + 99 others); Wed, 2 Feb 2022 07:50:59 -0500 Received: from foss.arm.com ([217.140.110.172]:57630 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230258AbiBBMu7 (ORCPT ); Wed, 2 Feb 2022 07:50:59 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B18111FB; Wed, 2 Feb 2022 04:50:58 -0800 (PST) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E52FF3F718; Wed, 2 Feb 2022 04:50:57 -0800 (PST) From: Valentin Schneider To: Marc Zyngier , linux-kernel@vger.kernel.org Cc: Thomas Gleixner , kernel-team@android.com, Steev Klimaszewski Subject: Re: [PATCH] irqchip/gic-v3-its: Skip HP notifier when no ITS is registered In-Reply-To: <20220202103454.2480465-1-maz@kernel.org> References: <20220202103454.2480465-1-maz@kernel.org> Date: Wed, 02 Feb 2022 12:50:52 +0000 Message-ID: <87pmo5o2j7.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/22 10:34, Marc Zyngier wrote: > We have some systems out there that have both LPI support and an > ITS, but that don't expose the ITS in their firmware tables > (either because it is broken or because they run under a hypervisor > that hides it...). > Huh :) > Is such a configuration, we still register the HP notifier to free > the allocated tables if needed, resulting in a warning as there is > no memory to free (nothing was allocated the first place). > Right, so list_empty(&its_nodes) means no ->pend_page, but still having the HP notifier means we hit the WARN_ON(!pend_page). > Fix it by keying the HP notifier on the presence of at least one > sucessfully probed ITS. > That looks fine to me. Reviewed-by: Valentin Schneider > Fixes: d23bc2bc1d63 ("irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve") > Reported-by: Steev Klimaszewski > Signed-off-by: Marc Zyngier > Cc: Valentin Schneider > --- > drivers/irqchip/irq-gic-v3-its.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index 9e93ff2b6375..cd772973114a 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -5517,6 +5517,9 @@ int __init its_lpi_memreserve_init(void) > if (!efi_enabled(EFI_CONFIG_TABLES)) > return 0; > > + if (list_empty(&its_nodes)) > + return 0; > + > gic_rdists->cpuhp_memreserve_state = CPUHP_INVALID; > state = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, > "irqchip/arm/gicv3/memreserve:online", > -- > 2.34.1