Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1303678rdb; Tue, 30 Jan 2024 14:31:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3UBiKnAMeQXAbVHqdIYPbiR0HIOenGfIaee6kJT5IlGr0mflA1LZkC0FkHY2FnTZQqzMs X-Received: by 2002:a17:906:19ce:b0:a36:bc3:3c8e with SMTP id h14-20020a17090619ce00b00a360bc33c8emr2866576ejd.50.1706653869343; Tue, 30 Jan 2024 14:31:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706653869; cv=pass; d=google.com; s=arc-20160816; b=bAQzPK6CPm+kR/PF0evDO47oEwk4sz2fO/zvD9t0t1t1fENvWUpL+uSZrLPhFv49gQ w6ZUTdfSZp0dH8dqdoudMIA1MCB3vsUGdm6sTKNn+BC8e3bkdB2gzCWfGFRhI+evN1Qd gexYw+yXL7hubmo0grYlAEqjnD1tRudN3bHFIo1XJ7SheIDnm4dTbu5A4n2HPlX+TML1 ISYZMh/YZwzDpT/6WSVRhgHFsToC9bNaX1D+nXlyskJDvW0IfIB0v1Kkgf3A4S/qaOLH tXmz2+IECRRkVmw16Jj0kTRzmAjccw6iyiOHJ7xpb09ktkeXBCoS4bF5Qsh51A0UQVO9 45qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=CHsI7G6NUmy3rPPwHz9CEuB456j8VcvU1g80bBBdmy4=; fh=zoHl8zDXMe/VTrgY6IpMY+VQ8cd9Xl7jeL1hL0ALyQI=; b=O0qXx6xhYKNTRlQIeMChGWbcB9oatrvJnZQdRTK2T0Tq+9p+WEvn2eizAA8IfItcXw 9uxVCFsdX/2JBGckRkPEo6PYLIEbapwswXlRmX7oZUplPp0roUpVf52fT+XEkD6KRtFe p00DKnIaBTQqfuiO8puRKWfSH/uFQqAa8Cz6cY8HHYr5lbSK/ISPKiuxN6F1cAHCvqNb UsKQtGdCMobv38SFxbwmusLPmCNf0A2R83emmKnhXhIyMx7e0e1EMXuVBTzrlu1BbiID 2onUEcwuMyGTiv1efAxZynKOKczJasTdKYEeG8LexKKIXWPM1CSkuln2he/QEfFABrJi Rwpg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Po/F5nmz"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-45399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45399-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j6-20020a17090643c600b00a363829537esi702386ejn.649.2024.01.30.14.31.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 14:31:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Po/F5nmz"; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-45399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45399-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1D4891F24FAB for ; Tue, 30 Jan 2024 22:31:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 361B078666; Tue, 30 Jan 2024 22:31:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Po/F5nmz" Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C948F7BB01 for ; Tue, 30 Jan 2024 22:30:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706653861; cv=none; b=hwoEgMXUFfj0bVDdL13T3vKEWIoWpx5pF7xTb8uPCMMGgcZp+7zyycUOaR+VO5Xhdvh5j4v5YSQha6upbJFW7fz1IN+OCs+8BA58i2WZ9EWtcdh3GGVTdZaz1kuvlAhj2oY+ovKbvkhT7K4gOsPWSGf5IZYBaBcF0dfD9Fuir5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706653861; c=relaxed/simple; bh=5HmmswglN9pKy7g/0osHBxBGg837xJKysUQuN28gYCo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=UhUHxCPWm8QqJDh4fAp08oAd0qycicLenSLWGGcZr89DxWsl7PFrZ9uOos0CSv/dlKjFW4TfyZd2UONsaNA4ZF3RMs79+VV0wylce6URSin3AjmS+09QKTEaUCOpxB8S/hXruHd94of3ArBba21G257DY7fPUokamaDKPN8EFaU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Po/F5nmz; arc=none smtp.client-ip=209.85.219.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-dc226bad48cso3944396276.3 for ; Tue, 30 Jan 2024 14:30:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1706653859; x=1707258659; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=CHsI7G6NUmy3rPPwHz9CEuB456j8VcvU1g80bBBdmy4=; b=Po/F5nmzXFvpYSgc3N8xcqQCr64afyVWlKhdEXHpxsEx6HIQadDbOn1QpC/lKAwyIo i+B+PcFZJko7gfD94/o6DWj9lDuOYhLpy00jVQ7AXSLBJGA0Ovm+f2FQDq9ro9tVQq6M dnW6OEebcGPsKEtVr1m/s3TNZrA5aEGmwCgQQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706653859; x=1707258659; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CHsI7G6NUmy3rPPwHz9CEuB456j8VcvU1g80bBBdmy4=; b=YD8aS5MX1oeJwk5MCyNhPwQcG8nUgM+T0nGmxY4FxhiSRdgiJ5VR9Hs0M2+F6if/VJ AsjpBSJdVahQOkGWuo3IYjhN+JboyxU+u+ii/ZLVmQAX2FMCmzMNzQiqfledZLj3LX9B CVChdup62G/Iey9gOyfvdCbZrNy/eBI/hB4YALlwkbZPyn/Y34s2Hhi1bRpi4sACTjue lWY/IrOvUHJ6C03eYaaWHyHr7WRWgCf5CuyG6Q+zK+USs8bHf1W2/H2fewIP7MRiVxH6 w0iToBHvFLGbKxPQI9TscYp6QXkSvOKIeC3JY2Yyfz61Fvaovd18rymLEcwx54eKjenu TJcw== X-Gm-Message-State: AOJu0YwkhobDrIGGman0Es23iOTEkQYD1IYfiXov8XBfHPOeTp5V8YaE QvrOoC38mc/p2j/vmmqFM3us6BjqxXkE3jq6kYVL/Ji5kbYkqvLRidiyGA9igbux+yDiRCU7DgL vmWInoeGvZ5cQuepDyMKSsOVu34DE0wzZ4bZb X-Received: by 2002:a81:eb0e:0:b0:5ff:6084:421e with SMTP id n14-20020a81eb0e000000b005ff6084421emr6945261ywm.32.1706653858789; Tue, 30 Jan 2024 14:30:58 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240126183930.1170845-1-abhishekpandit@chromium.org> <8cf38c26-c8ec-401e-8aab-527ef811af90@amd.com> In-Reply-To: <8cf38c26-c8ec-401e-8aab-527ef811af90@amd.com> From: Abhishek Pandit-Subedi Date: Tue, 30 Jan 2024 14:30:47 -0800 Message-ID: Subject: Re: [PATCH v3 0/3] usb: typec: ucsi: Adding support for UCSI 3.0 To: Mario Limonciello Cc: Heikki Krogerus , linux-usb@vger.kernel.org, pmalani@chromium.org, jthies@google.com, Andy Shevchenko , Bjorn Andersson , Dmitry Baryshkov , Fabrice Gasnier , Greg Kroah-Hartman , Hans de Goede , Neil Armstrong , Prashanth K , Rajaram Regupathy , Saranya Gopal , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 28, 2024 at 8:06=E2=80=AFAM Mario Limonciello wrote: > > On 1/26/2024 12:39, Abhishek Pandit-Subedi wrote: > > > > Hi Heikki, > > > > This series starts the work adding UCSI 3.0 support to the UCSI driver. > > > > There's a couple of pieces to start here: > > * Add version checks and limit read size on 1.2. > > * Update Connector Status and Connector Capability structures. > > * Expose Partner PD revision from Capability data. > > > > These were tested against on a 6.6 kernel running a usermode PPM agains= t > > a Realtek Evaluation board. > > > > One additional note: there are a lot more unaligned fields in UCSI now > > and the struct definitions are getting a bit out of hand. We can discus= s > > alternate mechanisms for defining these structs in the patch that > > changes these structures. > > On the Windows side I notice that Microsoft explicitly checks the UCSI > version to decide what data structures to use. > > https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/ucsi#uc= m-ucsi-acpi-device-for-ucsi-20-and-greater > > Perhaps doing something similar makes sense in Linux? That probably belongs in `ucsi_acpi` and would be good to add there. I don't have a Windows device reporting a UCSI version 2.0 but wanting 1.2 so I can't add or test this patch. > > > > > Thanks, > > Abhishek > > > > Changes in v3: > > - Change include to asm/unaligned.h and reorder include. > > > > Changes in v2: > > - Changed log message to DEBUG > > - Formatting changes and update macro to use brackets. > > - Fix incorrect guard condition when checking connector capability. > > > > Abhishek Pandit-Subedi (3): > > usb: typec: ucsi: Limit read size on v1.2 > > usb: typec: ucsi: Update connector cap and status > > usb: typec: ucsi: Get PD revision for partner > > > > drivers/usb/typec/ucsi/ucsi.c | 49 +++++++++++++++++++++++++-- > > drivers/usb/typec/ucsi/ucsi.h | 64 ++++++++++++++++++++++++++++++++--= - > > 2 files changed, 107 insertions(+), 6 deletions(-) > > >