Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3550836pxp; Wed, 23 Mar 2022 00:27:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy90YZhfNs2b+snBfJxiD6+URFrWaNw5pUpCLozP6E0YhShac72NyePiT5vhy5BFm7I7WlJ X-Received: by 2002:a05:6a00:10cb:b0:4f7:942:6a22 with SMTP id d11-20020a056a0010cb00b004f709426a22mr33878845pfu.84.1648020469664; Wed, 23 Mar 2022 00:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648020469; cv=none; d=google.com; s=arc-20160816; b=LzFj7nWiKMVRclj8lYjj8sqcRw82BbFUOLsVBYAEOFZWhW0ByYGjyByKzaIljpcrja 07/npO7stvwHWMIXYby7nZwa/w7E9nQcaRT/DFZc8KPO/4BQ82KV0PyTqT/Dtru+eZk5 b/0Ocw1sON1QWFFlqi5Gv/ONZa5dudrT4U1a0sGKtTHpx391KXZwbagsAepNKjSdqqZX sZKsorCeN7rvhicxB1780iZd+NRBQqsrjnr2OucEQ5RDQKENV7CAhR/bQ7Q4HhHpNkeE xBCWjGQk7KMxq5gK2hAoaA+TdlddBgSV1f5dMckudND+9fH8Kbno51gExoIcDL4nTtWu hd0g== 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=k+7ohEaGYlxJD5xGUiG0/te21kR90Mfpug+lveAoGqE=; b=ddk44klrHtj84KIkM+5c7UYD/6uVHV4CqX71hLAhbqfuoO+ASw0Dv6+OKh3pdJFuO9 556nu6UhZKVNl4QhG3Fdj+28/06ec5WdAWYsBmrds5aXHxpvtPW0BKm5vWqNyzwbL+J2 opdFijbSlFo/Knpdq1/c543eRWin5tRBjzSXOw2K0RRrwZ7J6TVc1hqeJ3lvb4kX2MYK fw0G2VECsoeYIRrAboXmZWQqIMU7OOm0J5qD7yPrpMaJeQCYE7koD/wAhu18tPK02dYE wkwKE42ktXx5AS3fThE2PIadNWXfemUMPrnBRnjKXQX8pc3qD2rVWXeHT+yXKjpgbDew LuQw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g13-20020a170902c38d00b00153e9a38290si15017066plg.264.2022.03.23.00.27.36; Wed, 23 Mar 2022 00:27:49 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238880AbiCVQFd (ORCPT + 99 others); Tue, 22 Mar 2022 12:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234194AbiCVQF3 (ORCPT ); Tue, 22 Mar 2022 12:05:29 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 467B86F483; Tue, 22 Mar 2022 09:03:59 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id fd475ee49fd01f3e; Tue, 22 Mar 2022 17:03:57 +0100 Received: from kreacher.localnet (unknown [213.134.175.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 87B6666BA74; Tue, 22 Mar 2022 17:03:56 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PM , LKML , Srinivas Pandruvada , Mario Limonciello , Ionela Voinescu Subject: [PATCH v1 2/2] ACPI: CPPC: Change default error code and clean up debug messages in probe Date: Tue, 22 Mar 2022 17:03:23 +0100 Message-ID: <2233747.ElGaqSPkdT@kreacher> In-Reply-To: <5552457.DvuYhMxLoT@kreacher> References: <5552457.DvuYhMxLoT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.175.187 X-CLIENT-HOSTNAME: 213.134.175.187 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudeghedgkedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvjeelgffhiedukedtleekkedvudfggefhgfegjefgueekjeelvefggfdvledutdenucfkphepvddufedrudefgedrudejhedrudekjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddujeehrddukeejpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidr ihhnthgvlhdrtghomhdprhgtphhtthhopehmrghrihhordhlihhmohhntghivghllhhosegrmhgurdgtohhmpdhrtghpthhtohepihhonhgvlhgrrdhvohhinhgvshgtuhesrghrmhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Rafael J. Wysocki Change the default error code returned by acpi_cppc_processor_probe() from -EFAULT (which is completely inadequate) to -ENODATA and change the debug messages printed by it to contain more information and be more consistent. While at it, format some white space to follow the coding style. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/cppc_acpi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) Index: linux-pm/drivers/acpi/cppc_acpi.c =================================================================== --- linux-pm.orig/drivers/acpi/cppc_acpi.c +++ linux-pm/drivers/acpi/cppc_acpi.c @@ -654,7 +654,7 @@ int acpi_cppc_processor_probe(struct acp unsigned int num_ent, i, cpc_rev; int pcc_subspace_id = -1; acpi_status status; - int ret = -EFAULT; + int ret = -ENODATA; if (osc_sb_cppc_not_supported) return -ENODEV; @@ -685,8 +685,8 @@ int acpi_cppc_processor_probe(struct acp goto out_free; } } else { - pr_debug("Unexpected entry type(%d) for NumEntries\n", - cpc_obj->type); + pr_debug("Unexpected _CPC NumEntries entry type (%d) for CPU:%d\n", + cpc_obj->type, pr->id); goto out_free; } cpc_ptr->num_entries = num_ent; @@ -696,8 +696,8 @@ int acpi_cppc_processor_probe(struct acp if (cpc_obj->type == ACPI_TYPE_INTEGER) { cpc_rev = cpc_obj->integer.value; } else { - pr_debug("Unexpected entry type(%d) for Revision\n", - cpc_obj->type); + pr_debug("Unexpected _CPC Revision entry type (%d) for CPU:%d\n", + cpc_obj->type, pr->id); goto out_free; } cpc_ptr->version = cpc_rev; @@ -728,7 +728,8 @@ int acpi_cppc_processor_probe(struct acp if (pcc_data_alloc(pcc_subspace_id)) goto out_free; } else if (pcc_subspace_id != gas_t->access_width) { - pr_debug("Mismatched PCC ids.\n"); + pr_debug("Mismatched PCC ids in _CPC for CPU:%d\n", + pr->id); goto out_free; } } else if (gas_t->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { @@ -747,20 +748,21 @@ int acpi_cppc_processor_probe(struct acp * SystemIO doesn't implement 64-bit * registers. */ - pr_debug("Invalid access width %d for SystemIO register\n", - gas_t->access_width); + pr_debug("Invalid access width %d for SystemIO register in _CPC\n", + gas_t->access_width); goto out_free; } if (gas_t->address & OVER_16BTS_MASK) { /* SystemIO registers use 16-bit integer addresses */ - pr_debug("Invalid IO port %llu for SystemIO register\n", - gas_t->address); + pr_debug("Invalid IO port %llu for SystemIO register in _CPC\n", + gas_t->address); goto out_free; } } else { if (gas_t->space_id != ACPI_ADR_SPACE_FIXED_HARDWARE || !cpc_ffh_supported()) { /* Support only PCC, SystemMemory, SystemIO, and FFH type regs. */ - pr_debug("Unsupported register type: %d\n", gas_t->space_id); + pr_debug("Unsupported register type (%d) in _CPC\n", + gas_t->space_id); goto out_free; } } @@ -768,7 +770,8 @@ int acpi_cppc_processor_probe(struct acp cpc_ptr->cpc_regs[i-2].type = ACPI_TYPE_BUFFER; memcpy(&cpc_ptr->cpc_regs[i-2].cpc_entry.reg, gas_t, sizeof(*gas_t)); } else { - pr_debug("Err in entry:%d in CPC table of CPU:%d\n", i, pr->id); + pr_debug("Invalid entry type (%d) in _CPC for CPU:%d\n", + i, pr->id); goto out_free; } }