From patchwork Sun Sep 8 20:01:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marek_Ma=C5=9Blanka?= X-Patchwork-Id: 13895530 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 829E0E77170 for ; Thu, 5 Dec 2024 15:19:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C858B6B00B0; Thu, 5 Dec 2024 10:19:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C36016B00AA; Thu, 5 Dec 2024 10:19:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 35A806B00AB; Thu, 5 Dec 2024 10:19:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 47E056B00DF for ; Sun, 8 Sep 2024 16:01:38 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C279D1C485B for ; Sun, 8 Sep 2024 20:01:37 +0000 (UTC) X-FDA: 82542641034.28.0432F1C Received: from mail-ej1-f74.google.com (mail-ej1-f74.google.com [209.85.218.74]) by imf30.hostedemail.com (Postfix) with ESMTP id F3EAB80019 for ; Sun, 8 Sep 2024 20:01:35 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=VJURN8Ga; spf=pass (imf30.hostedemail.com: domain of 3nQLeZgkKCFgCC0IB0DA06EE6B4.2ECB8DKN-CCAL02A.EH6@flex--mmaslanka.bounces.google.com designates 209.85.218.74 as permitted sender) smtp.mailfrom=3nQLeZgkKCFgCC0IB0DA06EE6B4.2ECB8DKN-CCAL02A.EH6@flex--mmaslanka.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725825645; a=rsa-sha256; cv=none; b=IRyjwZEyrJVzWLG8jE112oYJucJ8pZx/e1SejmSVXOmACP4v8SS10NrI3RUryWDmJ+P0vk cfktDZ9EdXg3jAr5v2NfrfnCSWHJijFl0WFHOWE5o0N5hpkfobAFKS6cVdYjBbU+9/S3Pg dHzisUQhxYlLy4aEIgkZhbijQoP4CLU= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=VJURN8Ga; spf=pass (imf30.hostedemail.com: domain of 3nQLeZgkKCFgCC0IB0DA06EE6B4.2ECB8DKN-CCAL02A.EH6@flex--mmaslanka.bounces.google.com designates 209.85.218.74 as permitted sender) smtp.mailfrom=3nQLeZgkKCFgCC0IB0DA06EE6B4.2ECB8DKN-CCAL02A.EH6@flex--mmaslanka.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725825645; h=from:from:sender: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:dkim-signature; bh=Ug9eaffYhqFA0PC6wFkjKlxNmNfpvwkr9YdUbFvwzDk=; b=D50FGpozW/i2gbBBy8anwv7gG4cROCic1rvI+OzKrsHg6EdxKamgVNLvgoZ4cRyvfAmai5 ljVe97QrGjGwMV847iFVNVOo4cBL94xxjaCL0iAYNZfh9FJhGv7R5uWR9z8kJqgSFXrjpq /T2I6tZX3sYYidA9VRITp3Jn+WWiCZ0= Received: by mail-ej1-f74.google.com with SMTP id a640c23a62f3a-a8d13383a9bso49311966b.0 for ; Sun, 08 Sep 2024 13:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1725825694; x=1726430494; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Ug9eaffYhqFA0PC6wFkjKlxNmNfpvwkr9YdUbFvwzDk=; b=VJURN8GaDCO91lV2JN50O6rRDo6rBQLWLL09zI6uizZErhZ8GJaV2A1D+IApn4mjNH eb++EOuw3XgdPBwHiiv4QBX1NDlcfSGQ6vUNKOIp6N8oqyB6QeceyyyOM4WfywyWFZm/ Kc5NZ+e/M7+Sip+/OFUXzKDKbndSb5x/rc9HIjzZq0HoFgLA5OKNtWvvam6IHsS/3eaK ej5gynYrP78JOChtNASWBqtqr4V8UWoQaucR/PKtIGmEk3SG3mRa71JFu9DzVqZm/evg PqSzqA0Bt9VZYTdz6dYhglOYGIl2ymlpWQUkJu7wWDzMSpfkaDgimIB49gqGknCgNcB5 to+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725825694; x=1726430494; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ug9eaffYhqFA0PC6wFkjKlxNmNfpvwkr9YdUbFvwzDk=; b=lve4pRfUIuLF7AaYEJNSKPSGKMs3Mwv7jmwRJHVxKZpFuhMdRYN5JFeQz8Ndv3iVUz V8MNeSE9i8h9UMdSiouC8fL+1q/7Gj+YmM/7nbXyCMSSRl9cysl+Etrcfl/1Lwns90A8 r2Y1c/dGrdC31nKlLvAZJUqL3MuCGsDb2pOUkXcYCeJKBXKENT5NXjqJQrCeVqjXpmDU /whqpHUapKTv/92lZ0BJNiAtq5pFlvIMcTLmYKZvKtJ56ihD1jSNdK3sW/v97c1tOxy+ kQ1luyhJRb9c8NAQ1xFm8WqETUjCUmKwoQV6+dejIt8lp/Yo9Rko/t9+bN2V2aQvmWgj 4Q7A== X-Forwarded-Encrypted: i=1; AJvYcCVQ/HmwJOZFaVZBZbEfyQZcV6BRh20PwxWBZSjVHM3BJ7DktCWJwdTcJMwHrPfP5wpoW6SWFj0MZQ==@kvack.org X-Gm-Message-State: AOJu0YxpsunM3f0wgp9wt+NuMdLa/XpHyTJLyUEcjLjzIidpkFtpDOjU 5qnplzVDb5WztddX/xow+735X/3KlFUaQM33EJmjwiUQ6gaksa23kr6h9m8/aVEtVfjLdK3zK7o 4CKDs+MV9rNo/lA== X-Google-Smtp-Source: AGHT+IGWEAAdTqy9HWRfpr2zIqIHAZb3LmSQlUJJORnY3nPzO6xcvB7Sly7TPnE3cqwQKWdDXl5RBe1OUtFmtgo= X-Received: from mmaslanka2.c.googlers.com ([fda3:e722:ac3:cc00:31:98fb:c0a8:b8d]) (user=mmaslanka job=sendgmr) by 2002:a17:906:f14a:b0:a8a:8a31:c47f with SMTP id a640c23a62f3a-a8a8a31dc1bmr558966b.1.1725825693954; Sun, 08 Sep 2024 13:01:33 -0700 (PDT) Date: Sun, 8 Sep 2024 20:01:27 +0000 In-Reply-To: <202409090259.6vsS5Bni-lkp@intel.com> Mime-Version: 1.0 References: <202409090259.6vsS5Bni-lkp@intel.com> X-Mailer: git-send-email 2.46.0.469.g59c65b2a67-goog Message-ID: <20240908200127.1848844-1-mmaslanka@google.com> Subject: [PATCH] platform/x86:intel/pmc: Encapsulate callbacks registration in CONFIG_X86_PM_TIMER check From: Marek Maslanka To: lkp@intel.com Cc: daniel.lezcano@linaro.org, hdegoede@redhat.com, linux-mm@kvack.org, mmaslanka@google.com, oe-kbuild-all@lists.linux.dev X-Stat-Signature: dfoznfwbyupyym7zhcptrm3p73xgmfg6 X-Rspamd-Queue-Id: F3EAB80019 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1725825695-925538 X-HE-Meta: U2FsdGVkX1/nWVbyHqRNh4/NtdkT/fGXZGVSIFEWDAWE1UcENf8jpLPwdFrhjJ47do9i/k0fVZyvFSm14JGhXgM3nY8kU2C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xqxM2SzgaiM32Qu8sytaUofdRWqVF3niewrYeyDx6qCTlPSVkwYZM9FpJQ8UAkanInfj6/oLKbZztDCXjTwX8Hq0fEoRLcy4d8DXmupE2P6BTSNDKnCmGrsRrkovV26+nG8Jop950NWpp0l4WVPTrFlBgvZcrqsQ5/S34h3MXRI50W54zGVOd8j2Oivl+EOb8A9hQgmeMYfntKvptvlsOpL3w/hzoGGOVevb4C+3Z/tf//Gr9PF9I6kFEeGbkCvGJJJqa2BYGdH7vKVCZIm87E7ixyiIMSmOriNeZF9hULMh4fAjTLsrT5Mf1wMwOMPVv1sJ7SWXE9F4Re0XMZMrOoO/gyN0ibXQ00tTOMANzthi0pNDIWWQxCWEUkDDr/FXWZYRaQQeIu/b6PINPkxiE5NPthi8xLXLHx/hnplhnnsv6vI65nFr7VOw4uJkzWNTfYrJ9uJg9SIMnvM5mRPRLR1wisBWqE+iuAJV50DH8GkHaGTdSI23lZy1TX0ovf2ILnvEKM1f+tyW7uSfhNwduhW+ARvEMYnN0Vdk6pEtcGHo0/7aicY/TMXGiBMihS5ohNWy6Xk5kIqGqYZDHVLUVysXaCSqvs= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Encapsulate the code that registers and unregisters the ACPI PM Timer suspend/resume callback to checks that CONFIG_X86_PM_TIMER is enabled. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202409090259.6vsS5Bni-lkp@intel.com/ Signed-off-by: Marek Maslanka --- drivers/platform/x86/intel/pmc/core.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c index 695804ca8de4..0c6392eeacee 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -1215,6 +1215,7 @@ static bool pmc_core_is_pson_residency_enabled(struct pmc_dev *pmcdev) return val == 1; } +#ifdef CONFIG_X86_PM_TIMER /* * Enable or disable ACPI PM Timer * @@ -1247,6 +1248,7 @@ static void pmc_core_acpi_pm_timer_suspend_resume(void *data, bool suspend) pmcdev->enable_acpi_pm_timer_on_resume = suspend && enabled; } +#endif static void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev) { @@ -1443,9 +1445,11 @@ static int pmc_core_probe(struct platform_device *pdev) struct pmc_dev *pmcdev; const struct x86_cpu_id *cpu_id; int (*core_init)(struct pmc_dev *pmcdev); - const struct pmc_reg_map *map; struct pmc *primary_pmc; int ret; +#ifdef CONFIG_X86_PM_TIMER + const struct pmc_reg_map *map; +#endif if (device_initialized) return -ENODEV; @@ -1502,10 +1506,12 @@ static int pmc_core_probe(struct platform_device *pdev) pm_report_max_hw_sleep(FIELD_MAX(SLP_S0_RES_COUNTER_MASK) * pmc_core_adjust_slp_s0_step(primary_pmc, 1)); +#ifdef CONFIG_X86_PM_TIMER map = primary_pmc->map; if (map->acpi_pm_tmr_ctl_offset) acpi_pmtmr_register_suspend_resume_callback(pmc_core_acpi_pm_timer_suspend_resume, - pmcdev); + pmcdev); +#endif device_initialized = true; dev_info(&pdev->dev, " initialized\n"); @@ -1516,11 +1522,13 @@ static int pmc_core_probe(struct platform_device *pdev) static void pmc_core_remove(struct platform_device *pdev) { struct pmc_dev *pmcdev = platform_get_drvdata(pdev); +#ifdef CONFIG_X86_PM_TIMER const struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; const struct pmc_reg_map *map = pmc->map; if (map->acpi_pm_tmr_ctl_offset) acpi_pmtmr_unregister_suspend_resume_callback(); +#endif pmc_core_dbgfs_unregister(pmcdev); pmc_core_clean_structure(pdev);