Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp200331lql; Fri, 12 Apr 2024 07:57:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6eioKHnbfXYnu8kOnU2VvASbyld6ZgMikA851e73ox3K+NfuQxV4k5LYAF4Ets3jDHIT993jw7yTE0jg/Gq/eZQy38Lz6NgFA49poZQ== X-Google-Smtp-Source: AGHT+IHrjKL8Avo8vZbjtg3Ih31jGetfhnPF+3LJ+SzrFnOFkLtkN+aDw3gogwx4FOc6yTA5OzI0 X-Received: by 2002:a05:6359:4608:b0:17f:5ef7:15cc with SMTP id my8-20020a056359460800b0017f5ef715ccmr4116545rwb.3.1712933870683; Fri, 12 Apr 2024 07:57:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712933870; cv=pass; d=google.com; s=arc-20160816; b=Pyy9+T9AYdWQgtPHUNHoWOZDN/tTUqYgmSI+8/zDaptiJKzIsFRieYpHC9r8sfttoz I8IlviwVhFb2UG89GtbnctuflcuqUVo+3L1HCJ7WmosEa1DUkhfNGLb+yd8tLivonZtP bAb4pkqZB1stDv6uHgtkVywGQ3D3pwP1adocliKhVuXV6FOO09LIMaPG/PHFRjHaDPoN 6Cb2mBasOwE0dwh/U+nK5RHMQi/A/rUmoUfcEwlbpyGL7k3fMZj5bBONhPqCGECCEOSm 3wtXiO6NPInezBdo88Z7tVtt33ifd+AvJHHzLUf0ZA4x0NQMSvTjRrcuCof9ku9UcfAB r41Q== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=LxVC8eAEj5227/hrFq867w/Ucx+VJjdjb+BncO88uVQ=; fh=8XQHdFtte3XOHSEIytMgmfctfSZlTmw2q6RqB5HTTCI=; b=r/kM4T54a84rU2zKYGVi0SKsADfmPLbKV462sWycsz9t4qcA8GEZBH6NtDbdO9jjm0 e/VEQ3BMAIO3vrvTOInJe1p14U0tAeA3fL5woz+JPhQ22UPC/3xbCYWB2hhstaADt8CJ YeEV6M8/uZZih5wL+VyEJQZvYrzBgEjY9rq1hyWMe4wmaSbAtsUB0IeBlJUu5D9MVbS4 0KZmljM0AAM93Rt8c1zp/7+yZ/oXXrngyON+l+P45dXIvSuww43YLwJl75ymddbLJO/9 6QnDnlsZfHuQ2THwIwHtbTSEKRpB0iEuU5/LxVxbstkS7pZElFgbReAOWAPFbJ65QMMM YuPg==; 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-142865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bx17-20020a056a02051100b005dc359d7e93si3498990pgb.806.2024.04.12.07.57.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:57:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::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-142865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142865-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5083FB25E8F for ; Fri, 12 Apr 2024 14:43:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0846D14386F; Fri, 12 Apr 2024 14:43:29 +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 04E8A14199C; Fri, 12 Apr 2024 14:43:27 +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=1712933008; cv=none; b=GABfXkUa1XN3aE0yQ9V5CkC/9XszZGoH5AkGyJSNWDJ1xpThu/5rhO3NPkLE/aGdTg94Kpm1xKG8la7Mm57y0vn0JztPQ9OSk1yMX6femVExWFpBgjfPc6ft1PP4FLSay7BzcwzzEogT64Ogm8jk+bmadu90kDueTk7SQEihtSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712933008; c=relaxed/simple; bh=dmhJWSD9xv9dYuU9/FWuiIHdAi7HU4yHvwTLrzYdN34=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cJ8as1J6tRAcUWMf9DBZ8ZlDicBO9YjxSFcsufEuEtHp9TENJA5vnVNryZEYLffV8OIoJhxLAuyiMl/YScUx+f6s/6smygPqYEmtAIYX505VMu9KDQCDmTMShJeBnYSUMbyv+0wDBTjpkIec/jm0+7ueBi0v1uo03judUvKfc+I= 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.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VGK5J5Rbfz6J6KY; Fri, 12 Apr 2024 22:41:40 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 1DA221402CD; Fri, 12 Apr 2024 22:43:25 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) 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; Fri, 12 Apr 2024 15:43:24 +0100 From: Jonathan Cameron To: , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon CC: , , Subject: [PATCH v5 12/18] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Date: Fri, 12 Apr 2024 15:37:13 +0100 Message-ID: <20240412143719.11398-13-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240412143719.11398-1-Jonathan.Cameron@huawei.com> References: <20240412143719.11398-1-Jonathan.Cameron@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) 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 --- v5: 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) -- 2.39.2