From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbdJSFvh (ORCPT ); Thu, 19 Oct 2017 01:51:37 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:61554 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbdJSFvg (ORCPT ); Thu, 19 Oct 2017 01:51:36 -0400 Subject: Re: [PATCH] powerpc: ipic - fix status get and status clear To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <20171018091647.B9E9F6872C@po15668-vm-win7.idsi0.si.c-s.fr> <8760bbn2va.fsf@concordia.ellerman.id.au> From: Christophe LEROY Message-ID: <803bdda8-d40b-569b-571d-7af415bf1853@c-s.fr> Date: Thu, 19 Oct 2017 07:51:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <8760bbn2va.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 19/10/2017 à 07:06, Michael Ellerman a écrit : > Christophe Leroy writes: > >> IPIC Status is provided by register IPIC_SERSR and not by IPIC_SERMR >> which is the mask register. > > This seems like it would be a bad bug. But I guess it hasn't mattered > for some reason? As far as I can see, this function has been added in kernel 2.6.12 but has never been used in-tree. I have discovered this error while implementing NMI watchdog on a 832x board, ie this function is needed to know when a machine check exception is generated by the watchdog timer. Christophe > > cheers > >> diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c >> index 16f1edd78c40..535cf1f6941c 100644 >> --- a/arch/powerpc/sysdev/ipic.c >> +++ b/arch/powerpc/sysdev/ipic.c >> @@ -846,12 +846,12 @@ void ipic_disable_mcp(enum ipic_mcp_irq mcp_irq) >> >> u32 ipic_get_mcp_status(void) >> { >> - return ipic_read(primary_ipic->regs, IPIC_SERMR); >> + return ipic_read(primary_ipic->regs, IPIC_SERSR); >> } >> >> void ipic_clear_mcp_status(u32 mask) >> { >> - ipic_write(primary_ipic->regs, IPIC_SERMR, mask); >> + ipic_write(primary_ipic->regs, IPIC_SERSR, mask); >> } >> >> /* Return an interrupt vector or 0 if no interrupt is pending. */ >> -- >> 2.13.3