Received: by 10.223.185.116 with SMTP id b49csp115641wrg; Fri, 2 Mar 2018 14:50:39 -0800 (PST) X-Google-Smtp-Source: AG47ELszuOAVmhgxHrMHQXZNBkoTSms4RgHKDHadLahG/JUY+KFsRyxTlyJEUYUSRotKGEaqyHag X-Received: by 2002:a17:902:bd05:: with SMTP id p5-v6mr6559875pls.137.1520031038972; Fri, 02 Mar 2018 14:50:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520031038; cv=none; d=google.com; s=arc-20160816; b=YSs6w3Lp3EQYapeWRhlqH+iBXEQ3dkYcpuUUHDSG8SAosZwUiUFaqknYYMLNjlMYPf LIlCezR93rx65brRqS+hrY9BRxFyLs2N3zKVKXb/zfaDvBoPZ87bDQ9zFa12DksxQK3h 5hP7XEWuzJcvH3/OG0KCF9eVwDnKVXjmUksxW7I+A1JgsJYAe10G2Zdr1e2Eo52b7M+z oVTIwW/3r4VzpXtEzw+vod9i9DiFq6BoZbgzcrOZ80mbXDRROhSIKD51TB31u1QzNyd/ 5YYgoMvVEDpD7zlNIJtJ0TmcWmj1mg+rPHrXuulYLIt1m/11j7WGroK4XdkznZ9KDP+r cBeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=jYHlPucHDWSjBadWfTNMuHbpE3XyZp+16M+QUaYiQyw=; b=jt1vOlp9Muezy6tOnE58NeWi9M+oZjjTOxK5/IzB/I7UqAVYu64jsAd1tR3dzh6BXX qbTHZE451DAkjdxKUsZHLqYn5YSI9D4oUtz95WRK9QufLG9KUrYeFCNEEd3H5XPY8ohy 42cO71QdYYyNCXvhtx/h15Aip2BCzqXraXdu0VcGPmJStLUi6pfZPWvSHigOuLTuUS9B 5XP04TAsiMRf/dP42I4vnVtZyrHLFaDjrBzAEUbLNVqyRBM4ACzDOLuUSvXozMz3lzWo egWJMgNBksqOQFlC40VHqMjAf+ylHUki1XyDA2gKGkIFWzdEqCyQh2k86dK0yUR6rYDm B6yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=fKuU4P9J; 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 p15si4577588pgq.51.2018.03.02.14.50.24; Fri, 02 Mar 2018 14:50:38 -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; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=fKuU4P9J; 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 S1946564AbeCBM7e (ORCPT + 99 others); Fri, 2 Mar 2018 07:59:34 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38035 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946553AbeCBM72 (ORCPT ); Fri, 2 Mar 2018 07:59:28 -0500 Received: by mail-pl0-f67.google.com with SMTP id m22-v6so2150928pls.5 for ; Fri, 02 Mar 2018 04:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jYHlPucHDWSjBadWfTNMuHbpE3XyZp+16M+QUaYiQyw=; b=fKuU4P9JkhwMnPtEUHeSl5qyisa/myZGDCxRaEE2LnrETTq9lOxPalxrLVpcFPfals Sy3ZpWxk7PdduGDHiWYhLdXJJXmbcpgwNLFtIHeMvYFanSJW0rFyt1n4FvFrzkmORt5v PfnYE+kEpWGHyFEQ5BdaGu6vmVonJYqVpK/jRy+Oej7LCADyAMsKKTS1FndOxGC1F3ve Qb/NQMRGj2iyST/x9RNnFW+FLydk/SJQLNne1+tjOmOa2r4F6ebRYcwaCy/aT8lUECSF kO7RV8YovNFVbVk8SAOYRUT1aXYGhrfln7PAqor5k5aFTwHGovroKuYtaZn8J/KF/BHZ +XNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jYHlPucHDWSjBadWfTNMuHbpE3XyZp+16M+QUaYiQyw=; b=IYVAkYwLjJJE01c/V5iRYXQvyiOm5Dd1oiaNcnQrCX7kiNwDIAqjZ7d+j9eDwCGuX9 gH5Qi4KKEqQrPQduYpPrTLFdGZlAhMoVbOKMNExbNBSWZzKvBkG87PfyBezLJwmZRMG6 GC1Z53NyLvPQwsL2MymDXetDcvPuEgyB1tdRItCRAZMnbGxST6jGU4Etrw07RFjV/iBx hIpZZmBXRC4l/F9E0JPh2zomJq8/XcR2dooMGuvlGa+n6rHl5yv0h96SuBdPlcSgj6s8 VtTq028KkIqvCVvU2Ukz5vs4Ux5kW+RQjOQJyvqUPj0fasbdFsZIg2Y9PNNhUgSkGaCw wQ7Q== X-Gm-Message-State: APf1xPBNuv/NtU2GzH4GDiCoyoOw2OPyWN3YgC8bU/6d/TpwFfMFaHgf cNOlOW9c/5tUUB/Cg03pjvM9BTZf4DY3RxRyp4uu/w== X-Received: by 2002:a17:902:2823:: with SMTP id e32-v6mr5248103plb.44.1519995568188; Fri, 02 Mar 2018 04:59:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.140.148 with HTTP; Fri, 2 Mar 2018 04:59:27 -0800 (PST) In-Reply-To: <20180302120556.xujh3hoy44y7ouz7@lakrids.cambridge.arm.com> References: <1519837260-30662-1-git-send-email-jaz@semihalf.com> <20180228171647.6t4dabntujcb5kon@lakrids.cambridge.arm.com> <20180302120556.xujh3hoy44y7ouz7@lakrids.cambridge.arm.com> From: Grzegorz Jaszczyk Date: Fri, 2 Mar 2018 13:59:27 +0100 Message-ID: Subject: Re: [PATCH] arm64: kdump: fix interrupt handling done during machine_crash_shutdown To: Mark Rutland , Marc Zyngier Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-02 13:05 GMT+01:00 Mark Rutland : > 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? You can reproduce this problem by: - enabling CONFIG_ARM_SBSA_WATCHDOG in your kernel - passing via command-line: sbsa_gwdt.action=1 sbsa_gwdt.timeout=170 - then load/prepare crasdump kernel (I am doing it via kexec tool) - echo 1 > /dev/watchdog and after 170s the watchdog interrupt will hit triggering panic and the whole kexec machinery will run. The sbsa_gwdt.timeout can't be too small since it is also used for reset: |----timeout-----(panic)----timeout-----reset. If it is too small the crasdump kernel will not have enough time to start. It is also reproducible with different interrupts, e.g. for test I put the panic to i2c interrupt handler and it was behaving the same. To use gic with EOImode == 0 mode, you can fulfill some of gic_check_eoimode ( irqchip/irq-gic.c) conditions or just for test "return false;" in this function. > I think you just mean GICv2 here. GICv2m is an MSI controller, and > shouldn't interact with the SBSA watchdog's SPI. Yes of course, I just wanted to mention that it has MSI controller. Thank you, Grzegorz