Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Alessio Ferri <alessio.ferri@mythread.it>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org, linux-mips@vger.kernel.org
Subject: [PATCH RFC 2/2] bcma: scan: allow SHIM-style mini-EROM wrapper-less
Date: Mon, 18 May 2026 13:41:50 +0200	[thread overview]
Message-ID: <7a6ed9e5-bbac-41e6-a304-79072efcbe9f@mythread.it> (raw)
In-Reply-To: <82d2ae7c-3913-4d1c-8e2f-f586c4196ce1@mythread.it>

bcma_get_next_core() rejects with -ENXIO any component whose
component_B descriptor reports NMW=NSW=0 unless its core id is in
a short allowlist (4706 MAC GBIT, NS_CHIPCOMMON_B, PMU, GCI).

On SoCs that publish a SHIM-style mini-EROM (BMIPS xDSL family:
BCM6362, BCM63268), the WLAN backplane lists three components:
ChipCommon, IEEE 802.11 and BCMA_CORE_SHIM. None of the three is 
in the existing allowlist, so all three are skipped silently, 
bus->cores stays empty, bcma_find_core(BCMA_CORE_CHIPCOMMON) 
returns NULL, and a later bcma_chipco_watchdog_register() 
dereferences cc->core->bus on its first line and oopses mid-probe.

BCMA_CORE_SHIM (0x837) is already defined in
include/linux/bcma/bcma.h with the in-tree comment "SHIM
component in ubus/6362"; this patch is what makes the SHIM core
actually probe and bind.

Signed-off-by: Alessio Ferri <alessio.ferri@mythread.it>
---
 drivers/bcma/scan.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 983a62dde..871baa221 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -318,6 +318,21 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
 		case BCMA_CORE_GCI:
 		/* Not used yet: case BCMA_CORE_OOB_ROUTER: */
 			break;
+		case BCMA_CORE_CHIPCOMMON:
+		case BCMA_CORE_80211:
+		case BCMA_CORE_SHIM:
+			/* SHIM-style mini-EROM SoCs publish CHIPCOMMON, the IEEE
+			 * 802.11 core and the SHIM core itself with NMW=NSW=0
+			 * because clock and reset gating happens at the SoC level
+			 * via the SHIM, not via per-core DMP wrappers. The
+			 * companion host_soc patch sets bus->shim_attached on
+			 * those SoCs from per-compatible quirks data; the strict
+			 * NMW=NSW=0 rejection still applies to PCI-attached cards
+			 * and to SoCs without that quirk.
+			 */
+			if (bus->shim_attached)
+				break;
+			fallthrough;
 		default:
 			bcma_erom_skip_component(bus, eromptr);
 			return -ENXIO;
-- 
2.43.0


      reply	other threads:[~2026-05-18 11:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 11:35 [PATCH RFC 0/2] bcma: support for SHIM-attached SoC backplane (BCM6362) Alessio Ferri
2026-05-18 11:39 ` [PATCH RFC 1/2] bcma: host_soc: support quirked big-endian SoC backplane Alessio Ferri
2026-05-18 11:41   ` Alessio Ferri [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=7a6ed9e5-bbac-41e6-a304-79072efcbe9f@mythread.it \
    --to=alessio.ferri@mythread.it \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=zajec5@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