[PATCH] drm/i915: avoid flush_scheduled_work() usage

Tetsuo Handa penguin-kernel at I-love.SAKURA.ne.jp
Fri Mar 3 12:49:36 UTC 2023


On 2023/03/03 19:11, Tetsuo Handa wrote:
> @@ -79,6 +81,7 @@ static int __init i915_init(void)
>  {
>  	int err, i;
>  
> +	i915_wq = alloc_workqueue("i915", 0, 0);

Oops. I forgot to add

	if (!i915_wq)
		return -ENOMEM;

here. But I'd like to wait for your response for a while before submitting v2 patch.


>  	for (i = 0; i < ARRAY_SIZE(init_funcs); i++) {
>  		err = init_funcs[i].init();
>  		if (err < 0) {
> @@ -86,6 +89,7 @@ static int __init i915_init(void)
>  				if (init_funcs[i].exit)
>  					init_funcs[i].exit();
>  			}
> +			destroy_workqueue(i915_wq);
>  			return err;
>  		} else if (err > 0) {
>  			/*
> @@ -113,6 +117,7 @@ static void __exit i915_exit(void)
>  		if (init_funcs[i].exit)
>  			init_funcs[i].exit();
>  	}
> +	destroy_workqueue(i915_wq);
>  }
>  
>  module_init(i915_init);



More information about the dri-devel mailing list