From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C75CC7EE25 for ; Wed, 7 Jun 2023 14:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240603AbjFGOWJ (ORCPT ); Wed, 7 Jun 2023 10:22:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240634AbjFGOWF (ORCPT ); Wed, 7 Jun 2023 10:22:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8040C1BFE for ; Wed, 7 Jun 2023 07:22:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DB4CB63F38 for ; Wed, 7 Jun 2023 14:22:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD41EC433EF; Wed, 7 Jun 2023 14:21:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686147721; bh=PWyDPpucE3UwcC14P8MHk7X2eKHdVp0MmHoFYCJy4qc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rSGIo2wqQgc1/y1rp138JEiKgpzLFwl2+PF4HMRDblbeb9FQc+AVj5dQj8Zwgt5V/ AkxUR3cAds3TTQT4sjR/GPBht6ndNOAJqwY21hkqbckTO367GuXnTYNLekPFitosoe vzni+2Q9BZtX4AFKa4kgl6Od0BJZKuBZUJ9wie3LSrVPzp32N82YJFvwIpitEL5DmG t4KyDCtW6m4qA5NdFIZ3NTdCIYYqtxEbSe67CZ4buibN2pg6scPmlEChII+p6urVj4 vLT0D+XQ5tQQQS/Q2oAOqnoXuUO+fhPJkX4fKH9Mc2Idv/dCt0lRRiXwjTuvm++vvj i8Cr4jMHsZsog== Date: Wed, 7 Jun 2023 16:21:55 +0200 From: Lorenzo Pieralisi To: Robin Murphy Cc: will@kernel.org, mark.rutland@arm.com, suzuki.poulose@arm.com, bwicaksono@nvidia.com, ilkka@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sudeep Holla , Hanjun Guo Subject: Re: [PATCH v2 2/4] ACPI/APMT: Don't register invalid resource Message-ID: References: <63b34656e1f7b41bcb458fb6d7496e04db757e0d.1685983270.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63b34656e1f7b41bcb458fb6d7496e04db757e0d.1685983270.git.robin.murphy@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 05, 2023 at 06:01:32PM +0100, Robin Murphy wrote: > Don't register a resource for the second page unless the dual-page > extension flag is actually present to say it's valid. > > CC: Lorenzo Pieralisi > CC: Sudeep Holla > Reviewed-by: Suzuki K Poulose > Reviewed-by: Hanjun Guo > Reviewed-and-tested-by: Ilkka Koskinen > Signed-off-by: Robin Murphy > --- > drivers/acpi/arm64/apmt.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) Acked-by: Lorenzo Pieralisi As you mentioned in v1 I don't think we need to backport this since the kernel is working around it (in code you are cleaning up) even though that would not hurt. Lorenzo > diff --git a/drivers/acpi/arm64/apmt.c b/drivers/acpi/arm64/apmt.c > index 8cab69fa5d59..aa7d5c3c0dd8 100644 > --- a/drivers/acpi/arm64/apmt.c > +++ b/drivers/acpi/arm64/apmt.c > @@ -35,11 +35,13 @@ static int __init apmt_init_resources(struct resource *res, > > num_res++; > > - res[num_res].start = node->base_address1; > - res[num_res].end = node->base_address1 + SZ_4K - 1; > - res[num_res].flags = IORESOURCE_MEM; > + if (node->flags & ACPI_APMT_FLAGS_DUAL_PAGE) { > + res[num_res].start = node->base_address1; > + res[num_res].end = node->base_address1 + SZ_4K - 1; > + res[num_res].flags = IORESOURCE_MEM; > > - num_res++; > + num_res++; > + } > > if (node->ovflw_irq != 0) { > trigger = (node->ovflw_irq_flags & ACPI_APMT_OVFLW_IRQ_FLAGS_MODE); > -- > 2.39.2.101.g768bb238c484.dirty >