]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gadget: tegra_xudc: do not use smp_processor_id()
authorJC Kuo <jckuo@nvidia.com>
Mon, 18 Aug 2014 07:00:52 +0000 (00:00 -0700)
committerTom Cherry <tcherry@nvidia.com>
Wed, 27 Aug 2014 19:07:56 +0000 (12:07 -0700)
Preemption has been enabled and driver shouldn't call smp_processor_id()
in preemptive context becuase smp_processor_id() is not reliable.

Kernel complains about the improper usage.
[    2.590477] BUG: using smp_processor_id() in preemptible [00000000] code: insmod/94
[    2.593033] caller is reset_data_struct+0x1c/0x39c [tegra_xudc]
[    2.595009] CPU: 0 PID: 94 Comm: insmod Tainted: G        W    3.10.33-g38bdf66-dirty #3
[    2.597704] Call trace:
[    2.598525] [<ffffffc00008876c>] dump_backtrace+0x0/0x118
[    2.600338] [<ffffffc000088974>] show_stack+0x10/0x1c
[    2.602026] [<ffffffc000304af8>] dump_stack+0x1c/0x28
[    2.603713] [<ffffffc000318c44>] debug_smp_processor_id+0xd4/0xfc
[    2.605747] [<ffffffbffc00d9c4>] reset_data_struct+0x18/0x39c [tegra_xudc]
[    2.608040] [<ffffffbffc00e8d8>] tegra_xudc_plat_probe+0xa58/0xc8c [tegra_xudc]
[    2.610484] [<ffffffc0003f77bc>] platform_drv_probe+0x14/0x20
[    2.612401] [<ffffffc0003f6120>] driver_probe_device+0xf8/0x240
[    2.614374] [<ffffffc0003f630c>] __driver_attach+0x5c/0x8c
[    2.616203] [<ffffffc0003f44e8>] bus_for_each_dev+0x50/0x94
[    2.618061] [<ffffffc0003f5d08>] driver_attach+0x1c/0x28
[    2.619839] [<ffffffc0003f5734>] bus_add_driver+0xb4/0x238
[    2.621669] [<ffffffc0003f6c90>] driver_register+0xb8/0x14c
[    2.623527] [<ffffffc0003f7da4>] platform_driver_register+0x58/0x64
[    2.625618] [<ffffffbffc015018>] $x+0x18/0xac [tegra_xudc]
[    2.627446] [<ffffffc000081570>] do_one_initcall+0x80/0x150
[    2.629311] [<ffffffc000102184>] load_module+0x193c/0x1d48
[    2.631140] [<ffffffc000102750>] SyS_init_module+0x1c0/0x1e4

Change-Id: I391c3e1c59f8bf41273524642dfd752352ddcacb
Signed-off-by: JC Kuo <jckuo@nvidia.com>
Reviewed-on: http://git-master/r/482650
Reviewed-by: Hui Fu <hfu@nvidia.com>
Tested-by: Hui Fu <hfu@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
drivers/usb/gadget/nvxxx.h

index 4da45ff67e7e60d567faab9352e09b852fb67cf1..5c26884b492f6f637b6ad47193daf43d29814591 100644 (file)
@@ -771,12 +771,8 @@ void nvudc_handle_event(struct NV_UDC_S *nvudc, struct EVENT_TRB_S *event);
 #define msg_warn(dev, fmt, args...) \
        { dev_warn(dev, fmt, ## args); }
 
-#define msg_entry(dev)  \
-       do { \
-               unsigned int _cpu = smp_processor_id(); \
-               msg_dbg(dev, "enter, cpu=%d\n", _cpu);  \
-       } while (0)
-#define msg_exit(dev) msg_dbg(dev, "exit");
+#define msg_entry(dev) msg_dbg(dev, "enter\n")
+#define msg_exit(dev) msg_dbg(dev, "exit\n")
 
 /* xhci dev registers*/
 #define TERMINATION_1                          (0x7e4)