Message ID | 20240121204123.275441-2-lk@c--e.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-32185-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2232937dyb; Sun, 21 Jan 2024 12:42:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAxH2RC3kMqN74IxKNtV5EwHJSd/yBF15jy6ffSI6GSs/2dn8KsIkBLozLUjFHBv3R3ykh X-Received: by 2002:a50:e709:0:b0:557:6401:e7c with SMTP id a9-20020a50e709000000b0055764010e7cmr1459633edn.18.1705869740623; Sun, 21 Jan 2024 12:42:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705869740; cv=pass; d=google.com; s=arc-20160816; b=An8UB7f5KCkDbnza8jp2tjW1OlqdKj/BTsljUFPLOLLxbckg/kZs6N7+bpyev3ShmR 2/gXJTyGy/j5t93de/c3pXRzyayKuE5NKO8kValchakRxzn7mWFR5rd2lNEax7/DxTb5 sGSEosAmaxrgZDAeELhI/sYLSFf+1Nq5Fnp0yTlsJCBWVOCGW7jjiR9NJc/AcogBHbYa si+qOKUhLjPmz7bpsawIdW5KxMinDWvsbjHv2NeolFcXLDQrPoN6ulO/41aFffcsgnEP M/BkyO8AlG2JZjuazHp0s/TUp6yAOqhZ91NwfxDRNkrqWGRQgc2r93Ywb04Y8Cz9ejkW Vpsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=SlG74RdWxXgmYtbRkC8NFJH0OPW+2aFWMX4TfDW74is=; fh=PBT+T+L/Wk7fQyAuF/ivTwxWqTQzcP6BniPDJctp9Xs=; b=zrfkyQyFuVdRbmqDvnyfIdggk6yh2gdcDddeGg0rffNs7+mbRpapiZGtkcihfHXmlG EpaCkohzPfBs6cS4jKeSYauglo+x8Jsy5dmhEJfOO6F1Nd3i9q0J2iW6etT0rLf0KkbR nqfNAii5MQSFupHMSonSmBRacnWb9u+LMrLQTCbCC4b+yxw2BlaxVS/Opti7yZNwLFZq 2/Iowlog5Y1YaXpn6KTJzXYWQY7eJOdJOiAQWOCpSiKa/lkAS5YZPvf+VVJD42vqHLJB REC1CtwjsR0XNL7nFewAM0QoTcw/DhOrCQuRaWziFz2mdmWS3ROZ3o10F0b+KE/UNI3y DqQw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=c--e.de); spf=pass (google.com: domain of linux-kernel+bounces-32185-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32185-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bl14-20020a056402210e00b0055c3454272dsi478839edb.647.2024.01.21.12.42.20 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 12:42:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32185-ouuuleilei=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; arc=pass (i=1 spf=pass spfdomain=c--e.de); spf=pass (google.com: domain of linux-kernel+bounces-32185-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32185-ouuuleilei=gmail.com@vger.kernel.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 365A01F219DD for <ouuuleilei@gmail.com>; Sun, 21 Jan 2024 20:42:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A88F38F9B; Sun, 21 Jan 2024 20:41:45 +0000 (UTC) Received: from cae.in-ulm.de (cae.in-ulm.de [217.10.14.231]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96DAD381AC; Sun, 21 Jan 2024 20:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.14.231 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705869703; cv=none; b=Mx53Vo0AGVJ5TRaYFW0DgLTZrDo2m6NaS+qgj8xrAoRzrdP8XQ5KLXlVbrDh8gsUDg1Jz/5beF/L983tSQQraJPwTaWY7QdODQ00fy93aeh1bFC0hggRJxQMxri3hETxO126qIP+og99sNYefIj/k3bxIwIWGhC2blL+8kKhEbE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705869703; c=relaxed/simple; bh=a74cBVmfYeJUZpWdG+gkCPScISxo1VpIOiqyEL6S6W8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UXj9FEOY6s9/E3m4XCTIWvP8LrKgzYS8/WwBwF8cVmluYdcSKXfN49mkZ1mAI75Q31GLTCmoLHyOrwbH3j79BtXqGcurKiwpDlDB7fO2wU2qkcwL2lIxnFkkTj+8ZucVihhBz63N2/2prRaHklgTUDsNh7qXf13MsqVjk/THhcs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=c--e.de; spf=pass smtp.mailfrom=c--e.de; arc=none smtp.client-ip=217.10.14.231 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=c--e.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=c--e.de Received: by cae.in-ulm.de (Postfix, from userid 1000) id 9B3C7140255; Sun, 21 Jan 2024 21:41:39 +0100 (CET) From: "Christian A. Ehrhardt" <lk@c--e.de> To: Heikki Krogerus <heikki.krogerus@linux.intel.com>, linux-usb@vger.kernel.org Cc: "Christian A. Ehrhardt" <lk@c--e.de>, Dell.Client.Kernel@dell.com, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Neil Armstrong <neil.armstrong@linaro.org>, Hans de Goede <hdegoede@redhat.com>, Jack Pham <quic_jackp@quicinc.com>, Fabrice Gasnier <fabrice.gasnier@foss.st.com>, =?utf-8?q?Samuel_=C4=8Cavoj?= <samuel@cavoj.net>, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] usb: ucsi: Add missing ppm_lock Date: Sun, 21 Jan 2024 21:41:21 +0100 Message-Id: <20240121204123.275441-2-lk@c--e.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240121204123.275441-1-lk@c--e.de> References: <20240121204123.275441-1-lk@c--e.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788734069403268085 X-GMAIL-MSGID: 1788734069403268085 |
Series |
UCSI fixes
|
|
Commit Message
Christian A. Ehrhardt
Jan. 21, 2024, 8:41 p.m. UTC
Calling ->sync_write must be done while holding the PPM lock as
the mailbox logic does not support concurrent commands.
At least since the addition of partner task this means that
ucsi_acknowledge_connector_change should be called with the
PPM lock held as it calls ->sync_write.
Thus protect the only call to ucsi_acknowledge_connector_change
with the PPM. All other calls to ->sync_write already happen
under the PPM lock.
Fixes: b9aa02ca39a4 ("usb: typec: ucsi: Add polling mechanism for partner tasks like alt mode checking")
Cc: stable@vger.kernel.org
Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
---
drivers/usb/typec/ucsi/ucsi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 61b64558f96c..8f9dff993b3d 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -935,7 +935,9 @@ static void ucsi_handle_connector_change(struct work_struct *work) clear_bit(EVENT_PENDING, &con->ucsi->flags); + mutex_lock(&ucsi->ppm_lock); ret = ucsi_acknowledge_connector_change(ucsi); + mutex_unlock(&ucsi->ppm_lock); if (ret) dev_err(ucsi->dev, "%s: ACK failed (%d)", __func__, ret);