* [PATCH for-3.12 1/3] brcmfmac: obtain platform data upon module initialization
2013-09-25 10:11 [PATCH for-3.12 0/3] brcm80211: fixes for reported issues Arend van Spriel
@ 2013-09-25 10:11 ` Arend van Spriel
2013-09-25 10:11 ` [PATCH for-3.12 2/3] bcma: make bcma_core_pci_{up,down}() callable from atomic context Arend van Spriel
2013-09-25 10:11 ` [PATCH for-3.12 3/3] brcmsmac: call bcma_core_pci_power_save() from non-atomic context Arend van Spriel
2 siblings, 0 replies; 6+ messages in thread
From: Arend van Spriel @ 2013-09-25 10:11 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel, stable
The driver uses platform_driver_probe() to obtain platform data
if any. However, that function is placed in the .init section so
it must be called upon driver module initialization.
The problem was reported by Fenguang Wu resulting in a kernel
oops because the .init section was already freed.
[ 48.966342] Switched to clocksource tsc
[ 48.970002] kernel tried to execute NX-protected page - exploit attempt? (uid: 0)
[ 48.970851] BUG: unable to handle kernel paging request at ffffffff82196446
[ 48.970957] IP: [<ffffffff82196446>] classes_init+0x26/0x26
[ 48.970957] PGD 1e76067 PUD 1e77063 PMD f388063 PTE 8000000002196163
[ 48.970957] Oops: 0011 [#1]
[ 48.970957] CPU: 0 PID: 17 Comm: kworker/0:1 Not tainted 3.11.0-rc7-00444-gc52dd7f #23
[ 48.970957] Workqueue: events brcmf_driver_init
[ 48.970957] task: ffff8800001d2000 ti: ffff8800001d4000 task.ti: ffff8800001d4000
[ 48.970957] RIP: 0010:[<ffffffff82196446>] [<ffffffff82196446>] classes_init+0x26/0x26
[ 48.970957] RSP: 0000:ffff8800001d5d40 EFLAGS: 00000286
[ 48.970957] RAX: 0000000000000001 RBX: ffffffff820c5620 RCX: 0000000000000000
[ 48.970957] RDX: 0000000000000001 RSI: ffffffff816f7380 RDI: ffffffff820c56c0
[ 48.970957] RBP: ffff8800001d5d50 R08: ffff8800001d2508 R09: 0000000000000002
[ 48.970957] R10: 0000000000000000 R11: 0001f7ce298c5620 R12: ffff8800001c76b0
[ 48.970957] R13: ffffffff81e91d40 R14: 0000000000000000 R15: ffff88000e0ce300
[ 48.970957] FS: 0000000000000000(0000) GS:ffffffff81e84000(0000) knlGS:0000000000000000
[ 48.970957] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 48.970957] CR2: ffffffff82196446 CR3: 0000000001e75000 CR4: 00000000000006b0
[ 48.970957] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 48.970957] DR3: 0000000000000000 DR6: 0000000000000000 DR7: 0000000000000000
[ 48.970957] Stack:
[ 48.970957] ffffffff816f7df8 ffffffff820c5620 ffff8800001d5d60 ffffffff816eeec9
[ 48.970957] ffff8800001d5de0 ffffffff81073dc5 ffffffff81073d68 ffff8800001d5db8
[ 48.970957] 0000000000000086 ffffffff820c5620 ffffffff824f7fd0 0000000000000000
[ 48.970957] Call Trace:
[ 48.970957] [<ffffffff816f7df8>] ? brcmf_sdio_init+0x18/0x70
[ 48.970957] [<ffffffff816eeec9>] brcmf_driver_init+0x9/0x10
[ 48.970957] [<ffffffff81073dc5>] process_one_work+0x1d5/0x480
[ 48.970957] [<ffffffff81073d68>] ? process_one_work+0x178/0x480
[ 48.970957] [<ffffffff81074188>] worker_thread+0x118/0x3a0
[ 48.970957] [<ffffffff81074070>] ? process_one_work+0x480/0x480
[ 48.970957] [<ffffffff8107aa17>] kthread+0xe7/0xf0
[ 48.970957] [<ffffffff810829f7>] ? finish_task_switch.constprop.57+0x37/0xd0
[ 48.970957] [<ffffffff8107a930>] ? __kthread_parkme+0x80/0x80
[ 48.970957] [<ffffffff81a6923a>] ret_from_fork+0x7a/0xb0
[ 48.970957] [<ffffffff8107a930>] ? __kthread_parkme+0x80/0x80
[ 48.970957] Code: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
cc cc cc cc cc cc <cc> cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
[ 48.970957] RIP [<ffffffff82196446>] classes_init+0x26/0x26
[ 48.970957] RSP <ffff8800001d5d40>
[ 48.970957] CR2: ffffffff82196446
[ 48.970957] ---[ end trace 62980817cd525f14 ]---
Cc: <stable@vger.kernel.org> # 3.10.x, 3.11.x
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
.../net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 28 +++++++++-----------
drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | 3 ++-
.../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 14 +++++-----
drivers/net/wireless/brcm80211/brcmfmac/usb.c | 2 +-
4 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 64f4a2b..c3462b7 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -464,8 +464,6 @@ static struct sdio_driver brcmf_sdmmc_driver = {
static int brcmf_sdio_pd_probe(struct platform_device *pdev)
{
- int ret;
-
brcmf_dbg(SDIO, "Enter\n");
brcmfmac_sdio_pdata = pdev->dev.platform_data;
@@ -473,11 +471,7 @@ static int brcmf_sdio_pd_probe(struct platform_device *pdev)
if (brcmfmac_sdio_pdata->power_on)
brcmfmac_sdio_pdata->power_on();
- ret = sdio_register_driver(&brcmf_sdmmc_driver);
- if (ret)
- brcmf_err("sdio_register_driver failed: %d\n", ret);
-
- return ret;
+ return 0;
}
static int brcmf_sdio_pd_remove(struct platform_device *pdev)
@@ -500,6 +494,15 @@ static struct platform_driver brcmf_sdio_pd = {
}
};
+void brcmf_sdio_register(void)
+{
+ int ret;
+
+ ret = sdio_register_driver(&brcmf_sdmmc_driver);
+ if (ret)
+ brcmf_err("sdio_register_driver failed: %d\n", ret);
+}
+
void brcmf_sdio_exit(void)
{
brcmf_dbg(SDIO, "Enter\n");
@@ -510,18 +513,13 @@ void brcmf_sdio_exit(void)
sdio_unregister_driver(&brcmf_sdmmc_driver);
}
-void brcmf_sdio_init(void)
+void __init brcmf_sdio_init(void)
{
int ret;
brcmf_dbg(SDIO, "Enter\n");
ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe);
- if (ret == -ENODEV) {
- brcmf_dbg(SDIO, "No platform data available, registering without.\n");
- ret = sdio_register_driver(&brcmf_sdmmc_driver);
- }
-
- if (ret)
- brcmf_err("driver registration failed: %d\n", ret);
+ if (ret == -ENODEV)
+ brcmf_dbg(SDIO, "No platform data available.\n");
}
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
index f7c1985..74156f8 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
@@ -156,10 +156,11 @@ extern int brcmf_bus_start(struct device *dev);
#ifdef CONFIG_BRCMFMAC_SDIO
extern void brcmf_sdio_exit(void);
extern void brcmf_sdio_init(void);
+extern void brcmf_sdio_register(void);
#endif
#ifdef CONFIG_BRCMFMAC_USB
extern void brcmf_usb_exit(void);
-extern void brcmf_usb_init(void);
+extern void brcmf_usb_register(void);
#endif
#endif /* _BRCMF_BUS_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index e067aec..40e7f85 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -1231,21 +1231,23 @@ u32 brcmf_get_chip_info(struct brcmf_if *ifp)
return bus->chip << 4 | bus->chiprev;
}
-static void brcmf_driver_init(struct work_struct *work)
+static void brcmf_driver_register(struct work_struct *work)
{
- brcmf_debugfs_init();
-
#ifdef CONFIG_BRCMFMAC_SDIO
- brcmf_sdio_init();
+ brcmf_sdio_register();
#endif
#ifdef CONFIG_BRCMFMAC_USB
- brcmf_usb_init();
+ brcmf_usb_register();
#endif
}
-static DECLARE_WORK(brcmf_driver_work, brcmf_driver_init);
+static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register);
static int __init brcmfmac_module_init(void)
{
+ brcmf_debugfs_init();
+#ifdef CONFIG_BRCMFMAC_SDIO
+ brcmf_sdio_init();
+#endif
if (!schedule_work(&brcmf_driver_work))
return -EBUSY;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index 39e01a7..f4aea47 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -1539,7 +1539,7 @@ void brcmf_usb_exit(void)
brcmf_release_fw(&fw_image_list);
}
-void brcmf_usb_init(void)
+void brcmf_usb_register(void)
{
brcmf_dbg(USB, "Enter\n");
INIT_LIST_HEAD(&fw_image_list);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH for-3.12 2/3] bcma: make bcma_core_pci_{up,down}() callable from atomic context
2013-09-25 10:11 [PATCH for-3.12 0/3] brcm80211: fixes for reported issues Arend van Spriel
2013-09-25 10:11 ` [PATCH for-3.12 1/3] brcmfmac: obtain platform data upon module initialization Arend van Spriel
@ 2013-09-25 10:11 ` Arend van Spriel
2013-10-02 11:53 ` Hauke Mehrtens
2013-09-25 10:11 ` [PATCH for-3.12 3/3] brcmsmac: call bcma_core_pci_power_save() from non-atomic context Arend van Spriel
2 siblings, 1 reply; 6+ messages in thread
From: Arend van Spriel @ 2013-09-25 10:11 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless, Arend van Spriel, stable, Tod Jackson,
Joe Perches, Rafal Milecki, Hauke Mehrtens
This patch removes the bcma_core_pci_power_save() call from
the bcma_core_pci_{up,down}() functions as it tries to schedule
thus requiring to call them from non-atomic context. The function
bcma_core_pci_power_save() is now exported so the calling module
can explicitly use it in non-atomic context. This fixes the
'scheduling while atomic' issue reported by Tod Jackson and
Joe Perches.
[ 13.210710] BUG: scheduling while atomic: dhcpcd/1800/0x00000202
[ 13.210718] Modules linked in: brcmsmac nouveau coretemp kvm_intel kvm cordic brcmutil bcma dell_wmi atl1c ttm mxm_wmi wmi
[ 13.210756] CPU: 2 PID: 1800 Comm: dhcpcd Not tainted 3.11.0-wl #1
[ 13.210762] Hardware name: Alienware M11x R2/M11x R2, BIOS A04 11/23/2010
[ 13.210767] ffff880177c92c40 ffff880170fd1948 ffffffff8169af5b 0000000000000007
[ 13.210777] ffff880170fd1ab0 ffff880170fd1958 ffffffff81697ee2 ffff880170fd19d8
[ 13.210785] ffffffff816a19f5 00000000000f4240 000000000000d080 ffff880170fd1fd8
[ 13.210794] Call Trace:
[ 13.210813] [<ffffffff8169af5b>] dump_stack+0x4f/0x84
[ 13.210826] [<ffffffff81697ee2>] __schedule_bug+0x43/0x51
[ 13.210837] [<ffffffff816a19f5>] __schedule+0x6e5/0x810
[ 13.210845] [<ffffffff816a1c34>] schedule+0x24/0x70
[ 13.210855] [<ffffffff816a04fc>] schedule_hrtimeout_range_clock+0x10c/0x150
[ 13.210867] [<ffffffff810684e0>] ? update_rmtp+0x60/0x60
[ 13.210877] [<ffffffff8106915f>] ? hrtimer_start_range_ns+0xf/0x20
[ 13.210887] [<ffffffff816a054e>] schedule_hrtimeout_range+0xe/0x10
[ 13.210897] [<ffffffff8104f6fb>] usleep_range+0x3b/0x40
[ 13.210910] [<ffffffffa00371af>] bcma_pcie_mdio_set_phy.isra.3+0x4f/0x80 [bcma]
[ 13.210921] [<ffffffffa003729f>] bcma_pcie_mdio_write.isra.4+0xbf/0xd0 [bcma]
[ 13.210932] [<ffffffffa0037498>] bcma_pcie_mdio_writeread.isra.6.constprop.13+0x18/0x30 [bcma]
[ 13.210942] [<ffffffffa00374ee>] bcma_core_pci_power_save+0x3e/0x80 [bcma]
[ 13.210953] [<ffffffffa003765d>] bcma_core_pci_up+0x2d/0x60 [bcma]
[ 13.210975] [<ffffffffa03dc17c>] brcms_c_up+0xfc/0x430 [brcmsmac]
[ 13.210989] [<ffffffffa03d1a7d>] brcms_up+0x1d/0x20 [brcmsmac]
[ 13.211003] [<ffffffffa03d2498>] brcms_ops_start+0x298/0x340 [brcmsmac]
[ 13.211020] [<ffffffff81600a12>] ? cfg80211_netdev_notifier_call+0xd2/0x5f0
[ 13.211030] [<ffffffff815fa53d>] ? packet_notifier+0xad/0x1d0
[ 13.211064] [<ffffffff81656e75>] ieee80211_do_open+0x325/0xf80
[ 13.211076] [<ffffffff8106ac09>] ? __raw_notifier_call_chain+0x9/0x10
[ 13.211086] [<ffffffff81657b41>] ieee80211_open+0x71/0x80
[ 13.211101] [<ffffffff81526267>] __dev_open+0x87/0xe0
[ 13.211109] [<ffffffff8152650c>] __dev_change_flags+0x9c/0x180
[ 13.211117] [<ffffffff815266a3>] dev_change_flags+0x23/0x70
[ 13.211127] [<ffffffff8158cd68>] devinet_ioctl+0x5b8/0x6a0
[ 13.211136] [<ffffffff8158d5c5>] inet_ioctl+0x75/0x90
[ 13.211147] [<ffffffff8150b38b>] sock_do_ioctl+0x2b/0x70
[ 13.211155] [<ffffffff8150b681>] sock_ioctl+0x71/0x2a0
[ 13.211169] [<ffffffff8114ed47>] do_vfs_ioctl+0x87/0x520
[ 13.211180] [<ffffffff8113f159>] ? ____fput+0x9/0x10
[ 13.211198] [<ffffffff8106228c>] ? task_work_run+0x9c/0xd0
[ 13.211202] [<ffffffff8114f271>] SyS_ioctl+0x91/0xb0
[ 13.211208] [<ffffffff816aa252>] system_call_fastpath+0x16/0x1b
[ 13.211217] NOHZ: local_softirq_pending 202
The issue was introduced in v3.11 kernel by following commit:
commit aa51e598d04c6acf5477934cd6383f5a17ce9029
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat Aug 24 00:32:31 2013 +0200
brcmsmac: use bcma PCIe up and down functions
replace the calls to bcma_core_pci_extend_L1timer() by calls to the
newly introduced bcma_core_pci_ip() and bcma_core_pci_down()
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This fix has been discussed with Hauke Mehrtens [1] selection
option 3) and is intended for v3.12.
Ref:
[1] http://mid.gmane.org/5239B12D.3040206@hauke-m.de
Cc: <stable@vger.kernel.org> # 3.11.x
Cc: Tod Jackson <tod.jackson@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Rafal Milecki <zajec5@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/bcma/driver_pci.c | 49 ++++++++++++++++++----------------
include/linux/bcma/bcma_driver_pci.h | 1 +
2 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index c9fd694..50329d1 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -210,25 +210,6 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc)
}
}
-static void bcma_core_pci_power_save(struct bcma_drv_pci *pc, bool up)
-{
- u16 data;
-
- if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
- data = up ? 0x74 : 0x7C;
- bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
- BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64);
- bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
- BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
- } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) {
- data = up ? 0x75 : 0x7D;
- bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
- BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65);
- bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
- BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
- }
-}
-
/**************************************************
* Init.
**************************************************/
@@ -255,6 +236,32 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc)
bcma_core_pci_clientmode_init(pc);
}
+void bcma_core_pci_power_save(struct bcma_bus *bus, bool up)
+{
+ struct bcma_drv_pci *pc;
+ u16 data;
+
+ if (bus->hosttype != BCMA_HOSTTYPE_PCI)
+ return;
+
+ pc = &bus->drv_pci[0];
+
+ if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
+ data = up ? 0x74 : 0x7C;
+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
+ BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64);
+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
+ BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
+ } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) {
+ data = up ? 0x75 : 0x7D;
+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
+ BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65);
+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
+ BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
+ }
+}
+EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);
+
int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
bool enable)
{
@@ -310,8 +317,6 @@ void bcma_core_pci_up(struct bcma_bus *bus)
pc = &bus->drv_pci[0];
- bcma_core_pci_power_save(pc, true);
-
bcma_core_pci_extend_L1timer(pc, true);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_up);
@@ -326,7 +331,5 @@ void bcma_core_pci_down(struct bcma_bus *bus)
pc = &bus->drv_pci[0];
bcma_core_pci_extend_L1timer(pc, false);
-
- bcma_core_pci_power_save(pc, false);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_down);
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index d66033f..0333e60 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -242,6 +242,7 @@ extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
struct bcma_device *core, bool enable);
extern void bcma_core_pci_up(struct bcma_bus *bus);
extern void bcma_core_pci_down(struct bcma_bus *bus);
+extern void bcma_core_pci_power_save(struct bcma_bus *bus, bool up);
extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH for-3.12 2/3] bcma: make bcma_core_pci_{up,down}() callable from atomic context
2013-09-25 10:11 ` [PATCH for-3.12 2/3] bcma: make bcma_core_pci_{up,down}() callable from atomic context Arend van Spriel
@ 2013-10-02 11:53 ` Hauke Mehrtens
2013-10-02 23:02 ` Tod Jackson
0 siblings, 1 reply; 6+ messages in thread
From: Hauke Mehrtens @ 2013-10-02 11:53 UTC (permalink / raw)
To: Arend van Spriel, John W. Linville
Cc: linux-wireless, stable, Tod Jackson, Joe Perches, Rafal Milecki
On 09/25/2013 12:11 PM, Arend van Spriel wrote:
> This patch removes the bcma_core_pci_power_save() call from
> the bcma_core_pci_{up,down}() functions as it tries to schedule
> thus requiring to call them from non-atomic context. The function
> bcma_core_pci_power_save() is now exported so the calling module
> can explicitly use it in non-atomic context. This fixes the
> 'scheduling while atomic' issue reported by Tod Jackson and
> Joe Perches.
>
> [ 13.210710] BUG: scheduling while atomic: dhcpcd/1800/0x00000202
> [ 13.210718] Modules linked in: brcmsmac nouveau coretemp kvm_intel kvm cordic brcmutil bcma dell_wmi atl1c ttm mxm_wmi wmi
> [ 13.210756] CPU: 2 PID: 1800 Comm: dhcpcd Not tainted 3.11.0-wl #1
> [ 13.210762] Hardware name: Alienware M11x R2/M11x R2, BIOS A04 11/23/2010
> [ 13.210767] ffff880177c92c40 ffff880170fd1948 ffffffff8169af5b 0000000000000007
> [ 13.210777] ffff880170fd1ab0 ffff880170fd1958 ffffffff81697ee2 ffff880170fd19d8
> [ 13.210785] ffffffff816a19f5 00000000000f4240 000000000000d080 ffff880170fd1fd8
> [ 13.210794] Call Trace:
> [ 13.210813] [<ffffffff8169af5b>] dump_stack+0x4f/0x84
> [ 13.210826] [<ffffffff81697ee2>] __schedule_bug+0x43/0x51
> [ 13.210837] [<ffffffff816a19f5>] __schedule+0x6e5/0x810
> [ 13.210845] [<ffffffff816a1c34>] schedule+0x24/0x70
> [ 13.210855] [<ffffffff816a04fc>] schedule_hrtimeout_range_clock+0x10c/0x150
> [ 13.210867] [<ffffffff810684e0>] ? update_rmtp+0x60/0x60
> [ 13.210877] [<ffffffff8106915f>] ? hrtimer_start_range_ns+0xf/0x20
> [ 13.210887] [<ffffffff816a054e>] schedule_hrtimeout_range+0xe/0x10
> [ 13.210897] [<ffffffff8104f6fb>] usleep_range+0x3b/0x40
> [ 13.210910] [<ffffffffa00371af>] bcma_pcie_mdio_set_phy.isra.3+0x4f/0x80 [bcma]
> [ 13.210921] [<ffffffffa003729f>] bcma_pcie_mdio_write.isra.4+0xbf/0xd0 [bcma]
> [ 13.210932] [<ffffffffa0037498>] bcma_pcie_mdio_writeread.isra.6.constprop.13+0x18/0x30 [bcma]
> [ 13.210942] [<ffffffffa00374ee>] bcma_core_pci_power_save+0x3e/0x80 [bcma]
> [ 13.210953] [<ffffffffa003765d>] bcma_core_pci_up+0x2d/0x60 [bcma]
> [ 13.210975] [<ffffffffa03dc17c>] brcms_c_up+0xfc/0x430 [brcmsmac]
> [ 13.210989] [<ffffffffa03d1a7d>] brcms_up+0x1d/0x20 [brcmsmac]
> [ 13.211003] [<ffffffffa03d2498>] brcms_ops_start+0x298/0x340 [brcmsmac]
> [ 13.211020] [<ffffffff81600a12>] ? cfg80211_netdev_notifier_call+0xd2/0x5f0
> [ 13.211030] [<ffffffff815fa53d>] ? packet_notifier+0xad/0x1d0
> [ 13.211064] [<ffffffff81656e75>] ieee80211_do_open+0x325/0xf80
> [ 13.211076] [<ffffffff8106ac09>] ? __raw_notifier_call_chain+0x9/0x10
> [ 13.211086] [<ffffffff81657b41>] ieee80211_open+0x71/0x80
> [ 13.211101] [<ffffffff81526267>] __dev_open+0x87/0xe0
> [ 13.211109] [<ffffffff8152650c>] __dev_change_flags+0x9c/0x180
> [ 13.211117] [<ffffffff815266a3>] dev_change_flags+0x23/0x70
> [ 13.211127] [<ffffffff8158cd68>] devinet_ioctl+0x5b8/0x6a0
> [ 13.211136] [<ffffffff8158d5c5>] inet_ioctl+0x75/0x90
> [ 13.211147] [<ffffffff8150b38b>] sock_do_ioctl+0x2b/0x70
> [ 13.211155] [<ffffffff8150b681>] sock_ioctl+0x71/0x2a0
> [ 13.211169] [<ffffffff8114ed47>] do_vfs_ioctl+0x87/0x520
> [ 13.211180] [<ffffffff8113f159>] ? ____fput+0x9/0x10
> [ 13.211198] [<ffffffff8106228c>] ? task_work_run+0x9c/0xd0
> [ 13.211202] [<ffffffff8114f271>] SyS_ioctl+0x91/0xb0
> [ 13.211208] [<ffffffff816aa252>] system_call_fastpath+0x16/0x1b
> [ 13.211217] NOHZ: local_softirq_pending 202
>
> The issue was introduced in v3.11 kernel by following commit:
>
> commit aa51e598d04c6acf5477934cd6383f5a17ce9029
> Author: Hauke Mehrtens <hauke@hauke-m.de>
> Date: Sat Aug 24 00:32:31 2013 +0200
>
> brcmsmac: use bcma PCIe up and down functions
>
> replace the calls to bcma_core_pci_extend_L1timer() by calls to the
> newly introduced bcma_core_pci_ip() and bcma_core_pci_down()
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> Cc: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> This fix has been discussed with Hauke Mehrtens [1] selection
> option 3) and is intended for v3.12.
>
> Ref:
> [1] http://mid.gmane.org/5239B12D.3040206@hauke-m.de
>
> Cc: <stable@vger.kernel.org> # 3.11.x
> Cc: Tod Jackson <tod.jackson@gmail.com>
> Cc: Joe Perches <joe@perches.com>
> Cc: Rafal Milecki <zajec5@gmail.com>
> Cc: Hauke Mehrtens <hauke@hauke-m.de>
> Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
> Signed-off-by: Arend van Spriel <arend@broadcom.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Hi,
This is a little late but I am ok with the brcmsmac patch and the bcma
patch, feel free to add my Acked-by. This should go into 3.12 and 3.13+.
Hauke
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH for-3.12 2/3] bcma: make bcma_core_pci_{up,down}() callable from atomic context
2013-10-02 11:53 ` Hauke Mehrtens
@ 2013-10-02 23:02 ` Tod Jackson
0 siblings, 0 replies; 6+ messages in thread
From: Tod Jackson @ 2013-10-02 23:02 UTC (permalink / raw)
To: Hauke Mehrtens
Cc: Arend van Spriel, John W. Linville, linux-wireless, stable,
Joe Perches, Rafal Milecki
The warnings are gone, indeed. brcmsmac is now working great for me.
(Late for me too... for some reason this e-mail was in my spam
folder... stupid gmail!)
On 10/2/13, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> On 09/25/2013 12:11 PM, Arend van Spriel wrote:
>> This patch removes the bcma_core_pci_power_save() call from
>> the bcma_core_pci_{up,down}() functions as it tries to schedule
>> thus requiring to call them from non-atomic context. The function
>> bcma_core_pci_power_save() is now exported so the calling module
>> can explicitly use it in non-atomic context. This fixes the
>> 'scheduling while atomic' issue reported by Tod Jackson and
>> Joe Perches.
>>
>> [ 13.210710] BUG: scheduling while atomic: dhcpcd/1800/0x00000202
>> [ 13.210718] Modules linked in: brcmsmac nouveau coretemp kvm_intel kvm
>> cordic brcmutil bcma dell_wmi atl1c ttm mxm_wmi wmi
>> [ 13.210756] CPU: 2 PID: 1800 Comm: dhcpcd Not tainted 3.11.0-wl #1
>> [ 13.210762] Hardware name: Alienware M11x R2/M11x R2, BIOS A04
>> 11/23/2010
>> [ 13.210767] ffff880177c92c40 ffff880170fd1948 ffffffff8169af5b
>> 0000000000000007
>> [ 13.210777] ffff880170fd1ab0 ffff880170fd1958 ffffffff81697ee2
>> ffff880170fd19d8
>> [ 13.210785] ffffffff816a19f5 00000000000f4240 000000000000d080
>> ffff880170fd1fd8
>> [ 13.210794] Call Trace:
>> [ 13.210813] [<ffffffff8169af5b>] dump_stack+0x4f/0x84
>> [ 13.210826] [<ffffffff81697ee2>] __schedule_bug+0x43/0x51
>> [ 13.210837] [<ffffffff816a19f5>] __schedule+0x6e5/0x810
>> [ 13.210845] [<ffffffff816a1c34>] schedule+0x24/0x70
>> [ 13.210855] [<ffffffff816a04fc>]
>> schedule_hrtimeout_range_clock+0x10c/0x150
>> [ 13.210867] [<ffffffff810684e0>] ? update_rmtp+0x60/0x60
>> [ 13.210877] [<ffffffff8106915f>] ? hrtimer_start_range_ns+0xf/0x20
>> [ 13.210887] [<ffffffff816a054e>] schedule_hrtimeout_range+0xe/0x10
>> [ 13.210897] [<ffffffff8104f6fb>] usleep_range+0x3b/0x40
>> [ 13.210910] [<ffffffffa00371af>]
>> bcma_pcie_mdio_set_phy.isra.3+0x4f/0x80 [bcma]
>> [ 13.210921] [<ffffffffa003729f>] bcma_pcie_mdio_write.isra.4+0xbf/0xd0
>> [bcma]
>> [ 13.210932] [<ffffffffa0037498>]
>> bcma_pcie_mdio_writeread.isra.6.constprop.13+0x18/0x30 [bcma]
>> [ 13.210942] [<ffffffffa00374ee>] bcma_core_pci_power_save+0x3e/0x80
>> [bcma]
>> [ 13.210953] [<ffffffffa003765d>] bcma_core_pci_up+0x2d/0x60 [bcma]
>> [ 13.210975] [<ffffffffa03dc17c>] brcms_c_up+0xfc/0x430 [brcmsmac]
>> [ 13.210989] [<ffffffffa03d1a7d>] brcms_up+0x1d/0x20 [brcmsmac]
>> [ 13.211003] [<ffffffffa03d2498>] brcms_ops_start+0x298/0x340
>> [brcmsmac]
>> [ 13.211020] [<ffffffff81600a12>] ?
>> cfg80211_netdev_notifier_call+0xd2/0x5f0
>> [ 13.211030] [<ffffffff815fa53d>] ? packet_notifier+0xad/0x1d0
>> [ 13.211064] [<ffffffff81656e75>] ieee80211_do_open+0x325/0xf80
>> [ 13.211076] [<ffffffff8106ac09>] ? __raw_notifier_call_chain+0x9/0x10
>> [ 13.211086] [<ffffffff81657b41>] ieee80211_open+0x71/0x80
>> [ 13.211101] [<ffffffff81526267>] __dev_open+0x87/0xe0
>> [ 13.211109] [<ffffffff8152650c>] __dev_change_flags+0x9c/0x180
>> [ 13.211117] [<ffffffff815266a3>] dev_change_flags+0x23/0x70
>> [ 13.211127] [<ffffffff8158cd68>] devinet_ioctl+0x5b8/0x6a0
>> [ 13.211136] [<ffffffff8158d5c5>] inet_ioctl+0x75/0x90
>> [ 13.211147] [<ffffffff8150b38b>] sock_do_ioctl+0x2b/0x70
>> [ 13.211155] [<ffffffff8150b681>] sock_ioctl+0x71/0x2a0
>> [ 13.211169] [<ffffffff8114ed47>] do_vfs_ioctl+0x87/0x520
>> [ 13.211180] [<ffffffff8113f159>] ? ____fput+0x9/0x10
>> [ 13.211198] [<ffffffff8106228c>] ? task_work_run+0x9c/0xd0
>> [ 13.211202] [<ffffffff8114f271>] SyS_ioctl+0x91/0xb0
>> [ 13.211208] [<ffffffff816aa252>] system_call_fastpath+0x16/0x1b
>> [ 13.211217] NOHZ: local_softirq_pending 202
>>
>> The issue was introduced in v3.11 kernel by following commit:
>>
>> commit aa51e598d04c6acf5477934cd6383f5a17ce9029
>> Author: Hauke Mehrtens <hauke@hauke-m.de>
>> Date: Sat Aug 24 00:32:31 2013 +0200
>>
>> brcmsmac: use bcma PCIe up and down functions
>>
>> replace the calls to bcma_core_pci_extend_L1timer() by calls to the
>> newly introduced bcma_core_pci_ip() and bcma_core_pci_down()
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> Cc: Arend van Spriel <arend@broadcom.com>
>> Signed-off-by: John W. Linville <linville@tuxdriver.com>
>>
>> This fix has been discussed with Hauke Mehrtens [1] selection
>> option 3) and is intended for v3.12.
>>
>> Ref:
>> [1] http://mid.gmane.org/5239B12D.3040206@hauke-m.de
>>
>> Cc: <stable@vger.kernel.org> # 3.11.x
>> Cc: Tod Jackson <tod.jackson@gmail.com>
>> Cc: Joe Perches <joe@perches.com>
>> Cc: Rafal Milecki <zajec5@gmail.com>
>> Cc: Hauke Mehrtens <hauke@hauke-m.de>
>> Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
>
> Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
>
>
> Hi,
>
> This is a little late but I am ok with the brcmsmac patch and the bcma
> patch, feel free to add my Acked-by. This should go into 3.12 and 3.13+.
>
> Hauke
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH for-3.12 3/3] brcmsmac: call bcma_core_pci_power_save() from non-atomic context
2013-09-25 10:11 [PATCH for-3.12 0/3] brcm80211: fixes for reported issues Arend van Spriel
2013-09-25 10:11 ` [PATCH for-3.12 1/3] brcmfmac: obtain platform data upon module initialization Arend van Spriel
2013-09-25 10:11 ` [PATCH for-3.12 2/3] bcma: make bcma_core_pci_{up,down}() callable from atomic context Arend van Spriel
@ 2013-09-25 10:11 ` Arend van Spriel
2 siblings, 0 replies; 6+ messages in thread
From: Arend van Spriel @ 2013-09-25 10:11 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless, Arend van Spriel, stable, Tod Jackson,
Joe Perches, Rafal Milecki, Hauke Mehrtens
This patch adds explicit call to bcma_core_pci_power_save() from
a non-atomic context resolving 'scheduling while atomic' issue.
[ 13.224317] BUG: scheduling while atomic: dhcpcd/1800/0x00000202
[ 13.224322] Modules linked in: brcmsmac nouveau coretemp kvm_intel kvm cordic brcmutil bcma dell_wmi atl1c ttm mxm_wmi wmi
[ 13.224354] CPU: 0 PID: 1800 Comm: dhcpcd Tainted: G W 3.11.0-wl #1
[ 13.224359] Hardware name: Alienware M11x R2/M11x R2, BIOS A04 11/23/2010
[ 13.224363] ffff880177c12c40 ffff880170fd1968 ffffffff8169af5b 0000000000000007
[ 13.224374] ffff880170fd1ad0 ffff880170fd1978 ffffffff81697ee2 ffff880170fd19f8
[ 13.224383] ffffffff816a19f5 00000000000f4240 000000000000d080 ffff880170fd1fd8
[ 13.224391] Call Trace:
[ 13.224399] [<ffffffff8169af5b>] dump_stack+0x4f/0x84
[ 13.224403] [<ffffffff81697ee2>] __schedule_bug+0x43/0x51
[ 13.224409] [<ffffffff816a19f5>] __schedule+0x6e5/0x810
[ 13.224412] [<ffffffff816a1c34>] schedule+0x24/0x70
[ 13.224416] [<ffffffff816a04fc>] schedule_hrtimeout_range_clock+0x10c/0x150
[ 13.224420] [<ffffffff810684e0>] ? update_rmtp+0x60/0x60
[ 13.224424] [<ffffffff8106915f>] ? hrtimer_start_range_ns+0xf/0x20
[ 13.224429] [<ffffffff816a054e>] schedule_hrtimeout_range+0xe/0x10
[ 13.224432] [<ffffffff8104f6fb>] usleep_range+0x3b/0x40
[ 13.224437] [<ffffffffa003733a>] bcma_pcie_mdio_read.isra.5+0x8a/0x100 [bcma]
[ 13.224442] [<ffffffffa00374a5>] bcma_pcie_mdio_writeread.isra.6.constprop.13+0x25/0x30 [bcma]
[ 13.224448] [<ffffffffa00374f9>] bcma_core_pci_power_save+0x49/0x80 [bcma]
[ 13.224452] [<ffffffffa003765d>] bcma_core_pci_up+0x2d/0x60 [bcma]
[ 13.224460] [<ffffffffa03dc17c>] brcms_c_up+0xfc/0x430 [brcmsmac]
[ 13.224467] [<ffffffffa03d1a7d>] brcms_up+0x1d/0x20 [brcmsmac]
[ 13.224473] [<ffffffffa03d2498>] brcms_ops_start+0x298/0x340 [brcmsmac]
[ 13.224478] [<ffffffff81600a12>] ? cfg80211_netdev_notifier_call+0xd2/0x5f0
[ 13.224483] [<ffffffff815fa53d>] ? packet_notifier+0xad/0x1d0
[ 13.224487] [<ffffffff81656e75>] ieee80211_do_open+0x325/0xf80
[ 13.224491] [<ffffffff8106ac09>] ? __raw_notifier_call_chain+0x9/0x10
[ 13.224495] [<ffffffff81657b41>] ieee80211_open+0x71/0x80
[ 13.224498] [<ffffffff81526267>] __dev_open+0x87/0xe0
[ 13.224502] [<ffffffff8152650c>] __dev_change_flags+0x9c/0x180
[ 13.224505] [<ffffffff815266a3>] dev_change_flags+0x23/0x70
[ 13.224509] [<ffffffff8158cd68>] devinet_ioctl+0x5b8/0x6a0
[ 13.224512] [<ffffffff8158d5c5>] inet_ioctl+0x75/0x90
[ 13.224516] [<ffffffff8150b38b>] sock_do_ioctl+0x2b/0x70
[ 13.224519] [<ffffffff8150b681>] sock_ioctl+0x71/0x2a0
[ 13.224523] [<ffffffff8114ed47>] do_vfs_ioctl+0x87/0x520
[ 13.224528] [<ffffffff8113f159>] ? ____fput+0x9/0x10
[ 13.224533] [<ffffffff8106228c>] ? task_work_run+0x9c/0xd0
[ 13.224537] [<ffffffff8114f271>] SyS_ioctl+0x91/0xb0
[ 13.224541] [<ffffffff816aa252>] system_call_fastpath+0x16/0x1b
Cc: <stable@vger.kernel.org> # 3.11.x
Cc: Tod Jackson <tod.jackson@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Rafal Milecki <zajec5@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 3a65447..edc5d10 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -457,6 +457,8 @@ static int brcms_ops_start(struct ieee80211_hw *hw)
if (err != 0)
brcms_err(wl->wlc->hw->d11core, "%s: brcms_up() returned %d\n",
__func__, err);
+
+ bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, true);
return err;
}
@@ -479,6 +481,8 @@ static void brcms_ops_stop(struct ieee80211_hw *hw)
return;
}
+ bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, false);
+
/* put driver in down state */
spin_lock_bh(&wl->lock);
brcms_down(wl);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread