Received: by 10.223.176.5 with SMTP id f5csp594831wra; Fri, 9 Feb 2018 04:11:28 -0800 (PST) X-Google-Smtp-Source: AH8x227oGKjzzviQsdjZnd0G75KqnWO3tm4OKDDDg9yzUWEgMXqCMMIqf9qHxRK3bobPlqWz0lht X-Received: by 10.98.1.7 with SMTP id 7mr2617140pfb.87.1518178288003; Fri, 09 Feb 2018 04:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518178287; cv=none; d=google.com; s=arc-20160816; b=fyrCTAUjOtnoPVxiy70fvRK7L+1QgI6UwmlQrOy8xMkvJuqQ60/fC47lra4c2x3lSP ncgHKEM3ClRNkAycncEvt7WojunpZgPYliTFXQ8QTAW6lw019MDrFkzWNyTDrn+baLEs TEa/lSsDje/62gjEY8AyeETKnE1RbNvHezJ3JOwGSUEB0iW0BRgh/L7XcjV7vqtuwhV7 Px8l6P7byyQP/JJ4d1JlFpm1EDRqPOBG7gN9/U2pvix5r0p6ZQAq7117sHrRW//czDPv MQL1M24sWNoZo0AB9ZE4HD4RKcKUI9mcMmBxX2kSta7t7fVSX/0OZa2PZj4DfIhQ65GU QftQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Ijkb9mm8iGfDTtTvgwMgI3L35NZWUO0WmaWgizCG728=; b=Pk9sJlJeCAyL/dQBn5MWCy37pClY3p5jhMmEl/of14bOOmQbsMysamtEWrDDeg2Kjp xVev5vsDGp5A5iMbXe3iqgvqsqs67R7+6I2CDqZ5vNnb15v+Zs3DZDQwunc5ssvpVAvJ H059CrSvv5uWTBtxgumH/L3RZgI1dhXcWF2LUTxylsEj+18icnPDy/CTh+ACGnWdS4Ja ACBx6vNRMdI6hPs02pBa/qZ3L6v3q6E0y9V/7NU574qbp2cXvPQFsqTRLecePekQLdQJ J+XZhFTcQ9uBjWYYVadzDC0V2anjgIcBBUrVBEcUTsf1bTBYv1qqgT/xTkpV/M9a53Us bCoA== ARC-Authentication-Results: i=1; mx.google.com; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l61-v6si1496123plb.219.2018.02.09.04.11.13; Fri, 09 Feb 2018 04:11:27 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751371AbeBIMKY (ORCPT + 99 others); Fri, 9 Feb 2018 07:10:24 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43952 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750997AbeBIMKW (ORCPT ); Fri, 9 Feb 2018 07:10:22 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 80845814DF5C; Fri, 9 Feb 2018 12:10:21 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-8-18.pek2.redhat.com [10.72.8.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 13F3F2024CA2; Fri, 9 Feb 2018 12:10:17 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org, ebiederm@xmission.com Cc: mingo@kernel.org, tglx@linutronix.de, x86@kernel.org, douly.fnst@cn.fujitsu.com, joro@8bytes.org, uobergfe@redhat.com, prarit@redhat.com, Baoquan He Subject: [PATCH v3 1/5] x86/apic: Split out restore_boot_irq_mode from disable_IO_APIC Date: Fri, 9 Feb 2018 20:10:04 +0800 Message-Id: <20180209121008.28980-2-bhe@redhat.com> In-Reply-To: <20180209121008.28980-1-bhe@redhat.com> References: <20180209121008.28980-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 09 Feb 2018 12:10:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 09 Feb 2018 12:10:21 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bhe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a preparation patch. Split out the code which restores boot irq mode from disable_IO_APIC() and wrap into a new function restore_boot_irq_mode(). No functional change. Signed-off-by: Baoquan He --- arch/x86/include/asm/io_apic.h | 1 + arch/x86/kernel/apic/io_apic.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index a8834dd546cd..558d1a6a13ad 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h @@ -193,6 +193,7 @@ static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) extern void setup_IO_APIC(void); extern void enable_IO_APIC(void); extern void disable_IO_APIC(void); +extern void restore_boot_irq_mode(void); extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin); extern void print_IO_APICs(void); #else /* !CONFIG_X86_IO_APIC */ diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 8ad2e410974f..7b73b6b9b4b6 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -1448,6 +1448,11 @@ void disable_IO_APIC(void) */ clear_IO_APIC(); + restore_boot_irq_mode(); +} + +void restore_boot_irq_mode(void) +{ if (!nr_legacy_irqs()) return; -- 2.13.6