From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 146DC1FDE for ; Mon, 13 Nov 2023 00:03:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d1f23R4z" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 950491FFD for ; Sun, 12 Nov 2023 16:03:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699833810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ZHIbA5dSDa0YFUBZZETUQKKTVizuf5JaF0jClraxRM=; b=d1f23R4z4J7igoUx6O4n+PBCHwLpONwfAsSnhIgC4GvGIowSKfk6qf6UxT80F9sjTYJzZu zcKuhjWoyb/e+4Y8YDWci5HlDbhlMNjvZNoNy2g4lJZj8ByT6vYo6XLB5znFJVYAcKpLM/ yPWvUpsFCOLgfemle8hx1EqVVrxEumU= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631--t2ZGp6eOxmzesK0eEUNgA-1; Sun, 12 Nov 2023 19:03:28 -0500 X-MC-Unique: -t2ZGp6eOxmzesK0eEUNgA-1 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1cc1682607eso43531875ad.1 for ; Sun, 12 Nov 2023 16:03:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699833808; x=1700438608; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+ZHIbA5dSDa0YFUBZZETUQKKTVizuf5JaF0jClraxRM=; b=xTKxU6wEuRNdjlN3ZYM/W9v4GqS439AhHSyZS8o/r+HXRrkGXsnAPx/r41Fh0nUDBn Tt5WLyVp8A25eRdQVGTk0sSoqd7FvrEHRLKK+5PLfx2h/UpfnFOL2S0WlIUbCieIKXoB M1F5gayi/v02kJEX/cp5/KnBWb5CEkPyWDwBr1eGior2RNe4J0nx6E3j/Wg9J1/h2AzH kAaNiZwyBd/C71bCh9PwXucxMBhZTiVWBW2CxDzd1f/mbF+PdCV17QzVlC86Af0t4Rs9 7K1WDLnIaIyyV+bYNcuAnxMm1MTXtwqAfnGSa9ONUQv4hz+ov+nv6AqGzuyXziWuzFp8 VVTw== X-Gm-Message-State: AOJu0YzIOo81gphAyUVsHhSYVwslzR4o3jqaVVPeOlnyhnICjSSKkZuW iBGqK18W2JfFFGKvbxkANq8UHppM1kJ6wlzQxXwsBBMD4G+UE6b4vRHCiO/B02cTOh5ij1mPQbv 1X0JdFLbVXRFx4jl0wrKuIg== X-Received: by 2002:a17:903:124a:b0:1ca:7f91:aa5d with SMTP id u10-20020a170903124a00b001ca7f91aa5dmr7816451plh.16.1699833807800; Sun, 12 Nov 2023 16:03:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IECTuRNfb72TOfAtkV7pMmjD+8xBNsdITfj8lqsTmhB+HwPaZ/5CGTlMF5gZ/CbtXGVZnzltA== X-Received: by 2002:a17:903:124a:b0:1ca:7f91:aa5d with SMTP id u10-20020a170903124a00b001ca7f91aa5dmr7816433plh.16.1699833807525; Sun, 12 Nov 2023 16:03:27 -0800 (PST) Received: from ?IPV6:2001:8003:e5b0:9f00:b890:3e54:96bb:2a15? ([2001:8003:e5b0:9f00:b890:3e54:96bb:2a15]) by smtp.gmail.com with ESMTPSA id jj3-20020a170903048300b001cc29ffcd96sm3038705plb.192.2023.11.12.16.03.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Nov 2023 16:03:27 -0800 (PST) Message-ID: Date: Mon, 13 Nov 2023 10:03:17 +1000 Precedence: bulk X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 02/22] x86: intel_epb: Don't rely on link order Content-Language: en-US To: "Russell King (Oracle)" , 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, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" References: From: Gavin Shan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/7/23 20:29, Russell King (Oracle) wrote: > From: James Morse > > intel_epb_init() is called as a subsys_initcall() to register cpuhp > callbacks. The callbacks make use of get_cpu_device() which will return > NULL unless register_cpu() has been called. register_cpu() is called > from topology_init(), which is also a subsys_initcall(). > > This is fragile. Moving the register_cpu() to a different > subsys_initcall() leads to a NULL dereference during boot. > > Make intel_epb_init() a late_initcall(), user-space can't provide a > policy before this point anyway. > > Signed-off-by: James Morse > Signed-off-by: Russell King (Oracle) > --- > subsys_initcall_sync() would be an option, but moving the register_cpu() > calls into ACPI also means adding a safety net for CPUs that are online > but not described properly by firmware. This lives in subsys_initcall_sync(). > --- > arch/x86/kernel/cpu/intel_epb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Gavin Shan