From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEBFAC282DD for ; Wed, 8 Jan 2020 15:24:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93A2D20673 for ; Wed, 8 Jan 2020 15:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728601AbgAHPYO (ORCPT ); Wed, 8 Jan 2020 10:24:14 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:50383 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726556AbgAHPYO (ORCPT ); Wed, 8 Jan 2020 10:24:14 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ipDB8-0001aV-Vt; Wed, 08 Jan 2020 16:23:27 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id C48DA1060B2; Wed, 8 Jan 2020 16:23:25 +0100 (CET) From: Thomas Gleixner To: Anchal Agarwal , mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, linux-pm@vger.kernel.org, linux-mm@kvack.org, kamatam@amazon.com, sstabellini@kernel.org, konrad.wilk@oracle.co, roger.pau@citrix.com, axboe@kernel.dk, davem@davemloft.net, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, peterz@infradead.org, eduval@amazon.com, sblbir@amazon.com, anchalag@amazon.com, xen-devel@lists.xenproject.org, vkuznets@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dwmw@amazon.co.uk, fllinden@amaozn.com Cc: anchalag@amazon.com Subject: Re: [RFC PATCH V2 09/11] xen: Clear IRQD_IRQ_STARTED flag during shutdown PIRQs In-Reply-To: <20200107234420.GA18738@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> References: <20200107234420.GA18738@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com> Date: Wed, 08 Jan 2020 16:23:25 +0100 Message-ID: <877e22ezv6.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Anchal Agarwal writes: > shutdown_pirq is invoked during hibernation path and hence > PIRQs should be restarted during resume. > Before this commit'020db9d3c1dc0a' xen/events: Fix interrupt lost > during irq_disable and irq_enable startup_pirq was automatically > called during irq_enable however, after this commit pirq's did not > get explicitly started once resumed from hibernation. > > chip->irq_startup is called only if IRQD_IRQ_STARTED is unset during > irq_startup on resume. This flag gets cleared by free_irq->irq_shutdown > during suspend. free_irq() never gets explicitly called for ioapic-edge > and ioapic-level interrupts as respective drivers do nothing during > suspend/resume. So we shut them down explicitly in the first place in > syscore_suspend path to clear IRQ<>event channel mapping. shutdown_pirq > being called explicitly during suspend does not clear this flags, hence > .irq_enable is called in irq_startup during resume instead and pirq's > never start up. What? > +void irq_state_clr_started(struct irq_desc *desc) > { > irqd_clear(&desc->irq_data, IRQD_IRQ_STARTED); > } > +EXPORT_SYMBOL_GPL(irq_state_clr_started); This is core internal state and not supposed to be fiddled with by drivers. irq_chip has irq_suspend/resume/pm_shutdown callbacks for a reason. Thanks, tglx