From patchwork Sun Jan 21 20:41:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Christian A. Ehrhardt" X-Patchwork-Id: 19219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2232939dyb; Sun, 21 Jan 2024 12:42:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IETZTYd8MqaqgoFTO4tnr1ltBOaZ+l5C8Uubsgyd09/Bx67rgyGwfECA56TtNzPzMQ4rbI2 X-Received: by 2002:a05:6a00:2e24:b0:6d9:87a9:8d21 with SMTP id fc36-20020a056a002e2400b006d987a98d21mr5247277pfb.44.1705869741942; Sun, 21 Jan 2024 12:42:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705869741; cv=pass; d=google.com; s=arc-20160816; b=EXZzxE+I7+ZXw8EfBimr8u6y+go+Hh693FsICACwlIwocS+L0NblnOZDsVh1iO/zp9 UsZiXb3kpBbsoZLAEBGwFDnD8xLNKMXjpYVQfsVocI+1ng95yKQg/90gY0eFv4nsKIb5 RRKqoC1hqC29Y4qWmlhA5GQxcK84liLBpPDeA0iep+hZyCXCuGZSPRLilJ2iA6S9n6g9 ZkSuhg51IoRxlCRVBAAT4i2H4jvfn7nGEuk4uL7az5+HA4bMv8SIyn/VWvKAMXQ6TSkm HMuwtNpMXL4UqR2Id/zTAF2G3+431gz/cDsBGHYvraHVbFe+x0wBiJkqXaHWae5WuaDh AYoA== 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:message-id:date:subject:cc:to :from; bh=x6ahsrJKRgyGRx2Q5qS8R9hqphG3/Ozc+FINaMVYqiw=; fh=PBT+T+L/Wk7fQyAuF/ivTwxWqTQzcP6BniPDJctp9Xs=; b=ufJPMe3jZXytl33jesCQ6SjDG0ifEMgwxLstFpMi5J5Z8H+5MCpyD4JzD4Sg/cmEpU Qv4gHr77CMpq50A0SgcTJSiesV++XrcM8mG9ersDlI9kxkkjtAA9F3IFUxGuOlOj8FNM 2BuJBPNhuVX736ddyM+zj+T8wmsboKBbbMxBkJuFYl1hYyW4bV+pucCrZ6zqDliFatrJ mEfH7+StVeOsjdp6k3/P5WAK+QDsetpdQIb/aD/KWqJr9RmzAlAQXUGhT8EJnS6K9zRJ ptRh4fTcICdUdULqkQrjduJ0rOC+QwMdSlnKB8Zug9U8yEhBdPEnHB3pGm1rvIYzmpKU BTyw== 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-32184-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32184-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id cm15-20020a056a00338f00b006dbd72af7aasi1958991pfb.194.2024.01.21.12.42.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 12:42:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32184-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=c--e.de); spf=pass (google.com: domain of linux-kernel+bounces-32184-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32184-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D11F3B218C6 for ; Sun, 21 Jan 2024 20:42:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E591738DF1; Sun, 21 Jan 2024 20:41:43 +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 55CC0381A9; Sun, 21 Jan 2024 20:41:38 +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=1705869702; cv=none; b=pzZJ8DUXSKeM2a1K3SVm2nMEevWEB1StrXB8wjLti3pAZpNfttKtf2bx0a9uKauiZcFWpzar6uUHjKR8iX2W4csgjCBBNVH2wO8eFvZXjbh8Qd94g/iaSo+omOXaSLzQV5vbGiK82LsQtyP32M3kCGOQIY9ccJDyl63XPtriXnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705869702; c=relaxed/simple; bh=A1sAifn2sBFzYOkWtoxj0vCZieiNpW4Rdqd4QI70m+E=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=l97Vdgn7WQ5ECaM2ovzuln5+6TmLHFJ4GQGLeM0WGOeEinW8bx94rsuJl6BtvtnSUoL58epl6MQ7GDF7LTmeoYBll9JWm8FhkZ8bIHGltJqEWlHBqTGaBMURBBv7QUspfhrDSs/rN4P0ldWIIg0p/dk+saNMUa86Db8AxE+yW64= 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 1D1C01401CF; Sun, 21 Jan 2024 21:41:37 +0100 (CET) From: "Christian A. Ehrhardt" To: Heikki Krogerus , linux-usb@vger.kernel.org Cc: "Christian A. Ehrhardt" , Dell.Client.Kernel@dell.com, Greg Kroah-Hartman , Neil Armstrong , Hans de Goede , Jack Pham , Fabrice Gasnier , =?utf-8?q?Samuel_=C4=8Cavoj?= , linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] UCSI fixes Date: Sun, 21 Jan 2024 21:41:20 +0100 Message-Id: <20240121204123.275441-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788734070484496774 X-GMAIL-MSGID: 1788734070484496774 This small series contains two general bugfixes to ucsi_acpi and a quirk to make the UCSI controller on various Dell laptops work. The changes can be applied idependently but all three are required to fix the Dell issues. For details on the general bugfixes please refer to the individual commit messages. The UCSI interface on a Dell Latitude 5431 stops working after the first async event with: GET_CONNECTOR_STATUS failed (-110) The core problem is that when sending the ACK_CC_CI command to clear the connector status changed condition the PPM expects us to send anothr ack for the command completion condition. However, the UCSI spec states that no ack for the command completion is required when the command is ACK_CC_CI (or PPM_RESET). There are various reports that suggest that several Dell laptops are affected by this problem. E.g. the kernel bugzilla has this report which is most likely an instance of this bug: https://bugzilla.kernel.org/show_bug.cgi?id=216426 This led me to the somewhat bold conclusion that the quirk should probably be applied to on Dell systems. To mitigate potential problems from this dell quirk includes a probe mechanism that detect the need for the quirk once and we only deviate from the UCSI spec if the quirk is actually required. Changes in v3 from v2: - Add an info message if the quirk is enabled. - Fix checkpatch errors etc. - Add Fixes: and CC: stable. Changes in v2 from v1: - Add a second general bugfix. - Remove module parmater and generic quirk infrastructure. - Implement quirk directly in ucsi_acpi.c - Add probe logic to reliably detect the need for the quirk Christian A. Ehrhardt (3): usb: ucsi: Add missing ppm_lock usb: ucsi_acpi: Fix command completion handling usb: ucsi_acpi: Quirk to ack a connector change ack cmd drivers/usb/typec/ucsi/ucsi.c | 2 + drivers/usb/typec/ucsi/ucsi_acpi.c | 86 +++++++++++++++++++++++++++--- 2 files changed, 81 insertions(+), 7 deletions(-)