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 9C154C3DA4A for ; Fri, 26 Jul 2024 16:40:00 +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:To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=I6IFr/uBFRmlohPZgze4KnKiKiNUVk+iL+TvkF/MXV4=; b=BLR2/A9x/l+PagUpQC8QfFH6CH 6p1gahRCtf37IpYDXEEsV5LVOrET0ifTfkzfja+huVVO5gz53ZSME+oPWML5yX5YksGA7oL63Wi/b UoGOy4uZZG9dAsK2+yXgnNV7WpmRQrQaznXDCQvgJVoBIeYFW8k7v7RAJpJXwo8gjKBy+0sqKuPeJ +E9gqXUV+cN97qm9HcOiNmoDghQA53m9DCw/7/0wzeDfd+paCvMW+7gQd79nk5TRjmajXThS2Q/56 mbazEn6kExkkKKJYmjaBCCuSsk5OI8A5L8/hwEgmMQyQcgHbJ1ZlKpGqQJ+zaosGu9MVHPWEqajrv o5VcGvgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXNyt-00000004S4f-3aqd; Fri, 26 Jul 2024 16:39:47 +0000 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXNyU-00000004RvM-0m4r for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 16:39:23 +0000 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3db2315d7ceso96285b6e.1 for ; Fri, 26 Jul 2024 09:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722011960; x=1722616760; darn=lists.infradead.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=I6IFr/uBFRmlohPZgze4KnKiKiNUVk+iL+TvkF/MXV4=; b=Ju4wlPGzXOms1Mu7iuXqoZ32MBFvwN/pxqpzpMwLR50Sq3SpT5kRNRGi3v2Cns182Y HmRvZDk/mpusp56w/PXI3ANux9SsXAs0tj0VTNaVLsQkUGLodDdu13m7mU0wSdK9bbOU J0gvp1+YsF7XFrIN6I9omMnjB+YvNK/U1gUOfVrX9B/mv6xblzwj8PUFg7u13E5rDiO3 0CtDzW4P4eh8X9wymZcAYaScy/rMRVCaS2aA4CdF6Z/a8c49QksdJQaSXFG9yn4ra4RQ 5lLCYp8nX+DRrc+OIYazgsCXmLKNYEPsyJkQ/taS3oHSZta2aMABHFF+dbXX3RpMVWRr eomg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722011960; x=1722616760; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I6IFr/uBFRmlohPZgze4KnKiKiNUVk+iL+TvkF/MXV4=; b=OSXWKut3S5T7exGIkBf/8kwYuphkBEM5TdWXW8oreODhXqZ1L1Zts2iV5vJPT851ex QaCpCuih4GeZv6dB5847TPWqh6Tc4zxnyQ6VhfFYewK+vftimpUOIamZjuQwHgQiSf7P 3Vvc/b5mhA6w1PBHcbmuCtPvB4HmWQXJWd1SkaDCIkqGx/ppOkYO/mQLo1VzEXDYTXbt LeqyJ3dZz3his9dcmGDf/5vqRsEcIfIQZDBFcRt6Vh3rqN9hr4HKv4AbKYzkOUOGx5Va gv+iiB+Df6B90MDrP22U7/uzmRk+VX82INwFjFBm7mxrP+IL2DpQ6Xz+rBkeD40aWWqU L/Ow== X-Forwarded-Encrypted: i=1; AJvYcCWh9cHBHCeoCVenE8JkqWdbqysJp67P+k8lIBY9sx6ytJlrKvzstQ7GY2M5SCDg6PSNppLkjDrhw+AkNmJkp8v+SiBHUXFEx+2dkGgo5Gb+hu0TrfQ= X-Gm-Message-State: AOJu0YxKMT75CjR8XETAwxI9REcgMmsOoN6Ubjqsu/ZoOeRlM/yN9x4p 4HsQyN8CMMRgB5d5Hmgdauo1XPRRFpI7M0XVw3YyTF96lR+MTxfu X-Google-Smtp-Source: AGHT+IGql7DSlnlCNI4PzWu2cUaeRUO5HNu83E/yXkFwTYIucinn8GjfMwqmu+CNcU5es9z81ilyjw== X-Received: by 2002:a05:6808:1416:b0:3da:4c28:6697 with SMTP id 5614622812f47-3db23a2edbcmr320916b6e.38.1722011960065; Fri, 26 Jul 2024 09:39:20 -0700 (PDT) Received: from smtpclient.apple (v133-130-115-230.a046.g.tyo1.static.cnode.io. [133.130.115.230]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70ead8116afsm2914860b3a.116.2024.07.26.09.39.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jul 2024 09:39:19 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: [PATCH] ACPI: rename acpi_arm_init to acpi_arch_init From: Miao Wang In-Reply-To: Date: Sat, 27 Jul 2024 00:39:03 +0800 Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Rafael J. Wysocki" , Len Brown , Hanjun Guo Content-Transfer-Encoding: quoted-printable Message-Id: References: <446b96d0-4b61-11ef-9239-3f7ac1938848@innull.com> To: Sudeep Holla X-Mailer: Apple Mail (2.3774.600.62) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_093922_248395_4D4D0F37 X-CRM114-Status: GOOD ( 27.37 ) 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 Hi, Thanks for your quick reply. > 2024=E5=B9=B47=E6=9C=8827=E6=97=A5 00:05=EF=BC=8CSudeep Holla = =E5=86=99=E9=81=93=EF=BC=9A >=20 > On Fri, Jul 26, 2024 at 11:03:01PM +0800, Miao Wang via B4 Relay = wrote: >> From: Miao Wang >>=20 >> 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. >>=20 >=20 > 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. >=20 >> 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(-) >>=20 >> 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) { = } >>=20 >> #define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE >>=20 >> +#define ACPI_HAVE_ARCH_INIT >> + >=20 > 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 >=20 >> #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" >>=20 >> -void __init acpi_arm_init(void) >> +void __init acpi_arch_init(void) >=20 > Keep the name acpi_arm_init as is. >=20 >> { >> 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(); >=20 > Here we need acpi_arch_init() like you have changed. >=20 >> 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 >>=20 >> -#ifdef CONFIG_ARM64 >> -void acpi_arm_init(void); >> +#ifdef ACPI_HAVE_ARCH_INIT >> +void acpi_arch_init(void); >=20 > 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 ? >=20 > #define acpi_arch_init() do { }while(0) >=20 > #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. > -- > Regards, > Sudeep