From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Sanjay R Mehta <sanmehta@amd.com>
Cc: Sanjay R Mehta <Sanju.Mehta@amd.com>,
andreas.noever@gmail.com, michael.jamet@intel.com,
YehezkelShB@gmail.com, linux-usb@vger.kernel.org,
Sanath S <Sanath.S@amd.com>
Subject: Re: [PATCH Internal] thunderbolt: Remove enabling/disabling TMU based on CLx
Date: Mon, 31 Jul 2023 12:41:16 +0300 [thread overview]
Message-ID: <20230731094116.GY14638@black.fi.intel.com> (raw)
In-Reply-To: <c1be3001-0df6-68e8-a024-3f0d6d8c37dc@amd.com>
On Thu, Jul 06, 2023 at 07:18:38PM +0530, Sanjay R Mehta wrote:
> > Agree. we will have to see what is going wrong in this case.
>
> Hi Mika,
Hi,
> When an unplug event occurs, the TMU is disabled by configuring the
> TSPacketInterval bits in TMU_RTR_CS_3 to 0 using the
> tb_switch_tmu_rate_write() API, followed by disabling the Time
> Synchronization Handshake using the DTS bit in TMU_ADP_CS_6. The code
> snippet for this functionality is present in the tb_switch_tmu_disable()
> function, as shown below:
>
> ```
> tb_switch_tmu_rate_write(sw, TB_SWITCH_TMU_RATE_OFF);
> tb_port_tmu_time_sync_disable(up);
> ret = tb_port_tmu_time_sync_disable(down);
> if (ret)
> return ret;
> ```
>
> However, we have observed that the tb_switch_tmu_rate_write() function
> fails to disable the TMU rate, and the code proceeds with disabling the
> Time Synchronization Handshake. To address this issue, we have modified
> the code to check the return value of the tb_switch_tmu_rate_write()
> function and only proceed with disabling the Time Synchronization
> Handshake if the TMU rate disabling succeeds. The updated code is as
> follows:
>
> ```
> ret = tb_switch_tmu_rate_write(sw, tmu_rates[TB_SWITCH_TMU_MODE_OFF]);
> if (ret)
> return ret;
> tb_port_tmu_time_sync_disable(up);
> ret = tb_port_tmu_time_sync_disable(down);
> if (ret)
> return ret;
> ```
>
> Please let us know your thoughts on this solution.
Makes sense to me.
prev parent reply other threads:[~2023-07-31 9:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 10:37 [PATCH Internal] thunderbolt: Remove enabling/disabling TMU based on CLx Sanjay R Mehta
2023-06-21 10:52 ` Greg KH
2023-06-21 10:52 ` Greg KH
2023-06-21 10:57 ` Sanjay R Mehta
2023-06-21 11:15 ` Mika Westerberg
2023-06-21 12:18 ` Sanjay R Mehta
2023-06-21 12:54 ` Mika Westerberg
2023-06-21 16:07 ` Sanjay R Mehta
2023-06-22 4:45 ` Mika Westerberg
2023-07-06 13:48 ` Sanjay R Mehta
2023-07-31 9:41 ` Mika Westerberg [this message]
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=20230731094116.GY14638@black.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=Sanath.S@amd.com \
--cc=Sanju.Mehta@amd.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=michael.jamet@intel.com \
--cc=sanmehta@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox