Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp704827rdb; Thu, 8 Feb 2024 20:35:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX2SQgu9+8hL5+VJtQA+mJMNlpxgfT50BTKo6Ck6DXLtJxgGhDKVbYOI1GWH8awd5vIxYijDp6HgBbthG3667LWpFIukDLYMXs/1TVuTg== X-Google-Smtp-Source: AGHT+IEsB929Og2xVJ7B8W7+vZCVa33GbQ6wjk8EEzjzUjLTHIfmfnCdzZAWV5p/akkemNd/YeXU X-Received: by 2002:a05:6830:3d12:b0:6e1:377e:c427 with SMTP id eu18-20020a0568303d1200b006e1377ec427mr485799otb.13.1707453353035; Thu, 08 Feb 2024 20:35:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707453353; cv=pass; d=google.com; s=arc-20160816; b=mk+efYY6xqsZZbQQUNG3J7AQN4lr1hhRiOxaxurdJHkdY4CGNHfwx/687xBp5g1IJ1 BUa4vaXQdDr6YvAWGqx6rel55p6aGi4eeF0XG6jg40P2ROJcnYaJcNZLhvpaS3eJHQzF lKMN/ic3UcuThXhPR1b7a/EvD+o1uwXWI+e5MYwOxESHFiUBSf23YqBvASgSUrA8xgd0 eDCM+rFoT6JNzN0/YR7mMNovvJsogOR5tlIT4b9J07imjsBQd473307LR4j2rSDpVN6i B6BouaIM8D5JCqndNsZV2G7xAnPNdtPrppakcWgBLP1MhuMC4uaPFMAppWTaH7iEVjXr q7LQ== 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=jF0LVyKfW9zrsYG7qAJeA0jKroE+BQWSh2P7D/n91V4=; fh=R4knHivSoJfD6GR/6mDGonLYvtv/Vyb810TDpZRQpds=; b=Gd3h1NuC2PbW2BZ6F+eFWXhOrJrxeQc+NV5FZLb7N9f6YPAICvB4RucHZcu+7AljpS mP5+f2WUZOUUKowsKpHOpsRmCvdKh7F/TuOzZcEe8LxTM3lLSKgKi/Jb6gauheOZX1SI jIqMHvP/GmW5PRhzkeGX6szXkYxphrZMlUoRdrVruBLS7YqzYMwCeqt/ho9LF+sv+Zn8 hJoOs5NNgw34Vq2v7zJhjoiRTVtsOBSFkqrQqe0Qf+daXhUFdh8YIlzs3cYiC+UBlZG8 /bEu/XAYFYGOpNavZbRa8kP1Hx/Ysi2tT2RwDr0y88V9Wmu/WF8H1v+ilc8kDsPgN92X 2wkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ur+OLccj; 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-58995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58995-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCXEp/OKHRTDVgDv9tHchfB3H4yKRD6xuY8qQCDXsQf8xY7XUlpA9ASD/pmOtlfFoGBE9e530VsrtLGAMG/vzI+0hAXPcKm1UEJIdfvH9Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o27-20020a63731b000000b005d5c89bd684si1055512pgc.414.2024.02.08.20.35.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 20:35:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ur+OLccj; 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-58995-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58995-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BC8A1286B5D for ; Fri, 9 Feb 2024 04:35:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D03F2566B; Fri, 9 Feb 2024 04:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Ur+OLccj" Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (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 942DA5673 for ; Fri, 9 Feb 2024 04:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707453331; cv=none; b=rijYJojBNcxa3C+4zLJv4xVqx61GxrpkaPFdd1HYToltKDSaX6qGquiVtnxmHXbjBvUSWsRP5HOGGl6LezhZdK5eWCtwtgko2LXv2/elelzFnDSF4rej5kwq3zNprKWA/mLI0khLPXkELh97SVUnBaKkH+w28c/rXFuJocKT/d0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707453331; c=relaxed/simple; bh=hTYAUXCmIabUW5HKsILrnw6rDD9lUI/Srw4C705HR5o=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eBRxB6B8bO1l5+EgDuDDwD7ZvpHZ5IOU4XfJ+YVG82mni7WCW5CS/jkRx26O7vGV8Pale+eblIkeTCByqXtx4+Hln39jTJ8odPzYSP4wYgnfjMKHV+sC8zP2sqo0lhi8WvPNyAdVpvsFORo2GokfUzghDSIFIdEX87ieLYE4ii0= 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=Ur+OLccj; arc=none smtp.client-ip=209.85.219.178 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-f178.google.com with SMTP id 3f1490d57ef6-dc755832968so293276.0 for ; Thu, 08 Feb 2024 20:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707453328; x=1708058128; 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=jF0LVyKfW9zrsYG7qAJeA0jKroE+BQWSh2P7D/n91V4=; b=Ur+OLccj8/+CUb8GKtf/xsBNddRAUmejqr0s4j+DYSIiexHyuCrygDNErtqMig6oxA y/UgbbrEXKzd0pXGiTe1FftGMyFRI7Sj1ZF5juO2lS76k8mJZG/vQPW8ckjssJRSOapY YsKDj6fvhV6c8jp7roKkhO6zCSDenPIW7SxnU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707453328; x=1708058128; 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=jF0LVyKfW9zrsYG7qAJeA0jKroE+BQWSh2P7D/n91V4=; b=mFfMA+nL2tyeL1wAghlkBQaOFm34xNqoTiHgxhRu6uA7OWZgjdSo5mjM4ZUc9VAFR2 MY+XmghLZWcNGDEu7P9hsgcke+N/id2QuV1KpriF4wXxj5P7EKTcZgpT5OLh2cRLw2Lw Ls3nthXeLO3gaij6u/R7ZtvLq9xam8G/fa94jv1CzOb3Pss52apjuFMDdFY/PG5giAAj qBL7lRBLIYsKP+TaJSq6iG1kGDemDcz0UuUoqmDK+jOYffaigCLWhu0BxPMqD+v+Xux2 XA4/NgnT6Fw3yfY0IEmGEX02bHK/xqupFimpkpJoYZ4hTGwYmYe3+yRQPM+gTMyzhcCC iLoA== X-Forwarded-Encrypted: i=1; AJvYcCXW+S2J6XO2ByipJ0pP3OisKg4ooFqVH0e7TAwYvlyLSOkvL6YgPK3k+Phn8cxpsVKBlPgeJh9cs7Lc9KzV1DziKa7uXmg4WIQe9YdE X-Gm-Message-State: AOJu0YyI8FThuuMmhmsLcpS4mJwCNXzmOGmg7PkuU+Y72IG4EgZiPzbh iMDJg1TqR0NdAdaYJvKbkuw3RCzB5BtW6mJIIpz2cGSOuK8gd66ewQcGIRCBJOaH0Ful70ORdtN EynkpxzGUvwOIc3wR6L7+77VRpJb6YaPaR3xs X-Received: by 2002:a25:3607:0:b0:dc6:4e33:10bb with SMTP id d7-20020a253607000000b00dc64e3310bbmr382362yba.58.1707453328472; Thu, 08 Feb 2024 20:35:28 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240125004456.575891-1-abhishekpandit@google.com> <20240124164443.v2.2.I3d909e3c9a200621e3034686f068a3307945fd87@changeid> In-Reply-To: From: Abhishek Pandit-Subedi Date: Thu, 8 Feb 2024 20:35:17 -0800 Message-ID: Subject: Re: [PATCH v2 2/3] usb: typec: ucsi: Update connector cap and status To: Jameson Thies Cc: Abhishek Pandit-Subedi , Heikki Krogerus , linux-usb@vger.kernel.org, pmalani@chromium.org, Dmitry Baryshkov , Greg Kroah-Hartman , Neil Armstrong , Rajaram Regupathy , Saranya Gopal , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 8, 2024 at 11:48=E2=80=AFAM Jameson Thies w= rote: > > Hi Abhishek, > > > +#define UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV_AS_BCD(_f_) \ > > + (UCSI_CONCAP_FLAG_PARTNER_PD_MAJOR_REV(_f_) << 8) > > Can you replace this with a common HEADER_REV_AS_BCD macro that can be > used for both GET_CONNECTOR_CAPABILTY and GET_CABLE_PROPERTY? > Also, the USB PD major revision value in the message header is one less t= han the > revision (PD Spec section 6.2.1.1.5). So, we need to add 1 before shiftin= g. Jameson and I talked briefly and I discovered that PD assigns the following values for the major rev: * 00 =3D 1 * 01 =3D 2 * 10 =3D 3 * 11 =3D Reserved/Invalid From PD 3 onwards, there's a new Get_Revision message that can be queried from UCSI using GET_PD_MESSAGE. In future patches adding support for Discover Identity (also using GET_PD_MESSAGE), we will need to check this major revision to see whether we should also query Get Revision. Since this code is incorrect, I will send up a PATCH v4 with the correct BCD version as Jameson suggested. I'll also fix up some of the minor nits in that patch series. > > Thanks, > Jameson