Marc Zyngier 3c0f3c605b NET: smsc95xx: don't use stack for async writes to the device
The set_multicast operation performs asynchronous writes to the
device, with some addresses pointing to the stack. Bad things may
happen, and this is trapped CONFIG_DMA_API_DEBUG:

[    5.237762] WARNING: at /build/buildd/linux-linaro-omap-2.6.38/lib/dma-debug.c:867 check_for_stack+0xd4/0x100()
[    5.237792] ehci-omap ehci-omap.0: DMA-API: device driver maps memory fromstack [addr=d9c77dec]
[    5.237792] Modules linked in: smsc95xx(+) usbnet twl6030_usb twl4030_pwrbutton leds_gpio omap_wdt omap2_mcspi
[    5.237854] [<c006d618>] (unwind_backtrace+0x0/0xf8) from [<c00a6a14>] (warn_slowpath_common+0x54/0x64)
[    5.237884] [<c00a6a14>] (warn_slowpath_common+0x54/0x64) from [<c00a6ab8>] (warn_slowpath_fmt+0x30/0x40)
[    5.237915] [<c00a6ab8>] (warn_slowpath_fmt+0x30/0x40) from [<c034e9d8>] (check_for_stack+0xd4/0x100)
[    5.237915] [<c034e9d8>] (check_for_stack+0xd4/0x100) from [<c034fea8>] (debug_dma_map_page+0xb4/0xdc)
[    5.237976] [<c034fea8>] (debug_dma_map_page+0xb4/0xdc) from [<c04242f0>] (map_urb_for_dma+0x26c/0x304)
[    5.237976] [<c04242f0>] (map_urb_for_dma+0x26c/0x304) from [<c0424594>] (usb_hcd_submit_urb+0x78/0x19c)
[    5.238037] [<c0424594>] (usb_hcd_submit_urb+0x78/0x19c) from [<bf049c5c>] (smsc95xx_write_reg_async+0xb4/0x130 [smsc95xx])
[    5.238067] [<bf049c5c>] (smsc95xx_write_reg_async+0xb4/0x130 [smsc95xx]) from [<bf049dd4>] (smsc95xx_set_multicast+0xfc/0x148 [smsc95xx])
[    5.238098] [<bf049dd4>] (smsc95xx_set_multicast+0xfc/0x148 [smsc95xx]) from [<bf04a118>] (smsc95xx_reset+0x2f8/0x68c [smsc95xx])
[    5.238128] [<bf04a118>] (smsc95xx_reset+0x2f8/0x68c [smsc95xx]) from [<bf04a8cc>] (smsc95xx_bind+0xcc/0x188 [smsc95xx])
[    5.238159] [<bf04a8cc>] (smsc95xx_bind+0xcc/0x188 [smsc95xx]) from [<bf03ef1c>] (usbnet_probe+0x204/0x4c4 [usbnet])
[    5.238220] [<bf03ef1c>] (usbnet_probe+0x204/0x4c4 [usbnet]) from [<c0429078>] (usb_probe_interface+0xe4/0x1c4)
[    5.238250] [<c0429078>] (usb_probe_interface+0xe4/0x1c4) from [<c03a8770>] (really_probe+0x64/0x160)
[    5.238250] [<c03a8770>] (really_probe+0x64/0x160) from [<c03a8a30>] (driver_probe_device+0x48/0x60)
[    5.238281] [<c03a8a30>] (driver_probe_device+0x48/0x60) from [<c03a8ad4>] (__driver_attach+0x8c/0x90)
[    5.238311] [<c03a8ad4>] (__driver_attach+0x8c/0x90) from [<c03a7b24>] (bus_for_each_dev+0x50/0x7c)
[    5.238311] [<c03a7b24>] (bus_for_each_dev+0x50/0x7c) from [<c03a82ec>] (bus_add_driver+0x190/0x250)
[    5.238311] [<c03a82ec>] (bus_add_driver+0x190/0x250) from [<c03a8cf8>] (driver_register+0x78/0x13c)
[    5.238433] [<c03a8cf8>] (driver_register+0x78/0x13c) from [<c0428040>] (usb_register_driver+0x78/0x13c)
[    5.238464] [<c0428040>] (usb_register_driver+0x78/0x13c) from [<c005b680>] (do_one_initcall+0x34/0x188)
[    5.238494] [<c005b680>] (do_one_initcall+0x34/0x188) from [<c00e11f0>] (sys_init_module+0xb0/0x1c0)
[    5.238525] [<c00e11f0>] (sys_init_module+0xb0/0x1c0) from [<c0065c40>] (ret_fast_syscall+0x0/0x30)

Move the two offenders to the private structure which is kmalloc-ed,
and thus safe.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-22 01:02:18 -07:00
..
2011-03-05 10:55:57 +01:00
2011-02-28 11:57:33 -08:00
2011-02-28 11:57:33 -08:00
2011-03-16 11:29:47 -07:00
2011-02-02 15:41:25 -08:00
2011-03-19 13:36:18 -07:00
2011-02-13 10:42:07 -08:00
2011-03-02 03:20:56 -08:00
2011-01-11 14:03:09 -08:00
2011-03-11 01:16:23 -08:00
2010-05-10 05:01:31 -07:00
2011-01-28 15:24:55 -08:00
2011-03-15 00:43:15 +01:00
2011-02-28 12:06:20 -08:00
2010-12-21 02:16:10 -08:00
2010-12-21 02:16:10 -08:00
2011-02-28 11:57:33 -08:00
2011-03-15 19:38:03 -07:00
2010-12-21 02:16:08 -08:00
2010-12-21 02:16:08 -08:00
2010-05-10 05:01:31 -07:00
2010-12-21 02:16:08 -08:00
2010-11-09 09:17:56 -08:00
2010-12-21 02:16:08 -08:00
2010-06-03 03:18:23 -07:00
2010-11-17 12:21:14 -08:00
2010-11-09 09:17:56 -08:00
2010-07-11 18:15:08 -07:00
2011-03-10 14:41:51 -08:00
2010-12-21 02:16:08 -08:00
2010-11-09 09:17:56 -08:00
2010-12-01 11:11:31 -08:00
2010-08-24 12:24:07 -07:00
2010-09-26 18:34:29 -07:00
2011-03-14 15:00:12 -07:00
2011-03-14 15:00:12 -07:00
2011-01-14 12:39:59 -08:00
2010-12-23 11:44:34 -08:00
2010-07-14 13:40:36 -07:00
2010-05-10 05:01:31 -07:00
2010-09-26 18:34:29 -07:00
2010-09-26 18:34:29 -07:00
2011-02-01 13:19:07 -08:00
2011-01-27 14:18:34 -08:00
2010-09-29 13:23:30 -07:00
2010-09-26 18:34:29 -07:00
2010-12-21 02:16:08 -08:00
2010-12-21 02:16:08 -08:00
2010-09-26 18:34:29 -07:00
2011-01-09 15:42:56 -08:00
2011-03-18 21:53:03 -07:00
2011-01-14 12:45:54 -08:00
2010-09-26 18:34:29 -07:00
2010-12-21 02:16:08 -08:00
2011-01-03 12:43:10 -08:00
2011-02-28 11:57:33 -08:00
2011-02-28 11:57:33 -08:00
2011-02-13 21:44:44 -08:00
2010-07-27 22:24:37 -07:00
2010-11-08 13:50:06 -08:00
2010-11-09 09:17:56 -08:00
2010-11-09 09:17:56 -08:00
2011-02-17 14:16:35 -08:00
2010-09-26 18:34:29 -07:00
2010-05-10 05:01:31 -07:00
2011-03-15 19:38:03 -07:00
2010-09-26 18:34:29 -07:00
2011-03-03 13:02:32 -08:00
2010-06-21 13:40:25 -07:00
2010-07-05 20:08:05 -07:00
2010-05-10 05:01:31 -07:00
2010-12-21 02:16:08 -08:00
2010-12-21 02:16:08 -08:00
2010-06-28 12:41:33 -07:00
2010-09-26 18:34:29 -07:00
2010-09-15 22:06:05 -07:00
2010-09-21 18:04:47 -07:00
2011-03-19 13:39:33 -07:00
2010-07-15 20:46:22 -07:00
2011-03-07 15:49:31 -08:00
2010-12-11 11:46:36 -08:00
2010-05-10 05:01:31 -07:00
2011-02-28 12:29:34 -08:00
2011-02-24 22:17:02 -08:00
2011-01-09 15:54:15 -08:00
2010-10-24 16:25:39 -07:00
2010-09-26 18:34:29 -07:00
2011-01-25 22:41:55 -08:00
2010-05-10 05:01:31 -07:00
2010-12-21 02:16:08 -08:00
2010-05-10 05:01:31 -07:00
2010-09-26 18:34:29 -07:00
2011-03-10 01:56:14 -08:00
2011-01-26 13:13:10 -08:00
2010-06-03 03:18:23 -07:00
2011-03-21 18:24:53 -07:00
2010-12-08 10:23:36 -08:00
2010-12-21 02:16:08 -08:00
2011-03-15 19:38:03 -07:00
2010-11-09 09:17:56 -08:00