From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796386086; b=C24sIxFnPPqrNlO9juMLGlQJSo00ZQnCaQsnEPXtCISoSfWkRtJ9ePXwpp1GF2WHDAXK KdW2hvqkwYUl1sZIuL+bLXUJ40YRVG7kap66aRi9XrGcMH7yiQJlpKCHCVW/aSM2An/iY BGBljx71Tyt2ybEMiQy01xbwM2wOXs2VgZVCv5gynAYUo7zBWJ58cg/dx+M/oTF8qr4JJ XJycwPRCVOD2p+jbJSsAmQFu8xrjzmXiE+BH7xp5VGrPFgDr9IJ1Pb5cojTLb0CK+H53C VbF22AMlT4PNV/uHQyxP4IKhUM5HR7TMAy+VDyavfq29RlRMOL2Hr6JAuKWtxXMBxgQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386086; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=piR0MK6k+JjGxKyigt+fHj70zk6gZWeNr/Iv4ZyJbcc=; b=0xLWhemZWZVSzRNl227eiMDKnhiE0riykALBHFb6tNLPPaWB+Uf5py4aOV7msXEs1nMX S6TlVZTaJLXvE+fvUCG8LbAYSFluJia6YlsBmxoJoKIhDgRIU+Gy/ILJxbxa4PmEFhXaB VBRbCvitz1rmcBw/4ZtoHzkjJLDQjW7NtYIaQhg6t9Bn7wn0pr9lkSdjbyLFBimVfRDIy VfZD/ddwGNE24Ec4uzn+if3F3sMFrIOBdqeJzA0UX6tNEcMmvMF+wZsbZcJ2YBT3K82vA xdo39Tnp9yOhoBy0g+mU6iWvs3J1BH/vYpt42l9K00z1SzmsbR5L7MVxNAoTknrBQcA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=DYHlBR+7; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AD4D606A322; Fri, 4 Dec 2026 12:08:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=DYHlBR+7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3AF51F000C2; Fri, 4 Dec 2026 12:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386086; bh=piR0MK6k+JjGxKyigt+fHj70zk6gZWeNr/Iv4ZyJbcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DYHlBR+7lv4MNQQNVQei/GfXdvDvA0nGNMx+dmOHv8kPoLzQayYMXmJCrpaGGtPcR sNH5dJ/J2ZYamSNwCbWbtXkoiDoWLlF6oohewxZczSL9Fi9+ofp8Tt7H+FKYDr37/b 5rC85GnIfGZuHOwbN/aMpTAvVs1N+0gWEOa7yo14= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Francesco Orro , Ihor Urazov , Heikki Krogerus , Huang Wei , Sasha Levin Subject: [PATCH 6.6 0822/1167] usb: typec: ucsi: acpi: Assume UCSI 1.0 on HP ZBook 8 G2i 14 Date: Fri, 4 Dec 2026 19:04:09 +0900 Message-ID: <20261204100723.534155799@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ihor Urazov [ Upstream commit 3ee1e1c3fca6fb5d0abbe0fc91539951ffa60aa7 ] The HP ZBook 8 G2i 14 (board 8ED9) exposes a working UCSI ACPI PPM, but its UCSI VERSION field reads zero until the first command completes. ucsi_register() rejects a zero version with -ENODEV, so no Type-C ports are registered. The firmware's _DSM READ function (2) is a stub. The mailbox VERSION field is written only by the EC response handler, after a command completes, after which it reads 0x0100 (UCSI 1.0). The mailbox is 48 bytes with 16-byte MESSAGE_IN/MESSAGE_OUT fields, the UCSI 1.x layout, and _DSM function 5 is not implemented. Add a DMI-specific read_version for this board that substitutes the version the firmware itself reports, UCSI 1.0, only when VERSION reads zero. A non-zero firmware version is used as is. The same firmware defect on the HP ZBook Fury G1i 16 was discussed in "[RFC PATCH] usb: typec: ucsi: acpi: bootstrap PPM on HP systems with empty _DSM func 2" [1]. The defect was reported to HP as case 5166176673. Tested on an HP ZBook 8 G2i 14 with BIOS Y70 01.02.08, from a fresh boot where VERSION reads zero: three connectors register, the PD contract and alternate modes of a Thunderbolt dock are reported, and its DisplayPort output stays up across the PPM reset in ucsi_init(). Dock unplug/replug and s2idle suspend/resume update the connector state without errors. Link: https://lore.kernel.org/linux-usb/f3M_fpjtt8FxDqGKcA84vqXmRbKzCBfpCrIK4-jCWvIscER51zkD8qD8FYpz75qZw51rMDRSkUyYlrBvLvdM8CGRY2l8TFVvr4MC1LdTzbc=@interstellar.eu/ [1] Fixes: c1b0bc2dabfa ("usb: typec: Add support for UCSI interface") Cc: stable Cc: Francesco Orro Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Ihor Urazov Reviewed-by: Heikki Krogerus Reviewed-by: Huang Wei Link: https://patch.msgid.link/20261026-ucsi-hp-zbook-8-g2i-v1-1-91002e9ef073@gmail.com Signed-off-by: Greg Kroah-Hartman [ sashal: adapted the HP quirk to the old ucsi ops API by wrapping ucsi_acpi_read() as ucsi_hp_read() like the Acer quirk, and added the missing UCSI_VERSION_1_0 define. ] Signed-off-by: Sasha Levin --- drivers/usb/typec/ucsi/ucsi.h | 1 + drivers/usb/typec/ucsi/ucsi_acpi.c | 33 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h index f0cf52c6ddeba..50c41fbf06a56 100644 --- a/drivers/usb/typec/ucsi/ucsi.h +++ b/drivers/usb/typec/ucsi/ucsi.h @@ -30,6 +30,7 @@ struct dentry; #define UCSI_TIMEOUT_MS 10000 /* UCSI versions */ +#define UCSI_VERSION_1_0 0x0100 #define UCSI_VERSION_1_2 0x0120 #define UCSI_VERSION_2_0 0x0200 #define UCSI_VERSION_2_1 0x0210 diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c index 7a4969a086df2..2da6c14e34a5d 100644 --- a/drivers/usb/typec/ucsi/ucsi_acpi.c +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c @@ -132,6 +132,32 @@ static const struct ucsi_operations ucsi_acer_ops = { .async_write = ucsi_acpi_async_write }; +static int ucsi_hp_read(struct ucsi *ucsi, unsigned int offset, + void *val, size_t val_len) +{ + struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi); + u16 *version = val; + int ret; + + ret = ucsi_acpi_read(ucsi, offset, val, val_len); + if (ret) + return ret; + + /* Firmware fills in VERSION (1.0) only after the first command completes */ + if (offset == UCSI_VERSION && val_len == sizeof(*version) && !*version) { + dev_warn(ua->dev, "UCSI version is zero, assuming 1.0\n"); + *version = UCSI_VERSION_1_0; + } + + return 0; +} + +static const struct ucsi_operations ucsi_hp_ops = { + .read = ucsi_hp_read, + .sync_write = ucsi_acpi_sync_write, + .async_write = ucsi_acpi_async_write +}; + static int ucsi_zenbook_read(struct ucsi *ucsi, unsigned int offset, void *val, size_t val_len) { @@ -206,6 +232,13 @@ static const struct dmi_system_id ucsi_acpi_quirks[] = { }, .driver_data = (void *)&ucsi_acer_ops, }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8ED9"), + }, + .driver_data = (void *)&ucsi_hp_ops, + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), -- 2.53.0