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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC8BCC3DA49 for ; Fri, 26 Jul 2024 17:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VTQsnDD9dOQ9aXW3fhwk4CaUxvGpW17OCJzKJw9Ccdc=; b=zj0/OUfr/GvdtCO2avaPZKb9Rm 9Is7LCDAAbvByJeE3/C1tQWJgH3fsU7phEPjGliEq/ljRjXJcb79CxffrFjh+9m2nFK6M16e+M/w5 LtzYp+s0hkq0aZuQOd2pa/5i79SznZnoJ1zt7zJlbCuf9WJNBE5VZZYQJ3vT3BSC0MUVHUQ352Qza p5iZl4efgtpxS4sdiZIaEdu6u0dK/TrliV50OSuAhxoQX688Sqk+ANq4we44CeX0MrvVzkJAbK+6K 15oA0ynjUuuzWt/Scefx/BXmL9Rmpl8ERRF9OS5qqh3VoNZp5wfrwLASWDGzOaZvaXOFmeuB+yiJC 2YYGxkrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPB4-00000004a9Z-3NCm; Fri, 26 Jul 2024 17:56:26 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXPAe-00000004a6y-2h1x for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 17:56:02 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-704156d0e0dso811441a34.1 for ; Fri, 26 Jul 2024 10:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1722016559; x=1722621359; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=VTQsnDD9dOQ9aXW3fhwk4CaUxvGpW17OCJzKJw9Ccdc=; b=jsc1nA288Wpu8BedRYMyTL84U0AdFuv9axm/Iy0dBzoAbHs/5XNPRiz9UZTAsoHvKV 517rU+cHlyyYMJJQPUQRBp66jbXTxJZjJb4J52S+xE872x53Cs7+wL11u1SpiO2I5vOf 99SFgpp3FzjoY/Oreyip7/OiGltKdWrxqg0dXrMbcWqrYACfpTpBLbXK6KqwTy7fWULZ pJVN3ttpnis76OjUwnUPxG47bIKVcYgiKU0j8tPk9q0DVWwtlt3qRWAHxrBlSM9Fjtmw peQymMbUUwmsmXRjf7hbn9i5lwgyRM4MRzbwJTbugrw/G23bWkwN2d6T6IWUA7k1+t5N JUPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722016559; x=1722621359; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VTQsnDD9dOQ9aXW3fhwk4CaUxvGpW17OCJzKJw9Ccdc=; b=On2SUMk6uFbcgoL77GFUQvaV6fWROpSW2X6GyixyVCTOAEUBUBV3tV0jLwo6OEeY5M KF1hSXILnsCJJZLDWW7JV750uDrrQHZ3usB+zO6beSPTtqbClHSoGIR7ikV18amJlvzy vU1u82LKQfh/8s9B6ec2piPcQiT+ywyRMPqhyLofSMaNJM0CQIq41GKc5vwFIQ3uqGOA +lkrS5CT+igAZhCSydMwW7xN0pOZ8ByBQLyrcXy0c3j/biP2J5owhs37lPV2833nWuM6 +pt8dg+9SkEnGeAnPAhPNjQKj118NAa/s0W08jWxS5qoPpOfV+TPkXm7fkxQtcrAZcF1 BT8w== X-Forwarded-Encrypted: i=1; AJvYcCXMVYkN0j02beEWNi2iWk9f5BdAW2w1dXI3R7cLylQCZEvJe1mTuprKCxl1t2zz4xU4BXceQRDfVmsBm+UPJIFUzmE4LAr+mVxYGRSn2fmfpS+MP0s= X-Gm-Message-State: AOJu0YyORNyEB8j4tWuu69s6Gua83suaa8pMoK3tAxUqAfqLUPqoDLva y2c6sx5Mn5YSLvZSLjD/dqGQ91ZrAaR8XzvIAO/Oc5lxUYGjiYCRvO9ybyijROU= X-Google-Smtp-Source: AGHT+IHljkEgQv5ran0KLKmhGq/iyvIgPz7k7A6vSGQHnc+uRtB/kEThWLvH9PXh/6khJbW9A6aLjg== X-Received: by 2002:a05:6830:6189:b0:704:47db:cd6d with SMTP id 46e09a7af769-70940c0892amr420224a34.1.1722016558854; Fri, 26 Jul 2024 10:55:58 -0700 (PDT) Received: from sunil-laptop ([106.51.198.16]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-70930794a19sm839816a34.78.2024.07.26.10.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jul 2024 10:55:58 -0700 (PDT) Date: Fri, 26 Jul 2024 23:25:51 +0530 From: Sunil V L To: Miao Wang Cc: Sudeep Holla , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Rafael J. Wysocki" , Len Brown , Hanjun Guo Subject: Re: [PATCH] ACPI: rename acpi_arm_init to acpi_arch_init Message-ID: References: <446b96d0-4b61-11ef-9239-3f7ac1938848@innull.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_105600_713454_B196AA46 X-CRM114-Status: GOOD ( 38.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Jul 27, 2024 at 12:39:03AM +0800, Miao Wang wrote: > Hi, > > Thanks for your quick reply. > > > 2024年7月27日 00:05,Sudeep Holla 写道: > > > > On Fri, Jul 26, 2024 at 11:03:01PM +0800, Miao Wang via B4 Relay wrote: > >> From: Miao Wang > >> > >> So that we avoid arch-specific code in general ACPI initialization flow. > >> Other architectures can also have chance to define their own > >> arch-specific acpi initialization process if necessary. > >> > > > > Nice, but I assume you are adding something similar to another arch(riscv > > or loongarch ?). It would be nice to have those changes as well together to > > make it easy to understand the intention much quicker. > > Yes, you are right about it. I'm trying to add some codes for loongarch, > after DSDT is loaded and namespace is created, before the devices are > enumerated, so I'll have chance to add a _DEP method to one of the device > using acpi_install_method to provide compatibility for some early loongarch > devices which are produced before the loongarch related ACPI standard is > finalized. > I have arch-specific initialization need for RISC-V as well. So, good to see this patch!. > > > >> Signed-off-by: Miao Wang > >> --- > >> arch/arm64/include/asm/acpi.h | 2 ++ > >> drivers/acpi/arm64/init.c | 2 +- > >> drivers/acpi/bus.c | 2 +- > >> include/linux/acpi.h | 6 +++--- > >> 4 files changed, 7 insertions(+), 5 deletions(-) > >> > >> diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h > >> index a407f9cd549e..0d24e920e143 100644 > >> --- a/arch/arm64/include/asm/acpi.h > >> +++ b/arch/arm64/include/asm/acpi.h > >> @@ -188,4 +188,6 @@ static inline void acpi_map_cpus_to_nodes(void) { } > >> > >> #define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE > >> > >> +#define ACPI_HAVE_ARCH_INIT > >> + > > > > There is nothing core arm66 arch specific in acpi_arm_init() and hence it > > is in drivers/acpi/arm64. I would like to avoid adding anything in arch/arm64 > > if possible. Also I don't think we need to define this ACPI_HAVE_ARCH_INIT > > > >> #endif /*_ASM_ACPI_H*/ > >> diff --git a/drivers/acpi/arm64/init.c b/drivers/acpi/arm64/init.c > >> index d0c8aed90fd1..7a47d8095a7d 100644 > >> --- a/drivers/acpi/arm64/init.c > >> +++ b/drivers/acpi/arm64/init.c > >> @@ -2,7 +2,7 @@ > >> #include > >> #include "init.h" > >> > >> -void __init acpi_arm_init(void) > >> +void __init acpi_arch_init(void) > > > > Keep the name acpi_arm_init as is. > > > >> { > >> if (IS_ENABLED(CONFIG_ACPI_AGDI)) > >> acpi_agdi_init(); > >> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c > >> index 284bc2e03580..662f69e379ef 100644 > >> --- a/drivers/acpi/bus.c > >> +++ b/drivers/acpi/bus.c > >> @@ -1458,7 +1458,7 @@ static int __init acpi_init(void) > >> acpi_viot_early_init(); > >> acpi_hest_init(); > >> acpi_ghes_init(); > >> - acpi_arm_init(); > >> + acpi_arch_init(); > > > > Here we need acpi_arch_init() like you have changed. > > > >> acpi_scan_init(); > >> acpi_ec_init(); > >> acpi_debugfs_init(); > >> diff --git a/include/linux/acpi.h b/include/linux/acpi.h > >> index f0b95c76c707..3c3a83499c2d 100644 > >> --- a/include/linux/acpi.h > >> +++ b/include/linux/acpi.h > >> @@ -1517,10 +1517,10 @@ static inline int find_acpi_cpu_topology_hetero_id(unsigned int cpu) > >> } > >> #endif > >> > >> -#ifdef CONFIG_ARM64 > >> -void acpi_arm_init(void); > >> +#ifdef ACPI_HAVE_ARCH_INIT > >> +void acpi_arch_init(void); > > > > This is bit inconsistent. The Makefile is still conditional on > > CONFIG_ARM64 while here you move to ACPI_HAVE_ARCH_INIT. > > So while not just undefine and redefine acpi_arch_init to acpi_arm_init. > > Something like this must work ? > > > > #define acpi_arch_init() do { }while(0) > > > > #ifdef CONFIG_ARM64 > > #undef acpi_arch_init > > #define acpi_arch_init() acpi_arm_init() > > #endif > > It will work. However I can see the pattern in other parts, where > the definition of a macro named HAVE_xxx is checked, and define an > inline static function with empty body if such macro is not defined > or define a function prototype with the same name otherwise, like > acpi_arch_set_root_pointer. I'm just trying to follow this pattern. > I was thinking to make it weak function similar to cpc_read_ffh(). Wouldn't it be better than ifdefery? Thanks Sunil