From patchwork Fri Jan 5 09:06:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jai Luthra X-Patchwork-Id: 185312 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6107326dyb; Fri, 5 Jan 2024 01:10:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXmoE9xXyEPOWs0s8xyOPVbznuTHcQpFdd0c1H4yLzg9yuysBSbrGjjiomhJK7R8cL1mNh X-Received: by 2002:a05:6e02:214c:b0:35f:f383:ac7b with SMTP id d12-20020a056e02214c00b0035ff383ac7bmr2137763ilv.16.1704445841223; Fri, 05 Jan 2024 01:10:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704445841; cv=none; d=google.com; s=arc-20160816; b=jHaW+qn7RsMM6fnp/ybh2wMfCNiVhiUqDNs0yd2eKpR6z24YR6ZFHVFGiPrBb8AKz2 ChwmuAf9KhtFuVJLPpxOq07+p5+Y5mzB0N4V3D4VGbIP1qG0eDXu0dtcIs23BjO0asV6 q60Y7HvouUivV20kmpTD0I3U46F+nCg83T29rXa9TA4QcmFnY5rM15hVWZFjptqzkyFg g8vsmTR4qMCPJNrKk8NVg4zolQckGxi2OJuMUyVbU5xbVu2SSz3MMW8Rovzmkb9pDR62 i59ER+Q0fL/7XwfHhHbk914Qn/W/tg9ojXA87A6JzmEIU93IdBOB3M06ftJgtSSECbVD ZmtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=z5vei7JlMzAa/jduUZEH+hGUqRGDx7E6gpd6wWEU6+Y=; fh=u3pCEbqOySYhS+ZSBYlW1uHrsLqSUXf81cy2f5J0m3A=; b=ZceIxJwVA64YSccKPImReWBtgocxMqNKUylZutlrO1iAGLQUMQdbLcgtTyLrYGLXbD f4E6p/F2ptTEZxcXHpsGVyV+4ARj92nYl6AUcZI7hQE7Hf4P8JjX/tYBvDAgw0tuG56T xUdUt+HwdfHSusQ1uCnrk0BeC2s9wVWc0Sn4gNtXAi/qT78kjaaoF445K0Z26ckcRsk+ xfthJROs7bxrv+zuf2ruFC8zKEXlL3zEaZsyWipq57TqA/hjBpGkTdrpcwSQQNwXGMRa DrX5tVOd7WJF7bY7kwDaOVSwbAvIn8yvYykW0RUBM9G83ArNVsBzg/rhIiBU+a+homhU HudA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Ii+DeqnH; spf=pass (google.com: domain of linux-kernel+bounces-17648-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17648-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bi8-20020a056a02024800b005cdffc2828esi1024315pgb.182.2024.01.05.01.10.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 01:10:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17648-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Ii+DeqnH; spf=pass (google.com: domain of linux-kernel+bounces-17648-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17648-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com 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 E43D2B24708 for ; Fri, 5 Jan 2024 09:10:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D88B9241F4; Fri, 5 Jan 2024 09:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="Ii+DeqnH" X-Original-To: linux-kernel@vger.kernel.org Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CC0A22EE6; Fri, 5 Jan 2024 09:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 405999iH007188; Fri, 5 Jan 2024 03:09:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1704445749; bh=z5vei7JlMzAa/jduUZEH+hGUqRGDx7E6gpd6wWEU6+Y=; h=From:Date:Subject:To:CC; b=Ii+DeqnHilv1oFkT3oYLRPOf2LzgbQkKXvrbI+LlosQq31Bjzdt3fho0Z87FLCLl4 sf9QuEVqQGi6M5b00RqF84Pz9D+TR3YJ1D+Bsq2zSJMs3yh7JjreY9LBO3aAMrkWLG sRGlb2rxqfvx0MdplyHfkre7VScfsjqrSA8JNFcs= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4059998I064077 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Jan 2024 03:09:09 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 5 Jan 2024 03:09:09 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 5 Jan 2024 03:09:09 -0600 Received: from localhost ([10.249.131.210]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 405998dW034337; Fri, 5 Jan 2024 03:09:08 -0600 From: Jai Luthra Date: Fri, 5 Jan 2024 14:36:54 +0530 Subject: [PATCH] usb: typec: tipd: Separate reset for TPS6598x Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240105-next-tps-fix-v1-1-158cabaec168@ti.com> X-B4-Tracking: v=1; b=H4sIAK3Gl2UC/x2MQQqAIBAAvyJ7bkHFDvaV6FC61V5MVEIQ/550n IGZBpkSU4ZFNEj0cuYnDFCTAHfv4SJkPxi01EYqOWOgWrDEjCdXtNKQt/pwyjkYSUw09L9bt94 /ISpihF4AAAA= To: Heikki Krogerus , Greg Kroah-Hartman , Javier Carrasco CC: , , , , , , Jai Luthra X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1839; i=j-luthra@ti.com; h=from:subject:message-id; bh=Z8O96E6ST2XTkcI+vrlIMRUkybW9YQ0pWHAzEcvC6XU=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBll8cyHksr3aAh4XZyshxl0tzvJE/F/cb8WuPoi JRe6uQdsF2JAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZZfHMgAKCRBD3pH5JJpx RVnMD/9y/zHVem29SzahsNwxmycKd7H9EsUBE7K7DyQXCvI0FqIU2fgoYk61YnTf8ub8jKZgMDs 1RkuUhbGUue06GinURDRmmk6cuD7db5q4Y85uXwGm/iktSLJlKRQ9BmSSCyn6/pUiHnUg2KXrWy TYqfEEGsa9LK7Q5XC2hANHAhuUczWvuVMtF7XHE3yVFZ7gR9ntKV0dtr9hu8UHOxu3/losGyAxn nMuCt7jNHaqXZEXpJBhZrjr/Q6H+cel22WukcSybS32emz14yeR+bhLutwZmuApVpvVaAc1S4Ux I5oePPJvCX7CwVUQmQ2j6DJa9BaAV4Dm8FJwGH/SVL2cwzFOtd5FC01YuUBR9OkPvU+4bEEEZ9L 2bz4cQmv2d4HW4ks9HWQFll/3gtAjOGwkPlfL7A/carDjvxvr4hG2IAc+zmzHPJd9QEEefgvV6T aEiNKcVH4VTVIANz5f+edG8o4uCs18qRm5P0VbIC8U+eN8uvy4JIVXW9dwV90Kt9ziFOiuEiHn9 Tl4akC9xJQYBO2ty+vgzsqy+mS0K57dJEulwwePYZ4wr+qTx+Qr3IX9iu+zPPHLZ5+lF3JDgtih RqumgHQjK2OngyDx1bQ0hVJKrXHHf1Isr1cE4V+agexA90FPpfDhV0MYg/EXMncdnmJ02LhM4xq RV6cUpp02dANuNA== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787241002319756087 X-GMAIL-MSGID: 1787241002319756087 Some platforms like SK-AM62, SK-AM62A cannot boot up to prompt if TPS6598x is cold-reset during unconditionally on probe failures by sending "GAID" sequence. The probe can fail initially because USB0 remote-endpoint may not be probed yet, which defines the usb-role-switch property. Fixes: d49f90822015 ("usb: typec: tipd: add init and reset functions to tipd_data") Closes: https://lore.kernel.org/linux-usb/vmngazj6si7xxss7txenezkcukqje2glhvvs7ipdcx3vjiqvlk@ohmmhhhlryws/ Signed-off-by: Jai Luthra Reviewed-by: Roger Quadros Reviewed-by: Heikki Krogerus --- Boot-logs with this patch applied: https://gist.github.com/jailuthra/b66d5722090ce1fbc2886986e53640f7 --- drivers/usb/typec/tipd/core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- base-commit: e2425464bc87159274879ab30f9d4fe624b9fcd2 change-id: 20240105-next-tps-fix-904ed92bc1cc Best regards, diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index a956eb976906..8ba2aa05db51 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -1223,11 +1223,16 @@ static int cd321x_reset(struct tps6598x *tps) return 0; } -static int tps6598x_reset(struct tps6598x *tps) +static int tps25750_reset(struct tps6598x *tps) { return tps6598x_exec_cmd_tmo(tps, "GAID", 0, NULL, 0, NULL, 2000, 0); } +static int tps6598x_reset(struct tps6598x *tps) +{ + return 0; +} + static int tps25750_register_port(struct tps6598x *tps, struct fwnode_handle *fwnode) { @@ -1545,7 +1550,7 @@ static const struct tipd_data tps25750_data = { .trace_status = trace_tps25750_status, .apply_patch = tps25750_apply_patch, .init = tps25750_init, - .reset = tps6598x_reset, + .reset = tps25750_reset, }; static const struct of_device_id tps6598x_of_match[] = {