linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Kalle Valo <kvalo@codeaurora.org>,
	Hante Meuleman <meuleman@broadcom.com>
Cc: David Miller <davem@davemloft.net>,
	Arend van Spriel <arend@broadcom.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-wireless@vger.kernel.org
Subject: Re: [GIT] Networking
Date: Mon, 18 Jan 2016 11:30:26 +0000	[thread overview]
Message-ID: <569CCCD2.4040105@arm.com> (raw)
In-Reply-To: <87k2n97n5e.fsf@kamboji.qca.qualcomm.com>

Hi Kalle,

On 16/01/16 11:57, Kalle Valo wrote:
> Marc Zyngier <marc.zyngier@arm.com> writes:
> 
>> David, Hante,
>>
>> On 13/01/16 02:51, David Miller wrote:
>>
>> [...]
>>
>>> Hante Meuleman (33):
>> [...]
>>>       brcmfmac: Move all module parameters to one place
> 
> As a reminder to myself this is the commit id:
> 
> 7d34b0560567 brcmfmac: Move all module parameters to one place
> 
>> This particular patch breaks one of my boxes in a spectacular way:
>>
>> [    3.602155] Unable to handle kernel paging request at virtual address 000027e4
>> [    3.602160] pgd = c0003000
>> [    3.602169] [000027e4] *pgd=80000040004003, *pmd=00000000
>> [    3.602181] Internal error: Oops: 206 [#1] PREEMPT SMP ARM
> 
> [...]
> 
>> This is caused by this hunk:
>>
>> @@ -890,7 +887,8 @@ static void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev)
>>  	if (!sdiodev->sg_support)
>>  		return;
>>  
>> -	nents = max_t(uint, BRCMF_DEFAULT_RXGLOM_SIZE, brcmf_sdiod_txglomsz);
>> +	nents = max_t(uint, BRCMF_DEFAULT_RXGLOM_SIZE,
>> +		      sdiodev->bus_if->drvr->settings->sdiod_txglomsz);
>>  	nents += (nents >> 4) + 1;
>>  
>>  	WARN_ON(nents > sdiodev->max_segment_count);
>>
>> were drvr->settings is NULL (as the settings allocation seems to be done
>> much later). The fix is not completely obvious to me (probably requires
>> pushing the call to brcmf_mp_device_attach() down into the various bus
>> specific functions). An alternative would be to restore the txglomsz
>> parameter as it was before and not rely on settings being allocated.
> 
> Should we revert the patch or can you Hante fix this? The revert doesn't
> seem to be trivial so I would appreciate if someone could send a patch.

I've worked out a partial revert (see below) that allows my system to
boot, but I'd rather see a proper fix from the maintainer of this code.

Thanks,

	M.

>From 4dcd43e859ebf4453da90de2034c37174bb88d13 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Mon, 18 Jan 2016 11:16:36 +0000
Subject: [PATCH] brcmfmac: Partial revert of module parameter rework

Commit 7d34b0560567 ("brcmfmac: Move all module parameters to one
place") reworked the brcmfmac driver parameters and moved them to
a dynamically allocated structure.

It turns out that at least one parameter (sdiod_txglomsz) is required
before this structure is allocated, leading to a crash.

This patch reverts the handling of that parameter until the maintainer
of this driver can sort it out for good.

Cc: Arend Van Spriel <arend@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 12 +++++++-----
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c |  7 -------
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h |  2 --
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index 5363739..410a664 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -47,8 +47,6 @@
 #include "debug.h"
 #include "sdio.h"
 #include "of.h"
-#include "core.h"
-#include "common.h"
 
 #define SDIOH_API_ACCESS_RETRY_LIMIT	2
 
@@ -59,6 +57,7 @@
 /* Maximum milliseconds to wait for F2 to come up */
 #define SDIO_WAIT_F2RDY	3000
 
+#define BRCMF_DEFAULT_TXGLOM_SIZE	32  /* max tx frames in glom chain */
 #define BRCMF_DEFAULT_RXGLOM_SIZE	32  /* max rx frames in glom chain */
 
 struct brcmf_sdiod_freezer {
@@ -69,6 +68,10 @@ struct brcmf_sdiod_freezer {
 	struct completion resumed;
 };
 
+static int brcmf_sdiod_txglomsz = BRCMF_DEFAULT_TXGLOM_SIZE;
+module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0);
+MODULE_PARM_DESC(txglomsz, "maximum tx packet chain size [SDIO]");
+
 static irqreturn_t brcmf_sdiod_oob_irqhandler(int irq, void *dev_id)
 {
 	struct brcmf_bus *bus_if = dev_get_drvdata(dev_id);
@@ -887,8 +890,7 @@ static void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev)
 	if (!sdiodev->sg_support)
 		return;
 
-	nents = max_t(uint, BRCMF_DEFAULT_RXGLOM_SIZE,
-		      sdiodev->bus_if->drvr->settings->sdiod_txglomsz);
+	nents = max_t(uint, BRCMF_DEFAULT_RXGLOM_SIZE, brcmf_sdiod_txglomsz);
 	nents += (nents >> 4) + 1;
 
 	WARN_ON(nents > sdiodev->max_segment_count);
@@ -900,7 +902,7 @@ static void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev)
 		sdiodev->sg_support = false;
 	}
 
-	sdiodev->txglomsz = sdiodev->bus_if->drvr->settings->sdiod_txglomsz;
+	sdiodev->txglomsz = brcmf_sdiod_txglomsz;
 }
 
 #ifdef CONFIG_PM_SLEEP
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
index 4265b50..1f57c42 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
@@ -35,12 +35,6 @@ const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 /* boost value for RSSI_DELTA in preferred join selection */
 #define BRCMF_JOIN_PREF_RSSI_BOOST	8
 
-#define BRCMF_DEFAULT_TXGLOM_SIZE	32  /* max tx frames in glom chain */
-
-static int brcmf_sdiod_txglomsz = BRCMF_DEFAULT_TXGLOM_SIZE;
-module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0);
-MODULE_PARM_DESC(txglomsz, "Maximum tx packet chain size [SDIO]");
-
 /* Debug level configuration. See debug.h for bits, sysfs modifiable */
 int brcmf_msg_level;
 module_param_named(debug, brcmf_msg_level, int, S_IRUSR | S_IWUSR);
@@ -234,7 +228,6 @@ int brcmf_mp_device_attach(struct brcmf_pub *drvr)
 		return -ENOMEM;
 	}
 
-	drvr->settings->sdiod_txglomsz = brcmf_sdiod_txglomsz;
 	drvr->settings->p2p_enable = !!brcmf_p2p_enable;
 	drvr->settings->feature_disable = brcmf_feature_disable;
 	drvr->settings->fcmode = brcmf_fcmode;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
index 3b0a63b..05ad4b8 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
@@ -41,7 +41,6 @@ extern struct brcmf_mp_global_t brcmf_mp_global;
 /**
  * struct brcmf_mp_device - Device module paramaters.
  *
- * @sdiod_txglomsz: SDIO txglom size.
  * @joinboost_5g_rssi: 5g rssi booost for preferred join selection.
  * @p2p_enable: Legacy P2P0 enable (old wpa_supplicant).
  * @feature_disable: Feature_disable bitmask.
@@ -49,7 +48,6 @@ extern struct brcmf_mp_global_t brcmf_mp_global;
  * @roamoff: Firmware roaming off?
  */
 struct brcmf_mp_device {
-	int	sdiod_txglomsz;
 	int	joinboost_5g_rssi;
 	bool	p2p_enable;
 	int	feature_disable;
-- 
2.1.4


-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2016-01-18 11:30 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160112.215136.850414372508130298.davem@davemloft.net>
     [not found] ` <56978094.4050302@arm.com>
2016-01-16 11:57   ` [GIT] Networking Kalle Valo
2016-01-18 11:30     ` Marc Zyngier [this message]
2016-01-18 22:05       ` Arend van Spriel
2016-01-19  8:55         ` Marc Zyngier
2016-01-19  9:36           ` Arend van Spriel
2016-01-19  9:51             ` Marc Zyngier
2016-01-19 13:08           ` Kalle Valo
     [not found] <20181023.202921.1185045750138652543.davem@davemloft.net>
     [not found] ` <CAHk-=whuhCGujWKO8JObGQaSdWOpJBXdkM-B-vD80QZifveScw@mail.gmail.com>
2018-10-24  7:30   ` Kalle Valo
     [not found]   ` <CAHk-=wh2H9jE2RXibQgWs3_Q539roj62_gzPXKjnhhKqSFcw2g@mail.gmail.com>
2018-10-24  7:50     ` Kalle Valo
2018-10-24  8:05       ` Kalle Valo
2018-10-24 13:28         ` Andy Gross
     [not found]         ` <CAPBZ5Qen9ak4eFqdHEKNVoGBWUtohu_hwYxZ2cwmyAU=a8Mv9A@mail.gmail.com>
2018-10-24 13:40           ` Linus Torvalds
     [not found] <20170905.214143.826912481689443792.davem@davemloft.net>
2017-09-06 23:27 ` Linus Torvalds
2017-09-06 23:31   ` David Miller
2017-09-06 23:37   ` Linus Torvalds
2017-09-07  4:11   ` Coelho, Luciano
2017-09-07  4:57     ` Linus Torvalds
2017-09-07  5:04       ` Coelho, Luciano
2017-09-07  5:40         ` Luca Coelho
2017-09-07  5:46           ` Linus Torvalds
     [not found] <87pobdt8qc.fsf@kamboji.qca.qualcomm.com>
     [not found] ` <20170830.101143.2305098064824357647.davem@davemloft.net>
     [not found]   ` <87val5rmh8.fsf@kamboji.qca.qualcomm.com>
     [not found]     ` <20170830.105447.125174575140677062.davem@davemloft.net>
     [not found]       ` <87fuc8s5v9.fsf@kamboji.qca.qualcomm.com>
     [not found]         ` <20170831065204.GA17812@amd>
2017-08-31 11:50           ` Kalle Valo
     [not found] <20170108.223847.1035900535306187665.davem@davemloft.net>
     [not found] ` <CA+55aFzjL6Tf7JazeZtbi9UARhqofWU8xzYm0rbdAeCsD+nMPw@mail.gmail.com>
2017-01-09 20:34   ` Kalle Valo
     [not found] <20160517.151113.367799295750703003.davem@davemloft.net>
2016-05-18  1:00 ` Linus Torvalds
2016-05-18  3:37   ` Emmanuel Grumbach
2016-05-18 10:51     ` Coelho, Luciano
2016-05-18 12:20       ` Reinoud Koornstra
2016-05-18 12:41         ` Coelho, Luciano
2016-05-18 12:51           ` Reinoud Koornstra
2016-05-18 14:23             ` Coelho, Luciano
2016-05-18 18:45               ` Linus Torvalds
2016-05-18 18:50                 ` Coelho, Luciano
2016-05-18 18:58                   ` Kalle Valo
2016-05-18 19:00                     ` Linus Torvalds
2016-05-18 19:03                       ` Coelho, Luciano
2016-05-18 19:11                       ` Kalle Valo
2016-05-18 18:51                 ` Linus Torvalds
2016-05-19  8:20                   ` Reinoud Koornstra
2016-05-19  9:14                     ` Reinoud Koornstra
2016-05-19  9:40                       ` Sedat Dilek
2016-05-19  4:08                 ` David Miller
     [not found] <20150624.063911.1220157256743743341.davem@davemloft.net>
2015-07-20 10:11 ` Xiong Zhou
2015-07-20 10:44   ` Johannes Berg
     [not found] <20140612.121445.484288603919840829.davem@davemloft.net>
     [not found] ` <CA+55aFy=CThoSKAJ6J3Jt-SJDkiGzwg=5tdF7_g+vyTEoPFzMQ@mail.gmail.com>
2014-06-13  6:59   ` Johannes Berg
2014-06-13  7:21     ` Geert Uytterhoeven
2014-06-13 14:28     ` Linus Torvalds
2014-06-13 14:44       ` Dave Jones
2013-11-11 20:47 David Miller
  -- strict thread matches above, loose matches on Subject: below --
2011-03-16 21:21 David Miller
2011-01-12  0:24 David Miller
     [not found] <20080903.161341.239039051.davem@davemloft.net>
     [not found] ` <alpine.LFD.1.10.0809031615450.3515@nehalem.linux-foundation.org>
2008-09-03 23:24   ` [GIT]: Networking David Miller
     [not found]   ` <alpine.LFD.1.10.0809031621160.3515@nehalem.linux-foundation.org>
2008-09-03 23:26     ` David Miller
2008-09-04  0:01       ` Luis R. Rodriguez
2008-09-04  0:10         ` david
2008-09-04  0:18         ` Linus Torvalds
2008-09-04  2:33           ` Tomas Winkler
2008-09-04  8:25       ` Rafael J. Wysocki
2008-09-04  9:35         ` Jeff Garzik
2008-09-04  9:58           ` Rafael J. Wysocki
2008-09-04 17:21             ` Andrew Morton

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=569CCCD2.4040105@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=arend@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=meuleman@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /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).