Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3765687pxt; Tue, 10 Aug 2021 10:48:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEv/TYgJeUsFVROUsqCNS+xGMPcPP8KB28vSN/yu9Ue/gYStCUy8sTrrMPgEDbZMZJRlR2 X-Received: by 2002:a17:906:7191:: with SMTP id h17mr29342809ejk.330.1628617712563; Tue, 10 Aug 2021 10:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617712; cv=none; d=google.com; s=arc-20160816; b=ofZw7YlfzMJXshq72kPXjr6FcUugu83MsV3QnoL70JcWY2VwZLhcvg7fWmdPkgAoyD iUESDi0asaAwrn2oojdfxO+mIHouwpRCw/pw/VAKQv+goHwX2MU7gowN+NUK6HjSMfdS FAchpvSSkX3T3tY/wIAE9mMmjw5lyIHmJg76OtleSHCDthwfIGm4Pa3DveTuKclpitdD IOJpCTccjZiv94jmcxpuvRFrsv6nYOjZmnR92uRLTRYCfzheu2FAX9ftVtF0kY7+Ojs7 ls2ciSpyUyj3KBcUDS9QEeLM9g9BhaFtmL8/1veex/tB0IrBBu0i3SQQKOc1yHEn0gBM 3WTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=A2+0jq8Ml052Prc2vOLaTnUYnSjR6uOW9uqdqISB8bk=; b=0doPiNyWVkCqWtPz3g6u7k+WWs819NAp6fshr6YbPVdL9BX3vuem262mq/kl3KftZc VC5aLSf+Pa3YRjRz1nMv8+jISyNxUQFFTCj0Cj9u+Nca/iTdmIGlcpqHdYKGt+7INdjC Q8L6ApxeQYYOx9V+u9RnKbDjE1C7zBlg7NdCI2VqG9AEOz2KszazAmBlNfMZsNdRTNf7 dK4dRYbZ1K09ZB1fmR3OU6DZGeuvWjdI/C0gz6OnCd3wuTs93/+E3HR52d3mKhRpx8GK kLukUKTpANfQdSUQYORxUWY6nsQ7jzBxy/mrLOw5XpxADWPsnB4unui2Bk7VOR93qvzh pMug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kGGu0jMP; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr12si24079701ejc.464.2021.08.10.10.48.08; Tue, 10 Aug 2021 10:48:32 -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=@linuxfoundation.org header.s=korg header.b=kGGu0jMP; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232331AbhHJRrK (ORCPT + 99 others); Tue, 10 Aug 2021 13:47:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:38076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236136AbhHJRoc (ORCPT ); Tue, 10 Aug 2021 13:44:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8140A610A0; Tue, 10 Aug 2021 17:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617176; bh=kZhnoqq0lOs/n/AkRcgA4EmH5PJ3/PgnMkbxD7CHxgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kGGu0jMPUZVDUoRKvMEWRXQXfSIdVjqhNoGXtDGBdpZKxeLFh18WXhb/YAS0uSGyg qyzt+zyfqUmmAIYUVNwvBNAD+qpIx+uS56UY/zhTH1g+ocwnB8Y/JqOuow3Aqx/nBd 6s6Jt4fQogfvJIT3N7ev4RNkvmjz3JmIzm6aZL40= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Badhri Jagan Sridharan , Guenter Roeck , Kyle Tso Subject: [PATCH 5.10 071/135] usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events Date: Tue, 10 Aug 2021 19:30:05 +0200 Message-Id: <20210810172958.141122822@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kyle Tso commit 43ad944cd73f2360ec8ff31d29ea44830b3119af upstream. 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: stable Cc: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck Reviewed-by: Badhri Jagan Sridharan Signed-off-by: Kyle Tso Link: https://lore.kernel.org/r/20210803091314.3051302-1-kyletso@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/tcpm/tcpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -4314,7 +4314,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); } @@ -4323,7 +4323,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); }