Received: by 10.223.185.116 with SMTP id b49csp8744581wrg; Fri, 2 Mar 2018 07:14:16 -0800 (PST) X-Google-Smtp-Source: AG47ELviLe+Y+Pe5TDIQSP33Urc/4oZYUFIfia7JKvnu+WTvBdMrudZK0zOVogW7707f/X8vWr25 X-Received: by 10.101.101.10 with SMTP id x10mr4870419pgv.223.1520003656229; Fri, 02 Mar 2018 07:14:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520003656; cv=none; d=google.com; s=arc-20160816; b=QMPAiVJ6knxJuCxMaX4PSH/s6p/uYSA1iR9N5nHzqPf6H1sjwiuu/S6ta4bCPmsDAT eHy96UPGF6y/ms0p8j+8OG1xLCzttHBj5DunZ9BC1FdgobCCGmkeN3y6+7WjSxxPeTR9 sRXFnVWMXUtcpZR9u5CTASp4L5o/vYv175rT28s8WdYBMktu/J9qgb/z9qV2i1KbzY6f TtEoW1hni6LHyJozcHAnnYaJAun0mSYGlXlR1ge06AMH3p5k/Z4FAKDsRdRMLc3lYnRi N9cOgCP/ffmMvqlSwEJmQBqfWQ9h4p55anEY90Q6gVDCMdUQ0AmtjYD9zK8Cype+s+Zg bk1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=7LCwDzmdMHnqAujcDJhs0ZGu+2HYJkXmAOOu5OXlhUg=; b=QVkiYDmajxrv2KHrkxJPOZf2lJl/6tE0+d76SyF6woa/QajWCwGIu+art7NlQE8t43 QA8zScSdR5nPqgm/2qYTTRmR0PH93w70XV29+0lzsNaFsyxrR8J2MKyXft7I7I3NpHw8 8Af6X3GKtJ5r0UC9LvD84TXIwj9ySlzL5kWSb76CoOcpCkwb60WeTG4crfebdv5h8eg2 90IrzEu4h7eAXbuqUJfgM2r/JrN3TAoErKNbQHXqSviSyQWuTYE+CAggoByPIpDdqRIE q+tuFCJ24lKMLgJSoojUsF1HVDQdCaFCASyACHkwQoLo1crDZHbQCIUV1rjkhVa10PGz WAQA== 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 i124si3353510pgd.576.2018.03.02.07.14.01; Fri, 02 Mar 2018 07:14:16 -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 S1427289AbeCBMGE (ORCPT + 99 others); Fri, 2 Mar 2018 07:06:04 -0500 Received: from foss.arm.com ([217.140.101.70]:53952 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422860AbeCBMGB (ORCPT ); Fri, 2 Mar 2018 07:06:01 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 998DF1435; Fri, 2 Mar 2018 04:06:01 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 937483F318; Fri, 2 Mar 2018 04:05:59 -0800 (PST) Date: Fri, 2 Mar 2018 12:05:57 +0000 From: Mark Rutland To: Grzegorz Jaszczyk Cc: Marc Zyngier , catalin.marinas@arm.com, will.deacon@arm.com, james.morse@arm.com, "AKASHI, Takahiro" , Hoeun Ryu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nadav Haklai , Marcin Wojtas Subject: Re: [PATCH] arm64: kdump: fix interrupt handling done during machine_crash_shutdown Message-ID: <20180302120556.xujh3hoy44y7ouz7@lakrids.cambridge.arm.com> References: <1519837260-30662-1-git-send-email-jaz@semihalf.com> <20180228171647.6t4dabntujcb5kon@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 02, 2018 at 12:56:24PM +0100, Grzegorz Jaszczyk wrote: > Thank you for your feedback. I probably over-interpreted some of the > documentation paragraph to justify (probably) buggy behavior that I am > seeing. Regardless of correctness of this patch I will appreciate if > you could help understanding this issue. > > First the whole story: I was debugging why the crashdump kernel hangs > in v. early stage, when the kdump was triggered from the > ARM_SBSA_WATCHDOG interrupt handler, while everything worked fine when > it was triggered from the process context. Finally It occurred that it > is because the crashdump kernel doesn't get any timer interrupt. I > also notice that this problem doesn't occur when the gic is configured > to work in EOImode == 1. In such circumstances, the write to > GIC_CPU_EOI in gic_handle_irq is causing priority drop to idle, and > therefore when the crashdump kernel starts, the timer interrupt is > able to preempt still active watchdog interrupt (I know that this > interrupt shouldn't be active after irq_set_irqchip_state but for some > reason it seems to not do the job correctly). Do you have a way to reproduce the problem? Is there an easy way to cause the watchdog to trigger a kdump as above, e.g. via LKDTM? > In my commit log I wrongly describe the bahaviour of > irq_set_irqchip_state and irq_get_irqchip_state. In > machine_kexec_mask_interrupts (when watchdog interrupt is active) > after adding some debugs I see that (focusing only on watchdog > interrupt): > 1) before calling irq_set_irqchip_state when I check the status with > irq_get_irqchip_state I see that watchdog interrupt is active > 2) decative interrupt via irq_set_irqchip_state > 3) check the status via irq_get_irqchip_state which indicates that the > status has changed to inactive, so everything seems to be fine, but > still in crashdump kernel I don't get any interrupts (when the EOImode > == 0). > > When I modify the machine_kexec_mask_interrupts, to call the eoi for > watchdog (only temporary to observe the effect): > if (i == watchdog_irq) > chip->irq_eoi(&desc->irq_data); > > everything is working. So it seems that deactivating the interrupt via > write to GIC_CPU_EOI (EOImode == 0) or GIC_CPU_EOI + > GIC_CPU_DEACTIVATE (EOImode == 1) does the job, while deactivating it > with use of GIC_DIST_ACTIVE_CLEAR doesn't. > > I am using the unmodified GICv2m ("arm,gic-400") and the watchdog > interrupt is connected as one of the SPI. I think you just mean GICv2 here. GICv2m is an MSI controller, and shouldn't interact with the SBSA watchdog's SPI. Can you tell us which platform you are seeing this on? Thanks, Mark.