Message ID | 91c8787f1e84d79e110a057615c838f6ac244669.1685619571.git.robin.murphy@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp262809vqr; Thu, 1 Jun 2023 05:02:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5IWjzjm90lnxsDQp6Mf66u84H4V8HmYxi6P8HB5OeMWOSCYtOGiEZKBl4MA5eHBvl/LFbB X-Received: by 2002:a17:903:2311:b0:1b0:7739:657c with SMTP id d17-20020a170903231100b001b07739657cmr7131415plh.55.1685620948102; Thu, 01 Jun 2023 05:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685620948; cv=none; d=google.com; s=arc-20160816; b=kpfpkol77WIKD60d8sMcm0lcgAzLpmH85neUJJDBvUZKdISizpKKhmWGzLOaCciSTL 2OSYF5b5/Rb45HTbA8MTByGL91yaWopcCf6Dir4cAR13otpa2uMa69eH0tJlLYSJfe2/ 1hPMOu4QxbcV9XHuo5uAQSBjoxo9BcZgxbEPno3BqvfVdaw5xD4izS6AcIankLGwvbFi fadavK/z5X3uK404SLCo4VWIUY9uVKwkkHNy0TppBcAZ+h0Wug1ZWjHb+mPqu68HCACU rEs2UrN8C7MjymZQR5BTZsoFpp10sRXjJWP1OlngYpLG1TrPUqKBdQPqvZSX2OeCsfWL B/rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=azWV7nwAIeTMUJhpl8GRs4bvNfHN1aop6xV1qRCPk8c=; b=DSLFS4ZpeaXSclYwbYzShZvmwvSj3kx11AA2Lz0MwDYhfn5oMXv4pKRgd3B4Txeexp T1JudjAtwKoAtFmDx/9dGjxR2i+GmbtlZykxGmzC9gUqhtTdTjs5W0xBZ/0pzM1oVffE yTBt9HsppZAaT5rAptmME/pCOYfqeBvSt3QSJ9OvK2S4UokY2FfuSvIYm+HDioB1//tJ E3TcGxr8IOO/GuH42gFUY7FEtG65fZdtRVLTbnCafkAiY+sCGePcZVZyTv3Ev7+Jk7J4 AFtiNT7DGjC7JB+OVOLtdYKmUMjrkADyhhazUtOQu0LU8zF1ucpc4infkHwLUSLAvpyR 6Nhg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a170902768700b0019e2bd0fea8si2592332pll.143.2023.06.01.05.02.07; Thu, 01 Jun 2023 05:02:28 -0700 (PDT) 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 S233101AbjFAL7r (ORCPT <rfc822;limurcpp@gmail.com> + 99 others); Thu, 1 Jun 2023 07:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233068AbjFAL7q (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 1 Jun 2023 07:59:46 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9A1EB134 for <linux-kernel@vger.kernel.org>; Thu, 1 Jun 2023 04:59:43 -0700 (PDT) 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 C42BA175D; Thu, 1 Jun 2023 05:00:28 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 104833F7D8; Thu, 1 Jun 2023 04:59:41 -0700 (PDT) From: Robin Murphy <robin.murphy@arm.com> To: will@kernel.org Cc: 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, Lorenzo Pieralisi <lpieralisi@kernel.org>, Hanjun Guo <guohanjun@huawei.com>, Sudeep Holla <sudeep.holla@arm.com> Subject: [PATCH 2/4] ACPI/APMT: Don't register invalid resource Date: Thu, 1 Jun 2023 12:59:30 +0100 Message-Id: <91c8787f1e84d79e110a057615c838f6ac244669.1685619571.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty In-Reply-To: <cover.1685619571.git.robin.murphy@arm.com> References: <cover.1685619571.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767501671158457546?= X-GMAIL-MSGID: =?utf-8?q?1767501671158457546?= |
Series |
perf/arm_cspmu: Fixes and cleanups
|
|
Commit Message
Robin Murphy
June 1, 2023, 11:59 a.m. UTC
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 <lpieralisi@kernel.org>
CC: Hanjun Guo <guohanjun@huawei.com>
CC: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
Not a critical fix, since the driver currently works around this itself,
but patch #4 would like to clean that up.
drivers/acpi/arm64/apmt.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Comments
On 01/06/2023 12:59, 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 <lpieralisi@kernel.org> > CC: Hanjun Guo <guohanjun@huawei.com> > CC: Sudeep Holla <sudeep.holla@arm.com> > Signed-off-by: Robin Murphy <robin.murphy@arm.com> > --- > > Not a critical fix, since the driver currently works around this itself, > but patch #4 would like to clean that up. > > drivers/acpi/arm64/apmt.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > 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); Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
On 2023/6/1 19:59, 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 <lpieralisi@kernel.org> > CC: Hanjun Guo <guohanjun@huawei.com> > CC: Sudeep Holla <sudeep.holla@arm.com> > Signed-off-by: Robin Murphy <robin.murphy@arm.com> > --- > > Not a critical fix, since the driver currently works around this itself, > but patch #4 would like to clean that up. > > drivers/acpi/arm64/apmt.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > 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); Good catch, Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
On Thu, 1 Jun 2023, 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 <lpieralisi@kernel.org> > CC: Hanjun Guo <guohanjun@huawei.com> > CC: Sudeep Holla <sudeep.holla@arm.com> > Signed-off-by: Robin Murphy <robin.murphy@arm.com> Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> > --- > > Not a critical fix, since the driver currently works around this itself, > but patch #4 would like to clean that up. > > drivers/acpi/arm64/apmt.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > 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 > >
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);