Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2277961pxy; Tue, 3 Aug 2021 02:15:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGcFFDR29ZgUCXUHkPKsIKzbprgUULv4t/KFZIvEOWaqDV0k6lUkW3Am9zrRwQVQVGU1g+ X-Received: by 2002:a5d:974f:: with SMTP id c15mr348766ioo.190.1627982130870; Tue, 03 Aug 2021 02:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627982130; cv=none; d=google.com; s=arc-20160816; b=Rud450MAkUXAaL3qB2+857yGxYiscL6KqvgQ+wXuJVhKsrmOETePm+r4MA6JfsLAUF WlsFkWMC3d4mBWK1Z3Ggy2yhnwuvNnG+ppUftI7KxNnKpZleuwkvQQKAXPrciWEgFZbt 73DHwppJfUeYEFeEUUQWnFxIpkJjf+e02uEDBYc34CbbVjlmUpSNDjjTHQ81GItjS36P 1C+IifQWORG8mvrjE81LzTt/2+9XOA+uWHvObH/5FhxQauRcrqbMQy39oRMYvowOaePj sCzKR38J30Qfjy9DH6O0zbgFlJAL/zwDUtvuMF6dwqeGby39NYCKmUt52aq67PaeRFC+ d09g== 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 :dkim-signature; bh=EyxbSnCrZkW0D1s78hoRTHvz/RIPrLxVkHp3d0qMYgk=; b=vOWXH5/NP3AoU3p0e+LU2XEBZb6zmMrtWD+K3RUbDZPCdTMX7Jb2N6WQUzrgcNAnw1 MyAdjFvaODVRqFfOj3+HwpmxOvgCJZwDRS4wJlitbeUKlA2UOE/YYC7j+3ueZLmWO72w vxvTwpKlWCUvSr32mJqtX5H1+xHUNTFqkAKbK1QRP0DqdnuJvyZ5xXiM2QydzzqPCG0u yyAHIKm2/w86iHzguf5/U4IY5EHGUO1Ifpd3bpLT9r8ODD3+8OhxGmFgnVo+Pt4UWV/f t2v5NH6fJHQmQAR4qLJQXP+08IfUKXjPWOlr5gmNe2MsICzD3vrI884nbfDcSOFga6CO K4Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Tip0r9HZ; 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 h2si15325958ils.86.2021.08.03.02.15.18; Tue, 03 Aug 2021 02:15:30 -0700 (PDT) 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=Tip0r9HZ; 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 S234709AbhHCJNg (ORCPT + 99 others); Tue, 3 Aug 2021 05:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234805AbhHCJNc (ORCPT ); Tue, 3 Aug 2021 05:13:32 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2901BC06175F for ; Tue, 3 Aug 2021 02:13:21 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id b9-20020a5b07890000b0290558245b7eabso22224749ybq.10 for ; Tue, 03 Aug 2021 02:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=EyxbSnCrZkW0D1s78hoRTHvz/RIPrLxVkHp3d0qMYgk=; b=Tip0r9HZ671jd/AbUl0qtLrYjIM8OpobmN6ubxWvSCfyGqfVj22QX+PlODtilbf1n0 tS9OXdzgxqqXTdXvYtJUMtktil0qOkeVid1+sQnY8w2rTdIR+PvU7xBi3l31o+xQ4Pu2 L3rJX0F4oPLugu8oRh6XDu7jc1w7261jW5FNlSdPxhS1sxsnGTSMFH4A5jywV3Wt7EUA KIsOUF2xY+EGNsD/gEJxs63Vcrah1/pfwYa1KpkHVri9QMsI13spa60/drhxx+r54oEB AEvLFKbn/NNAG1/mAwoCj0rmmeYXllnxNibL+wg3rPSh/bwzwGuF1f/y9gyrJ37VQ1Dk SZsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=EyxbSnCrZkW0D1s78hoRTHvz/RIPrLxVkHp3d0qMYgk=; b=boPilbAMHiVgdw94wXPHT90FL679d6dJMly9UyrlONwm6y/J5Kfaax0xKfvP/cBZRq ysmkD9qPTxInfiCgaDyIetzT9s1FdKleLzHDgKxCN+ajlvOAh85yXBeJ8cR/5hYBwT2e CbioriQlJi4/+h4UviBH+bbdXT8sUTHeBplpPg7UN17FZKgZo+DZruxNiHP/w2VM2iud 3Ha7Qocvku08ryxi1v87vBUPjj/migh6OaPe02hhv4brHSmqlNPm1pkEVtIE6oPokBKu JEW1Z0cw6/ulqAsYlFtjSzCSRls9S2WtoKv8BJLJlPHjI8L3817I2c0gDuyTYwxMqtga STCg== X-Gm-Message-State: AOAM530ewEz68y+FV2dxZIah4um4OrZLRtoNaXLBd6sMyLbfPXZReE34 f/uQgwt0XvkS4c3k8SiQTwuUt3cla9pG X-Received: from kyletso.ntc.corp.google.com ([2401:fa00:fc:202:2c1f:318f:d55f:e51b]) (user=kyletso job=sendgmr) by 2002:a5b:58e:: with SMTP id l14mr27198466ybp.143.1627982000390; Tue, 03 Aug 2021 02:13:20 -0700 (PDT) Date: Tue, 3 Aug 2021 17:13:14 +0800 Message-Id: <20210803091314.3051302-1-kyletso@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [PATCH] usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events From: Kyle Tso To: linux@roeck-us.net, heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org Cc: badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Kyle Tso Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When receiving FRS and Sourcing_Vbus events from low-level drivers, keep other events which come a bit earlier so that they will not be ignored in the event handler. Fixes: 8dc4bd073663 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)") Cc: Badhri Jagan Sridharan Signed-off-by: Kyle Tso --- drivers/usb/typec/tcpm/tcpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 5b22a1c931a9..b9bb63d749ec 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -5369,7 +5369,7 @@ EXPORT_SYMBOL_GPL(tcpm_pd_hard_reset); void tcpm_sink_frs(struct tcpm_port *port) { spin_lock(&port->pd_event_lock); - port->pd_events = TCPM_FRS_EVENT; + port->pd_events |= TCPM_FRS_EVENT; spin_unlock(&port->pd_event_lock); kthread_queue_work(port->wq, &port->event_work); } @@ -5378,7 +5378,7 @@ EXPORT_SYMBOL_GPL(tcpm_sink_frs); void tcpm_sourcing_vbus(struct tcpm_port *port) { spin_lock(&port->pd_event_lock); - port->pd_events = TCPM_SOURCING_VBUS; + port->pd_events |= TCPM_SOURCING_VBUS; spin_unlock(&port->pd_event_lock); kthread_queue_work(port->wq, &port->event_work); } -- 2.32.0.554.ge1b32706d8-goog