Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6212117ybl; Wed, 15 Jan 2020 00:23:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxFUuwbbFJAkQR0eTHm8X7wG7vBhwAw5Sf1CteoJZni7XeQO+cYYIpJBI68GUYZjKHBQmLw X-Received: by 2002:a05:6830:2147:: with SMTP id r7mr1987667otd.94.1579076590179; Wed, 15 Jan 2020 00:23:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579076590; cv=none; d=google.com; s=arc-20160816; b=fc8afXXT9xD1lzEeADCog+MZdY5qnQTjt+E/00kYIVcDjYd305v+PewxwUtSG9A5pf iwuFe1pHYA9L/H2+Rous414jA+XYUy5/UxN9XAk3bCyk6YQ5adJD2a0/qzgVx0yUW8J4 /YECGVAb2pzOXYhC0UoKW+CQJoChtyVjNKcxOYsdxSECaduOKAsjlOcARxv9H+1b/pkq +ozZS7mOXkG2jAyc35oAXeByeqvhT7ytehEUj652gfhFwBTsI1R3g69gHlSg79r4uOsY MLoTPst1BnKrluRfrEWWM/R09zzDT30oTTBtdiavWUt8EioN++CdM9KLa+UIcXDA1wpF XW4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=eJiFO3QydhCB4khlmR01YfA4JWX/p+awL0NaGEa+nTY=; b=WVXe4+IUvuoOrPLRQDdENV4o6H55lsFqqHpPxG+k5Fv3gq8JhTC969sqnxHPjIh9gs 9+I1aUMN/fnMIr6vKB6xNOCRL5ZbSDJmYXAT7oUTK3HUbazlOX2nPdaSnqQEDSvaA24W ywBKOd+5AFDQupXtFh4A8Gt5Y2UpItvmiVF6n3g49Y1zP4HnmDnJt97Uv+A7ad+XHKBj xBetNdZCViKvVZB7xiXzpgY55gZhkEbrSZsPzfSB+82OHqyE3rrcYOP+c03znPNKjy9O XORa2O0O9N1+1Nlg0YQ/9lmba0yE+RMeYFuVguFC1xVOL0ZCZR5UGkx9aV9g23aOzYFV 9hpw== 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 s3si8250768otk.261.2020.01.15.00.22.57; Wed, 15 Jan 2020 00:23:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726483AbgAOIV5 (ORCPT + 99 others); Wed, 15 Jan 2020 03:21:57 -0500 Received: from ZXSHCAS1.zhaoxin.com ([203.148.12.81]:31105 "EHLO ZXSHCAS1.zhaoxin.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726088AbgAOIV5 (ORCPT ); Wed, 15 Jan 2020 03:21:57 -0500 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Wed, 15 Jan 2020 16:21:54 +0800 Received: from tony-HX002EA.zhaoxin.com (10.32.64.11) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Wed, 15 Jan 2020 16:21:51 +0800 From: Tony W Wang-oc To: , , , , , , , , , , , CC: , , , Subject: [PATCH] x86/apic: mask IOAPIC entries when disable LAPIC Date: Wed, 15 Jan 2020 16:22:19 +0800 Message-ID: <1579076539-7267-1-git-send-email-TonyWWang-oc@zhaoxin.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.32.64.11] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx1.zhaoxin.com (10.29.252.163) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When system suspend to S1, LAPIC disabled via soft but some IOAPIC entries are unmask like IOAPIC 0 pin 9 which is for acpi interrupt. This state IOAPIC can response external interrupt, but the interrupt message can not handled by LAPIC. When wakeup system via keyboard/rtc, level triggered interrupt IOAPIC 0 pin 9 RTE's Remote IRR bit may be set to 1 but LAPIC does not send EOI for it. So this Remote IRR bit will remain all the time. This cause the following S1 suspend sequence failed because software lockup in __synchronize_hardirq. Mask IOAPIC entries when disable LAPIC to make IOAPIC completely quiet when LAPIC disabled. Signed-off-by: Tony W Wang-oc --- arch/x86/kernel/apic/apic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 28446fa..233239a 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2626,6 +2626,12 @@ static int lapic_suspend(void) #endif local_irq_save(flags); + + /* + * Make IOAPIC quiet before disable LAPIC + */ + mask_ioapic_entries(); + disable_local_APIC(); irq_remapping_disable(); -- 2.7.4