Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3391262pxb; Mon, 17 Jan 2022 19:26:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxbjmzXrbTrVl1nNeljbVA281Mo30N0GQZ0ooIW7OX2aoc4gSkduyjxBWlo4t/dS8KVsKa X-Received: by 2002:a17:902:e842:b0:14a:8735:1a5d with SMTP id t2-20020a170902e84200b0014a87351a5dmr21746190plg.69.1642476388578; Mon, 17 Jan 2022 19:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642476388; cv=none; d=google.com; s=arc-20160816; b=ZNzTEH7Z9Ph2Y1NuByVVp1KSFHOMAP6C58GIt1oh9IUkSallUD7E2Mm/y6JJEYqFX7 GRqeRCoo0jSJoQCmw9R9fGysKvDztDVpHNMeBXI70Gfysf4VM/eMJweUM/PKQuUG5N7B rzuMQiYWGnwMZBxCVc64KUAR+2wRuZjI9sF8vhDY9kUL5A9vYbSuJTJgF8A7rWvCa2lw YotiwAjgJW/dyh/QiQdIsNUEiZgXAHkfh6ZcRBJHbOuCwBDkhieNEQ8TZ6tWN+mXMQ2f QFKE5an5pckZb3TnIuWpaSUAwa2vMXxfvVbp9FfpOT5UYv+ukHGA6CQC0KLp2paPf+ig iHsw== 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 :dkim-signature; bh=0O0wUih4cQmrRp2Fiw4mOts6u6oTnrRMIBHnWsxVgEM=; b=PiKB8zMQGOGpmNvqRHSSc23K4+5IhPsmlMFJc1T4q5balyxO3njacpC2IwEwlH9xAU oE7rZRjYJS5uEZvJw91paFgqm+kvqVUeNE7UZ0uInZ0ie7fjgx3Sp2qPFIM9Lbg797fm YAUgkMUSYtn6k0hkfByvPojfeRV99djwgFW7cXvgxfcJ1fsbUjdu08YB36rHz8ji8o1/ p1O0ZPTYYyh4WYFfRIY2gjlD72Q85UdQazeiQ7GIda4qmRFKFCdy6oUrFN6N1n92/yI3 iwHk6Vl8ckJl48pXEJoJDjpbrRcexksJcneOkmN606uKyIHGyNtIg6eKHAnT6XovWQMP SQEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LrRKyYWP; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si19299182plh.147.2022.01.17.19.26.13; Mon, 17 Jan 2022 19:26:28 -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=@kernel.org header.s=k20201202 header.b=LrRKyYWP; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344614AbiARChI (ORCPT + 99 others); Mon, 17 Jan 2022 21:37:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345494AbiARCbg (ORCPT ); Mon, 17 Jan 2022 21:31:36 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F10C0C0617A7; Mon, 17 Jan 2022 18:29:26 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D4019611D8; Tue, 18 Jan 2022 02:29:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65403C36AEF; Tue, 18 Jan 2022 02:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472966; bh=F1XJP86QbRwonoLiEZokl4JXQQnS7jSJrjYRteoU7C4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LrRKyYWPAYK9vu6W7EbSGfBd1vSSpNcZck2I5P5LmG4fTPXeJHavUirHRdkkgRpZP 7Up4/TCogLmyY6QvnHoTdRE0zAET9ceSCoGfbd1WAOyg2UBv0FqQWerSA+C6IKG5uG 0YKcO3wLduVRMauPXr2yHoC5h8CMx6krvRb2abLwNd+xjy6txiUpnfdv4h9uAhj6ft k1ouAtRpmV6asLALUuyP2kfte1aJhQjBlV4zk+HzjUIlxzn/dU+r9Nfdqx7Zng2G9r tBH8aWSyI/cGFMncIyHp22NNCFLhg2dsFK8/6jai+UjHJb1Uv3mCocgX5YNxZuQU7v K3Vqly/E8WqLg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sudeep Holla , Bob Moore , "Rafael J . Wysocki" , Sasha Levin , linux-acpi@vger.kernel.org, devel@acpica.org Subject: [PATCH AUTOSEL 5.16 182/217] ACPICA: Fix wrong interpretation of PCC address Date: Mon, 17 Jan 2022 21:19:05 -0500 Message-Id: <20220118021940.1942199-182-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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