Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4322328pxb; Mon, 1 Feb 2021 19:44:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwABNajkr8XqjbDRZJkWujjOQNWGBRpOo2t0z9Ko068Arq2SsKTp43a/ZXRvFAma5fC7/LP X-Received: by 2002:a17:907:9495:: with SMTP id dm21mr20869847ejc.462.1612237447980; Mon, 01 Feb 2021 19:44:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612237447; cv=none; d=google.com; s=arc-20160816; b=se8Gf7LLZGPct54fxV3PD4ql/SKeKxJp11kwNkK6cK14qiBYRB5fUtSLxSp7lrNPv4 kWL6ixX2ku+SKXMakCbi1nQ/B+5roM782VLGZMaAAoehguAVvaxS/Ed9g3ZqqVS0EMXX AB90RJcfQcEFNzU/0JuOeYZJ2jMPc7osAeu5pHJ8E46TTyVnQ0Bwh+nHtY5pYRUNgma8 SOlYdj1u2OwLv952xYCxya7BRha9u41/77hbQ/VCOD++0XmyQV5ioVj1pe9I0T7Uai2X Mswmcfb1Xw5+BEGQ3q61QQZ5Zu9uMCmrc6RVLEPnwPX2GzZddLNsKa8FDpK5Ywi6sBjD suFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :sender:dkim-signature; bh=8YVuxrTBaW2u/EvVshmB1lhIJOhjS6aKrPCo07emghg=; b=kysOpeh5MtbC97Ysbr/On6SqJn51P1FBAtB6JY9neth4CblptyV1yi+8MuTM0HmJx0 h295XLdPW4wF0uebTvYSsra5CsndVK+hLFHtbwoY910rSrgeSU/39H9KLSPjL7m16ixV et+3ifYj46tPzlko/3u2/V8JtBsz58oHyJsa1qNlAvY/J5Ct+XKbtjn0RGEE70hyo+s5 +esDTNxe3c1M0P/8nvldV9ynNe/zfftFZRS9CdZGR7VRJ+cpLpUwAPpy6ujoMjg2Y8tf aI+6AjNjkaJWzXAnZOHZbdrEp/jxVi0iyatqVbL7/N5qgKKP4n1v/sbAzj62y2QndaDn U4eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Sz7AEELQ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si11588993edx.601.2021.02.01.19.43.43; Mon, 01 Feb 2021 19:44:07 -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=@google.com header.s=20161025 header.b=Sz7AEELQ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231225AbhBBDjp (ORCPT + 99 others); Mon, 1 Feb 2021 22:39:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbhBBDjo (ORCPT ); Mon, 1 Feb 2021 22:39:44 -0500 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D416C06174A for ; Mon, 1 Feb 2021 19:39:04 -0800 (PST) Received: by mail-qv1-xf4a.google.com with SMTP id d8so12787392qvs.1 for ; Mon, 01 Feb 2021 19:39:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=8YVuxrTBaW2u/EvVshmB1lhIJOhjS6aKrPCo07emghg=; b=Sz7AEELQcZbOmHR4c3XoJoG0B0b9UXp6kt1AxKunbluqicRtEdb0MPrxNytbawaU8j 1w1PRgFtMu8NDu7PUo6GquGnAC7AGef4uOwUstOSVOBfvpQa6SYYhqH2J+dvaVCEhspv xyMd/R83xqZmVDHtmLgBuhI+MFTcydHy9h1W78n6eO1iCUI0V5ahSN/E3HNtnRT7ZylP yTpxh+KvuZIwgKUU0nXpV0gbX5IdOlPr8qn0uTuzhvddI6SmJf0LOayy4Z2a9efMnUtx sWnkG2+e9X/mougZZOZkS6hnGc2F8QsooTewfAjFNOAdgehOb0ZB8D9scKoUdsPHYVFa bwcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=8YVuxrTBaW2u/EvVshmB1lhIJOhjS6aKrPCo07emghg=; b=Sz4hbWu5sjY2VkthL7Ka0HUZ0loPhpIV5kNLGP/R1ZsQi2Da+/zpsYCbl7w3gNI29+ OpRGYrOAsLbqePSaVkMV0p9KYjExSS2YIhezvsrF84CBz31qV9QjH8g5JGTSGiyV8EwL Vuzc4i8DxVI34ORVWTyf8WCc2+tgalU3xsLxwgXp6QiDs8/OBHJNvPxo203GkFKzsx58 LaTPb/Ka8aqMnwry6/CtGdXHWYsFoYa5D/NvthwB2wQZqsst3FtQgM3T1+nFwU7XNYuW hGXzxomiO3qmxY2q+QuqX21eV1mE6gkyipmlMfPsgOEAwQg5P1rkHhPK0kmL0Lqauha8 NS2w== X-Gm-Message-State: AOAM533EgxkzTQDHAD2eUjHJbg1pBqz5WJ1/GBn0ZwV93nxiASGmOybx DRJj3A+NBGW3N8SU8ycS7pOsCxRNOlM= Sender: "badhri via sendgmr" X-Received: from badhri.mtv.corp.google.com ([2620:15c:211:201:d56c:119f:44fb:5da4]) (user=badhri job=sendgmr) by 2002:ad4:4c84:: with SMTP id bs4mr18662349qvb.0.1612237143459; Mon, 01 Feb 2021 19:39:03 -0800 (PST) Date: Mon, 1 Feb 2021 19:38:59 -0800 Message-Id: <20210202033859.258491-1-badhri@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog Subject: [PATCH v1] usb: typec: tcpm: Set in_ams flag when Source caps have been received From: Badhri Jagan Sridharan To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , Kyle Tso Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Badhri Jagan Sridharan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Receiving the first packet in an AMS sequence signals the beginning of AMS. Set in_ams flag to true when SRC_CAPS are received during POWER_NEGOTIATION AMS. This fixes the failure flagged while running TD.PD.SNK.E9 compliance test. From Deterministic PD compliance MOI spec: TD.PD.SNK.E9. GetSinkCap in Place of Accept Description: As Provider, the Tester intentionally sends a GetSinkCap message in place of Accept message and verifies the UUT will send a SoftReset and recover from the error. Steps: a) Run PROC.PD.E1 Bring-up according to the UUT role. b) The Tester cycles VBus. c) The Tester sends a Source Capabilities message to the UUT. d) Upon receipt of a Request message from the UUT, the Tester replies with a GoodCRC message. e) The Tester sends a GetSinkCap message to the UUT. f) If a SoftReset is not received within 15 ms after the GetSinkCap EOP was sent, the test fails. g) If a SoftReset is received timely, the Tester replies with an Accept message. h) The Tester sends Source Capabilities message to the UUT repeatedly until nCapsCount reached or a GoodCRC is received. If nCapsCount reached, the test fails. i) If a Request is not received timely within 30 ms after the GoodCRC EOP corresponding to Source Capabilities message was received, the test fails. Signed-off-by: Badhri Jagan Sridharan --- drivers/usb/typec/tcpm/tcpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 0afd8ef692e8..b3e07d9b7597 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -2243,6 +2243,7 @@ static void tcpm_pd_data_request(struct tcpm_port *port, * handled. */ port->ams = POWER_NEGOTIATION; + port->in_ams = true; tcpm_set_state(port, SNK_NEGOTIATE_CAPABILITIES, 0); } else { if (port->ams == GET_SOURCE_CAPABILITIES) -- 2.30.0.365.g02bc693789-goog