Stefan Sperling wrote:
> The problem seems to be that iwm's various tasks will sleep while waiting
> for a device command to finish. If an ioctl process now sneaks in it will
> trigger new commands to be sent in parallel, which the hardware does not like.
>
> I see one way of fixing this: grab the ioctl lock in all of iwm's tasks.
> With this patch I cannot reproduce the problem anymore.
This sounds a little backwards. The ioctl should queue a task, then wait for
the result.
So you'd have:
iwm_ioctl() {
case SETRATES:
task.wait = "setrates"
task.params = whatever_else;
task_queue(&task);
tsleep(&task.wait);
iwm_setrates_task() {
/* do the thing */
if (task.wait)
wakeup(task.wait);