Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751887AbdCVVqA (ORCPT ); Wed, 22 Mar 2017 17:46:00 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:16155 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbdCVVpu (ORCPT ); Wed, 22 Mar 2017 17:45:50 -0400 X-IronPort-AV: E=Sophos;i="5.36,206,1486422000"; d="scan'208";a="265767076" Date: Wed, 22 Mar 2017 22:45:25 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Julia Cartwright cc: Julia Lawall , Gilles Muller , Nicolas Palix , Michal Marek , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Thomas Gleixner , Sebastian Andrzej Siewior , Linus Walleij , cocci@systeme.lip6.fr Subject: Re: [PATCH v2 1/9] Coccinelle: locks: identify callers of spin_lock{,_irq,_irqsave}() in irqchip implementations In-Reply-To: <20170322161856.GJ10423@jcartwri.amer.corp.natinst.com> Message-ID: References: <48a11ad61edb4bec130f2ae0d46fc4e7d4855044.1490135047.git.julia@ni.com> <20170322161856.GJ10423@jcartwri.amer.corp.natinst.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1767 Lines: 47 On Wed, 22 Mar 2017, Julia Cartwright wrote: > On Wed, Mar 22, 2017 at 10:54:15AM +0100, Julia Lawall wrote: > > On Tue, 21 Mar 2017, Julia Cartwright wrote: > > > On PREEMPT_RT, the spinlock_t type becomes an object which sleeps under > > > contention. The codepaths used to support scheduling (irq dispatching, arch > > > code, the scheduler, timers) therefore must make use of the > > > raw_spin_lock{,_irq,_irqsave}() variations which preserve the non-sleeping > > > spinlock behavior. > > > > > > Because the irq_chip callbacks are invoked in the process of interrupt > > > dispatch, they cannot therefore make use of spin_lock_t type. Instead, the > > > usage of raw_spinlock_t is appropriate. > > > > > > Provide a spatch to identify (and attempt to patch) such problematic irqchip > > > implementations. > > > > > > Note to those generating patches using this spatch; in order to maintain > > > correct semantics w/ PREEMPT_RT, it is necessary to audit the > > > raw_spinlock_t-protected codepaths to ensure their execution is bounded and > > > minimal. This is a manual audit process. > > > > > > See commit 47b03ca903fb0 ("pinctrl: qcom: Use raw spinlock variants") as an > > > example of _one_ such instance, which fixed a real bug seen in the field. > > > > > > Cc: Thomas Gleixner > > > Cc: Sebastian Andrzej Siewior > > > Cc: Linus Walleij > > > Signed-off-by: Julia Cartwright > > > > Acked-by: Julia Lawall > > Thanks, Julia. > > How do these semantic patches normally land? It looks like they quite a > few have gone through the kbuild tree, is this the norm? Michal Marek takes care of them. julia > > Thanks, > Other Julia >