From patchwork Mon Jun 24 05:33:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 11012139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C59A186E for ; Mon, 24 Jun 2019 05:34:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F102928B0D for ; Mon, 24 Jun 2019 05:34:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3E4E28B1E; Mon, 24 Jun 2019 05:34:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4EBE128B16 for ; Mon, 24 Jun 2019 05:34:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kwim7rtxLlDpE2yyd77appo2KN3OueerUHFMltkiLKU=; b=GSMGT+sY4VV7E2 h6+4m4tZnJG3rJrzN8yDxE5lG2MdO7Em8MvvUvVqfFDk+Bs+PP5GmDFDuUwGCrtNzZRpMiVy+ND6y yrcbo6Gk5/sxim7ntuB9GYG2Jqp17aBF5jYovfP1RQKEytS00Y+8b5vQYNr3GmYkEMWoiQFX2pE96 Y2XXd6ix5J7hkvXSPObjNW2BZBafgCVKK4lEn9Ys1ggcEh7vcQ0G9BwXO9LWTLr8nghS5VtG6pVdO TO/uL/kisOfkPPpAAAyATTMUhGwZHsmDDm6099ik4xUAE5t5JaUjYTfMd/x0e3AO7qkiKrc3M1cwZ Se5j+xRDSTRsafFgR71A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hfHcK-0002j1-O2; Mon, 24 Jun 2019 05:34:12 +0000 Received: from smtp02.smtpout.orange.fr ([80.12.242.124] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hfHcG-0002i0-Om for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2019 05:34:10 +0000 Received: from localhost.localdomain ([86.243.180.47]) by mwinf5d04 with ME id UVZv2000C11lVym03VZwBJ; Mon, 24 Jun 2019 07:34:03 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 24 Jun 2019 07:34:03 +0200 X-ME-IP: 86.243.180.47 From: Christophe JAILLET To: eric@anholt.net, stefan.wahren@i2se.com, gregkh@linuxfoundation.org, f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, tuomas.tynkkynen@iki.fi, inf.braun@fau.de, tobias.buettner@fau.de, hofrat@osadl.org Subject: [PATCH] staging: bcm2835-camera: Avoid apotential sleep while holding a spin_lock Date: Mon, 24 Jun 2019 07:33:51 +0200 Message-Id: <20190624053351.5217-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190623_223409_101777_D91715FF X-CRM114-Status: GOOD ( 15.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Christophe JAILLET , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Do not allocate memory with GFP_KERNEL when holding a spin_lock, it may sleep. Use GFP_NOWAIT instead. Fixes: 950fd867c635 ("staging: bcm2835-camera: Replace open-coded idr with a struct idr.") Signed-off-by: Christophe JAILLET Reviewed-by: Nicholas Mc Guire --- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 16af735af5c3..438d548c6e24 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -186,7 +186,7 @@ get_msg_context(struct vchiq_mmal_instance *instance) */ spin_lock(&instance->context_map_lock); handle = idr_alloc(&instance->context_map, msg_context, - 0, 0, GFP_KERNEL); + 0, 0, GFP_NOWAIT); spin_unlock(&instance->context_map_lock); if (handle < 0) {