From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752898AbdGLUVp (ORCPT ); Wed, 12 Jul 2017 16:21:45 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:45077 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbdGLUVn (ORCPT ); Wed, 12 Jul 2017 16:21:43 -0400 Date: Wed, 12 Jul 2017 22:21:33 +0200 (CEST) From: Thomas Gleixner To: Juergen Gross cc: jeffy.chen@rock-chips.com, Linux Kernel Mailing List , xen-devel , Boris Ostrovsky , Konrad Rzeszutek Wilk , Marc Zyngier , Peter Zijlstra Subject: Re: Problem with commit bf22ff45bed664aefb5c4e43029057a199b7070c In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Jul 2017, Thomas Gleixner wrote: > On Mon, 10 Jul 2017, Juergen Gross wrote: > > It is based on suspend/resume framework. The main work to be done > > additionally is to disconnect from the pv-backends at save time and > > connect to the pv-backends again at restore time. > > > > The main function triggering all that is xen_suspend() (as seen in > > above backtrace). > > The untested patch below should give you hooks to do what you need to do. > > Add the irq_suspend/resume callbacks and set the IRQCHIP_GENERIC_SUSPEND > flag on your xen irqchip, so it actually gets invoked. > > I have to make that opt in right now because the callbacks are used in the > generic irqchip implementation already. We can revisit that when you can > confirm that this is actually solving the problem. There might be an even simpler solution. As this is using the regular suspend_device_irqs() call, you just might get away with setting IRQCHIP_MASK_ON_SUSPEND for your irq chip. That does not use the lazy disable approach, it also masks all interrupts which are not marked as wakeup irqs. I assume none of them is when you do that save/restore dance. That said, you still might make the whole mechanism cleaner by using the irq chip callbacks so you can avoid traversing all the interrupts another time. But I can't say for sure as I got lost in that xen event channel code. Thanks, tglx