mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Andre Eikmeyer <dev@deq.rocks>
Cc: arend.vanspriel@broadcom.com, linux-wireless@vger.kernel.org,
	brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com,
	linux-kernel@vger.kernel.org, michael.reeves077@gmail.com,
	marcan@marcan.st, j@jannau.net, asahi@lists.linux.dev,
	sebastian.reichel@collabora.com
Subject: Re: [PATCH v2 3/5] wifi: brcmfmac: pcie: probe again after a resume through firmware
Date: Thu, 26 Nov 2026 15:29:39 +0100	[thread overview]
Message-ID: <20261126142942.881504-2-arend.vanspriel@broadcom.com> (raw)
In-Reply-To: <20261111120748.23795-4-dev@deq.rocks>

On Wed, 11 Nov 2026 13:07:46 +0100, Andre Eikmeyer <dev@deq.rocks> wrote:
> After ACPI S3 the chip comes back without its firmware, but the
> interrupt mask can read back nonzero, so brcmf_pcie_pm_leave_D3()
> takes the hot resume path and every command times out afterwards.
> Seen on the BCM4377 and BCM4364 of the T2 Macs.
>
> When the platform firmware handled the resume and WoWL is off, go
> straight to the existing remove and re-probe path.
>
> Signed-off-by: Andre Eikmeyer <dev@deq.rocks>

[...]

> ---
>  .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c    | 10 ++++++++++
>  1 file changed, 10 insertions(+)

[...]

> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
> @@ -2844,6 +2845,15 @@ static int brcmf_pcie_pm_leave_D3(struct device *dev)
>  	devinfo = bus->bus_priv.pcie->devinfo;
>  	brcmf_dbg(PCIE, "Enter, dev=%p, bus=%p\n", dev, bus);
>
> +	/*
> +	 * Without WoWL the device is powered off when the platform firmware
> +	 * handles the system sleep, as with ACPI S3, and comes back without
> +	 * its firmware. Its registers can still read back nonzero, so probe
> +	 * it again.
> +	 */
> +	if (pm_resume_via_firmware() && !devinfo->wowl_enabled)
> +		goto cleanup;
> +
>  	/* Check if device is still up and running, if so we are ready */
>  	if (brcmf_pcie_read_pcie32(devinfo, devinfo->reginfo->intmask) != 0) {
>  		brcmf_dbg(PCIE, "Try to wakeup device....\n");

This applies to every chip handled by brcmfmac PCIe on any platform that resumes
through platform firmware, while the problem was seen on the BCM4377 and BCM4364 of
the T2 Macs. A device that keeps its power across S3 elsewhere resumed fine through
the hot resume path and now gets a full firmware reload. Please limit this to the
affected chips (e.g. check devinfo->ci->chip) or explain why a re-probe is right for
all of them.

The series "wifi: brcmfmac: pcie: recover from fatal PCIe errors"
(https://patchwork.kernel.org/series/1203582/) also re-probes the device, from its
PCI error resume callback with device_reprobe(). An error that hits during a
resume through platform firmware could start both re-probes. Please check how the
two interact, and make sure only one of them runs.

Regards,
Arend

  reply	other threads:[~2026-11-26 14:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 12:07 [PATCH v2 0/5] wifi: brcmfmac: pcie: S3 and deep sleep on the T2 Mac chips Andre Eikmeyer
2026-11-11 12:07 ` [PATCH v2 1/5] wifi: brcmfmac: pcie: set the state before D0_INFORM on resume Andre Eikmeyer
2026-11-26 14:29   ` Arend van Spriel
2026-11-11 12:07 ` [PATCH v2 2/5] wifi: brcmfmac: pcie: skip the host ready doorbell at init once it is a capability Andre Eikmeyer
2026-11-26 14:29   ` Arend van Spriel
2026-11-11 12:07 ` [PATCH v2 3/5] wifi: brcmfmac: pcie: probe again after a resume through firmware Andre Eikmeyer
2026-11-26 14:29   ` Arend van Spriel [this message]
2026-11-11 12:07 ` [PATCH v2 4/5] wifi: brcmfmac: msgbuf: send the flowring delete without waiting for tx status Andre Eikmeyer
2026-11-26 14:29   ` Arend van Spriel
2026-11-11 12:07 ` [PATCH v2 5/5] wifi: brcmfmac: pcie: support inband device wake and deep sleep Andre Eikmeyer
2026-11-26 14:29   ` Arend van Spriel

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=20261126142942.881504-2-arend.vanspriel@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=asahi@lists.linux.dev \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211@lists.linux.dev \
    --cc=dev@deq.rocks \
    --cc=j@jannau.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=michael.reeves077@gmail.com \
    --cc=sebastian.reichel@collabora.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®