Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755639Ab2HAPqM (ORCPT ); Wed, 1 Aug 2012 11:46:12 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:49692 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755474Ab2HAPqK (ORCPT ); Wed, 1 Aug 2012 11:46:10 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 1 Aug 2012 19:46:08 +0400 Message-ID: Subject: Re: drivers/misc/apds990x.c: might_sleep operation in interrupt handler From: Denis Yefremov To: Greg Kroah-Hartman Cc: Axel Lin , Arnd Bergmann , linux-kernel@vger.kernel.org, ldv-project@ispras.ru Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1503 Lines: 41 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 : > 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); > ... > } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/