Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp826357pxb; Thu, 26 Aug 2021 16:04:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc0f291h4DW8Iyngm5A03OfMaXU5XyZlJX1t2lRnlW8MLyKB4DMgoD0WVVSvzTkc+cLByv X-Received: by 2002:a17:907:9908:: with SMTP id ka8mr6723891ejc.164.1630019067781; Thu, 26 Aug 2021 16:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630019067; cv=none; d=google.com; s=arc-20160816; b=W/qqUBLcNWGMWNwBHRVjpXvUQKiXew34DJ+6coJPbFmOHpyGAKFE9YrTTxx4gYuiRz nwhvelw3sEXPApWFIaTrfjQSU8w+NDuO0NdbS7d1w+LB1173EgiI7jL4EuEOTuq6VAPE fVBr5x0f44L3PvihYBu/GEddTIrQ3YWMPP3GAV9+En5djM/zp29uesOlQmWiZH8o/F4w AmM/IZkUOikX6XM/FC4UDhKXjDVielg2nshXjut4GwheljMoOluCCLvGTHlR5pxd8tUI iu8i82zyGPnLHmNydDzw867JxY/OBU45KSvXAkOxr78oSS9s/LHJgRbEJJel0BIRc9i1 AKyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=QhAhXFtWFEQ6Fdud3DSVJ+WltS966zTxEwlJ84LG7/A=; b=CcKfmAseezHZ6n8LkAjk2kuDM5TteEbd9vy2VZlxIjgohRZoq5PlD79s+dStfjCIF0 O4TiPIHq0hzHttMhLlYcdobHUvo0rG3q7z6aY5+FkeeAZXxZE8CfEKDHpNaBjw92UQt5 EihkWYsQW1pklzqwL3WzI7DaBR/HcR5PmbspbPQC+agdgU6n0KfdRoiMgYAfe61a0nMm 3WQvs1xwJYrzxCrx+0fltuLpawgVsGlgJtx4yYndihS2Y+xZ2sVckYTz45RLy5qU/CGI Sl2EUtCpqoO8gzJywSiXYvZAqye6UmBz106dKfwntv9pS/ADBcxP+ec43uvGeZGFkt6U SQSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D31R1diY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g23si4471477edp.82.2021.08.26.16.04.01; Thu, 26 Aug 2021 16:04:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D31R1diY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234617AbhHZXC0 (ORCPT + 99 others); Thu, 26 Aug 2021 19:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbhHZXCZ (ORCPT ); Thu, 26 Aug 2021 19:02:25 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7F23C061757 for ; Thu, 26 Aug 2021 16:01:37 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1630018896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QhAhXFtWFEQ6Fdud3DSVJ+WltS966zTxEwlJ84LG7/A=; b=D31R1diY5EMMf2tOjF+6cu84KqhQ5KjS9eZ1nxjl3GKuOUhT28KjdP4VwVjzktiUynTz2n hnzf3tjdblm0GLkZU4vrbOqkA5/i1+82PTLU3WS017cseiPuy7ya5miPR934n8r5W+AmG+ NYf4klgm8B+blGOWYDAtzBjdy0KTJU/9Tq3bqXhkkAszQHmSS5NApbLt+/jLwzUD+iGE1n i141aTUPdJQXsXWNAQtxrTTuBmTOXqlImhZAE7YbPVyfpjIR5ybtfj+jS3vsDGfOkqAwcm 09avdmN++wpUj8gtICzLu7u13uB1DIita/QGoxl6Yb7nfKHESdVm1Ss02TINGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1630018896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QhAhXFtWFEQ6Fdud3DSVJ+WltS966zTxEwlJ84LG7/A=; b=IOd1zB7uwqqmnYnXZMHPbcYVak9RPVS0waZw011OMQ8Ky2nld5qhyi1TZfkw2AKtqTOL6+ 5Aw+UnQJxXtxkPDA== To: Vladimir Oltean , Mark Brown Cc: Rasmus Villemoes , Lee Jones , Arnd Bergmann , Marc Zyngier , Hou Zhiqiang , Biwen Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] regmap: teach regmap to use raw spinlocks if requested in the config In-Reply-To: <20210825205041.927788-2-vladimir.oltean@nxp.com> References: <20210825205041.927788-1-vladimir.oltean@nxp.com> <20210825205041.927788-2-vladimir.oltean@nxp.com> Date: Fri, 27 Aug 2021 01:01:35 +0200 Message-ID: <875yvr3j5c.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 25 2021 at 23:50, Vladimir Oltean wrote: > Some drivers might access regmap in a context where a raw spinlock is > held. An example is drivers/irqchip/irq-ls-extirq.c, which calls > regmap_update_bits() from struct irq_chip :: irq_set_type, which is a > method called by __irq_set_trigger() under the desc->lock raw spin lock. > > Since desc->lock is a raw spin lock and the regmap internal lock for > mmio is a plain spinlock (which can become sleepable on RT), this is an > invalid locking scheme and we get a splat stating that this is a > "[ BUG: Invalid wait context ]". > > It seems reasonable for regmap to have an option use a raw spinlock too, > so add that in the config such that drivers can request it. What's reasonable about that? What exactly prevents the regmap locking to use a raw spinlock unconditionally? Even for the case where the regmap is not dealing with irq chips it does not make any sense to protect low level operations on shared register with a regular spinlock. I might be missing something though... Thanks, tglx