Skip to contentSkip to conversation

brcmfmac + compat wireless + 2.6.35

PATCH New Denis 'GNUtoo' Carikli 2 participants 10 messages Nov 22, 2011 – Dec 19, 2011 Networking drivers (wireless)

lore
Share & tools
lore
#1 lore raw

Some more infos:

* The version of compat wireless used is the following:
compat-wireless-2011-11-21

* adding an if 0 in brcmf_sdcard_intr_reg removes the problematic dmesg
message:
int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev)

{
        brcmf_dbg(TRACE, "Entering\n");
#if 0
        sdio_claim_host(sdiodev->func[1]);
        sdio_claim_irq(sdiodev->func[1], brcmf_sdioh_irqhandler);
        sdio_release_host(sdiodev->func[1]);
#endif
        return 0;
}
but then:
# ifconfig wlan0 up
ifconfig: SIOCSIFFLAGS: Operation not permitted
(with rfkill state ok (soft = 0, hard = 0, state = 1) and beeing root.

Denis.

#2 lore raw

Hi Denis,

Quoted 16 lines · Denis 'GNUtoo' Carikli

* adding an if 0 in brcmf_sdcard_intr_reg removes the problematic dmesg
message:
int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev)

{
         brcmf_dbg(TRACE, "Entering\n");
#if 0
         sdio_claim_host(sdiodev->func[1]);
         sdio_claim_irq(sdiodev->func[1], brcmf_sdioh_irqhandler);
         sdio_release_host(sdiodev->func[1]);
#endif
         return 0;
}
but then:
# ifconfig wlan0 up
ifconfig: SIOCSIFFLAGS: Operation not permitted
(with rfkill state ok (soft = 0, hard = 0, state = 1) and beeing root.

Root cause for the mmc complain is that there is no handler for function 2 interrupt. 4329 generate a SDIO interrupt when there are something available for the driver to retrieve from the dongle. It will flag both function 1 and function 2 at the same time. They are identical. A empty dummy irq handler register to function 2 irq will make the warning go away. FWIW, it doesn't affect anything here since they have been taken care in function 1 irq handler. I will submit a patch too add the dummy handler.

Thanks,
Franky

#3 lore raw
Quoted 7 lines

Root cause for the mmc complain is that there is no handler for function 2 interrupt. 4329 generate a SDIO interrupt when there are something available for the driver to retrieve from the dongle. It will flag both function 1 and function 2 at the same time. They are identical. A empty dummy irq handler register to function 2 irq will make the warning go away. FWIW, it doesn't affect anything here since they have been taken care in function 1 irq handler.

ok,thanks for the explanation.

Quoted 1 line

I will submit a patch too add the dummy handler.

Thanks a lot.

Denis.

#4 lore raw
In reply to Franky Lin

Hi,

Quoted 1 line

I will submit a patch too add the dummy handler.

Since the patch hasn't shown up yet, I decided to give a try, But I failed:

The patch which will follow blocks the phone(ssh doens't respond anymore), I really wonder what's wrong with it since it does something very similar to the bcm4329 driver.
The last printk are theses ones:

[   63.436157] wifi_set_power = 1
[   63.641585] wifi_set_carddetect = 1
[   63.646195] sdhci_s3c_force_presence_change : Enter
[   63.780660] mmc2: queuing unknown CIS tuple 0x80 (50 bytes)
[   63.796865] mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
[   63.843426] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[   63.851883] mmc2: new SDIO card at address 0001

Denis.

#5 lore raw

PATCH 1/1 brcm80211: fmac: try to add a dummy interupt handler for sdio function 2

---
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +13 -0
index 74933dc..62cb779 100644
@@ -52,10 +52,19 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
 	sdio_claim_host(func);
 }
 
+static void brcmf_sdioh_dummy_irqhandler(struct sdio_func *func)
+{
+	brcmf_dbg(TRACE, "*** DUMMY IRQHandler\n");
+}
+
 int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev)
 {
 	brcmf_dbg(TRACE, "Entering\n");
 
+	sdio_claim_host(sdiodev->func[2]);
+	sdio_claim_irq(sdiodev->func[2], brcmf_sdioh_dummy_irqhandler);
+	sdio_release_host(sdiodev->func[2]);
+
 	sdio_claim_host(sdiodev->func[1]);
 	sdio_claim_irq(sdiodev->func[1], brcmf_sdioh_irqhandler);
 	sdio_release_host(sdiodev->func[1]);
@@ -71,6 +80,10 @@ int brcmf_sdcard_intr_dereg(struct brcmf_sdio_dev *sdiodev)
 	sdio_release_irq(sdiodev->func[1]);
 	sdio_release_host(sdiodev->func[1]);
 
+	sdio_claim_host(sdiodev->func[2]);
+	sdio_release_irq(sdiodev->func[2]);
+	sdio_release_host(sdiodev->func[2]);
+
 	return 0;
 }
 
Signature · 1 line
1.7.4.1
#6 lore raw
In reply to Denis 'GNUtoo' Carikli

Hi Denis,

Quoted 3 lines · Denis 'GNUtoo' Carikli
Quoted 1 line

I will submit a patch too add the dummy handler.

Since the patch hasn't shown up yet, I decided to give a try, But I failed:

I saw the patch you sent. I have one queued up internally but am happy to take yours. Does the patch work or not?

Quoted 11 lines

The patch which will follow blocks the phone(ssh doens't respond anymore), I really wonder what's wrong with it since it does something very similar to the bcm4329 driver.
The last printk are theses ones:

[   63.436157] wifi_set_power = 1
[   63.641585] wifi_set_carddetect = 1
[   63.646195] sdhci_s3c_force_presence_change : Enter
[   63.780660] mmc2: queuing unknown CIS tuple 0x80 (50 bytes)
[   63.796865] mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
[   63.843426] mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
[   63.851883] mmc2: new SDIO card at address 0001

Did you try to enable more debug trace? Looks like sdio probe has never been called.

Franky

#7 lore raw

Hi,

Quoted 2 lines

I saw the patch you sent. I have one queued up internally but am happy to take yours. Does the patch work or not?

No it doesn't work as the phone freeze(maybe for another reason tough). I think you should rather send your patch.

Quoted 2 lines

Did you try to enable more debug trace? Looks like sdio probe has never been called.

I'll try tomorrow, thanks a lot.

Denis.

#8 lore raw
In reply to Franky Lin

Hi,
With the following patch instead of mine:
brcm80211: fmac: register a dummy irq handler for SDIO function 2
it still fails the same way.

I added that:
#define BCMDBG 1
after:
#include "dhd_proto.h"
#include "dhd_dbg.h"
in:
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c and:
insmod brcmfmac.ko brcmf_msg_level=8192

But it wasn't more verbose so I added MMC debug and I got that:

[  101.531001] mmc2: starting CMD52 arg 00205000 flags 00000195
[  101.531149] sdhci [sdhci_irq()]: *** mmc2 got interrupt: 0x00000001
[  101.531232] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[  101.531381] mmc2: starting CMD52 arg 00205200 flags 00000195
[  101.531468] sdhci [sdhci_irq()]: *** mmc2 got interrupt: 0x00000001
[  101.531615] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[  101.531701] mmc2: starting CMD52 arg 00205400 flags 00000195
[  101.531851] sdhci [sdhci_irq()]: *** mmc2 got interrupt: 0x00000001
[  101.531934] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[  101.532084] mmc2: starting CMD52 arg 00205600 flags 00000195
[  101.533235] sdhci [sdhci_irq()]: *** mmc2 got interrupt: 0x00000001
[  101.533321] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[  101.533473] mmc2: starting CMD52 arg 00205800 flags 00000195
[  101.533560] sdhci [sdhci_irq()]: *** mmc2 got interrupt: 0x00000001
[  101.533707] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[  101.533794] mmc2: starting CMD52 arg 00205a00 flags 00000195
[  101.533944] sdhci [sdhci_irq()]: *** mmc2 got interrupt: 0x00000001
[  101.534027] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[  101.534177] mmc2: starting CMD52 arg 00205c00 flags 00000195
[  101.534327] sdhci [sdhci_irq()]: *** mmc2 got interrupt: 0x00000001
[  101.534411] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[  101.534562] mmc2: starting CMD52 arg 00205e00 flags 00000195

--- Then it blocks here ---

Denis.

#9 lore raw

Hi Denis,

Quoted 4 lines · Denis 'GNUtoo' Carikli

Hi,
With the following patch instead of mine:
brcm80211: fmac: register a dummy irq handler for SDIO function 2
it still fails the same way.

Indeed there is no big difference from yours. We tested it on X86 and OMAP panda board.

Quoted 9 lines

I added that:
#define BCMDBG 1
after:
#include "dhd_proto.h"
#include "dhd_dbg.h"
in:
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c and:
insmod brcmfmac.ko brcmf_msg_level=8192

Could you try to load the driver by insmod brcmfmac.ko brcmf_msg_level=0x7 and send me the log?

Quoted 7 lines

But it wasn't more verbose so I added MMC debug and I got that:

[  101.534177] mmc2: starting CMD52 arg 00205c00 flags 00000195
[  101.534327] sdhci [sdhci_irq()]: *** mmc2 got interrupt: 0x00000001
[  101.534411] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[  101.534562] mmc2: starting CMD52 arg 00205e00 flags 00000195

--- Then it blocks here ---

Looks like it hangs in the middle of downloading firmware.

Thanks,
Franky