linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	<linux-acpi@vger.kernel.org>, <linux-arch@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-pm@vger.kernel.org>, <linuxarm@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	<loongarch@lists.linux.dev>, <x86@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	"Miguel Luis" <miguel.luis@oracle.com>,
	James Morse <james.morse@arm.com>,
	"Salil Mehta" <salil.mehta@huawei.com>,
	Jean-Philippe Brucker <jean-philippe@linaro.org>,
	Hanjun Guo <guohanjun@huawei.com>, Gavin Shan <gshan@redhat.com>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, <justin.he@arm.com>,
	<jianyong.wu@arm.com>
Subject: Re: [PATCH v10 13/19] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc()
Date: Wed, 19 Jun 2024 09:11:37 +0100	[thread overview]
Message-ID: <20240619091122.00003a9e@huawei.com> (raw)
In-Reply-To: <20240529133446.28446-14-Jonathan.Cameron@huawei.com>

On Wed, 29 May 2024 14:34:40 +0100
Jonathan Cameron <Jonathan.Cameron@huawei.com> wrote:

> From: James Morse <james.morse@arm.com>
> 
> 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 <james.morse@arm.com>
> Reviewed-by: Gavin Shan <gshan@redhat.com>
> Tested-by: Miguel Luis <miguel.luis@oracle.com>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Sorry. I managed not to pick up Marc's RB form v8 and this patch is unchanged.
https://lore.kernel.org/all/87jzkktaui.wl-maz@kernel.org/

Hopefully whoever picks this up is using tooling (b4 or similar) that will get it from
here.

Reviewed-by: Marc Zyngier <maz@kernel.org>

So just patch 14 waiting for Marc to take another glance.


> ---
>  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)



  reply	other threads:[~2024-06-19  8:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29 13:34 [PATCH v10 00/19] ACPI/arm64: add support for virtual cpu hotplug Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 01/19] ACPI: processor: Simplify initial onlining to use same path for cold and hotplug Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 02/19] cpu: Do not warn on arch_register_cpu() returning -EPROBE_DEFER Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 03/19] ACPI: processor: Drop duplicated check on _STA (enabled + present) Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 04/19] ACPI: processor: Return an error if acpi_processor_get_info() fails in processor_add() Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 05/19] ACPI: processor: Fix memory leaks in error paths of processor_add() Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 06/19] ACPI: processor: Move checks and availability of acpi_processor earlier Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 07/19] ACPI: processor: Add acpi_get_processor_handle() helper Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 08/19] ACPI: processor: Register deferred CPUs from acpi_processor_get_info() Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 09/19] ACPI: scan: switch to flags for acpi_scan_check_and_detach() Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 10/19] ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 11/19] arm64: acpi: Move get_cpu_for_acpi_id() to a header Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 12/19] arm64: acpi: Harden get_cpu_for_acpi_id() against missing CPU entry Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 13/19] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Jonathan Cameron
2024-06-19  8:11   ` Jonathan Cameron [this message]
2024-05-29 13:34 ` [PATCH v10 14/19] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs Jonathan Cameron
2024-06-19 12:10   ` Marc Zyngier
2024-05-29 13:34 ` [PATCH v10 15/19] arm64: psci: Ignore DENIED CPUs Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 16/19] arm64: arch_register_cpu() variant to check if an ACPI handle is now available Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 17/19] arm64: Kconfig: Enable hotplug CPU on arm64 if ACPI_PROCESSOR is enabled Jonathan Cameron
2024-06-30  0:39   ` Gavin Shan
2024-06-30  9:26     ` Catalin Marinas
2024-07-01  0:17       ` Gavin Shan
2024-05-29 13:34 ` [PATCH v10 18/19] arm64: document virtual CPU hotplug's expectations Jonathan Cameron
2024-06-30 12:53   ` Huacai Chen
2024-07-10  8:23     ` Jonathan Cameron
2024-05-29 13:34 ` [PATCH v10 19/19] cpumask: Add enabled cpumask for present CPUs that can be brought online Jonathan Cameron
2024-06-13 10:25 ` [PATCH v10 00/19] ACPI/arm64: add support for virtual cpu hotplug Jonathan Cameron
2024-06-19 12:11   ` Marc Zyngier
2024-06-28 14:49     ` Jonathan Cameron
2024-06-28 17:56 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240619091122.00003a9e@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=gshan@redhat.com \
    --cc=guohanjun@huawei.com \
    --cc=james.morse@arm.com \
    --cc=jean-philippe@linaro.org \
    --cc=jianyong.wu@arm.com \
    --cc=justin.he@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxarm@huawei.com \
    --cc=loongarch@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=miguel.luis@oracle.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).