Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6536029ybl; Mon, 23 Dec 2019 07:27:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzG37SaICZ/nkY9KytkecHK+BsIk5N2JoMIViOG5p2YSYFMMYA60Vs9z9WTB31QUbA0Wwya X-Received: by 2002:a9d:7b50:: with SMTP id f16mr34198399oto.18.1577114834902; Mon, 23 Dec 2019 07:27:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577114834; cv=none; d=google.com; s=arc-20160816; b=wf19URj6RT3rCwqztuuBabik5D2b/SqSaOR2W0wAqn1G8c21cdjsNvbUHXnKwGpicH EXKN3PEXR+9Efg62HCvsXdK88P7DuF1YvR6y/cM4GEUFJpVNrgUvZj67Y2Ux5VgKIN7f F+X2ugYcDdvMVgaqj7J9zznDoXsAXOl+I6q/uWDYh39UBPZT0uTx9oH36q9XOy2Ey6Fq ULjsqBlv9gcqgcG1L/K/Q3fXQ9nUyq58aS5ps4iUqjuOwLdoTja7+ROwwj60WUZF9euv 1jnVBLNa/BbvfyaqgmJfgEXYj3vWTY5Zce7D8bPcTZB6/dOp/8UFlqU3wr5QpukDMt/p bYAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=/A5nHGIX1n3gwM0sFa6XeCQneVLd9/XPssrSN7a7g8I=; b=CXaZp41A6gHqifijI+GZjr6BMTRSmkHr4ResKLuKECx2eTxXLH3L3MPZ01Vp3D/0kW E8aGjwq6iAPj5h2lv/19HrG9Ls0J5r5F11nANVAfbjLvHS4iUncJ8EVpX66ExpKBBx3C i2HMoIZ160i6OeaR2jqR9NaV16EZ/EGTIp8BWeT/AyxZ4lSCJXFaOrb+yoRZRFnmWe9T to9++B103TrKjCmp12x1d3lJTxnv4ZTuKF8EIAuYTxBh5UvoeYVCD1RTkALdW4g7kPng GA4tcrOapa+sMBFMJqlnDPS23rvLqPBqHXfEZ2wmA9UgIRIHnlAR/EreTxmO4POOSXiQ ofOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=sHXfRysl; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si11237138otk.142.2019.12.23.07.27.02; Mon, 23 Dec 2019 07:27:14 -0800 (PST) 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=pass header.i=@c-s.fr header.s=mail header.b=sHXfRysl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbfLWP0T (ORCPT + 99 others); Mon, 23 Dec 2019 10:26:19 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:49052 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726756AbfLWP0P (ORCPT ); Mon, 23 Dec 2019 10:26:15 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47hNV96yzQz9vJyt; Mon, 23 Dec 2019 16:26:09 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=sHXfRysl; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id L8wKDvhVT9WF; Mon, 23 Dec 2019 16:26:09 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47hNV95tz6z9vJyn; Mon, 23 Dec 2019 16:26:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1577114769; bh=/A5nHGIX1n3gwM0sFa6XeCQneVLd9/XPssrSN7a7g8I=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=sHXfRysliIex+d9/Owu7dVjupZ7ryZ4/iam1CzsrVLiPJ3QWUWPNKNxH2tlzAx0T7 2mJv4J994amOHthnEbpWAe6aPUuiJEyWrLCLMG9NGhtWSXZbPDkdCpaK7fb2+10M5I KcCNi4EXt6+o4eROPWPD2kOCTHPAUZ0u1QNvWOH0= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0165D8B7AB; Mon, 23 Dec 2019 16:26:15 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id mfRKu-QhdIrE; Mon, 23 Dec 2019 16:26:14 +0100 (CET) Received: from po16098vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.100]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D3EC28B7A1; Mon, 23 Dec 2019 16:26:14 +0100 (CET) Received: by po16098vm.idsi0.si.c-s.fr (Postfix, from userid 0) id DE545637D8; Mon, 23 Dec 2019 15:26:14 +0000 (UTC) Message-Id: <98430a9b57d4888610fd245337422434376e22fb.1577114567.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [RFC PATCH 4/8] powerpc/irq: move set_irq_regs() closer to irq_enter/exit() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 23 Dec 2019 15:26:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org set_irq_regs() is called by do_IRQ() while irq_enter() and irq_exit() are called by __do_irq(). Move set_irq_regs() in __do_irq() Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/irq.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 410accba865d..28414c6665cc 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -647,6 +647,7 @@ static inline void call_do_irq(struct pt_regs *regs, void *sp) void __do_irq(struct pt_regs *regs) { + struct pt_regs *old_regs = set_irq_regs(regs); unsigned int irq; irq_enter(); @@ -672,11 +673,11 @@ void __do_irq(struct pt_regs *regs) trace_irq_exit(regs); irq_exit(); + set_irq_regs(old_regs); } void do_IRQ(struct pt_regs *regs) { - struct pt_regs *old_regs = set_irq_regs(regs); void *cursp, *irqsp, *sirqsp; /* Switch to the irq stack to handle this */ @@ -686,16 +687,11 @@ void do_IRQ(struct pt_regs *regs) check_stack_overflow(); - /* Already there ? */ - if (unlikely(cursp == irqsp || cursp == sirqsp)) { + /* Already there ? Otherwise switch stack and call */ + if (unlikely(cursp == irqsp || cursp == sirqsp)) __do_irq(regs); - set_irq_regs(old_regs); - return; - } - /* Switch stack and call */ - call_do_irq(regs, irqsp); - - set_irq_regs(old_regs); + else + call_do_irq(regs, irqsp); } void __init init_IRQ(void) -- 2.13.3