* drivers/misc/apds990x.c: might_sleep operation in interrupt handler
@ 2012-07-31 17:44 Denis Yefremov
2012-08-01 15:46 ` Denis Yefremov
0 siblings, 1 reply; 2+ messages in thread
From: Denis Yefremov @ 2012-07-31 17:44 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Axel Lin, Arnd Bergmann, linux-kernel, ldv-project
Interrupt handler apds990x_irq in APDS990x sensor driver
invokes mutex_lock that is might sleep operation.
Found by Linux Driver Verification project (linuxtesting.org)
within my participation in the GSoC 2012 program.
static irqreturn_t apds990x_irq(int irq, void *data)
{
struct apds990x_chip *chip = data;
u8 status;
apds990x_read_byte(chip, APDS990X_STATUS, &status);
apds990x_ack_int(chip, status);
mutex_lock(&chip->mutex);
...
}
static int __devinit apds990x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
...
err = request_threaded_irq(client->irq, NULL,
apds990x_irq,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW |
IRQF_ONESHOT,
"apds990x", chip);
...
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: drivers/misc/apds990x.c: might_sleep operation in interrupt handler
2012-07-31 17:44 drivers/misc/apds990x.c: might_sleep operation in interrupt handler Denis Yefremov
@ 2012-08-01 15:46 ` Denis Yefremov
0 siblings, 0 replies; 2+ messages in thread
From: Denis Yefremov @ 2012-08-01 15:46 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Axel Lin, Arnd Bergmann, linux-kernel, ldv-project
Sorry. My mistake. In this case it seems that sleep functions can
be called from apds990x_irq, since interrupt line is disabled globally
(because of IRQF_ONESHOT). And nothing bad will happen if
you know that device can be blocked for relatively long time.
2012/7/31 Denis Yefremov <yefremov.denis@gmail.com>:
> Interrupt handler apds990x_irq in APDS990x sensor driver
> invokes mutex_lock that is might sleep operation.
>
> Found by Linux Driver Verification project (linuxtesting.org)
> within my participation in the GSoC 2012 program.
>
>
> static irqreturn_t apds990x_irq(int irq, void *data)
> {
> struct apds990x_chip *chip = data;
> u8 status;
>
> apds990x_read_byte(chip, APDS990X_STATUS, &status);
> apds990x_ack_int(chip, status);
>
> mutex_lock(&chip->mutex);
> ...
> }
>
> static int __devinit apds990x_probe(struct i2c_client *client,
> const struct i2c_device_id *id)
> {
> ...
> err = request_threaded_irq(client->irq, NULL,
> apds990x_irq,
> IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW |
> IRQF_ONESHOT,
> "apds990x", chip);
> ...
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-01 15:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 17:44 drivers/misc/apds990x.c: might_sleep operation in interrupt handler Denis Yefremov
2012-08-01 15:46 ` Denis Yefremov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.