All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Kalle Valo <kvalo@kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH v2] wifi: rtw89: rtw8852b{t}: fix TSSI debug timestamps
Date: Thu, 13 Feb 2025 00:45:24 +0000	[thread overview]
Message-ID: <2a466aad362d456abbc4bde0a592483c@realtek.com> (raw)
In-Reply-To: <20250212073833.1265407-1-dmantipov@yandex.ru>

Dmitry Antipov <dmantipov@yandex.ru> wrote:
> According to Ping-Ke, 

"As vendor driver...."

I think I shouldn't be the reason...

> 'tssi_alimk_time' of 'struct rtw89_tssi_info'
> is in microseconds. So adjust rtw8852b{t}-specific '_tssi_alimentk()'
> to not mess the former with nanoseconds and print both per-call
> and accumulated times. Compile tested only.
> 
> Fixes: 7f18a70d7b4d ("wifi: rtw89: 8852b: rfk: add TSSI")
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
> v2: actually use microseconds and print both times
> ---
>  drivers/net/wireless/realtek/rtw89/core.h          |  2 +-
>  drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c  | 12 ++++++------
>  drivers/net/wireless/realtek/rtw89/rtw8852bt_rfk.c | 12 ++++++------
>  3 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
> index b3fdd8eded21..eb2a6b90c940 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.h
> +++ b/drivers/net/wireless/realtek/rtw89/core.h
> @@ -5141,7 +5141,7 @@ struct rtw89_tssi_info {
>         u32 alignment_backup_by_ch[RF_PATH_MAX][TSSI_MAX_CH_NUM][TSSI_ALIMK_VALUE_NUM];
>         u32 alignment_value[RF_PATH_MAX][TSSI_ALIMK_MAX][TSSI_ALIMK_VALUE_NUM];
>         bool alignment_done[RF_PATH_MAX][TSSI_ALIMK_MAX];
> -       u32 tssi_alimk_time;
> +       u64 tssi_alimk_time;
>  };
> 
>  struct rtw89_power_trim_info {
> diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
> b/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
> index ef47a5facc83..1e0490813c40 100644
> --- a/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
> +++ b/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
> @@ -3585,7 +3585,7 @@ static void _tssi_alimentk(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
>         u8 ch_idx = _tssi_ch_to_idx(rtwdev, channel);
>         struct rtw8852bx_bb_tssi_bak tssi_bak;
>         s32 aliment_diff, tssi_cw_default;
> -       u32 start_time, finish_time;
> +       ktime_t start_time, this_time;
>         u32 bb_reg_backup[8] = {0};
>         const s16 *power;
>         u8 band;
> @@ -3613,7 +3613,7 @@ static void _tssi_alimentk(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
>                 return;
>         }
> 
> -       start_time = ktime_get_ns();
> +       start_time = ktime_get();
> 
>         if (chan->band_type == RTW89_BAND_2G)
>                 power = power_2g;
> @@ -3738,12 +3738,12 @@ static void _tssi_alimentk(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy,
>         rtw8852bx_bb_restore_tssi(rtwdev, phy, &tssi_bak);
>         rtw8852bx_bb_tx_mode_switch(rtwdev, phy, 0);
> 
> -       finish_time = ktime_get_ns();
> -       tssi_info->tssi_alimk_time += finish_time - start_time;
> +       this_time = ktime_us_delta(ktime_get(), start_time);

As prototype 
   static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)

The type of this_time should be s64 instead of ktime_t. 


> +       tssi_info->tssi_alimk_time += this_time;
> 
>         rtw89_debug(rtwdev, RTW89_DBG_RFK,
> -                   "[TSSI PA K] %s processing time = %d ms\n", __func__,
> -                   tssi_info->tssi_alimk_time);
> +                   "[TSSI PA K] %s processing time = %llu us (acc = %llu us)\n",
> +                   __func__, this_time, tssi_info->tssi_alimk_time);
>  }
> 
>  void rtw8852b_dpk_init(struct rtw89_dev *rtwdev)

[...]


  reply	other threads:[~2025-02-13  0:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11  7:39 [PATCH 1/2] wifi: rtw89: simplify rtw89_debug_priv_mac_reg_dump_select() Dmitry Antipov
2025-02-11  7:39 ` [PATCH 2/2] wifi: rtw89: rtw8852b{t}: fix TSSI debug timestamps Dmitry Antipov
2025-02-12  5:42   ` Ping-Ke Shih
2025-02-12  7:38     ` [PATCH v2] " Dmitry Antipov
2025-02-13  0:45       ` Ping-Ke Shih [this message]
2025-02-13  5:42         ` [PATCH v3] " Dmitry Antipov
2025-02-13  7:55           ` Ping-Ke Shih
2025-02-13  9:50             ` [PATCH v4] " Dmitry Antipov
2025-02-21  1:36               ` Ping-Ke Shih
2025-02-12  5:35 ` [PATCH 1/2] wifi: rtw89: simplify rtw89_debug_priv_mac_reg_dump_select() Ping-Ke Shih

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=2a466aad362d456abbc4bde0a592483c@realtek.com \
    --to=pkshih@realtek.com \
    --cc=dmantipov@yandex.ru \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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.