Received: by 10.223.185.116 with SMTP id b49csp8972764wrg; Fri, 2 Mar 2018 11:02:58 -0800 (PST) X-Google-Smtp-Source: AG47ELt7SwWWuKw1XV0xNM+qiViSEqw3OsrbORr0EDG7BskTD99r4gVkQH1erCL5m8J4w8/+sC03 X-Received: by 2002:a17:902:4581:: with SMTP id n1-v6mr6286088pld.135.1520017378777; Fri, 02 Mar 2018 11:02:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520017378; cv=none; d=google.com; s=arc-20160816; b=gf11xJddeqHSIF3U0/P0u0B4F8pP0VPf1VA4S7StdAJqKkuvucf57ffZhqX1DKG6KW x8j71PHFNaOxru3RRv7zlsMhJnpljlKlG1xGx78FjcECyxwhK5HySLEUhoCW6Yzi92iZ bwAAOZvjbKZW91ohsxcUNXJKQsinWlJ2vDTH2bY2Iuirj59eYrv7YAZpl4q6niHgw3Rt 8aMMNv7dkudIlFBZXj9l04vo+pilwk/vWBpdq+3fO3SM4ha2svRpz3vrrbqRMuepi6xM F6tmFzR1MYCtQTCNHQKhfgqaISjM/dyT+Ov9PT3xU9Y6Q65uC6bmYFGh/1PqtOJbM8u5 B/iA== 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=yBK7uiUw5SgXNlS+YVklwGLqs5Lx8qEa9auSHs93YWE=; b=mM1GKpeTaEvBheOfNGxPnvMCeu7V2fm4Fm05tf5dGmnrC5ZbXIdpwBQi65zAS2kM3F YIKAsqDiuUEhdQuz/sgWh6Xh+m1ln6LuTkGidxaKJfx5FbdvoYyngUXYeVIOYsxng4XD XtcK6ERWtPIDTvarKfi2lSLihFpk49F/PVsluAV0xwfQAXG3NZG1XhBc9R1RL7wwX2+B BAX8rMEECAXINuUJy8NN7CSR0S5XywejE2khR58Y3nqvOtukQP/ScCPO2gD9DvmpY9ge jfesnP8rHLmHEFff2l/ha8tHE4COZjVizEHP/XMU9DjZb2+kM0vhwLDCpWNbnROMbfDn ZTkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=QEevN+JM; 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 b2si2304729pgt.44.2018.03.02.11.02.35; Fri, 02 Mar 2018 11:02:58 -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=QEevN+JM; 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 S1428331AbeCBNwK (ORCPT + 99 others); Fri, 2 Mar 2018 08:52:10 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:40565 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424338AbeCBNwI (ORCPT ); Fri, 2 Mar 2018 08:52:08 -0500 Received: by mail-pf0-f176.google.com with SMTP id x1so2146696pfh.7 for ; Fri, 02 Mar 2018 05:52:08 -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=yBK7uiUw5SgXNlS+YVklwGLqs5Lx8qEa9auSHs93YWE=; b=QEevN+JM74aED7SUbbuGecw1GY09R6MgLRUVDM3AP4l9JGEB807fk+PJq0AV8c3+r8 AqsiWr1Jd2HAjf53mZ4wS0NQ4xo3gYI3EXicYvvFQUKzINgUPfzINfsIiOEsrf2sm/jY dU10nrcZXHZ1dP9KxZE3YpQvPrODUfj3V0snaQ4KjgsODel5BrxAPpshfYRbohXB0y0e PtrznkXDMS8ns5cHrBtLjx9P/AMmwg58kNuGDOyOir2set/AZwQEPRUYXwXQ0/Cgm0yD 2mMcHJh2xse5YGCT1ZHhj46S+sqfa83gmF1G3SGPmId/jTwDhnF0deuHPExxuB6fXlFz snDQ== 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=yBK7uiUw5SgXNlS+YVklwGLqs5Lx8qEa9auSHs93YWE=; b=j5ktOLNKuAD4snPRoiPfzsdL3peP0Q9zFh17EerdGOS9iVLuxb/697c30QOCl1OeIC C5DJR2bBncX+0CCvxSbTfs5+n5z9Y8Hhyt07XMtfRIraCiR2dUj6ILtcwSWfKv6zo6Ic CIM8q72Hflv7pw48qzGa8P3L1ALtLxF0lg/FweI6+IyyGiFpi4Rm6UM57yHyaQFiEkTK vRlr0KnKUVlvrpoVNc+B1/jQ+qQaxVjpCeADyCw+L2N0Qj29qZV2Jm3g702DqIoK7akD pHMdkmdvoK4oB9Y3l1RmtJ6UKH98pandKKOrN8t2jYw8VtYt4pv2bHzdvv4QXa0hv/YU UL2g== X-Gm-Message-State: APf1xPC3NjP+gfstDnnVhvojsPJ2m9+Eq02HpGdJebD8ZjmhRXMl2mPL Fcly3fXgUnvO6GOwpw5oZcN6grn0Dq6ckvaz3pUlhQ== X-Received: by 10.99.125.92 with SMTP id m28mr4687962pgn.257.1519998728241; Fri, 02 Mar 2018 05:52:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.140.148 with HTTP; Fri, 2 Mar 2018 05:52:07 -0800 (PST) In-Reply-To: <20180302131545.q2vf6uc3yofofqdb@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> <20180302131545.q2vf6uc3yofofqdb@lakrids.cambridge.arm.com> From: Grzegorz Jaszczyk Date: Fri, 2 Mar 2018 14:52:07 +0100 Message-ID: Subject: Re: [PATCH] arm64: kdump: fix interrupt handling done during machine_crash_shutdown To: Mark Rutland 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 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 14:15 GMT+01:00 Mark Rutland : > On Fri, Mar 02, 2018 at 01:59:27PM +0100, Grzegorz Jaszczyk wrote: >> 2018-03-02 13:05 GMT+01:00 Mark Rutland : >> > 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. > > Do you see this for a panic() in *any* interrupt handler? I only test with this two interrupt handlers: watchdog and i2c but I think it will behave the same with others - I can try with other if you want, any suggestion which? Maybe with some PPI interrupt instead? > > Can you trigger the issue with magic-sysrq c, for example? There is no problem when I trigger it via 'echo c > /proc/sysrq-trigger' - it works well all the time. The problem appears only, when the kexec/kdump procedure is triggered from interrupt context - as I said it seems that deactivating the interrupt via irq_set_irqchip_state doesn't do the job and because of that any new interrupt (e.g. timer interrupt) can't interrupt the CPU (the previous irq watchdog/i2c irq seems to be still active preventing other irq to interrupt the CPU). This result with crashdump kernel hang (it waits for the timer interrupt, which never interrupts the CPU). Reworking the machine_kexec_mask_interrupts routine so it will call 'chip->irq_eoi(&desc->irq_data);' independently of irq_set_irqchip_state return value, solves the problem. Thank you, Grzegorz