Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7031478rdb; Wed, 3 Jan 2024 02:07:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkyBM7aA0OOd1xtuEvBtICx2pqgClsc8rGotJE6kyI8NmXMlnGrQgNbr8e9VwPlKNq/QUL X-Received: by 2002:a81:a04e:0:b0:5d7:1940:dd7e with SMTP id x75-20020a81a04e000000b005d71940dd7emr13176909ywg.84.1704276428727; Wed, 03 Jan 2024 02:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704276428; cv=none; d=google.com; s=arc-20160816; b=oMqqJJbiNEfplKQbiExa2Kf4z1qS8pmpkqc+i5HsUmK1C3pMX9TIQYJvGSSDmOQ7KV C5P5rYWTW34/E/U20cxsG/pK1crbXtmGtzFrXiWknIKMcxPNaa6L/DW+qjF9HqryTEgP Onp7USn1kutG86AVrpy6KFKfZnewHhhvMvlHUrXz3j55opU0YM2+m8st8QMpTCCwovpF +DBZ2/YBDq9PQgRn1H2os+4T8s/kgeKX6ak1XbA+RZQDz9CLlq1D8zMkxuwN1BvC+kc/ v7rmnGp9k5dBEDQogJhScOQRP0Qh50GjZgovWvCzFzz8pjAUjetzIW1bzgqlPLvpXxp5 2ssw== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from; bh=leztn7Xb4Oi3Blp8e0cSsDkYeELBbBFa4lXVbVM/yU4=; fh=tQmHdDUQIPXkQGN6zxl0sNOuD4uL5AtyiCzLaFenc5Q=; b=qAW1lz3HShZJaKmLIKaCL6Cv33PrAzvAkh86mzWjqFGvrPpN8mLfvVMfF3C79ov1p7 trksBDj/4J2BIo3YIRdS1dKsFZ89RnjOjZzxSHs9bgfJ66/Mmlvft42FOooIVz/uv+60 qhvxCLtwO5IUFQJ1Y6lZ/R+zIG7ldOVck9MoQZDfBgAjZt2won+PSR3DAz7mfVTGsUm3 ESvaLtqItzo4ZPuX9akNOKSSD4WUpVk8QJFqjVMWQ+1JavD51XLwbuQpCz5V95x3NRMG 5JcWk+kj5DxxycBBPnr8yhuvKvIztQvCCLTHpGWUAvO3Y1z5Bd0Y6BwsM5i+5QOSMaTj A3zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15372-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c17-20020ac87dd1000000b004282727f2e8si4857686qte.129.2024.01.03.02.07.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 02:07:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15372-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 782B21C22E77 for ; Wed, 3 Jan 2024 10:07:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B99D18AE6; Wed, 3 Jan 2024 10:06:58 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from cae.in-ulm.de (cae.in-ulm.de [217.10.14.231]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42D5B18632; Wed, 3 Jan 2024 10:06:51 +0000 (UTC) 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 10E881408EB; Wed, 3 Jan 2024 11:06:50 +0100 (CET) From: "Christian A. Ehrhardt" To: linux-usb@vger.kernel.org Cc: "Christian A. Ehrhardt" , Heikki Krogerus , Greg Kroah-Hartman , Neil Armstrong , Hans de Goede , Mario Limonciello , Saranya Gopal , linux-kernel@vger.kernel.org Subject: [RFC] Fix stuck UCSI controller on DELL Date: Wed, 3 Jan 2024 11:06:35 +0100 Message-Id: <20240103100635.57099-1-lk@c--e.de> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit I have a DELL Latitude 5431 where typec only works somewhat. After the first plug/unplug event the PPM seems to be stuck and commands end with a timeout (GET_CONNECTOR_STATUS failed (-110)). This patch fixes it for me but according to my reading it is in violation of the UCSI spec. On the other hand searching through the net it appears that many DELL models seem to have timeout problems with UCSI. Do we want some kind of quirk here? There does not seem to be a quirk framework for this part of the code, yet. Or is it ok to just send the additional ACK in all cases and hope that the PPM will do the right thing? regards Christian diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 61b64558f96c..65098a454f63 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -53,7 +53,10 @@ static int ucsi_acknowledge_connector_change(struct ucsi *ucsi) ctrl = UCSI_ACK_CC_CI; ctrl |= UCSI_ACK_CONNECTOR_CHANGE; - return ucsi->ops->sync_write(ucsi, UCSI_CONTROL, &ctrl, sizeof(ctrl)); + if (ucsi->ops->sync_write(ucsi, UCSI_CONTROL, &ctrl, sizeof(ctrl))) + pr_err("ACK FAILED\n"); + + return ucsi_acknowledge_command(ucsi); } static int ucsi_exec_command(struct ucsi *ucsi, u64 command); -- 2.40.1