From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbdIMGOg (ORCPT ); Wed, 13 Sep 2017 02:14:36 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36431 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbdIMGOd (ORCPT ); Wed, 13 Sep 2017 02:14:33 -0400 X-Google-Smtp-Source: AOwi7QCRvunQ1kU1Cgj+BNFC2WagJ59trKIG6QcL+RsqlAPd4KA2cQalMtCnl33QlHcGNywnR/y5aw== Subject: Re: [PATCH] sysrq : fix Show Regs call trace on ARM From: Jiri Slaby To: Jibin Xu , gregkh@linuxfoundation.org Cc: rmk+kernel@armlinux.org.uk, mingo@elte.hu, linux-arm-kernel@lists.infradead.org, riel@redhat.com, linux-kernel@vger.kernel.org References: <20170911031142.254308-1-jibin.xu@windriver.com> <8c09c309-e088-1dd6-8d6f-f8929acf0f5f@suse.cz> <5dd5bb30-15af-ab44-8b56-57c3c1d53bc4@windriver.com> <17da8267-c4aa-dc0f-1150-4fd5efe0073c@windriver.com> Message-ID: <58805d5d-b520-c27f-b4c6-633d897d90cc@suse.cz> Date: Wed, 13 Sep 2017 08:14:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/13/2017, 08:04 AM, Jiri Slaby wrote: > On 09/11/2017, 01:22 PM, Jibin Xu wrote: >> Hi,Jiri: >> >> I tested get_irq_regs() behave in the softirq context, >> I called get_irq_regs() by a tasklet, It returns NULL.My understanding is get_irq_regs() can return the right result >> only in hardware IRQ,otherwise it returns NULL. >> So I think in_irq() would be better. > > Hi, > > tasklets are run in the process context (in a kthread). But what about > timers? HARDIRQ is decremented, SOFTIRQ remains set and sysrq handlers > are called in such conditions (in_interrupt() is true, in_irq() is > false). At that moment, irq_regs are still set and valid IMO. > > But I would believe for now that sysrq handlers are not invoked from > softirq context. AFAIK they are called only from hardirq (serial port or > keyboard IRQ handler) or process context (write to /proc/sysrq-trigger). > So this change *should* be safe unless someone else objects there are > some kgdb special cases or something. Oops, serial8250_timeout actually can do so. So yes, sysrq handlers can be invoked from softirq (timer) context and they still should print the registers at best. I have to leave now, will look into it later if someone (you :)) doesn't beat me to it. thanks, -- js suse labs