Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1482366pxb; Thu, 4 Mar 2021 12:29:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJymnSaf4FuaUtCjAsedUPSdgnaKzRH8t2gLjap1ksK56zV9IsUEQVSfYn6MelaJVORUufB1 X-Received: by 2002:aa7:c74a:: with SMTP id c10mr6304840eds.332.1614889758248; Thu, 04 Mar 2021 12:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614889758; cv=none; d=google.com; s=arc-20160816; b=07AwlmHsLMV12FCEKrAvLHckIfCYfEgp/IbDqLngERdwY6nr8WhIc4012EtCH+xxCK PB8GEIV+SUrfFbmSWDddHAgk8enkOHZxgE4tJwFRWnRhgsToIMjmweMchsnpRohhCBDP MgL4orcxwhlTAge3oRAmnj4/Zzv/MQLshmEaJwpYxBJP5KAE/JZ+jzed1+EaLeeWdsPk wgLJoEBU8jhn5E+VcCDzRb1ZImV1QXNzJFMUYThvl3aghlfMOPE/OmHQul7ZRpqnwX+G BREULFt6ZE3C8M2y+uS4OGf1Dq3xxFztvcvSWP75vpaNHMKotBd4IMJjP0WdZrvAiawc i2dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fH3JGnPracA7r+fOpBn4d+WCsviqyOhUBcGVJ2v5d4w=; b=t3fYr2wYLiygn2JNHTSr6HtJd9icOb3HludJht7CMMUhPp3bOBiRNQklCQqcWzVvV9 jepCx7g+qq01QPgRbXIea/8ss7qDiBv8WOBAhLJDTtj5bediInIx8lYDkKIzrRwSdV6g E/7XVbvNZs5GgYh0CnbCJMoH142k6T42U4qSuZ6Nnap/up0bRdbP2MB92Jf608HEw3Ww Bk0qjOS/gzCXyU9KM/dKiCHY6MUQaLXk+uGvoZTwYQiKRk3To4J4vhB7kpoEYWGNzbBs 73/Xo5K7+wLx1L0/TkwTShevta06iRVlCJzuF9WiiSQbOGbO6Gk2JjuuF3gzWEVyc8F1 xYXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr15si157493ejb.275.2021.03.04.12.28.54; Thu, 04 Mar 2021 12:29:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381665AbhCBVWs (ORCPT + 99 others); Tue, 2 Mar 2021 16:22:48 -0500 Received: from gecko.sbs.de ([194.138.37.40]:45318 "EHLO gecko.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352057AbhCBS3g (ORCPT ); Tue, 2 Mar 2021 13:29:36 -0500 Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 122GXF5L002099 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 Mar 2021 17:33:15 +0100 Received: from md1za8fc.ad001.siemens.net ([167.87.44.113]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 122GXBHR025192; Tue, 2 Mar 2021 17:33:14 +0100 From: Henning Schild To: linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-watchdog@vger.kernel.org Cc: Srikanth Krishnakar , Jan Kiszka , Henning Schild , Gerd Haeussler , Guenter Roeck , Wim Van Sebroeck , Mark Gross , Hans de Goede , Pavel Machek , Michael Haener Subject: [PATCH 4/4] platform/x86: pmc_atom: improve critclk_systems matching for Siemens PCs Date: Tue, 2 Mar 2021 17:33:09 +0100 Message-Id: <20210302163309.25528-5-henning.schild@siemens.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210302163309.25528-1-henning.schild@siemens.com> References: <20210302163309.25528-1-henning.schild@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Henning Schild Siemens industrial PCs unfortunately can not always be properly identified the way we used to. An earlier commit introduced code that allows proper identification without looking at DMI strings that could differ based on product branding. Switch over to that proper way and revert commits that used to collect the machines based on unstable strings. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Fixes: e8796c6c69d1 ("platform/x86: pmc_atom: Add Siemens CONNECT ...") Fixes: f110d252ae79 ("platform/x86: pmc_atom: Add Siemens SIMATIC ...") Fixes: ad0d315b4d4e ("platform/x86: pmc_atom: Add Siemens SIMATIC ...") Tested-by: Michael Haener Signed-off-by: Henning Schild --- drivers/platform/x86/pmc_atom.c | 39 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c index ca684ed760d1..03344f5502ad 100644 --- a/drivers/platform/x86/pmc_atom.c +++ b/drivers/platform/x86/pmc_atom.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -424,30 +425,31 @@ static const struct dmi_system_id critclk_systems[] = { }, }, { - .ident = "SIMATIC IPC227E", + .ident = "SIEMENS AG", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "SIEMENS AG"), - DMI_MATCH(DMI_PRODUCT_VERSION, "6ES7647-8B"), - }, - }, - { - .ident = "SIMATIC IPC277E", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "SIEMENS AG"), - DMI_MATCH(DMI_PRODUCT_VERSION, "6AV7882-0"), - }, - }, - { - .ident = "CONNECT X300", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "SIEMENS AG"), - DMI_MATCH(DMI_PRODUCT_VERSION, "A5E45074588"), }, }, { /*sentinel*/ } }; +static int pmc_clk_is_critical(const struct dmi_system_id *d) +{ + int ret = true; + u32 station_id; + + if (!strcmp(d->ident, "SIEMENS AG")) { + if (dmi_walk(simatic_ipc_find_dmi_entry_helper, &station_id)) + ret = false; + else + ret = (station_id == SIMATIC_IPC_IPC227E || + station_id == SIMATIC_IPC_IPC277E); + } + + return ret; +} + static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap, const struct pmc_data *pmc_data) { @@ -462,8 +464,9 @@ static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap, clk_data->base = pmc_regmap; /* offset is added by client */ clk_data->clks = pmc_data->clks; if (d) { - clk_data->critical = true; - pr_info("%s critclks quirk enabled\n", d->ident); + clk_data->critical = pmc_clk_is_critical(d); + if (clk_data->critical) + pr_info("%s critclks quirk enabled\n", d->ident); } clkdev = platform_device_register_data(&pdev->dev, "clk-pmc-atom", -- 2.26.2