From patchwork Tue Jun 9 11:41:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 49644 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A4DA121419 for ; Tue, 9 Jun 2015 11:42:12 +0000 (UTC) Received: by wibdt2 with SMTP id dt2sf3765415wib.3 for ; Tue, 09 Jun 2015 04:42:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=GNDJ7EI0KJ+vyBkWHQGhr8/fd/WZP0TiHzp/vP92PiU=; b=dBzXBQXJ9OwuYIF8CLmDzC0JUdGJsAmcaGNh90o4inKrFGE8G8a8W0mnTz60EgSCin FAW5n7/qqcENsGoChHEAVbuPJ0IUfiPY1zXwQsolJhf0BYfLoBVaxScPm0PypEH9Jy01 BoKN6pxQCZDS4jl/s/JWwfEo6TPkdx1w2aD6DeJe3omNwzOb8+1Sy2dzN4NErTwiNZtc elBmKwQYBSkEutJDnO7Z2+n4g9h55+3kLpVTPdvrxNPQd4O1+SxZq3VMxh5uukGvhPjt DCuoZUSFVNQw9D9cNoff7UgThS1ZHNHMp7qPd3y92Ji7MaTvm6WcyQj3YGJZcR5zx0la ac6w== X-Gm-Message-State: ALoCoQm9KULkJtBAWLxnXXHWDwACBTmWFbVVX/bYh1gFw/2+gdxGmqpOcDyytfMjruVbDustKlJI X-Received: by 10.180.97.9 with SMTP id dw9mr16939651wib.2.1433850132009; Tue, 09 Jun 2015 04:42:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.73 with SMTP id i9ls57937lai.100.gmail; Tue, 09 Jun 2015 04:42:11 -0700 (PDT) X-Received: by 10.152.88.5 with SMTP id bc5mr21955381lab.45.1433850131755; Tue, 09 Jun 2015 04:42:11 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id j2si5521623lbd.98.2015.06.09.04.42.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jun 2015 04:42:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbqq2 with SMTP id qq2so8736916lbb.3 for ; Tue, 09 Jun 2015 04:42:11 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr21510295lac.41.1433850131443; Tue, 09 Jun 2015 04:42:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2544196lbb; Tue, 9 Jun 2015 04:42:10 -0700 (PDT) X-Received: by 10.68.68.130 with SMTP id w2mr38633464pbt.38.1433850129562; Tue, 09 Jun 2015 04:42:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si8572182pds.203.2015.06.09.04.42.08; Tue, 09 Jun 2015 04:42:09 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932420AbbFILmB (ORCPT + 28 others); Tue, 9 Jun 2015 07:42:01 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:36381 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbbFILlw (ORCPT ); Tue, 9 Jun 2015 07:41:52 -0400 Received: by wigg3 with SMTP id g3so13879967wig.1 for ; Tue, 09 Jun 2015 04:41:51 -0700 (PDT) X-Received: by 10.180.9.7 with SMTP id v7mr31466322wia.60.1433850111012; Tue, 09 Jun 2015 04:41:51 -0700 (PDT) Received: from [192.168.1.124] (cpc4-aztw19-0-0-cust71.18-1.cable.virginm.net. [82.33.25.72]) by mx.google.com with ESMTPSA id j7sm8996018wjz.11.2015.06.09.04.41.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jun 2015 04:41:50 -0700 (PDT) Message-ID: <5576D0FE.10900@linaro.org> Date: Tue, 09 Jun 2015 12:41:50 +0100 From: Daniel Thompson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Maxime Coquelin , Russell King - ARM Linux CC: Arnd Bergmann , =?UTF-8?B?VXdlIEtsZWluZS1Lw7ZuaWc=?= , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] ARM: Re-enable TRACE_IRQFLAGS_SUPPORT on ARMv7-M References: <1433802288-25508-1-git-send-email-mcoquelin.stm32@gmail.com> <20150608224749.GB7557@n2100.arm.linux.org.uk> In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 09/06/15 10:14, Maxime Coquelin wrote: >> The real solution is to provide a definition _in asm-generic_ for >> arch_irqs_disabled(), rather than having almost every arch doing: >> >> static inline bool arch_irqs_disabled(void) >> { >> return arch_irqs_disabled_flags(arch_local_save_flags()); >> } >> >> I'm personally refusing to take a patch for ARM which adds yet another >> copy of the above. This is, after all, exactly the kind of stuff that >> should be in asm-generic, or if not, in include/linux but overridable >> by arch stuff. >> >> We keep going between the two extremes of "lets push lots of stuff into >> arch stuff" and "lets try to extract the common bits out of arch code". >> >> Let's try and settle on one approach, and apply it universally. > > I agree on the idea but I don't measure all the impacts it would have. Hey Maxime, just out of interest... Does the following patch, which makes the arch_irqs_disabled() implementation from asm-generic available on arm, fix the build for you? I've only done a real quick 'n dirty check for regression: multi_v7_defconfig still works ;-) If the patch is useful I can test it a bit harder... From d86ef4466cfdbe622a65bcc7e72a8ca0d1dd2879 Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Tue, 9 Jun 2015 12:35:24 +0100 Subject: [PATCH] ARM: irqflags: Get arch_irqs_disabled from asm-generic asm-generic/irqflags.h provides an implementation of arch_irqs_disabled(). Lets grab that implementation. Suggested-by: Russell King Signed-off-by: Daniel Thompson --- arch/arm/include/asm/irqflags.h | 11 +++++++++++ 1 file changed, 11 insertions(+) #endif /* ifndef __ASM_ARM_IRQFLAGS_H */ diff --git a/arch/arm/include/asm/irqflags.h b/arch/arm/include/asm/irqflags.h index 3b763d6652a0..43908146a5cf 100644 --- a/arch/arm/include/asm/irqflags.h +++ b/arch/arm/include/asm/irqflags.h @@ -20,6 +20,7 @@ #if __LINUX_ARM_ARCH__ >= 6 +#define arch_local_irq_save arch_local_irq_save static inline unsigned long arch_local_irq_save(void) { unsigned long flags; @@ -31,6 +32,7 @@ static inline unsigned long arch_local_irq_save(void) return flags; } +#define arch_local_irq_enable arch_local_irq_enable static inline void arch_local_irq_enable(void) { asm volatile( @@ -40,6 +42,7 @@ static inline void arch_local_irq_enable(void) : "memory", "cc"); } +#define arch_local_irq_disable arch_local_irq_disable static inline void arch_local_irq_disable(void) { asm volatile( @@ -56,6 +59,7 @@ static inline void arch_local_irq_disable(void) /* * Save the current interrupt enable state & disable IRQs */ +#define arch_local_irq_save arch_local_irq_save static inline unsigned long arch_local_irq_save(void) { unsigned long flags, temp; @@ -73,6 +77,7 @@ static inline unsigned long arch_local_irq_save(void) /* * Enable IRQs */ +#define arch_local_irq_enable arch_local_irq_enable static inline void arch_local_irq_enable(void) { unsigned long temp; @@ -88,6 +93,7 @@ static inline void arch_local_irq_enable(void) /* * Disable IRQs */ +#define arch_local_irq_disable arch_local_irq_disable static inline void arch_local_irq_disable(void) { unsigned long temp; @@ -135,6 +141,7 @@ static inline void arch_local_irq_disable(void) /* * Save the current interrupt enable state. */ +#define arch_local_save_flags arch_local_save_flags static inline unsigned long arch_local_save_flags(void) { unsigned long flags; @@ -147,6 +154,7 @@ static inline unsigned long arch_local_save_flags(void) /* * restore saved IRQ & FIQ state */ +#define arch_local_irq_restore arch_local_irq_restore static inline void arch_local_irq_restore(unsigned long flags) { asm volatile( @@ -156,10 +164,13 @@ static inline void arch_local_irq_restore(unsigned long flags) : "memory", "cc"); } +#define arch_irqs_disabled_flags arch_irqs_disabled_flags static inline int arch_irqs_disabled_flags(unsigned long flags) { return flags & IRQMASK_I_BIT; } +#include + #endif /* ifdef __KERNEL__ */