From patchwork Tue Jun 25 07:20:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1951963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7bpr6BZVz20X1 for ; Tue, 25 Jun 2024 17:21:08 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM0U5-0007JF-G5; Tue, 25 Jun 2024 07:20:57 +0000 Received: from mail-pj1-f44.google.com ([209.85.216.44]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM0U4-0007In-A7 for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 07:20:56 +0000 Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2c7b14bb4a5so3583977a91.0 for ; Tue, 25 Jun 2024 00:20:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719300054; x=1719904854; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4o/OEDM+ySRx9/ajoCrXwKz7g6A2cEijzKef6uTCS7U=; b=SfAElgVKH5tHpeQm0jEuMHYGRZ9B390brZ+LcvOko3n0vqSRliJSYqeeJ7dJSdyZVA DsvdFFcEjwP1jZKOa7i7oHetD7aIfWjbq8Tkr92Zmb0poVWx7LLVGqkof4AQO+q3wCGP JCbBjDAJNwX42Znn+pnbSWLUGXa0sMjMUzPRszepd56W/wLXMyruBrxH/8Q+Ibok93Ms fH5JX2J2N4rvs4RlIWbcXCeRC8dfksWKqfdMegvPweiedlGjPLnHMtKEidiI7qfXZL2o LTPQGaE7SU5o4H1h3gaAwLkQUXTvZ5A12JZRpqxHBab+o5yUN0IyrdNVeDk8wYmvNBwA kwEw== X-Gm-Message-State: AOJu0YyAuuvcPxIk3HB7aNAqD3DPFC4LJWQhbwndNhwlVSctcjPqnpVS llJcbAoZuPrbvwOyA34xnP3pFwJr+2cml4SMvGQ9M5TROc3wEof5VBV1oDck X-Google-Smtp-Source: AGHT+IGLRSKGD4HjekUBgb9YmtB36dMpVPDnE/Su2scLKDDZgq//0myz6XOjo0yxjTCD0NeEaplV1w== X-Received: by 2002:a17:90b:d85:b0:2c3:2f5a:17d4 with SMTP id 98e67ed59e1d1-2c8a232c548mr3933100a91.4.1719300054086; Tue, 25 Jun 2024 00:20:54 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c819db97f8sm7938969a91.39.2024.06.25.00.20.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 00:20:53 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/4][SRU][Noble] ACPI: utils: Make acpi_handle_path() not static Date: Tue, 25 Jun 2024 15:20:30 +0800 Message-ID: <20240625072033.3410543-2-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625072033.3410543-1-vicamo.yang@canonical.com> References: <20240625072033.3410543-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.44; envelope-from=vicamo@gmail.com; helo=mail-pj1-f44.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Sakari Ailus BugLink: https://bugs.launchpad.net/bugs/2070251 acpi_handle_path() will soon be required for node name comparison elsewhere in ACPI framework. Remove the static keyword and add the prototype to include/linux/acpi.h. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki (cherry picked from commit 1269b6d7222f761b6f5fb85b19f7ab76a5bbf803) Signed-off-by: You-Sheng Yang --- drivers/acpi/utils.c | 2 +- include/linux/acpi.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index abac5cc25477..202234ba54bd 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -559,7 +559,7 @@ EXPORT_SYMBOL(acpi_evaluate_ost); * * Caller must free the returned buffer */ -static char *acpi_handle_path(acpi_handle handle) +char *acpi_handle_path(acpi_handle handle) { struct acpi_buffer buffer = { .length = ACPI_ALLOCATE_BUFFER, diff --git a/include/linux/acpi.h b/include/linux/acpi.h index b7165e52b3c6..a170c389dd74 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1170,6 +1170,7 @@ static inline void acpi_ec_set_gpe_wake_mask(u8 action) {} #endif #ifdef CONFIG_ACPI +char *acpi_handle_path(acpi_handle handle); __printf(3, 4) void acpi_handle_printk(const char *level, acpi_handle handle, const char *fmt, ...); From patchwork Tue Jun 25 07:20:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1951964 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7bpr6Dqpz20ZS for ; Tue, 25 Jun 2024 17:21:08 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM0U7-0007Jk-NP; Tue, 25 Jun 2024 07:20:59 +0000 Received: from mail-pj1-f45.google.com ([209.85.216.45]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM0U6-0007JE-BS for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 07:20:58 +0000 Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2c7fa0c9a8cso3536361a91.1 for ; Tue, 25 Jun 2024 00:20:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719300056; x=1719904856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2EviKWw4X1CW46c81aEcC0niCW+hssSnGqgQTa1W05g=; b=jtanJH7iEUZ+iydct2ZBDVrM0z7t0LtvqxifC+zvapOF2hWaqUh8fBHaXJGFvBW4w9 PiDYuFm5LDqDdAEEwdtXhGSwaWAICWslq3vUXuLRD2lF4GYqbd9GoXm1rG4tmhvFwdee 3dynDNTl0fCo9Sts9FnOmVolQXcXE+cQpWm+qmwS5I6UKZIT9alvVb+bmmWwfVo/ydgj JlIDAUPjcD3NuhBSywU/DyHb7fnIIxSYYJwZYhc3QFa2qVOpY5MMGsO15FW+Vgh4sVaa pgKaB6rOjtFjPiuVu1/pfYDG/e7x6T9GoocGUaPL7mj78090pN6/3sxTSo9+qVycTE4i IGZA== X-Gm-Message-State: AOJu0YyInJT5MFgeaRJEqfPnzmOFL6f1yrBDS35uW3ow+QNNT2FVYUKs 9WO0mWZB2k/MsrxkhApWGl97CEv61wDWhiOAzBLGGUpSvLsgnK+LyZ9xHJMn X-Google-Smtp-Source: AGHT+IGhnXiC9cq2CsmoC5M8vOViZp4NmUvVVszdXpDtJGlINXZ0JDd9+tNmLak/Ohip/5GRdwjajA== X-Received: by 2002:a17:90b:e89:b0:2c4:c2d3:c061 with SMTP id 98e67ed59e1d1-2c8581fd2c7mr5558312a91.18.1719300055630; Tue, 25 Jun 2024 00:20:55 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c819db97f8sm7938969a91.39.2024.06.25.00.20.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 00:20:55 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/4][SRU][Noble] ACPI: property: Ignore bad graph port nodes on Dell XPS 9315 Date: Tue, 25 Jun 2024 15:20:31 +0800 Message-ID: <20240625072033.3410543-3-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625072033.3410543-1-vicamo.yang@canonical.com> References: <20240625072033.3410543-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.45; envelope-from=vicamo@gmail.com; helo=mail-pj1-f45.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Sakari Ailus BugLink: https://bugs.launchpad.net/bugs/2070251 Some systems were shipped with both Windows and Linux camera descriptions. In general, if Linux description exist, they will be used and Windows description ignored. In this case the Linux descriptions were buggy so use Windows definition instead. This patch ignores the bad graph port nodes on Dell XPS 9315 and there are likely other such systems, too. The corresponding information has been added to ipu-bridge to cover the missing bits. Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki (cherry picked from commit 5bd4edbbf920b0ab72b19f486e20fb552e794a88) Signed-off-by: You-Sheng Yang --- drivers/acpi/internal.h | 1 + drivers/acpi/mipi-disco-img.c | 71 +++++++++++++++++++++++++++++++++++ drivers/acpi/property.c | 3 ++ 3 files changed, 75 insertions(+) diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 6588525c45ef..e0145df519bd 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -301,5 +301,6 @@ void acpi_mipi_check_crs_csi2(acpi_handle handle); void acpi_mipi_scan_crs_csi2(void); void acpi_mipi_init_crs_csi2_swnodes(void); void acpi_mipi_crs_csi2_cleanup(void); +bool acpi_graph_ignore_port(acpi_handle handle); #endif /* _ACPI_INTERNAL_H_ */ diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c index 7286cf4579bc..da71eb4bf6a6 100644 --- a/drivers/acpi/mipi-disco-img.c +++ b/drivers/acpi/mipi-disco-img.c @@ -19,6 +19,7 @@ */ #include +#include #include #include #include @@ -723,3 +724,73 @@ void acpi_mipi_crs_csi2_cleanup(void) list_for_each_entry_safe(csi2, csi2_tmp, &acpi_mipi_crs_csi2_list, entry) acpi_mipi_del_crs_csi2(csi2); } + +static const struct dmi_system_id dmi_ignore_port_nodes[] = { + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 9315"), + }, + }, + { 0 } +}; + +static const char *strnext(const char *s1, const char *s2) +{ + s1 = strstr(s1, s2); + + if (!s1) + return NULL; + + return s1 + strlen(s2); +} + +/** + * acpi_graph_ignore_port - Tell whether a port node should be ignored + * @handle: The ACPI handle of the node (which may be a port node) + * + * Returns true if a port node should be ignored and the data to that should + * come from other sources instead (Windows ACPI definitions and + * ipu-bridge). This is currently used to ignore bad port nodes related to IPU6 + * ("IPU?") and camera sensor devices ("LNK?") in certain Dell systems with + * Intel VSC. + */ +bool acpi_graph_ignore_port(acpi_handle handle) +{ + const char *path = NULL, *orig_path; + static bool dmi_tested, ignore_port; + + if (!dmi_tested) { + ignore_port = dmi_first_match(dmi_ignore_port_nodes); + dmi_tested = true; + } + + if (!ignore_port) + return false; + + /* Check if the device is either "IPU" or "LNK" (sensor). */ + orig_path = acpi_handle_path(handle); + if (!orig_path) + return false; + path = strnext(orig_path, "IPU"); + if (!path) + path = strnext(orig_path, "LNK"); + if (!path) + goto out_free; + + if (!(path[0] >= '0' && path[0] <= '9' && path[1] == '.')) + goto out_free; + + /* Check if the node has a "PRT" prefix. */ + path = strnext(path, "PRT"); + if (path && path[0] >= '0' && path[0] <= '9' && !path[1]) { + acpi_handle_debug(handle, "ignoring data node\n"); + + kfree(orig_path); + return true; + } + +out_free: + kfree(orig_path); + return false; +} diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index a6ead5204046..2b73580c9f36 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -80,6 +80,9 @@ static bool acpi_nondev_subnode_extract(union acpi_object *desc, struct acpi_data_node *dn; bool result; + if (acpi_graph_ignore_port(handle)) + return false; + dn = kzalloc(sizeof(*dn), GFP_KERNEL); if (!dn) return false; From patchwork Tue Jun 25 07:20:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1951965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7bps0JZtz23tw for ; Tue, 25 Jun 2024 17:21:08 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM0UA-0007Ld-0x; Tue, 25 Jun 2024 07:21:02 +0000 Received: from mail-pg1-f175.google.com ([209.85.215.175]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM0U7-0007Jb-Fi for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 07:20:59 +0000 Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-707040e3017so3483689a12.3 for ; Tue, 25 Jun 2024 00:20:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719300057; x=1719904857; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2GqrOJ+yVHCcrT7nUHqyM1s51FSJhWslt0os6Dx6ZLE=; b=t30RlhNOjuQOjBftH+//xSR4f/DhQI5qu6mcd60tblCzk3ihTJukSnA1ukbsZ/qb4/ 9uN617ewgBRJorRWj120l8jp9WzwPqIvcfRQYruty0QRQeeq3YsBj355YJJt65tKuqkG oI7sAEltp8tj8YnDrVe5SH00A6iCCUlyuUAOVg2tTxsXHFP6TtykQhaGft1J7A+Mc8x2 WMINWGjvv88MsKNTpaXksLHIVEO0Mp3ujGWFG0gflrCVC7+U6FZGeYb+Dlqd2JHXwF3t jqkqzlhR681ntYdpGMgscK5vyLEynYm56kWr12L5o+3JrRqen/PlLq3dCHU+u0u4/I1v vtBA== X-Gm-Message-State: AOJu0Yy+lp5WD+jSQRvc+ERXix/5GEyDAkT3sfteCUw0ctwlMbkNK6EX 6KVj67j2Z7WujYYnjDgIv0a1xicYWx7WCW9/xsLOW/QQQHasFmrLY33ceVdJ X-Google-Smtp-Source: AGHT+IE1zblO7Ep2YDOBLfuZDwItC/q7X2kLwhEnJBTSJORdjBSo4GZYSPHfCQFOSi9EUc6R6zP2Hw== X-Received: by 2002:a17:90b:4c11:b0:2c7:ae93:8f86 with SMTP id 98e67ed59e1d1-2c861409383mr5001936a91.27.1719300057399; Tue, 25 Jun 2024 00:20:57 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c819db97f8sm7938969a91.39.2024.06.25.00.20.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 00:20:56 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/4][SRU][Noble] ACPI: property: Polish ignoring bad data nodes Date: Tue, 25 Jun 2024 15:20:32 +0800 Message-ID: <20240625072033.3410543-4-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625072033.3410543-1-vicamo.yang@canonical.com> References: <20240625072033.3410543-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.175; envelope-from=vicamo@gmail.com; helo=mail-pg1-f175.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Sakari Ailus BugLink: https://bugs.launchpad.net/bugs/2070251 Clean up ignoring data nodes in mipi-disco-img.c: use { } initialiser, fix a kernel-doc warning and use isdigit(). Fixes: 5bd4edbbf920 ("ACPI: property: Ignore bad graph port nodes on Dell XPS 9315") Signed-off-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki (cherry picked from commit 8d60902f16e2a36e9138a7ac0e90eb30f35a33b5) Signed-off-by: You-Sheng Yang --- drivers/acpi/mipi-disco-img.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c index da71eb4bf6a6..d05413a0672a 100644 --- a/drivers/acpi/mipi-disco-img.c +++ b/drivers/acpi/mipi-disco-img.c @@ -732,7 +732,7 @@ static const struct dmi_system_id dmi_ignore_port_nodes[] = { DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 9315"), }, }, - { 0 } + { } }; static const char *strnext(const char *s1, const char *s2) @@ -749,7 +749,7 @@ static const char *strnext(const char *s1, const char *s2) * acpi_graph_ignore_port - Tell whether a port node should be ignored * @handle: The ACPI handle of the node (which may be a port node) * - * Returns true if a port node should be ignored and the data to that should + * Return: true if a port node should be ignored and the data to that should * come from other sources instead (Windows ACPI definitions and * ipu-bridge). This is currently used to ignore bad port nodes related to IPU6 * ("IPU?") and camera sensor devices ("LNK?") in certain Dell systems with @@ -778,12 +778,12 @@ bool acpi_graph_ignore_port(acpi_handle handle) if (!path) goto out_free; - if (!(path[0] >= '0' && path[0] <= '9' && path[1] == '.')) + if (!(isdigit(path[0]) && path[1] == '.')) goto out_free; /* Check if the node has a "PRT" prefix. */ path = strnext(path, "PRT"); - if (path && path[0] >= '0' && path[0] <= '9' && !path[1]) { + if (path && isdigit(path[0]) && !path[1]) { acpi_handle_debug(handle, "ignoring data node\n"); kfree(orig_path); From patchwork Tue Jun 25 07:20:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1951967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7bps3l6Dz23tx for ; Tue, 25 Jun 2024 17:21:09 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM0UA-0007Lw-FR; Tue, 25 Jun 2024 07:21:02 +0000 Received: from mail-pj1-f53.google.com ([209.85.216.53]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM0U9-0007Ka-KX for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 07:21:01 +0000 Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2c2c6b27428so3833369a91.3 for ; Tue, 25 Jun 2024 00:21:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719300059; x=1719904859; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qdc4UGjxsmCtdEry2laJdCK0nWC/9/ZdiXKy7/Hgin4=; b=H6SkAki+/dxWKfcoSFDEfgLtVBnzN4b28+aaBiASc9DwgsOpwgZGlS7QYYJC9IMaMW XwvqwA6To+KQ46G/TLgLrLJ0wC4o/zKPi/iYu2S9aEmMmBfzZct8jF+72lU7WcsZ8Vev xxpBYkcqLhJFXaYWNYfvfkPvJnczVr190dzhqpGAkuqB3L2+sztZRaUmAODdJi6TgL0p Q9JjsdjN4PYZlSdPNcesNy7vSgpzDs7/h5bpx+Vw+KXA0OHUEKnTOFovGD83Oyo2RB7z IALGfHC+d4o76B2xXh7xoeswQUDXWOIepv1vLsJ/bsvFII9nauU6prxifHqcJ8ct/bL2 9Nxw== X-Gm-Message-State: AOJu0YzfeZhvIdAto4k9e8aklF6gte9Br7MB5ibbwNrz6Yp7bdQPM1m/ FMzBR9t7L+jHBVTb2UiZRXuZ5px8dta9lngpU8jgxGse5yJnR70q717aYDzi X-Google-Smtp-Source: AGHT+IEaHOPMtoLs2XlRZFV4CC+Gh9yLd1Kioj0RXS1Oj78iJP0AMbV2jS+UkiRNzokmAMvYFSe1ig== X-Received: by 2002:a17:90b:4f4b:b0:2c1:a068:ba83 with SMTP id 98e67ed59e1d1-2c86140624emr5760799a91.11.1719300058854; Tue, 25 Jun 2024 00:20:58 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c819db97f8sm7938969a91.39.2024.06.25.00.20.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 00:20:58 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/4][SRU][Noble] ACPI: scan: Ignore camera graph port nodes on all Dell Tiger, Alder and Raptor Lake models Date: Tue, 25 Jun 2024 15:20:33 +0800 Message-ID: <20240625072033.3410543-5-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625072033.3410543-1-vicamo.yang@canonical.com> References: <20240625072033.3410543-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.53; envelope-from=vicamo@gmail.com; helo=mail-pj1-f53.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Hans de Goede BugLink: https://bugs.launchpad.net/bugs/2070251 Dell laptops with IPU6 camera (the Tiger Lake, Alder Lake and Raptor Lake generations) have broken ACPI MIPI DISCO information (this results from an OEM attempt to make Linux work by supplying it with custom data in the ACPI tables which has never been supported in the mainline). Instead of adding a lot of DMI quirks for this, check for Dell platforms based on the processor generations in question and drop the ACPI graph port nodes, likely to be created with the help of invalid data, on all of them. Fixes: bd721b934323 ("ACPI: scan: Extract CSI-2 connection graph from _CRS") Signed-off-by: Hans de Goede [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki (cherry picked from commit c7be64355fccfe7d4727681e32fce07113e40af1) Signed-off-by: You-Sheng Yang --- drivers/acpi/internal.h | 4 ++++ drivers/acpi/mipi-disco-img.c | 28 +++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index e0145df519bd..117725f4ab5e 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -301,6 +301,10 @@ void acpi_mipi_check_crs_csi2(acpi_handle handle); void acpi_mipi_scan_crs_csi2(void); void acpi_mipi_init_crs_csi2_swnodes(void); void acpi_mipi_crs_csi2_cleanup(void); +#ifdef CONFIG_X86 bool acpi_graph_ignore_port(acpi_handle handle); +#else +static inline bool acpi_graph_ignore_port(acpi_handle handle) { return false; } +#endif #endif /* _ACPI_INTERNAL_H_ */ diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c index d05413a0672a..0ab13751f0db 100644 --- a/drivers/acpi/mipi-disco-img.c +++ b/drivers/acpi/mipi-disco-img.c @@ -725,14 +725,20 @@ void acpi_mipi_crs_csi2_cleanup(void) acpi_mipi_del_crs_csi2(csi2); } -static const struct dmi_system_id dmi_ignore_port_nodes[] = { - { - .matches = { - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 9315"), - }, - }, - { } +#ifdef CONFIG_X86 +#include +#include + +/* CPU matches for Dell generations with broken ACPI MIPI DISCO info */ +static const struct x86_cpu_id dell_broken_mipi_disco_cpu_gens[] = { + X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, NULL), + X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, NULL), + X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, NULL), + X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, NULL), + X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE, NULL), + X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P, NULL), + X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_S, NULL), + {} }; static const char *strnext(const char *s1, const char *s2) @@ -761,7 +767,10 @@ bool acpi_graph_ignore_port(acpi_handle handle) static bool dmi_tested, ignore_port; if (!dmi_tested) { - ignore_port = dmi_first_match(dmi_ignore_port_nodes); + if (dmi_name_in_vendors("Dell Inc.") && + x86_match_cpu(dell_broken_mipi_disco_cpu_gens)) + ignore_port = true; + dmi_tested = true; } @@ -794,3 +803,4 @@ bool acpi_graph_ignore_port(acpi_handle handle) kfree(orig_path); return false; } +#endif