Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37952967rwd; Wed, 12 Jul 2023 00:31:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/xeZIActdY5/IdbBU6LnAq0Y66fo8kXgHjP3X5Gwi8VHxrIVSEA4/VgE1DVS5CbmBL4os X-Received: by 2002:a17:906:33d0:b0:992:b3a3:81f9 with SMTP id w16-20020a17090633d000b00992b3a381f9mr16031371eja.71.1689147069426; Wed, 12 Jul 2023 00:31:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689147069; cv=pass; d=google.com; s=arc-20160816; b=wOHyjINDQqsHsoTIyXmxyTzVTi7DZEUjFPWyIwk1RJYj7j0M4jYXTrpfuPvmiysIDN VCT6Tj0Ma1pX4wCY0W5AZuFQkXj0wNpDQyRe+61r91QvTq1uSxKBy4oOkS8P4jYtsROp +BWwHtWaxP6Ccr26m3nQ2e9dgmUYzfs7nA/KGWpsj7PsD++VOpqIXSdythfhqbijy6yB gU2a8cUwWn+DRUUrjYXJsUtPppVkN94lvvUXuYftdTZ1D4GYDAR1JsdI/8X5a7StCq/h hffPY+h1IYxfvQ9RmE+7fxgaK4X2OnWZXwW/Q+Tu6Cdd0EWGBwPmlltCFJ4z5g+3qjcl plNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=S2gqtwjfdjibzSMjtncdI4n2YrcP8m1Xj2QL4XqozZE=; fh=4RuwvS34e/TMnKChW1C2aBwMH3joErL4FUVB+3kePeU=; b=nfllwDPqigqVfPNLei2YEODSe8+jr6xdsVvyJ0mnOVEro+OgjuI7sKbLQYWqp9dEJQ TGS1mSHvpZc5BmSZ2s9wHAo9/fa4Qwl4HJ/H8W3d32ltT/Q+70J5KNbDO/b9Me0r0m+v 4VqXpC0Ra0InRLaTNnb0Ai3NvR0CHmGReW8957M7FKOAfGfPeHy1zDyqpFoiolkpJTuF KtnLMlluccQ4FIydy5g7a5NhIIsBBJ+R5KsFwls9unwZAGLspTki3WvsIXMtyq49u04X I+Ik3M90+EHFOB4D2OO7rC5OcPAOc/hD45KOSVHl4H+RU2INAtPJZBSu3wKfBVZ1Dq1f WRCg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=o4VxsF19; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j11-20020a17090686cb00b0098d861f6513si4907303ejy.68.2023.07.12.00.30.45; Wed, 12 Jul 2023 00:31:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=o4VxsF19; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231298AbjGLHWF (ORCPT + 99 others); Wed, 12 Jul 2023 03:22:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231916AbjGLHWB (ORCPT ); Wed, 12 Jul 2023 03:22:01 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2073.outbound.protection.outlook.com [40.107.7.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B8E1E49; Wed, 12 Jul 2023 00:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UliDnoODM9IRpV4FkghTWfLcCHQffF2bcV1KVLKcR/GgzKvqV47OvQ9QwdJsfpumtDc/vnyXm/z5kRNg6IGz3LaKCpu6eREkHKivjRZAu1XoKIeiR9EQT9eblKToVrOS1OWCauNKLCFbZdS9eNuduiSNxNDvLdbXzlkiUNrN2SDKt58IzSHyVW9fTKLr4SnYLkig6UA58Xym6Jlt07i0ijnNhORX2dqkiHZBWSsvCENCPC++aIq4+r9bHHYUMpLRfRIC4XHA/u4NQiqn7eeto1u3+b3Im+OHxmmnDS2oeAMUe1YsLf4azOEl5ifANApxovm4+SYzmFCil+Zpjupt+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S2gqtwjfdjibzSMjtncdI4n2YrcP8m1Xj2QL4XqozZE=; b=GHNhpC3ozP28ySDZeVVzgH6WkbG9kNc2GlavVS96Sl97luwjfWhGawg85L+JpAHTthzz9zaiEzyjeYiSTc9sniWN7He/YwRyWUlbcbKfzrfHGefy0BmVW6DgCVGnZT2pIFH3Rfmwvng+jjeFMnl2KRO4pP+a+3Ek9BQhdrtqnWfcbexDT0RNuJMh/9F7jwxzVceteEgxbK8wQ0DskAsM3wPiGsecJL7LZEILb8J9pc8f5jBdcQxgqxfREidkM6tXSXt4X+4DHdG6j+/Me6AzZKHSa5VQWw8QIEVXj7fOHkrskhRbkX9EPyeL4UFdrUicCt6rU+tBMpNa04586sQ2Nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S2gqtwjfdjibzSMjtncdI4n2YrcP8m1Xj2QL4XqozZE=; b=o4VxsF19W0pcJEmKgcm+z29OJIj52hsxqvivEoKvwcN7Q3fqZ5lMGlL6CjfXccOEPTr5arjRwHNHtf4lsKUIQ2hkvLbBmCVQVEecbnuJNpSWkOvZ0lHvPdSSzpJzWgUdOam3V5OIL4EQfRMOWST5FQ43BYdm4tUGsRafCx+lB1ElT6RN0xxBpBLp9W8HthfLlWTTHL6C7fpdWTv6RVjcDiNGQQMs7Uiww0i0BjuTw8/at2QHHg6EvUKkNTDeTy4Js1j/1g4HThGxvYtY8EqZEHmdhhoOG3nxRYeO6oPn1P46ubpCKHub4YrA2s0ZkVzHrswm/7NdRsOItat5lZGaDg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siemens.com; Received: from PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:269::8) by DB8PR10MB3242.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:f9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Wed, 12 Jul 2023 07:21:53 +0000 Received: from PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM ([fe80::a171:a3f2:99b7:5f29]) by PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM ([fe80::a171:a3f2:99b7:5f29%6]) with mapi id 15.20.6565.028; Wed, 12 Jul 2023 07:21:53 +0000 Date: Wed, 12 Jul 2023 09:21:47 +0200 From: Henning Schild To: Hans de Goede , Mark Gross , , Cc: Tobias Schaffner , Gerd Haeussler Subject: Re: [PATCH 2/2] platform/x86: simatic-ipc: add auto-loading of hwmon modules Message-ID: <20230712092147.061009b2@md1za8fc.ad001.siemens.net> In-Reply-To: <20230711120842.30044-3-henning.schild@siemens.com> References: <20230711120842.30044-1-henning.schild@siemens.com> <20230711120842.30044-3-henning.schild@siemens.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0015.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1d::13) To PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:269::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA4PR10MB5780:EE_|DB8PR10MB3242:EE_ X-MS-Office365-Filtering-Correlation-Id: 1127f031-a1f5-4286-8444-08db82a8aaa6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yelzulfM6Re42/uo9o+M0bTYoEiQVQ1UrXQJdjeATcKoOpy383e/f0FBRsoltY+ULj8XMxEC5p17JWBorRZEGRERRARVcYc+CV3ku5vzaEtWEpR6q9F0wFiFP4hA07HCYi1fzwPidUag6XW1dzkpP4gs4BM+OzyPdOir+YsQQUQBBUFenwll7aU3aKPmiAjR9RzjxG0NbmHxWKtXNrtxaMkVcxhGNbHNIYjQcZkHS3vAFpxp3NUOpIYZI7Gp3PQl4SC5GEsXtW38cf2bQhHGPOwmH/w/GKLVd4vB4dAQusDVHVF6gdb7k5qHFgd9y+yuQZwc4YlOU/NX/QAZJujHNDT9dVNdb6rfyJ5MPdT3GrUIhD0vqgll9bInCg46lwZ6/JibnkAge7D0YAsLYxiqdw/xRgbTBzTa/lHBGNCcO6NIAGiKp2lY9fdSHKIIiMeY1QnQsIZxRyDkMg0fPw/BYPx6b0pvoePCOxH9OdiTacZa1tYOKpuEWDIOLjzUU7qdXXrZBnUGIaS5DJPP0HyRkg1Jgz6Le99td/5QDFz0K21QuX4paQME/+QOfFpBQk4O X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(136003)(39860400002)(376002)(396003)(451199021)(2906002)(6512007)(82960400001)(38100700002)(83380400001)(186003)(107886003)(1076003)(9686003)(86362001)(6506007)(5660300002)(8936002)(8676002)(44832011)(110136005)(54906003)(6666004)(6486002)(478600001)(41300700001)(66556008)(66946007)(66476007)(316002)(4326008)(66899021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?9/aOym190VjTk3ctHl7+XUX9xpRbSB6RtgIxiSvLCguaeUiUsuW8Tz2zbujS?= =?us-ascii?Q?T9vmeH7THrT8DWi9eI0rvSgtRTNXjrI6gLMlnE255yEDHD5qaE+R411NTJot?= =?us-ascii?Q?K2zBL6A8M71hH84yPFAJP9gx7US4OiPpUex+gB5gSFk5YdkZkLVenM2nH+t1?= =?us-ascii?Q?+AlzdcN9uwreULXSx2Kii6GidCrj5D7PdRNHHQGHjCYGsmedt9e8U7hdHd5q?= =?us-ascii?Q?jFVjaGf/R8iPp41Kq40OJE5RTXsXAVYaCIhxRVxHCtYky6rFa80Df3fGxyY1?= =?us-ascii?Q?y+wLMY+Y44lXGZVspuBQ9WQ6ao6Zz+9dwBaChCDHBNvwyB3Dx+T/+KiMiYDU?= =?us-ascii?Q?VnfhGTkaU9rgRlOy2g578xPjwcce7DvMU/uoineWDQcCog+diAoj9m2AYixK?= =?us-ascii?Q?r1UdIjOlYPA3ANLrNM94yqqgz9RE5kgo5yMeDAYsWftEC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DjJ+RKG6u91NlFU1FVDYAbIJwEWu4vnSd?= =?us-ascii?Q?N4oZWKKu9Mr6nP87+VD/dPc9G91ru1Rbz2p5EvZC3d8V/fGsedKHkOEo0a05?= =?us-ascii?Q?kP6+JR5/L+bTA+gObbyNlT4qi+LTi8UKLw11E7XkzKLxg2IdfnpY+Fise6KO?= =?us-ascii?Q?pjUOWLEJPpUOoNXK+P9hOfQHXZJLMbLNb/SirFisZsghSavOgvlnDLS5k+XV?= =?us-ascii?Q?pvwG7UPHtxiJmLECHo/3FcVKP7naPoESjYwt6VgCBEVatqg580QOUSeWx5Zq?= =?us-ascii?Q?PVIEIGtUGSRY1hGP9oyVjAQTixlbEQDlRl7z+Gs1WJCbNN63C+7FID7NVB6V?= =?us-ascii?Q?SSd3uQ=3D=3D?= X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1127f031-a1f5-4286-8444-08db82a8aaa6 X-MS-Exchange-CrossTenant-AuthSource: PA4PR10MB5780.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2023 07:21:53.3361 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FgIJjsdTvbRFG5ENSeCAeaL/kUcE4iZKm7BYI3GtdMucOr21qlkCMj77TWzQrfqiJuDmVghtGracyO9ZgPE+5uuyxh1vvnrG4+/4n3IRt5o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR10MB3242 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Tue, 11 Jul 2023 14:08:42 +0200 schrieb Henning Schild : > In order to know which hwmon modules to load one would have to usually > first probe from user-land i.e. with sensors-detect and create a > config for each machine. But here we know exactly what machines we > are dealing with, so we can request those howmon modules without > user-mode detection and config files. > > Signed-off-by: Henning Schild > --- > drivers/platform/x86/simatic-ipc.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/platform/x86/simatic-ipc.c > b/drivers/platform/x86/simatic-ipc.c index 71487216d33f..403dc231bef7 > 100644 --- a/drivers/platform/x86/simatic-ipc.c > +++ b/drivers/platform/x86/simatic-ipc.c > @@ -153,6 +153,21 @@ static int register_platform_devices(u32 > station_id) return 0; > } > > +static void request_additional_modules(u32 station_id) > +{ > + switch (station_id) { > + case SIMATIC_IPC_IPC227G: > + case SIMATIC_IPC_IPC277G: > + case SIMATIC_IPC_IPCBX_39A: > + case SIMATIC_IPC_IPCPX_39A: > + request_module("nct6775"); > + break; > + default: > + request_module("emc1403"); > + break; This one will be hard to maintain since every new model would choose the default path. Requesting emc1403 on a device where that would not do anything is not a problem, but still. And people might forget to even look at this and maybe name a module that should be used instead. I will send a v2 where an array of module names will become part of device_modes. The array would hold all additional modules which do not autoload. Then the module w83627hf_wdt used for some models can also be part of that and no longer be modeled with wdtmode. Should anyone have objections on the whole idea of requesting additional modules, please already speak up. Henning > + } > +} > + > static int __init simatic_ipc_init_module(void) > { > const struct dmi_system_id *match; > @@ -170,6 +185,8 @@ static int __init simatic_ipc_init_module(void) > return 0; > } > > + request_additional_modules(station_id); > + > return register_platform_devices(station_id); > } >