All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcma: add check if sprom is available before accessing it.
@ 2011-07-09 11:22 Hauke Mehrtens
  2011-07-14 18:43   ` Rafał Miłecki
  0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2011-07-09 11:22 UTC (permalink / raw)
  To: linville, zajec5; +Cc: linux-wireless, b43-dev, Hauke Mehrtens

The SoCs like the bcm4716 do not have a sprom on the bcma bus like a
pcie device. It stores the values in some partition on flash memory.
For ssb this informations are read out in the bcm47xx arch code,
something like that should also be implemented for bcma. Without this
patch bcma panics on SoCs.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/bcma/main.c  |    4 +++-
 drivers/bcma/sprom.c |    3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 08a14a3..873e2e4 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -149,7 +149,9 @@ int bcma_bus_register(struct bcma_bus *bus)
 
 	/* Try to get SPROM */
 	err = bcma_sprom_get(bus);
-	if (err) {
+	if (err == -ENOENT) {
+		pr_err("No SPROM available\n");
+	} else if (err) {
 		pr_err("Failed to get SPROM: %d\n", err);
 		return -ENOENT;
 	}
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c
index ffbb0e3..8e8d5cf 100644
--- a/drivers/bcma/sprom.c
+++ b/drivers/bcma/sprom.c
@@ -143,6 +143,9 @@ int bcma_sprom_get(struct bcma_bus *bus)
 	if (!bus->drv_cc.core)
 		return -EOPNOTSUPP;
 
+	if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM))
+		return -ENOENT;
+
 	sprom = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
 			GFP_KERNEL);
 	if (!sprom)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] bcma: add check if sprom is available before accessing it.
  2011-07-09 11:22 [PATCH] bcma: add check if sprom is available before accessing it Hauke Mehrtens
@ 2011-07-14 18:43   ` Rafał Miłecki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2011-07-14 18:43 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, b43-dev

2011/7/9 Hauke Mehrtens <hauke@hauke-m.de>:
> The SoCs like the bcm4716 do not have a sprom on the bcma bus like a
> pcie device. It stores the values in some partition on flash memory.
> For ssb this informations are read out in the bcm47xx arch code,
> something like that should also be implemented for bcma. Without this
> patch bcma panics on SoCs.

Didn't regress my BCM43224 or BCM4313, seems this flag is safe to use,
Broadcom really cares to set it.

Thanks Hauke.

-- 
Rafał

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] bcma: add check if sprom is available before accessing it.
@ 2011-07-14 18:43   ` Rafał Miłecki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafał Miłecki @ 2011-07-14 18:43 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linville, linux-wireless, b43-dev

2011/7/9 Hauke Mehrtens <hauke@hauke-m.de>:
> The SoCs like the bcm4716 do not have a sprom on the bcma bus like a
> pcie device. It stores the values in some partition on flash memory.
> For ssb this informations are read out in the bcm47xx arch code,
> something like that should also be implemented for bcma. Without this
> patch bcma panics on SoCs.

Didn't regress my BCM43224 or BCM4313, seems this flag is safe to use,
Broadcom really cares to set it.

Thanks Hauke.

-- 
Rafa?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-14 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-09 11:22 [PATCH] bcma: add check if sprom is available before accessing it Hauke Mehrtens
2011-07-14 18:43 ` Rafał Miłecki
2011-07-14 18:43   ` Rafał Miłecki

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.