Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp823555imm; Wed, 6 Jun 2018 06:34:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKUO2f2WkDkC7802B+hSepIeNBbSbldQBFmBUIZ7twb/V3Rx50HWj/fpCTwv1BW3M87k4L6 X-Received: by 2002:a17:902:1e3:: with SMTP id b90-v6mr3183892plb.273.1528292058413; Wed, 06 Jun 2018 06:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528292058; cv=none; d=google.com; s=arc-20160816; b=QLqkSlcrR1D2TsgQ5UQkz9fi3zcYrCi3frdBTpRexl4IrswJZRnRyUoVAoXYZXwqqK Px7rA2msZGBrCVCllkiVuUf0PZlK7pSlQgXABKWP83lylCnfZeAPxwENpiA9pHdKvSOJ NoGRHZQB+M4wNY1ouxRN3C4TkzHbsPgqIlTSBygd1gj7RIEltOVcmExU7l1fqqjwTwSN oxcFcYOK/Qpja+C7tC9jxEXST4LCz6JxbsdqiJRRi5rakGkmnpq+NmPJgs7xbYSJlzuo SzGVLOLGllqYY5pDR4IWt1DENgUF+4xIXWsxAsi6zVk5bpX/tUUDHUkE7eQYap/yn5Yh xVKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=wH6R3SKk1dOBG5QsexH1v2gMSfbY7i/NefsdVKk6iJc=; b=GByIdtopPSgppXpPs8TC2QHGSXKSMnE5dTxD1kSISdhlZLbHRCT8Q39NvGB4haheOs ooChRY1/5AIrStLEO//5yLK6QTVKC4NiFJ5tA9DpZoozD/vmRT6uTEhrwaosmcZFzSBM pp4im03fphQdcOrYOJy8K4HS75Z7PlTe46HgYe9kNk6SE99XL5IZkBF7AkTTVIpo6g8H ql8rSYVYQoUHQ+H9sQiX92+aMHY0GEwf9+UvPHD04iyqACUJ2CzD+dQZkPpd7kUxmj20 ui1JhCUHTYLw6Fwwv9r2PeTtCQ+fMQFhiIksNQ6SNCeYVtpmTMSEeANEmmuNHdOfLui9 +4Lg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13-v6si22445271pfh.282.2018.06.06.06.34.04; Wed, 06 Jun 2018 06:34:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752407AbeFFNdF (ORCPT + 99 others); Wed, 6 Jun 2018 09:33:05 -0400 Received: from terminus.zytor.com ([198.137.202.136]:38179 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338AbeFFNdD (ORCPT ); Wed, 6 Jun 2018 09:33:03 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w56DWNFi1794117 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Jun 2018 06:32:23 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w56DWN3e1794114; Wed, 6 Jun 2018 06:32:23 -0700 Date: Wed, 6 Jun 2018 06:32:23 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Thomas Gleixner Message-ID: Cc: jroedel@suse.de, liu.song.a23@gmail.com, hpa@zytor.com, 0x7f454c46@gmail.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@alien8.de, mike.travis@hpe.com, songliubraving@fb.com, mingo@kernel.org, tariqt@mellanox.com, peterz@infradead.org Reply-To: mike.travis@hpe.com, bp@alien8.de, peterz@infradead.org, tariqt@mellanox.com, songliubraving@fb.com, mingo@kernel.org, hpa@zytor.com, liu.song.a23@gmail.com, jroedel@suse.de, linux-kernel@vger.kernel.org, tglx@linutronix.de, 0x7f454c46@gmail.com In-Reply-To: <20180604162224.471925894@linutronix.de> References: <20180604162224.471925894@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/apic: Provide apic_ack_irq() Git-Commit-ID: c0255770ccdc77ef2184d2a0a2e0cde09d2b44a4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c0255770ccdc77ef2184d2a0a2e0cde09d2b44a4 Gitweb: https://git.kernel.org/tip/c0255770ccdc77ef2184d2a0a2e0cde09d2b44a4 Author: Thomas Gleixner AuthorDate: Mon, 4 Jun 2018 17:33:55 +0200 Committer: Thomas Gleixner CommitDate: Wed, 6 Jun 2018 15:18:20 +0200 x86/apic: Provide apic_ack_irq() apic_ack_edge() is explicitely for handling interrupt affinity cleanup when interrupt remapping is not available or disable. Remapped interrupts and also some of the platform specific special interrupts, e.g. UV, invoke ack_APIC_irq() directly. To address the issue of failing an affinity update with -EBUSY the delayed affinity mechanism can be reused, but ack_APIC_irq() does not handle that. Adding this to ack_APIC_irq() is not possible, because that function is also used for exceptions and directly handled interrupts like IPIs. Create a new function, which just contains the conditional invocation of irq_move_irq() and the final ack_APIC_irq(). Reuse the new function in apic_ack_edge(). Preparatory change for the real fix. Fixes: dccfe3147b42 ("x86/vector: Simplify vector move cleanup") Signed-off-by: Thomas Gleixner Tested-by: Song Liu Cc: Joerg Roedel Cc: Peter Zijlstra Cc: Song Liu Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: stable@vger.kernel.org Cc: Mike Travis Cc: Borislav Petkov Cc: Tariq Toukan Link: https://lkml.kernel.org/r/20180604162224.471925894@linutronix.de --- arch/x86/include/asm/apic.h | 2 ++ arch/x86/kernel/apic/vector.c | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 08acd954f00e..74a9e06b6cfd 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -436,6 +436,8 @@ static inline void apic_set_eoi_write(void (*eoi_write)(u32 reg, u32 v)) {} #endif /* CONFIG_X86_LOCAL_APIC */ +extern void apic_ack_irq(struct irq_data *data); + static inline void ack_APIC_irq(void) { /* diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index 72b575a0b662..b708f597eee3 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -809,13 +809,18 @@ static int apic_retrigger_irq(struct irq_data *irqd) return 1; } -void apic_ack_edge(struct irq_data *irqd) +void apic_ack_irq(struct irq_data *irqd) { - irq_complete_move(irqd_cfg(irqd)); irq_move_irq(irqd); ack_APIC_irq(); } +void apic_ack_edge(struct irq_data *irqd) +{ + irq_complete_move(irqd_cfg(irqd)); + apic_ack_irq(irqd); +} + static struct irq_chip lapic_controller = { .name = "APIC", .irq_ack = apic_ack_edge,