Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7838279rdb; Thu, 4 Jan 2024 09:09:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOyLSKDkammoSAP+XWlNbu+jnwTx6JXkGJiohJJ0zSpW6WmXTEidGkrbXUV3ExI1it5Ph6 X-Received: by 2002:a05:6a20:7490:b0:190:8f32:7899 with SMTP id p16-20020a056a20749000b001908f327899mr918010pzd.18.1704388155027; Thu, 04 Jan 2024 09:09:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704388155; cv=none; d=google.com; s=arc-20160816; b=mCVxLF1P79Ey/y3g/NWch5zENGPXEK4zWTmyJdUcpy77rnIphWawRIMvLvosdRd+WI ZiC8QZy9wgW8dKXhuPYxctDW5CY1ye6NsRaPnMk4JuwNnKkPNXv3ladnavrSyN0q+P1o qCxhmTSbktW/Wewzm+f7iuJPtyDWx7p06+4mDNmPrHO7uGz/QEhH37feP8Glh/IPkmA9 05Qa5EyTXuQtfjQmrrcS0naULASQ8r4F5jisbGmu3zHRVUsKXJo2t2mFL6XMNXkKeA7B OnWU9RPnYB5J07lvNMkJLEZn6TJkCe9dlrQxuhkuFUlNzjo9IrLyGzSi+M6VtmIqNJ3W VHug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=epC5BWFx7EFWdcMl9iEwQgp2N8CIY4VvaPoIBbm4N/g=; fh=tKKHykgrDQYCqQF5PMFZHHDJLIP5bT6W4QnKalg1XBg=; b=ZynBBiKy97wtGXFqeUWh6hwV+ifWljX7WyY1vWCViZiAKpN5CtAa9zISYHCl/pmjys oCAmV78A0WMAroeQRwS1DURkAjGx7z+fLRIMyyEk+EN6bxqO/Rf92S/GFAzv8Nuryf+Q HNiAih1nBV2r/bYwMoCLETSFZNYA1QMqfs/nSp89Bixh7dPyiGZKk7OowHf6+UsS88db 6rK1nhboZut6rnfYVvuj7XGJU6xTn3jLZKyQmspz3x5SRmG3NaEB2nWxj906P/ZtyCZu ovQBamBovif300NCPZ6GCERL+hnEvrlYLeSJf+GNqsl7f5qAVxo1eQfdc10L5xttpI7z R3WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HPcxO3yM; spf=pass (google.com: domain of linux-kernel+bounces-16987-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fc19-20020a056a002e1300b006daa9f122d0si4560710pfb.332.2024.01.04.09.09.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:09:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16987-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HPcxO3yM; spf=pass (google.com: domain of linux-kernel+bounces-16987-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AC38E283446 for ; Thu, 4 Jan 2024 17:09:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A08E42557A; Thu, 4 Jan 2024 17:09:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HPcxO3yM" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D3F7825568; Thu, 4 Jan 2024 17:09:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41E46C433C7; Thu, 4 Jan 2024 17:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704388144; bh=RWeAVVvZw1mx2BvGayUBS6umOxU8tPTVMM+VecJn/f8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HPcxO3yMF3LAMwce01ASv+HwPrY6kxiRVKzBS1WDDfGH4hfeIaJwmR8OsadaPgI+q QOUuo6L0QiaDmKaFgIzixHb4rGQY2OLcVMpdHSVSNOtxTMeeqw3c7Ivs6LXHNqPwTD PgMzUiD+Pp/r/5exuDJyKI5s8fvXJy+BSB2KqspKzKTYzYTb0mqPYOKG5aPdV6OcCI XbSNeR1xlNpU82dXUZRMygcOd4KqzAjbeRj6ZTOGJD5FZ12rEsBq6n9vdTz4oxocSk jo5XHUncegf+8c0b7f2cxzV0k0qmTCOZoSBEjuDNeEVQK4eUq7A+i/ufwCtlMP5N6d Cfsfs67PvbVag== Message-ID: <5ed7ee66-ad7f-43ce-8550-a1a671cce9ad@kernel.org> Date: Thu, 4 Jan 2024 19:08:59 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/4] usb: typec: tipd: add patch update support for tps6598x Content-Language: en-US To: Javier Carrasco , Jai Luthra , Greg Kroah-Hartman Cc: Heikki Krogerus , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, vigneshr@ti.com, d-gole@ti.com, nm@ti.com References: <20231207-tps6598x_update-v2-0-f3cfcde6d890@wolfvision.net> <2nqiaxakx6setx4tzgddnbjadbh7miegz5p6wamsbbiyrfuq3x@un2uxajbswkg> From: Roger Quadros In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/01/2024 18:36, Javier Carrasco wrote: > On 04.01.24 17:15, Roger Quadros wrote: >> >> >> On 04/01/2024 17:47, Jai Luthra wrote: >>> Hi Javier, >>> The following change seems to fix boot on SK-AM62A without reverting >>> this whole series: >>> >>> ------------------ >>> >>> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c >>> index a956eb976906a5..8ba2aa05db519b 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[] = { >>> >>> ------------------ >>> >>> I am not an expert on this, will let you/others decide on what should be >>> the correct way to reset TPS6598x for patching without breaking this SK. >>> >>> >> >> This looks like a correct fix to me. >> Could you please send a proper PATCH with Fixes tag? Thanks! >> > Hi Roger, > > that fix only removes the reset function and does nothing instead, but > the reset call is identical for both devices (hence why there was a > single function for both devices). As I mentioned in my reply to Jai This is incorrect. Look at the original code, the GAID command is issued only if it is a tps25750 device. Below is your part of the code that replaces it with reset() ops. > @@ -1340,8 +1360,8 @@ static int tps6598x_probe(struct i2c_client *client) > tps6598x_write64(tps, TPS_REG_INT_MASK1, 0); > err_reset_controller: > /* Reset PD controller to remove any applied patch */ > - if (is_tps25750) > - tps6598x_exec_cmd_tmo(tps, "GAID", 0, NULL, 0, NULL, 2000, 0); > + tps->data->reset(tps); > + > return ret; > } which means the GAID command will be executed for both tps25750 and tps6598x as you have a single reset function for both. This is a problem for boards using the tps6598x. -- cheers, -roger