From patchwork Wed Mar 20 07:39:24 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: 781500 Received: from cae.in-ulm.de (cae.in-ulm.de [217.10.14.231]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFAE722093; Wed, 20 Mar 2024 07:40:11 +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=1710920416; cv=none; b=pDoe6djHr6jy2iYJQM2AzFcJhDmuhXzSGMKBxk++NR+tc3nGGbzX8Wblt+A3DUOQHoZdaY8nCIFVB23Pkzj81yPZfqf9Ktx0I1UfoBqQLq6OEQklSMzzU57IvllNTlTezioA3FmZwE5cD3rtP2J2/zfY8iWSTOOT12SejoKD3D4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710920416; c=relaxed/simple; bh=TAgwJX9EFPn204jUDPo3aVHiPhT8JDQjDPaFSAM31yg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TEo2LvN83aSV6YO2/C9d+c1U8UrNIe9OkloaKtLRMm3EmAITCYgr+Q1uY9yWD/DZiKvuEmZz6iRsuQVNQWdInEjdHjbzFeiq/jomE2bxsI7fQy9TWrpAPpQ9vbQYbv5xIITd+J2XnYenByAlISOZvy8112nnYtW7pqFVM7nx6F8= 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 DF060140928; Wed, 20 Mar 2024 08:40:09 +0100 (CET) From: "Christian A. Ehrhardt" To: linux-kernel@vger.kernel.org Cc: "Christian A. Ehrhardt" , Heikki Krogerus , Greg Kroah-Hartman , Prashant Malani , Jameson Thies , Abhishek Pandit-Subedi , Neil Armstrong , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , =?utf-8?q?Samuel_=C4=8Cavoj?= , linux-usb@vger.kernel.org, Kenneth Crudup Subject: [PATCH 3/5] usb: typec: ucsi: Ack unsupported commands Date: Wed, 20 Mar 2024 08:39:24 +0100 Message-Id: <20240320073927.1641788-4-lk@c--e.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240320073927.1641788-1-lk@c--e.de> References: <20240320073927.1641788-1-lk@c--e.de> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If a command completes the OPM must send an ack. This applies to unsupported commands, too. Send the required ACK for unsupported commands. Signed-off-by: Christian A. Ehrhardt Reviewed-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index dceeed207569..63f340dbd867 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -151,8 +151,12 @@ static int ucsi_exec_command(struct ucsi *ucsi, u64 cmd) if (!(cci & UCSI_CCI_COMMAND_COMPLETE)) return -EIO; - if (cci & UCSI_CCI_NOT_SUPPORTED) + if (cci & UCSI_CCI_NOT_SUPPORTED) { + if (ucsi_acknowledge_command(ucsi) < 0) + dev_err(ucsi->dev, + "ACK of unsupported command failed\n"); return -EOPNOTSUPP; + } if (cci & UCSI_CCI_ERROR) { if (cmd == UCSI_GET_ERROR_STATUS)