netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	"Network Development" <netdev@vger.kernel.org>,
	"Franky (Zhenhui) Lin" <frankyl@broadcom.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	"Larry Finger" <Larry.Finger@lwfinger.net>
Subject: Re: brcm80211 breakage..
Date: Wed, 11 Jan 2012 11:44:22 +0100	[thread overview]
Message-ID: <4F0D6806.4080201@broadcom.com> (raw)
In-Reply-To: <CA+55aFxw5e3EYCGYjkWiTmhy9-WaY4T_-MF7EYcn4jXuBoxAgw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]

On 01/10/2012 09:15 PM, Linus Torvalds wrote:
> So the wireless on my Macbook Air no longer seems to work with the
> current -git tree.
> 
> The BRCMSMAC driver *used* to work, and no longer does. Also, very
> annoyingly, it's even hard to *compile* the thing, because it used to
> be
> 
>   depends on BCMA=n
> 
> but now it is the exact reverse:
> 
>   depends on BCMA
> 
> so there is no sane way to carry a configuration over from before, and
> things like bisection is a major pain due to having to play idiotic
> configuration games to get it to work across all these modifications.

BCMA support has been added to brcmsmac so now we depend on it. As BCMA
claims the PCI device we had the BCMA=n in place before. I agree that it
makes bisecting a pain in the...

> Ragardless, even once you actually enable BCMA and can get the driver
> to come back, it just doesn't do anything. Maybe there is some
> remaining config problem, but I don't think so. I think the driver is
> just buggered.

Looking at the output I had deja-vu feeling. The issue popped up when we
published part of the patches for BCMA support. I looked into it with
Larry Finger and Rafał Miłecki. We found the reason for the failure, but
it seemed resolved after submitting the remaining patches for BCMA
support. However, it seems to have raised its ugly head.

> Please look into this. I'll obviously be happy test any reasonable suggestions,
> 
>                  Linus
> 

My theory is that the BAR window is not mapped to a valid address. Could
you try to revert the following commit:

commit 439678f8b0fca7aeca06c6581e3679eef618721a
Author: Rafał Miłecki <zajec5@gmail.com>
Date:   Mon Dec 5 19:13:39 2011 +0100

    bcma: pci: use fixed windows when possible

    Some cores are mapped in the fixed way, they registers can be accessed
    all the time.

    Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

I have attached the 'revert patch' based on your git master branch.

Gr. AvS

[-- Attachment #2: 0001-Revert-bcma-pci-use-fixed-windows-when-possible.patch --]
[-- Type: text/plain, Size: 2737 bytes --]

>From 71e949a668bc8c371dc21f17af01284719f1b383 Mon Sep 17 00:00:00 2001
From: Arend van Spriel <arend@broadcom.com>
Date: Wed, 11 Jan 2012 11:35:05 +0100
Subject: [PATCH] Revert "bcma: pci: use fixed windows when possible"

This reverts commit 439678f8b0fca7aeca06c6581e3679eef618721a.
---
 drivers/bcma/host_pci.c |   32 +++++++++++---------------------
 1 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 443b83a..990f5a8 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -21,58 +21,48 @@ static void bcma_host_pci_switch_core(struct bcma_device *core)
 	pr_debug("Switched to core: 0x%X\n", core->id.id);
 }
 
-/* Provides access to the requested core. Returns base offset that has to be
- * used. It makes use of fixed windows when possible. */
-static u16 bcma_host_pci_provide_access_to_core(struct bcma_device *core)
+static u8 bcma_host_pci_read8(struct bcma_device *core, u16 offset)
 {
-	switch (core->id.id) {
-	case BCMA_CORE_CHIPCOMMON:
-		return 3 * BCMA_CORE_SIZE;
-	case BCMA_CORE_PCIE:
-		return 2 * BCMA_CORE_SIZE;
-	}
-
 	if (core->bus->mapped_core != core)
 		bcma_host_pci_switch_core(core);
-	return 0;
-}
-
-static u8 bcma_host_pci_read8(struct bcma_device *core, u16 offset)
-{
-	offset += bcma_host_pci_provide_access_to_core(core);
 	return ioread8(core->bus->mmio + offset);
 }
 
 static u16 bcma_host_pci_read16(struct bcma_device *core, u16 offset)
 {
-	offset += bcma_host_pci_provide_access_to_core(core);
+	if (core->bus->mapped_core != core)
+		bcma_host_pci_switch_core(core);
 	return ioread16(core->bus->mmio + offset);
 }
 
 static u32 bcma_host_pci_read32(struct bcma_device *core, u16 offset)
 {
-	offset += bcma_host_pci_provide_access_to_core(core);
+	if (core->bus->mapped_core != core)
+		bcma_host_pci_switch_core(core);
 	return ioread32(core->bus->mmio + offset);
 }
 
 static void bcma_host_pci_write8(struct bcma_device *core, u16 offset,
 				 u8 value)
 {
-	offset += bcma_host_pci_provide_access_to_core(core);
+	if (core->bus->mapped_core != core)
+		bcma_host_pci_switch_core(core);
 	iowrite8(value, core->bus->mmio + offset);
 }
 
 static void bcma_host_pci_write16(struct bcma_device *core, u16 offset,
 				 u16 value)
 {
-	offset += bcma_host_pci_provide_access_to_core(core);
+	if (core->bus->mapped_core != core)
+		bcma_host_pci_switch_core(core);
 	iowrite16(value, core->bus->mmio + offset);
 }
 
 static void bcma_host_pci_write32(struct bcma_device *core, u16 offset,
 				 u32 value)
 {
-	offset += bcma_host_pci_provide_access_to_core(core);
+	if (core->bus->mapped_core != core)
+		bcma_host_pci_switch_core(core);
 	iowrite32(value, core->bus->mmio + offset);
 }
 
-- 
1.7.5.4


  reply	other threads:[~2012-01-11 10:44 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 20:15 brcm80211 breakage Linus Torvalds
2012-01-11 10:44 ` Arend van Spriel [this message]
2012-01-11 15:05   ` Linus Torvalds
2012-01-11 16:04     ` Linus Torvalds
2012-01-11 17:00       ` Larry Finger
2012-01-12  1:06         ` Linus Torvalds
2012-01-12  1:46           ` Larry Finger
2012-01-12  1:58             ` Linus Torvalds
2012-01-12  2:11             ` Linus Torvalds
2012-01-12  4:15               ` Larry Finger
2012-01-12  5:20                 ` Linus Torvalds
2012-01-12  5:30                   ` Linus Torvalds
2012-01-12  7:08                     ` Rafał Miłecki
2012-01-12  7:10                       ` Rafał Miłecki
2012-01-12  7:18                       ` Linus Torvalds
2012-01-12 15:39                       ` Larry Finger
2012-01-12 15:46                         ` Rafał Miłecki
2012-01-12  7:13                     ` Linus Torvalds
2012-01-12  7:18                       ` Rafał Miłecki
2012-01-12  7:22                         ` Linus Torvalds
2012-01-12 10:03                       ` Arend van Spriel
2012-01-12 15:51                         ` Linus Torvalds
2012-01-12 19:00                       ` Linus Torvalds
2012-01-12 19:08                         ` Linus Torvalds
2012-01-12 20:09                           ` Arend van Spriel
2012-01-12 20:27                             ` Linus Torvalds
2012-01-12 20:36                               ` Arend van Spriel
2012-01-12 22:38                               ` Linus Torvalds
2012-01-12 22:42                                 ` Rafał Miłecki
2012-01-12 22:45                                   ` Linus Torvalds
2012-01-12 23:04                                     ` Rafał Miłecki
2012-01-13  0:13                                       ` Linus Torvalds
2012-01-13  2:30                                         ` Linus Torvalds
2012-01-13  5:34                                           ` Linus Torvalds
2012-01-13  6:50                                             ` Rafał Miłecki
2012-01-13  6:57                                               ` Rafał Miłecki
2012-01-13  7:17                                                 ` Linus Torvalds
2012-01-13  7:41                                                   ` [PATCH] bcma: s&r: NULL mapped core Rafał Miłecki
2012-01-13  7:53                                                     ` Linus Torvalds
2012-01-13  7:59                                                     ` [0/5] bcma/brcmsmac suspend/resume cleanups and fixes Linus Torvalds
2012-01-13  8:00                                                       ` [PATCH 1/5] bcma: convert suspend/resume to pm_ops Linus Torvalds
2012-01-13  9:58                                                         ` Arend van Spriel
2012-01-13 10:01                                                           ` Rafał Miłecki
2012-01-13  8:00                                                       ` [PATCH 2/5] bcma: add stub for bcma_bus suspend() Linus Torvalds
2012-01-13  8:01                                                       ` [PATCH 3/5] bcma: connect the bcma bus suspend/resume to the bcma driver suspend/resume Linus Torvalds
2012-01-13  8:01                                                       ` [PATCH 4/5] brcmsmac: remove PCI suspend/resume from bcma driver Linus Torvalds
2012-01-13  9:59                                                         ` Arend van Spriel
2012-01-13  8:02                                                       ` [PATCH 5/5] bcma: invalidate the mapped window over suspend/resume Linus Torvalds
2012-01-13 10:03                                                       ` [0/5] bcma/brcmsmac suspend/resume cleanups and fixes Rafał Miłecki
2012-01-13 16:15                                                         ` Linus Torvalds
2012-01-13 11:06                                                       ` Arend van Spriel
2012-01-13 16:23                                                         ` Linus Torvalds
2012-01-14  3:50                                                         ` Linus Torvalds
2012-01-14 12:22                                                           ` Dominique Martinet
2012-01-14 14:34                                                             ` Rafał Miłecki
2012-01-14 15:07                                                               ` Dominique Martinet
2012-01-14 19:15                                                             ` Linus Torvalds
2012-01-14 23:08                                                               ` Dominique Martinet
2012-01-14 23:28                                                                 ` Linus Torvalds
2012-01-14 17:36                                                           ` Arend van Spriel
2012-01-16 14:00                                                           ` Arend van Spriel
2012-01-16 17:33                                                             ` Arend van Spriel
2012-01-17  1:12                                                               ` Linus Torvalds
2012-01-17 10:37                                                                 ` Arend van Spriel
2012-01-19  9:42                                                                 ` Arend van Spriel
2012-01-19 12:12                                                                 ` Arend van Spriel
2012-01-19 16:15                                                                   ` Linus Torvalds
2012-01-13  7:13                                               ` brcm80211 breakage Linus Torvalds
2012-01-12 19:46                         ` Arend van Spriel
2012-01-13  1:53                         ` Larry Finger
2012-01-31 12:08                         ` Henrik Rydberg
2012-01-31 17:02                           ` Linus Torvalds
2012-01-31 19:08                             ` Arend van Spriel
2012-01-31 19:25                               ` John W. Linville
2012-01-31 19:35                                 ` Arend van Spriel
2012-01-31 19:58                                 ` Henrik Rydberg
2012-01-31 20:21                                   ` Arend van Spriel
2012-01-31 22:23                                     ` Henrik Rydberg
2012-01-31 19:36                               ` Henrik Rydberg
2012-01-31 19:49                                 ` Arend van Spriel
2012-01-12 13:13                 ` Arend van Spriel
2012-01-12 16:22                   ` Larry Finger
2012-01-12 17:18                   ` Larry Finger
2012-01-12 17:31                     ` Linus Torvalds
2012-01-12 17:44                       ` Larry Finger
2012-01-11 21:01       ` Arend van Spriel
2012-01-12  0:07         ` Linus Torvalds
2012-01-11 17:15   ` Ben Hutchings
2012-01-12  0:10     ` Linus Torvalds

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=4F0D6806.4080201@broadcom.com \
    --to=arend@broadcom.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=frankyl@broadcom.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).