Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3082275imm; Mon, 10 Sep 2018 10:43:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbT38TmRQ+zODR/jFE4x0thLWrf6gNeos192MLlsPbSbntO+BLnLhFsWeO2Ll7n66LF2dwI X-Received: by 2002:a17:902:7845:: with SMTP id e5-v6mr23190951pln.197.1536601398009; Mon, 10 Sep 2018 10:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536601397; cv=none; d=google.com; s=arc-20160816; b=FJSqRbLsvg3Vvz6+LOHvY1HXck2Rn8ilz2b+qAYUMMpnYMVEUKLrxf7Bx3L625cC/F mdQ9G1Zsuwjfh2acHjtrSRugDBeZs7BWlEN49e6SKe7ieqbSBk8y7cSz+Hqb+OjfhPMg SZRNT3IKmh3ix9LSkC+nyJb5DifX49gOeCbt8+FEOs1NZhtTfL/ywpjtEKDge4ngwxyF 27Q1MeE+xPph+5YxFwuOx6oo7ZJ++HKSjtePQDrPzTAxtF7BhKzVd63aZAn0miD1YeEo QP4jmvXSuQzO/QebrPYbB2VUCFjj9oh+yUM0IvEJQ8kx+fQxU5cro7I5i+pDfZ/JH+KA er6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mLrntdNq2nCeE3K+Fix0ZRoq+ZJBEOa0Bp3DXrTsBug=; b=EFbYu1j+hEo2JvfoJXPphGue99tVCBKgiwltOvuNKzqSpBmSsdn3E3o1o5MFfvRC4C dekaJVy9Ip5yA0t2RZrKh+MtSHfmHYKGY++v4UQYvobKeB5jw3voJFzNpX2VLZwue0EO xHH1OCG5HemtP1E2sV/RiIhjtmyDFhC8URp8wcru6ETZR5TJgCGKVLgqIpY4LGn0+2FC ZAcNSorZ1k8wJ3pGwrTkT3FBSPt2Sru+9EpR+mxT6xojtny0aQYa2L2EmJ2hjJncrrJu 62Y/MP3VeEIR0GUp2UJKDvYhdMQg4Eauiv//pleZfNRk7RF2syNbbOUo5XxuGJPkD4Hf khEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=xxR6SuKT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b98-v6si5262593plb.38.2018.09.10.10.42.58; Mon, 10 Sep 2018 10:43:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=xxR6SuKT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728296AbeIJWgX (ORCPT + 99 others); Mon, 10 Sep 2018 18:36:23 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:60292 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbeIJWgX (ORCPT ); Mon, 10 Sep 2018 18:36:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mLrntdNq2nCeE3K+Fix0ZRoq+ZJBEOa0Bp3DXrTsBug=; b=xxR6SuKTQklOJOvKfE62x0DHD /k1MTb4CPr6yvHKpeoL4zVDKbXHGdc/LNF3NOFdZOmcoCRsJnnU1igYt9eOzu63xNaZFSz9HIyq1N 7rOXvASyJEFhmYxYhk0HyqGzrTlOP6QwQxg07Zul6s+Rt62zzC34HslpIakxNuz4N6KXs=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1fzQBN-00027f-27; Mon, 10 Sep 2018 17:41:05 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 9850A11227B6; Mon, 10 Sep 2018 18:41:04 +0100 (BST) Date: Mon, 10 Sep 2018 18:41:04 +0100 From: Mark Brown To: Jia-Ju Bai Cc: gregkh@linuxfoundation.org, rafael@kernel.org, David Howells , Dan Carpenter , Linus Torvalds , linus.walleij@linaro.org, Linux Kernel Mailing List Subject: Re: [BUG] [Resend] Possible sleep-in-atomic-context bugs involving regmap_lock_mutex() Message-ID: <20180910174104.GD10889@sirena.org.uk> References: <9bcef57b-1a5c-cd16-8e44-932ef3be08cb@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zbGR4y+acU1DwHSi" Content-Disposition: inline In-Reply-To: <9bcef57b-1a5c-cd16-8e44-932ef3be08cb@gmail.com> X-Cookie: You must be present to win. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zbGR4y+acU1DwHSi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 30, 2018 at 10:34:20AM +0800, Jia-Ju Bai wrote: > My static tool DSAC reports many sleep-in-atomic-context bugs involving > regmap_lock_mutex(), so I wonder whether this function is possible to be > executed in atomic context. Have you actually analyzed the code paths that are really taken here? Static tools really don't cope very well with the pluggable locking in regmap. If there are problems I'd suggest reporting them to the authors of the drivers using them, it's not really anything to do with regmap if they've messed up their locking. > Here are some example bugs and their call paths in Linux-4.16 (from bottom > to top, and [FUNC_PTR] means that there is a function pointer call): That's quite old now... not that this has been rapidly developed recently but still. --zbGR4y+acU1DwHSi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAluWrK8ACgkQJNaLcl1U h9D2Ggf+IRS/Vo6RNxCedLlyo6Clb2Lft0qW0jvtMBVOpOLeTe3zF394SWdyz+cC RCRqSfDSc0EotIjip8x01HfCsKAGLHSmsnVhVHkiVC7h68lOJvDo9yHOdqTJJxrB cSno1c7dRPbE8xPtgYcw+RXh/PmWYwnIgYryv7yyzFfWOYifd/6Psrcctl4y06bW +W9yj3WRxABuL206Ww/chnz8zEGOLknisL+CxO971buZ6rme1DnQjBDYwMO652Xm u4l4FK4lPQxxTi50vcKfrg2Xq/vzwsJQk8DY1pt5k/Kmr8hzSeM2P4OtQqltoRx3 bgcNWu5Hghq8f9GqAx3p6Zzryj//zA== =WEKA -----END PGP SIGNATURE----- --zbGR4y+acU1DwHSi--