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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2250C25B07 for ; Tue, 9 Aug 2022 11:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236738AbiHILP7 (ORCPT ); Tue, 9 Aug 2022 07:15:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232697AbiHILP6 (ORCPT ); Tue, 9 Aug 2022 07:15:58 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D230193C5; Tue, 9 Aug 2022 04:15:55 -0700 (PDT) Received: from zn.tnic (p200300ea971b9800329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:971b:9800:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 147AE1EC03B9; Tue, 9 Aug 2022 13:15:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1660043750; 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:in-reply-to:in-reply-to: references:references; bh=MIjfxB31faRlyNlM6lmpdYiamFIJbK6PbTWIDNiIw7M=; b=HU7gmif1TzStx3TWOsiA1v/TvaoPgCr8Xg648DYMGzon1j+fFER8H29IXFqADgIztjlJr9 VeAEOz4C4BGU27dsnINa24jX+S6x3SgFBxs9JcfHxCwMXO9bwz9ALkvVu7z1dCKWOTmZEz JncVL534Imc6BcvmQawCI2EIqRSpCxA= Date: Tue, 9 Aug 2022 13:15:49 +0200 From: Borislav Petkov To: Justin He Cc: "Kani, Toshi" , "Rafael J. Wysocki" , Len Brown , James Morse , Tony Luck , Mauro Carvalho Chehab , Robert Richter , Shuai Xue , Jarkko Sakkinen , ACPI Devel Maling List , Linux Kernel Mailing List , "open list:EDAC-CORE" Subject: Re: =?utf-8?B?5Zue5aSNOiBbUEFUQ0hdIEFDUEk=?= =?utf-8?Q?=3A?= APEI: move edac_init ahead of ghes platform drv register Message-ID: References: <20220805023200.154634-1-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Tue, Aug 09, 2022 at 09:24:33AM +0000, Justin He wrote: > If no, what is the detail logic of ghes_edac_driver_is_preferred()? That should be moved from ghes_edac.c to ghes.c: /* * Known systems that are safe to enable this module. */ static struct acpi_platform_list plat_list[] = { {"HPE ", "Server ", 0, ACPI_SIG_FADT, all_versions}, { } /* End */ }; and then bool ghes_edac_driver_is_preferred() { if (IS_ENABLED(CONFIG_X86)) { /* Check if safe to enable on this system */ idx = acpi_match_platform_list(plat_list); } else if (ARM) { /* insert ARM logic here */ } } That function should be called by the EDAC modules which compete with ghes_edac. In the x86 case, that's sb_edac, skx_edac and amd64_edac, I guess. It all depends on what platforms Toshi wants to load it - I'm guessing HPE has both Intel and AMD platforms where they prefer ghes_edac. On ARM, that's up to ARM folks. > Because I notice that lots of other edac drivers are probing like: > ... > owner = edac_get_owner(); > if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR))) > return -EBUSY; No, that's a silly mechanism to allow a single EDAC driver to load on the system. But your test will go before it, at the very beginning of the init function. HTH. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette