[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140501160921.GB3245@sirena.org.uk>
Date: Thu, 1 May 2014 09:09:21 -0700
From: Mark Brown <broonie@...nel.org>
To: Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi: Fix hung task timeout when initialization fails
On Thu, May 01, 2014 at 10:15:15AM +0200, Ricardo Ribalda Delgado wrote:
> If kthread_run on spi_init_queue() fails, spi_destroy_queue can lead to
> hang timeout.
...
> When this happens, spi_destroy_queue() leads to a hung process that
> outputs a error message and avoids the computer to be halted/rebooted.
Why is the fix for this not to avoid running spi_destroy_queue() in the
first place? I would not in general expect it to be robust to call the
destructor function if the init function failed (and indeed this looks
like what's happening with the kthread code here) - even if it works now
it seems like it will be a source of bugs in the future.
> - flush_kthread_worker(&master->kworker);
> - kthread_stop(master->kworker_task);
> + if (!IS_ERR(master->kworker_task)) {
> + flush_kthread_worker(&master->kworker);
> + kthread_stop(master->kworker_task);
> + }
This still just looks like a race condition.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists