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 7C959C4332F for ; Fri, 3 Nov 2023 14:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To: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=2d0caIEZ1hYwkkmPzaYKklrV9IJQcXrOnukEjUdliWg=; b=32KqRzhI8rgVp1 XHkpquMt6xZNON2sGxX1Wg79u+w5rixQqRABNspabP3zuoeg9HPAIsm9dridYmgcG1fPDd0q16Fg9 wDEOC8d+YUPIPSQHdBSNWSpTlVAJFrzmu8rWOekpEhgOPUUmZ330UdRqMvYZbFXKH1PEZBqN16qN/ TPgTQOi+504cFdIZhbfyNL4SorxwvFQ2m2Y+Uhfhg1/vCm/VjFrISdGa+fChHNx63ppBU2IQLxTC8 2LllWV7E8nipzCHYErk8fEaBo3rRDblL96AiA5zgtEo8Xfdbd/xRTcW4De078IrafMuP/nkl/6UkO 4CpKuEJygesf7/Rs7DEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qyurS-00BXp7-12; Fri, 03 Nov 2023 14:09:22 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qyurM-00BXnf-32; Fri, 03 Nov 2023 14:09:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BFRj35KrFXvb8dOU4qKYIZykCYryvGHUV2gtHG32BRc=; b=N7IAMLo8B8O672s8M7tRvaa4vK DGmi9axnE8hQbJFc2awa2avk/xkDbNbAesNI8bOCGQMeNHTgd5uaSG/MxrOyUrOzM/bTjGbPz7BAf fKI5aHNokx2hjf9s8+LgyqcuezHU6GHfnHU59ulY6EIwPOE8Bsz1lEPZnyD2K35gp/S/D/QqVB8uR h/v8UICVLbZ2Q9/zCAc00Ts6T6a5STzH4Vo+4PZMK/THvyto6roi7Oy5ElRGk5C5yPz8dAKE4FjkI lxYEMem3w8reGnxHatoVy9sP+4VxDz/xb9X0ztnFkj6yGNL3ki1Qzrz4XU3My8Ih7lJ8XXzk47bBQ y63qvj1A==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:52238) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qyur8-0005as-2z; Fri, 03 Nov 2023 14:09:03 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qyur8-0008Si-5S; Fri, 03 Nov 2023 14:09:02 +0000 Date: Fri, 3 Nov 2023 14:09:02 +0000 From: "Russell King (Oracle)" To: Jonathan Cameron Cc: James Morse , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com Subject: Re: [RFC PATCH v2 22/35] ACPI: Check _STA present bit before making CPUs not present Message-ID: References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-23-james.morse@arm.com> <20230914153110.00003e38@Huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230914153110.00003e38@Huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231103_070916_983116_E913CF9C X-CRM114-Status: GOOD ( 17.02 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 14, 2023 at 03:31:10PM +0100, Jonathan Cameron wrote: > On Wed, 13 Sep 2023 16:38:10 +0000 > James Morse wrote: > > -#ifdef CONFIG_ACPI_HOTPLUG_PRESENT_CPU > > /* Removal */ > > -static void acpi_processor_post_eject(struct acpi_device *device) > > +static void acpi_processor_make_not_present(struct acpi_device *device) > > { > > struct acpi_processor *pr; > > > > - if (!device || !acpi_driver_data(device)) > > + if (!IS_ENABLED(CONFIG_ACPI_HOTPLUG_PRESENT_CPU)) > > Would it be possible to do all the ifdef to IS_ENABLED changes in a separate > patch? I haven't figure out if any of them have dependencies on the other > changes, but they do create a bunch of noise I'd rather not see in the more > complex corners of this. I'm also wondering why we want to do this check here, rather than... > > +static void acpi_processor_post_eject(struct acpi_device *device) > > +{ > > + struct acpi_processor *pr; > > + unsigned long long sta; > > + acpi_status status; ... here, because none of the code below has any effect if acpi_processor_make_not_present() merely returns. So the below seems like a waste of code space when CONFIG_ACPI_HOTPLUG_PRESENT_CPU is disabled. > > + > > + if (!device) > > + return; > > + > > + pr = acpi_driver_data(device); > > + if (!pr || pr->id >= nr_cpu_ids || invalid_phys_cpuid(pr->phys_id)) > > + return; > > + > > + status = acpi_evaluate_integer(pr->handle, "_STA", NULL, &sta); > > + if (ACPI_FAILURE(status)) > > + return; > > + > > + if (cpu_present(pr->id) && !(sta & ACPI_STA_DEVICE_PRESENT)) { > > + acpi_processor_make_not_present(device); > > + return; > > + } > > +} -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel