Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp881926ybl; Wed, 8 Jan 2020 07:25:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxGqKuxTdAW2quTL2uvNxsm9mCCbUOWYoq8MISgDh9b0U31kqlxBs8RG75+kMmNc/LMpa/l X-Received: by 2002:aca:c509:: with SMTP id v9mr3295614oif.151.1578497124668; Wed, 08 Jan 2020 07:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578497124; cv=none; d=google.com; s=arc-20160816; b=yS5LY6/C9Hl7B84TqMXGsdxQDfilSne+sNicHMxQ836LvL73YnGkhon3BxPAu3mZE4 ApBbKYK6zxjRix9o+2ec7CqjsL/MJdzJ3sL1uvtRrKtieEUsbvlW6S9c//FfbAQ7mG/l XzuVQypcCM/wFKFPWv33sSnkz1+ndczqxRwsZkUHTRFUMx746QmrnyLfrF7L3LM7VbcY xmmvX19mG0X77YLSdV/jARw37WKpkuFvUIt+kFkt63FCWDkwrJoK4I4x1U1cZAYpWszz haf4d9J5uk4kMRXgcjHS9utYd6i9fqlFDqDpQpBuUotDVbnoVIcS4SD0LEb3iBpeOE4r qMEw== 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:references :in-reply-to:subject:cc:to:from; bh=6CWyuF6zk2Jj9Hf/lMKRlb2BzrCBrWQ2LMT/ldD9gJg=; b=fTkJ++ehQWU3EiptDmRBjUfRzT/SwkBot0hIUdif6pIKKpD2x3LvLE9eZeWKZBHjlv 1/XFauMMSMozr9gtUUUj+HZ7Nci+dPbIMhr48R2eGmOHZg6R1nMFTmIag9OwB57whSrJ IeSniB1WsIqMHOrWTVh0phNHSLzK/fwPgu5IidkeYxGn1zJJuV3Fn7Pd7JYC1jfTuFnS nK1ellNUsPFHdhz9oVJEl1+Rf+FO4jv2jikiFBmqHF2JU/9Tm66jz/4RrC6QwTuS3XMv 1eTNFEvGn7H/pDK4d7ivMySdDAO+DeBsAKfFaMXHVYYdLih28w8cXh3KQPg3aoO9eLmb Sf0g== 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 k7si1767904oib.115.2020.01.08.07.25.12; Wed, 08 Jan 2020 07:25:24 -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 S1728537AbgAHPYO (ORCPT + 99 others); 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