Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3713006pxb; Mon, 24 Jan 2022 16:05:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEJ+5OUjsPQHcsTRKF8pL3BczYVNbaVyAEHnkE4j3bpPZYMbcLtT8cRHdzDAAPAHZFvjln X-Received: by 2002:a17:90a:7891:: with SMTP id x17mr761230pjk.112.1643069155307; Mon, 24 Jan 2022 16:05:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069155; cv=none; d=google.com; s=arc-20160816; b=LWCVRhKW17SdDzWS6C69lsr/ROovWP/JwAVsq3BZTgoY+Z26mWnClWQGPa8uHreBSG sEQ2FoeNeGlWjDosjIADJk4dzBZV9qU2aiaEy6rC2SjQJmNSNG0GpqcoPct+jcFNUuUN R1TZ8sagPuE+ZL6YVIDM7AsyGfkSBnFVOB8RT1b8ecTWDp85VEPUzogP443TcRcxcrl1 l4t0rYIhaSQ8bsV0xXkJEXvirzGSJAsMnKteal0OGA0h5z7biPVt/XB6EfW5JO4UQyib hXbhYXIwaS+bhUALsblcSMVpC0vHGcJnvlcwk3fqcLPvaOE+baI4T82+VQYnmSq53a5Z gprA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0O0wUih4cQmrRp2Fiw4mOts6u6oTnrRMIBHnWsxVgEM=; b=j2n2PL7s+zovJzDKbMv4MO+vp58sA2BdaBT2+xgHx7y9v1kgOhwkQTxgWXzyddkx5x //YXNdEA6GNaEc3AvnfiZVSswErgoHvoVZtirU6T3a29ut05D5ggjZf2amU9u8m0sN1r IE59HGvajSHeE9+EwC2VwX6WJyyiAMeraTq4x09PhgNGi6nIYbBEmz1kDA9l4WGgd721 WIc97k2JA3xxr/7SASHq5+zqvT9oatv22gYp8+2bz/iWSWKU8RikBGsRajwrXBA7VTBU STkaDRzTpYM3E7YF+ugkiAyfF/Dq0Rfm5WyF56ojunm+BjEvZoE2/5iUlAopKCkpqRi6 BTug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IhJv4K+y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si14771692pfl.100.2022.01.24.16.05.23; Mon, 24 Jan 2022 16:05:55 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IhJv4K+y; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2368604AbiAXX7h (ORCPT + 99 others); Mon, 24 Jan 2022 18:59:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1847648AbiAXXUP (ORCPT ); Mon, 24 Jan 2022 18:20:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1F0AC028C20; Mon, 24 Jan 2022 13:28:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8FCF4B815A3; Mon, 24 Jan 2022 21:28:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5B7EC340EE; Mon, 24 Jan 2022 21:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059683; bh=F1XJP86QbRwonoLiEZokl4JXQQnS7jSJrjYRteoU7C4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IhJv4K+y+itXVmTW/IPX2R3xTRsxZKzqzvsFT1XxnQumOoKcGSjSlzUenPXYuaKX9 QHs9BVrVltbp+yXXck/g7ghtivFYx2snRnCNAiFPiY7ANYwRVLEER75nR7s1rOFcdg T/woezF9ZvbbDm5LDZ4pa4QpikhJkUUDbxv0OsCA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sudeep Holla , Bob Moore , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.16 0699/1039] ACPICA: Fix wrong interpretation of PCC address Date: Mon, 24 Jan 2022 19:41:28 +0100 Message-Id: <20220124184148.838374027@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sudeep Holla [ Upstream commit 9a3b8655db1ada31c82189ae13f40eb25da48c35 ] ACPICA commit 41be6afacfdaec2dba3a5ed368736babc2a7aa5c With the PCC Opregion in the firmware and we are hitting below kernel crash: -->8 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 Workqueue: pm pm_runtime_work pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __memcpy+0x54/0x260 lr : acpi_ex_write_data_to_field+0xb8/0x194 Call trace: __memcpy+0x54/0x260 acpi_ex_store_object_to_node+0xa4/0x1d4 acpi_ex_store+0x44/0x164 acpi_ex_opcode_1A_1T_1R+0x25c/0x508 acpi_ds_exec_end_op+0x1b4/0x44c acpi_ps_parse_loop+0x3a8/0x614 acpi_ps_parse_aml+0x90/0x2f4 acpi_ps_execute_method+0x11c/0x19c acpi_ns_evaluate+0x1ec/0x2b0 acpi_evaluate_object+0x170/0x2b0 acpi_device_set_power+0x118/0x310 acpi_dev_suspend+0xd4/0x180 acpi_subsys_runtime_suspend+0x28/0x38 __rpm_callback+0x74/0x328 rpm_suspend+0x2d8/0x624 pm_runtime_work+0xa4/0xb8 process_one_work+0x194/0x25c worker_thread+0x260/0x49c kthread+0x14c/0x30c ret_from_fork+0x10/0x20 Code: f9000006 f81f80a7 d65f03c0 361000c2 (b9400026) ---[ end trace 24d8a032fa77b68a ]--- The reason for the crash is that the PCC channel index passed via region.address in acpi_ex_store_object_to_node is interpreted as the channel subtype incorrectly. Assuming the PCC op_region support is not used by any other type, let us remove the subtype check as the AML has no access to the subtype information. Once we remove it, the kernel crash disappears and correctly complains about missing PCC Opregion handler. ACPI Error: No handler for Region [PFRM] ((____ptrval____)) [PCC] (20210730/evregion-130) ACPI Error: Region PCC (ID=10) has no handler (20210730/exfldio-261) ACPI Error: Aborting method \_SB.ETH0._PS3 due to previous error (AE_NOT_EXIST) (20210730/psparse-531) Link: https://github.com/acpica/acpica/commit/41be6afa Signed-off-by: Sudeep Holla Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/exfield.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c index 06f3c9df1e22d..8618500f23b39 100644 --- a/drivers/acpi/acpica/exfield.c +++ b/drivers/acpi/acpica/exfield.c @@ -330,12 +330,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, obj_desc->field.base_byte_offset, source_desc->buffer.pointer, data_length); - if ((obj_desc->field.region_obj->region.address == - PCC_MASTER_SUBSPACE - && MASTER_SUBSPACE_COMMAND(obj_desc->field. - base_byte_offset)) - || GENERIC_SUBSPACE_COMMAND(obj_desc->field. - base_byte_offset)) { + if (MASTER_SUBSPACE_COMMAND(obj_desc->field.base_byte_offset)) { /* Perform the write */ -- 2.34.1