All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Jai Luthra <j-luthra@ti.com>,
	Javier Carrasco <javier.carrasco@wolfvision.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	vigneshr@ti.com, d-gole@ti.com, nm@ti.com
Subject: Re: [PATCH v2 0/4] usb: typec: tipd: add patch update support for tps6598x
Date: Thu, 4 Jan 2024 18:15:36 +0200	[thread overview]
Message-ID: <e9e8dd9f-b11b-43fc-8d76-6734dbddb540@kernel.org> (raw)
In-Reply-To: <2nqiaxakx6setx4tzgddnbjadbh7miegz5p6wamsbbiyrfuq3x@un2uxajbswkg>



On 04/01/2024 17:47, Jai Luthra wrote:
> Hi Javier,
> 
> On Jan 04, 2024 at 19:50:05 +0530, Jai Luthra wrote:
>> Hi Javier, Greg,
>>
>> On Dec 14, 2023 at 17:29:08 +0100, Javier Carrasco wrote:
>>> This series extends the patch update mechanism to support the tps6598x.
>>>
>>> Currently there is only support for the tps25750 part and some
>>> conditional clauses are used to make a special case out of it. Now that
>>> different parts support patch updates, a more general approach is
>>> proposed.
>>>
>>> The update mechanism differs from the one required by tps25750 and it is
>>> explained in the commit message as a summary of the application note in
>>> that respect.
>>>
>>> Note that the series makes use of the TPS_SETUP_MS introduced in
>>> commit 6a4d4a27f986 ("usb: typec: tps6598x: add reset gpio support"),
>>> which is currently available in usb-next / usb-testing.
>>>
>>> A TPS65987D has been used to test this functionality with positive
>>> results.
>>>
>>> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
>>> ---
>>> Changes in v2:
>>> - Remove probe defeferring mechanism and expect the firmware to be
>>>   available (Heikki Krogerus).
>>> - Link to v1: 
>>> https://lore.kernel.org/r/20231207-tps6598x_update-v1-0-dc21b5301d91@wolfvision.net
>>>
>>
>> FYI, this series breaks boot for TI SK-AM62A and SK-AM62 which use 
>> TPS6598x as the USB-C PD chip.
>>
>> The platforms stopped booting since next-20240103 [1], and reverting 
>> this series [4] seems to fix the issue [2]
>>
>> Is there any change needed in the board device-tree [3] and bindings?
>>
>> We don't specify any firmware in the device-tree node, but seems like 
>> that is an assumption in this series. I tried reverting it (below 
>> change) but that did *not* help with the stuck boot.
>>
>> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
>> index a956eb976906..fa3bd7349265 100644
>> --- a/drivers/usb/typec/tipd/core.c
>> +++ b/drivers/usb/typec/tipd/core.c
>> @@ -1139,7 +1139,7 @@ static int tps6598x_apply_patch(struct tps6598x *tps)
>>         ret = device_property_read_string(tps->dev, "firmware-name",
>>                                           &firmware_name);
>>         if (ret)
>> -               return ret;
>> +               return 0;
>>
>>         ret = tps_request_firmware(tps, &fw);
>>         if (ret)
>>
>>
>> [1] https://linux.kernelci.org/soc/ti/job/next/kernel/next-20240103/plan/baseline-nfs/
>> [2] https://gist.github.com/jailuthra/0c077176585e4df2f8b78f7784087865
>> [3] https://gitlab.com/linux-kernel/linux-next/-/blob/master/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts#L305
>> [4] https://github.com/jailuthra/linux/commits/next-20240103-tps6598-fix/
> 
> 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!

-- 
cheers,
-roger

  reply	other threads:[~2024-01-04 16:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 16:29 [PATCH v2 0/4] usb: typec: tipd: add patch update support for tps6598x Javier Carrasco
2023-12-14 16:29 ` [PATCH v2 1/4] usb: typec: tipd: add init and reset functions to tipd_data Javier Carrasco
2023-12-19 11:46   ` Heikki Krogerus
2024-01-04 16:14   ` Roger Quadros
2024-01-04 16:39     ` Javier Carrasco
2023-12-14 16:29 ` [PATCH v2 2/4] usb: typec: tipd: add function to request firmware Javier Carrasco
2023-12-19 11:50   ` Heikki Krogerus
2023-12-14 16:29 ` [PATCH v2 3/4] usb: typec: tipd: declare in_data in as const in exec_cmd functions Javier Carrasco
2023-12-19 11:51   ` Heikki Krogerus
2023-12-14 16:29 ` [PATCH v2 4/4] usb: typec: tipd: add patch update support for tps6598x Javier Carrasco
2023-12-19 13:24   ` Heikki Krogerus
2024-01-04 14:20 ` [PATCH v2 0/4] " Jai Luthra
2024-01-04 15:47   ` Jai Luthra
2024-01-04 16:15     ` Roger Quadros [this message]
2024-01-04 16:36       ` Javier Carrasco
2024-01-04 17:08         ` Roger Quadros
2024-01-04 17:15           ` Javier Carrasco
2024-01-04 18:52       ` Dhruva Gole
2024-01-04 20:15         ` Javier Carrasco
2024-01-05  7:57           ` Roger Quadros
2024-01-04 16:25     ` Javier Carrasco
2024-01-05  8:12       ` Jai Luthra
2024-01-05  9:49         ` Javier Carrasco
2024-01-05 10:10           ` Jai Luthra
2024-01-05 16:40             ` Abdel Alkuor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9e8dd9f-b11b-43fc-8d76-6734dbddb540@kernel.org \
    --to=rogerq@kernel.org \
    --cc=d-gole@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=j-luthra@ti.com \
    --cc=javier.carrasco@wolfvision.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.