mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Swapnil Shinde <shindeswapnil028@gmail.com>,
	"kvalo@kernel.org" <kvalo@kernel.org>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtw88: pci: Power off MAC and disable interrupts on shutdown
Date: Fri, 27 Nov 2026 03:47:05 +0000	[thread overview]
Message-ID: <24cb6dca77d3456fb5893ce37b0bd1c7@realtek.com> (raw)
In-Reply-To: <20261127004822.8536-1-shindeswapnil028@gmail.com>


Swapnil Shinde <shindeswapnil028@gmail.com> wrote:
> Currently rtw_pci_shutdown() invokes chip->ops->shutdown() and
> immediately transitions the device to PCI_D3hot without powering off
> the MAC or disabling PCI interrupts when RTW_FLAG_POWERON is active.
> 
> On RTL8723DE combo cards, leaving the MAC powered across a warm reset
> causes REG_APS_FSMCO polling (offset 0x5, mask 0x1) to time out with
> -EBUSY (-16) on the next boot. Power off the MAC under rtwdev->mutex
> and disable PCI interrupts before entering PCI_D3hot.

IIRC the commit 05202746ed70 ("rtw88: 8723d: Add shutdown callback to disable BT USB suspend")
is to fix the problem your encountered. 

The later another commit 44492e70adc8 ("rtw88: pci: Power cycle device during shutdown")
is to let PCI enters PCI_D3hot.

Can you revert both or either one to see if anything different?

> 
> Signed-off-by: Swapnil Shinde <shindeswapnil028@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/pci.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
> index 66d2e5f51..b0bbb9397 100644
> --- a/drivers/net/wireless/realtek/rtw88/pci.c
> +++ b/drivers/net/wireless/realtek/rtw88/pci.c
> @@ -1949,14 +1949,29 @@ void rtw_pci_shutdown(struct pci_dev *pdev)
>  {
>         struct ieee80211_hw *hw = pci_get_drvdata(pdev);
>         struct rtw_dev *rtwdev;
> +       struct rtw_pci *rtwpci;
>         const struct rtw_chip_info *chip;
> 
>         if (!hw)
>                 return;
> 
>         rtwdev = hw->priv;
> +       rtwpci = (struct rtw_pci *)rtwdev->priv;
>         chip = rtwdev->chip;
> 

Can it just call rtw_enter_ips()?

> +       mutex_lock(&rtwdev->mutex);
> +       if (test_bit(RTW_FLAG_POWERON, rtwdev->flags)) {
> +               clear_bit(RTW_FLAG_RUNNING, rtwdev->flags);
> +               clear_bit(RTW_FLAG_FW_RUNNING, rtwdev->flags);
> +               rtw_power_off(rtwdev);
> +               clear_bit(RTW_FLAG_POWERON, rtwdev->flags);
> +       } else {
> +               rtw_hci_link_ps(rtwdev, false);
> +       }
> +       mutex_unlock(&rtwdev->mutex);
> +
> +       rtw_pci_disable_interrupt(rtwdev, rtwpci);
> +
>         if (chip->ops->shutdown)
>                 chip->ops->shutdown(rtwdev);
> 
> --
> 2.56.0


  reply	other threads:[~2026-11-27  3:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  0:48 Swapnil Shinde
2026-11-27  3:47 ` Ping-Ke Shih [this message]
2026-11-27  7:00   ` ꧁Swapnil Shinde꧂
2026-11-27  7:11     ` 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=24cb6dca77d3456fb5893ce37b0bd1c7@realtek.com \
    --to=pkshih@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=shindeswapnil028@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

all inboxes | Powered by JetHome®