public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Louis Kotze <loukot@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "rtl8821cerfe2@gmail.com" <rtl8821cerfe2@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 2/2] wifi: rtw89: phy: make RF calibration timeouts non-fatal on USB
Date: Tue, 14 Apr 2026 06:39:39 +0000	[thread overview]
Message-ID: <9f43a228419b44b1a55ee3d8c31abcbd@realtek.com> (raw)
In-Reply-To: <20260410080017.82946-3-loukot@gmail.com>

Louis Kotze <loukot@gmail.com> wrote:
> On USB adapters, RF calibration timeouts can still occasionally occur
> despite the increased timeout values, particularly under system load
> or USB bus contention. However, the radio typically continues to
> operate correctly despite an incomplete calibration — the timeout
> does not indicate a hardware failure.
> 
> Make calibration timeouts and bad state returns non-fatal on USB by
> logging at debug level and continuing, rather than 

If calibration timeouts, the performance might be bad. How about just
to enlarge timeout time in 1/2 patch?

> returning
> -ETIMEDOUT/-EFAULT which can cascade into a connection failure or
> disconnect.

It seems like we don't actually handle the return code for now.
Could you point out the path you encountered?

> 
> PCIe error handling is unchanged — timeouts remain fatal on PCIe
> where they indicate a real problem.
> 
> Signed-off-by: Louis Kotze <loukot@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw89/phy.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
> index 4d809df8b..a06bea88e 100644
> --- a/drivers/net/wireless/realtek/rtw89/phy.c
> +++ b/drivers/net/wireless/realtek/rtw89/phy.c
> @@ -3972,9 +3972,21 @@ int rtw89_phy_rfk_report_wait(struct rtw89_dev *rtwdev, const char *rfk_name,
>         time_left = wait_for_completion_timeout(&wait->completion,
>                                                 msecs_to_jiffies(ms));
>         if (time_left == 0) {
> +               if (rtwdev->hci.type == RTW89_HCI_TYPE_USB) {
> +                       rtw89_debug(rtwdev, RTW89_DBG_RFK,
> +                                   "RF %s timeout (non-fatal on USB)\n",
> +                                   rfk_name);
> +                       goto out;
> +               }
>                 rtw89_warn(rtwdev, "failed to wait RF %s\n", rfk_name);
>                 return -ETIMEDOUT;
>         } else if (wait->state != RTW89_RFK_STATE_OK) {
> +               if (rtwdev->hci.type == RTW89_HCI_TYPE_USB) {
> +                       rtw89_debug(rtwdev, RTW89_DBG_RFK,
> +                                   "RF %s state %d (non-fatal on USB)\n",
> +                                   rfk_name, wait->state);
> +                       goto out;
> +               }
>                 rtw89_warn(rtwdev, "failed to do RF %s result from state %d\n",
>                            rfk_name, wait->state);
>                 return -EFAULT;
> --
> 2.53.0


  reply	other threads:[~2026-04-14  6:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <795a8567fdbe48babc5cf0f2b5e10c0a@realtek.com>
2026-04-10  8:00 ` [PATCH 0/2] wifi: rtw89: fix RF calibration for USB transport Louis Kotze
2026-04-10  8:00   ` [PATCH 1/2] wifi: rtw89: phy: increase RF calibration timeouts " Louis Kotze
2026-04-14  6:32     ` Ping-Ke Shih
2026-04-15 11:13       ` Louis Kotze
2026-04-10  8:00   ` [PATCH 2/2] wifi: rtw89: phy: make RF calibration timeouts non-fatal on USB Louis Kotze
2026-04-14  6:39     ` Ping-Ke Shih [this message]
2026-04-15 11:13       ` Louis Kotze
2026-04-15 11:13   ` [PATCH v2] wifi: rtw89: phy: increase RF calibration timeouts for USB transport Louis Kotze
2026-04-16  1:15     ` Ping-Ke Shih
2026-04-16  4:56       ` Louis Kotze

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=9f43a228419b44b1a55ee3d8c31abcbd@realtek.com \
    --to=pkshih@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=loukot@gmail.com \
    --cc=rtl8821cerfe2@gmail.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