Skip to contentSkip to conversation

Regression in 9390ace brcmfmac: free net device when registration fails

DISCUSSION Stephen Warren 4 participants 7 messages Jun 3, 2013 – Jun 13, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

(John, note that this commit is part of the pull request you sent to Dave today)

Arend,

Commit 9390ace "brcmfmac: free net device when registration fails" causes a regression.

I had the BCM4330 firmware present in my root fs, whereas my HW is a BCM4329. With this patch applied, I get a kernel panic on boot. With it reverted, I see that no issues of that nature. This is true in next-20130531 (and also 5/30 and 6/1 but not earlier). A bisect of Linus's tree followed by a merge of John's wireless pull request from today pointed at this same commit.

Related: Since the two hardware require different firmware, I wonder why the driver doesn't use a firmware filename that encodes the HW device ID instead of using the same name for all HW. This means that when I move my SD card between development systems, I have to copy different firmware over the top. That's a little painful...

#2 lore raw
In reply to a message not in the archive
Quoted 8 lines · Stephen Warren

(John, note that this commit is part of the pull request you sent to Dave today)

Arend,

Commit 9390ace "brcmfmac: free net device when registration fails" causes a regression.

Quoted 6 lines

I had the BCM4330 firmware present in my root fs, whereas my HW is a BCM4329. With this patch applied, I get a kernel panic on boot. With it reverted, I see that no issues of that nature. This is true in next-20130531 (and also 5/30 and 6/1 but not earlier). A bisect of Linus's tree followed by a merge of John's wireless pull request from today pointed at this same commit.

Thanks, Stephen

I will look into this.

Quoted 5 lines

Related: Since the two hardware require different firmware, I wonder why the driver doesn't use a firmware filename that encodes the HW device ID instead of using the same name for all HW. This means that when I move my SD card between development systems, I have to copy different firmware over the top. That's a little painful...

I agree that for development switching cards it is kinda awkward and I have been fooled by it as well. We may want to change or if your itch is annoying enough feel free to send a patch for it ;-)

Regards,
Arend

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 16 lines · Arend van Spriel
Quoted 8 lines · Stephen Warren

(John, note that this commit is part of the pull request you sent to Dave today)

Arend,

Commit 9390ace "brcmfmac: free net device when registration fails" causes a regression.

Quoted 6 lines

I had the BCM4330 firmware present in my root fs, whereas my HW is a BCM4329. With this patch applied, I get a kernel panic on boot. With it reverted, I see that no issues of that nature. This is true in next-20130531 (and also 5/30 and 6/1 but not earlier). A bisect of Linus's tree followed by a merge of John's wireless pull request from today pointed at this same commit.

Quoted 3 lines

Thanks, Stephen

I will look into this.

Hi Stephen,

Can you try the attached patch? If it does not solve the issue, could you provide a log.

Quoted 9 lines
Quoted 5 lines

Related: Since the two hardware require different firmware, I wonder why the driver doesn't use a firmware filename that encodes the HW device ID instead of using the same name for all HW. This means that when I move my SD card between development systems, I have to copy different firmware over the top. That's a little painful...

I agree that for development switching cards it is kinda awkward and I have been fooled by it as well. We may want to change or if your itch is annoying enough feel free to send a patch for it ;-)

We have a patch for this that we can submit to wireless-next.

Regards,
Arend

Quoted 1 line

From 2c0bf2dc8ecf91175a4b9a28dc2c4e84aceee4cf Mon Sep 17 00:00:00 2001

From: Arend van Spriel <[email protected]>
Date: Thu, 6 Jun 2013 22:43:41 +0200
Subject: [PATCH] brcmfmac: free primary net_device when brcmf_bus_start()
fails

When initialization within brcmf_bus_start() fails on steps before the brcmf_net_attach() the net_device for the primary interface needs to be freed.

---
 drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +4 -0
index 63cadf6..d7cf98e 100644
@@ -941,6 +941,10 @@ fail:
 			brcmf_fws_del_interface(ifp);
 			brcmf_fws_deinit(drvr);
 		}
+		if (drvr->iflist[0]) {
+			free_netdev(ipf->ndev);
+			drvr->iflist[0] = NULL;
+		}
 		if (p2p_ifp) {
 			free_netdev(p2p_ifp->ndev);
 			drvr->iflist[1] = NULL;
Signature · 1 line
1.7.10.4
author Tested-by
#4 lore raw
Quoted 17 lines · Arend van Spriel
Quoted 16 lines · Arend van Spriel
Quoted 14 lines · Stephen Warren

(John, note that this commit is part of the pull request you sent to Dave today)

Arend,

Commit 9390ace "brcmfmac: free net device when registration fails" causes a regression.

I had the BCM4330 firmware present in my root fs, whereas my HW is a BCM4329. With this patch applied, I get a kernel panic on boot. With it reverted, I see that no issues of that nature. This is true in next-20130531 (and also 5/30 and 6/1 but not earlier). A bisect of Linus's tree followed by a merge of John's wireless pull request from today pointed at this same commit.

Quoted 8 lines
Quoted 3 lines

Thanks, Stephen

I will look into this.

Hi Stephen,

Can you try the attached patch? If it does not solve the issue, could you provide a log.

Yes, that works great, thanks.

Quoted 11 lines
Quoted 9 lines
Quoted 5 lines

Related: Since the two hardware require different firmware, I wonder why the driver doesn't use a firmware filename that encodes the HW device ID instead of using the same name for all HW. This means that when I move my SD card between development systems, I have to copy different firmware over the top. That's a little painful...

I agree that for development switching cards it is kinda awkward and I have been fooled by it as well. We may want to change or if your itch is annoying enough feel free to send a patch for it ;-)

We have a patch for this that we can submit to wireless-next.

Oh, great! If you could Cc me, that'd be helpful, since I'm not on that list. Thanks.

#5 lore raw
Quoted 22 lines · Stephen Warren
Quoted 21 lines · Arend van Spriel
Quoted 19 lines · Arend van Spriel
Quoted 8 lines · Stephen Warren

(John, note that this commit is part of the pull request you sent to Dave today)

Arend,

Commit 9390ace "brcmfmac: free net device when registration fails" causes a regression.

Quoted 6 lines

I had the BCM4330 firmware present in my root fs, whereas my HW is a BCM4329. With this patch applied, I get a kernel panic on boot. With it reverted, I see that no issues of that nature. This is true in next-20130531 (and also 5/30 and 6/1 but not earlier). A bisect of Linus's tree followed by a merge of John's wireless pull request from today pointed at this same commit.

Thanks, Stephen

I will look into this.

Quoted 8 lines
Quoted 4 lines

Hi Stephen,

Can you try the attached patch? If it does not solve the issue, could you provide a log.

Yes, that works great, thanks.

Did this patch get applied anywhere? I was hoping it'd go into 3.10-rc* given it's a user-triggerable backtrace introduced in 3.10-rc*.

#6 lore raw
Quoted 28 lines · Stephen Warren
Quoted 27 lines · Stephen Warren
Quoted 25 lines · Arend van Spriel
Quoted 16 lines · Arend van Spriel
Quoted 8 lines · Stephen Warren

(John, note that this commit is part of the pull request you sent to Dave today)

Arend,

Commit 9390ace "brcmfmac: free net device when registration fails" causes a regression.

Quoted 6 lines

I had the BCM4330 firmware present in my root fs, whereas my HW is a BCM4329. With this patch applied, I get a kernel panic on boot. With it reverted, I see that no issues of that nature. This is true in next-20130531 (and also 5/30 and 6/1 but not earlier). A bisect of Linus's tree followed by a merge of John's wireless pull request from today pointed at this same commit.

Quoted 3 lines

Thanks, Stephen

I will look into this.

Hi Stephen,

Can you try the attached patch? If it does not solve the issue, could you provide a log.

Quoted 6 lines
Quoted 3 lines

Yes, that works great, thanks.

Did this patch get applied anywhere? I was hoping it'd go into 3.10-rc* given it's a user-triggerable backtrace introduced in 3.10-rc*.

Hi Stephen,

The patch went into the wireless-next tree. Given recent events with our patch series I am a bit more carsful to tag patches for 3.10. Your issue is user-triggerable but the scenario to get there can be avoided. But you are right it was introduced in the 3.10-rc cycle. I leave it to John to decide.

Regards,
Arend

#7 lore raw
Quoted 38 lines · Arend van Spriel
Quoted 28 lines · Stephen Warren
Quoted 27 lines · Stephen Warren
Quoted 25 lines · Arend van Spriel
Quoted 16 lines · Arend van Spriel
Quoted 8 lines · Stephen Warren

(John, note that this commit is part of the pull request you sent to Dave today)

Arend,

Commit 9390ace "brcmfmac: free net device when registration fails" causes a regression.

Quoted 6 lines

I had the BCM4330 firmware present in my root fs, whereas my HW is a BCM4329. With this patch applied, I get a kernel panic on boot. With it reverted, I see that no issues of that nature. This is true in next-20130531 (and also 5/30 and 6/1 but not earlier). A bisect of Linus's tree followed by a merge of John's wireless pull request from today pointed at this same commit.

Quoted 3 lines

Thanks, Stephen

I will look into this.

Hi Stephen,

Can you try the attached patch? If it does not solve the issue, could you provide a log.

Quoted 6 lines
Quoted 3 lines

Yes, that works great, thanks.

Did this patch get applied anywhere? I was hoping it'd go into 3.10-rc* given it's a user-triggerable backtrace introduced in 3.10-rc*.

Hi Stephen,

Quoted 8 lines

The patch went into the wireless-next tree. Given recent events with our patch series I am a bit more carsful to tag patches for 3.10. Your issue is user-triggerable but the scenario to get there can be avoided. But you are right it was introduced in the 3.10-rc cycle. I leave it to John to decide.

Regards,
Arend

I've just applied it to the wireless tree. I doubt if it will make -rc6, but it might make the final 3.10.

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.