Re: w1-gpio: sleeping function called from invalid context

From: Sebastian Andrzej Siewior
Date: Mon Feb 16 2015 - 08:29:51 EST


* Stanislav Meduna | 2014-04-17 16:18:16 [+0200]:

>diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c
>index e10acc2..7065486 100644
>--- a/drivers/w1/w1_io.c
>+++ b/drivers/w1/w1_io.c
>@@ -170,14 +170,14 @@ static u8 w1_read_bit(struct w1_master *dev)
> unsigned long flags = 0;
>
> /* sample timing is critical here */
>- local_irq_save(flags);
>+ if(w1_disable_irqs) local_irq_save(flags);
> dev->bus_master->write_bit(dev->bus_master->data, 0);
> w1_delay(6);
> dev->bus_master->write_bit(dev->bus_master->data, 1);
> w1_delay(9);
>
> result = dev->bus_master->read_bit(dev->bus_master->data);
>- local_irq_restore(flags);
>+ if(w1_disable_irqs) local_irq_restore(flags);
>
> w1_delay(55);
>

there is local_irq_save_nort() and its friends.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/