I fixed all known kernel oopses by placing spinlock in interrupt handler and changing driver initialization order.
Left to do: 1) deal with timers 2) support and testing on other platforms I am going away for few days for not being too noisy. Best, Alexander Bersenev, Institute of Mathematics and Mechanics, Russia понедельник, 28 апреля 2014 г., 11:10:18 UTC+6 пользователь Александр Берсенев написал: > > I did 300 000 insmod/rmmod cycles and all was ok, but the memory > consumption increased from 23MB to 36MB. I think, it is because of timers. > As Hans de Goede said, it is better to use devm_clk_get to get the clock. I > use this function in my first patch, but I not found a way to get apb0_ir0 > clock, because it is not registered. I forced registering with this part of > first patch: > > diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c > index 3be8846..83a20fa 100644 > --- a/drivers/clk/sunxi/clk-sunxi.c > +++ b/drivers/clk/sunxi/clk-sunxi.c > @@ -1036,11 +1036,17 @@ static void __init sunxi_gates_clk_setup(struct > device_node *node, > /* No driver claims this clock, but it should remain gated */ > ignore = !strcmp("ahb_sdram", clk_name) ? CLK_IGNORE_UNUSED : 0; > > + > clk_data->clks[i] = clk_register_gate(NULL, clk_name, > clk_parent, ignore, > reg + 4 * (i/32), i % 32, > 0, &clk_lock); > WARN_ON(IS_ERR(clk_data->clks[i])); > + > + if(!IS_ERR(clk_data->clks[i])) { > + clk_register_clkdev(clk_data->clks[i], clk_name, NULL); > + } > + > > I am looking for sane way to do same without > patching drivers/clk/sunxi/clk-sunxi.c. > > Also I've tested parallel module load/unload. I executed folowwing > commands: > while true; do echo bay; rmmod sunxi-ir; insmod /sunxi-ir.ko; done & > while true; do echo bay; rmmod sunxi-ir; insmod /sunxi-ir.ko; done & > ... 20 times ... > > It runs ok, but when I press buttons on my IR remote controller in the > process, I got a kernel OOPS(null pointer dereference) sometimes. I am > fixing this. > > Best, > Alexander Bersenev, Institute of Mathematics and Mechanics, Russia > > -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.