Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2170870lqt; Mon, 22 Apr 2024 03:44:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyhGciVJD8iDg+f60z62ihAsa0g1lJhLXSGYjkmwJ3GjTcWJLYKuBGMlvltOGzWortU7V/h4YFkbENj3mF3v369uMbm4IDGW6TR57nwQ== X-Google-Smtp-Source: AGHT+IFKh1xarRdvAjTrymKNuXOVhuXbYJ/ZINrdBH2v48LnC8ytc8ZlnKlY0WF9JdCwb7pD6+wy X-Received: by 2002:a0c:e7c7:0:b0:6a0:5034:778b with SMTP id c7-20020a0ce7c7000000b006a05034778bmr10016531qvo.61.1713782651125; Mon, 22 Apr 2024 03:44:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713782651; cv=pass; d=google.com; s=arc-20160816; b=0HQTxBPAntknF1lllI9NHd8ptFHphDK+13WVvejf2kHVLN1PBvcfiW+fkOi95RGnGS ZobwAw61qFqQOoo6Enc+g5cVefnujqyCOZMkRRDEW6XZ6ciRrCAqIr6Y4GEVFrQy10Jr FR9dO1HJWNUMpUCRCh+l9sI3BH43zRLgBOfMUbM+Pj2wkKTftwr4ijt3VQTT+7ioZydd /nK7u2xMxVzhZG2ViVjU7M9MlmGLfedOSdDPViI7z5XQA6rLXBMYaDpo9bc07zjQ/XHC vik2DiG7V8ULQd8Y6bSd1hoaR3o4dlLTzG0jkthjM0bXrv7/RL/6khSO/DKMxQZLeTSf MxJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=RBCZqlPk01ksZEWpYmQ5JMfOdFYR38RW//vnqoWwTPM=; fh=hoMyqmeT9qjZhM+6Q2A+KBK7GrekNkfuvGjTn7zzQIc=; b=IbmlhbDFSQWjSQOBDwP2rdBHf2O6qsG40DhdpntB/jbpYRTo6xG0hereY1cVE0xnnu 3NaNOpucTtOJWAOEqjhT2nnIvjJ7XnA9hgEWWnGNpGsoLISeq0Q1e8Pl30stTphnizau tp4/x3fFiMNb+2vZ243cylJu3UnZwW7X5HancVziZBa2bIX/xRinlC7fBZscqh+7n5go KuKU5bbEzdSVQqGkXRzfHtAjbvhkc9mg5xaYFpqMQzAWTvYeIjK8w/+sYYRjeOWKIkHk S//EIrVjZ7XvIGTbJdsfovKlKjmF7RTyG7ODFXkrnoUZDb+Q8G23OZf9cNID6kg6Yvww 1qnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-153221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s12-20020a0562140cac00b0069e900f5620si10407661qvs.220.2024.04.22.03.44.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 03:44:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-153221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D46341C21236 for ; Mon, 22 Apr 2024 10:44:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3ABCA15251D; Mon, 22 Apr 2024 10:39:23 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B6E5146D46; Mon, 22 Apr 2024 10:39:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713782362; cv=none; b=WPH1t3tbL9B/m0Y5hwzJoJwqk81JWvquxnw0HDvbRO67s9w0sBEIplY6AFnuIXs/Ic/CmY8VETcW6OHnEvYjvPID34moSmflklas83SC778t4VIw72XT2ukObQZEUphhIZFyelsoaUNe97oHaEFMor8q30AH+xho0bL1jyXEtXI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713782362; c=relaxed/simple; bh=JqE3ylYWKarL5FDsaFXHHjgdDBTPGkxZWyvz1pBSwRY=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tZvr1uUiE1xKovsTXYa3hGaj1A7xUS7rXUqCMNUQqX0O3UOGu3QWQP/+DSQANOD4Vlae9kXouzRzVyCUZOwsQ2JlaOe6CP1iLMFzOeORCJMwLbMIpcJgpHRyV+VekKAUiAjoH6we9zEmpozLRuUNpE+iI38Ww7onKod8YLa+vdw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VNMBM0NFfz6JBRQ; Mon, 22 Apr 2024 18:36:59 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 928E1140CB1; Mon, 22 Apr 2024 18:39:12 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 22 Apr 2024 11:39:11 +0100 Date: Mon, 22 Apr 2024 11:39:10 +0100 From: Jonathan Cameron To: Thomas Gleixner , Peter Zijlstra , , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , "James Morse" , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , CC: Ingo Molnar , Borislav Petkov , "Dave Hansen" , , , Marc Zyngier Subject: Re: [PATCH v7 10/16] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Message-ID: <20240422113839.00000cde@huawei.com> In-Reply-To: <20240418135412.14730-11-Jonathan.Cameron@huawei.com> References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-11-Jonathan.Cameron@huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500005.china.huawei.com (7.191.163.240) On Thu, 18 Apr 2024 14:54:06 +0100 Jonathan Cameron wrote: > From: James Morse > > gic_acpi_match_gicc() is only called via gic_acpi_count_gicr_regions(). > It should only count the number of enabled redistributors, but it > also tries to sanity check the GICC entry, currently returning an > error if the Enabled bit is set, but the gicr_base_address is zero. > > Adding support for the online-capable bit to the sanity check will > complicate it, for no benefit. The existing check implicitly depends on > gic_acpi_count_gicr_regions() previous failing to find any GICR regions > (as it is valid to have gicr_base_address of zero if the redistributors > are described via a GICR entry). > > Instead of complicating the check, remove it. Failures that happen at > this point cause the irqchip not to register, meaning no irqs can be > requested. The kernel grinds to a panic() pretty quickly. > > Without the check, MADT tables that exhibit this problem are still > caught by gic_populate_rdist(), which helpfully also prints what went > wrong: > | CPU4: mpidr 100 has no re-distributor! > > Signed-off-by: James Morse > Reviewed-by: Gavin Shan > Signed-off-by: Russell King (Oracle) > Reviewed-by: Jonathan Cameron > Signed-off-by: Jonathan Cameron I've been focused on the ACPI aspects until now, but now realize that this and the next patch should have included the GIC maintainer in the to list. I'll fix that for future versions, but for now +CC Marc. > --- > v7: No change > --- > drivers/irqchip/irq-gic-v3.c | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c > index 6fb276504bcc..10af15f93d4d 100644 > --- a/drivers/irqchip/irq-gic-v3.c > +++ b/drivers/irqchip/irq-gic-v3.c > @@ -2415,19 +2415,10 @@ static int __init gic_acpi_match_gicc(union acpi_subtable_headers *header, > * If GICC is enabled and has valid gicr base address, then it means > * GICR base is presented via GICC > */ > - if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address) { > + if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address) > acpi_data.enabled_rdists++; > - return 0; > - } > > - /* > - * It's perfectly valid firmware can pass disabled GICC entry, driver > - * should not treat as errors, skip the entry instead of probe fail. > - */ > - if (!acpi_gicc_is_usable(gicc)) > - return 0; > - > - return -ENODEV; > + return 0; > } > > static int __init gic_acpi_count_gicr_regions(void)